@aussieljk/forkbook 0.0.1-1 → 0.0.1-11
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 +1 -1
- package/assets/create/rendererAssets/common/header.css +1 -1
- package/assets/create/rendererAssets/common/page.css +2 -2
- 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 +27 -26
- package/dist/_browser-chunks/{Color-OEKZ7XSW.js → Color-QLZNXLSV.js} +8 -8
- package/dist/_browser-chunks/WithTooltip-GNLRTZDF.js +198 -0
- package/dist/_browser-chunks/{chunk-66OCZ54D.js → chunk-3HM3VWJS.js} +1 -1
- package/dist/_browser-chunks/{chunk-CFAOWGL7.js → chunk-3M5T7BW4.js} +1 -1
- package/dist/_browser-chunks/{chunk-2MEPHP35.js → chunk-4KIQBRD2.js} +1 -1
- package/dist/_browser-chunks/{chunk-OQWFVDIN.js → chunk-5H4KFI44.js} +1 -1
- package/dist/_browser-chunks/chunk-6AKCRYVX.js +6 -0
- package/dist/_browser-chunks/{chunk-PFRNG3UC.js → chunk-6ELMKWKX.js} +5 -5
- package/dist/_browser-chunks/{chunk-6SXYJQST.js → chunk-76222HQR.js} +1 -1
- package/dist/_browser-chunks/{chunk-JSBKXXXF.js → chunk-7DQREF4S.js} +1 -1
- package/dist/_browser-chunks/{chunk-RSPAQWVJ.js → chunk-BNP234B4.js} +1 -1
- package/dist/_browser-chunks/chunk-C5TKXHTM.js +82 -0
- package/dist/_browser-chunks/chunk-DNJ3OSLB.js +6021 -0
- package/dist/_browser-chunks/{chunk-PP4R7USA.js → chunk-DS2WQZGO.js} +222 -433
- package/dist/_browser-chunks/{chunk-FJGWSWL5.js → chunk-DYNTDJ3O.js} +3 -3
- package/dist/_browser-chunks/{chunk-CFWWCCZV.js → chunk-EQKMUQF3.js} +5 -4
- package/dist/_browser-chunks/{chunk-LV5PIKV4.js → chunk-FRAOQJDI.js} +5 -3
- package/dist/_browser-chunks/{chunk-ODVJ3XZJ.js → chunk-GRO2ZYEJ.js} +2 -2
- package/dist/_browser-chunks/{chunk-MFMDGWP6.js → chunk-I4ATZPNZ.js} +1 -1
- package/dist/_browser-chunks/chunk-IFADVEQE.js +669 -0
- package/dist/_browser-chunks/{chunk-YTIT5NA5.js → chunk-KYSD26D6.js} +3 -3
- 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-OD6IBQCC.js → chunk-N3NRW5XX.js} +2 -2
- 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-NGMQJMCY.js +53 -0
- package/dist/_browser-chunks/chunk-NPNIBOPF.js +18 -0
- package/dist/_browser-chunks/{chunk-52CW7FF7.js → chunk-NTUHL5NS.js} +8 -3
- package/dist/_browser-chunks/{chunk-MDOL7KML.js → chunk-O24AZJZ7.js} +1 -1
- 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-PZQRXPVR.js +21 -0
- package/dist/_browser-chunks/{chunk-VVWPND3J.js → chunk-QU4RB2WU.js} +12 -12
- package/dist/_browser-chunks/{chunk-C3D4HEFY.js → chunk-TTBPZQ24.js} +282 -127
- package/dist/_browser-chunks/{chunk-ZTQ5MEJ5.js → chunk-UMGDO2ZM.js} +3 -37
- package/dist/_browser-chunks/{chunk-2SCZVUKW.js → chunk-V5U45XXZ.js} +1 -1
- package/dist/_browser-chunks/{chunk-73OX2G56.js → chunk-WBLVFDJT.js} +100 -108
- package/dist/_browser-chunks/chunk-XKTORVEQ.js +255 -0
- package/dist/_browser-chunks/{chunk-FVSEPWWX.js → chunk-XTQCLWVH.js} +325 -1635
- package/dist/_browser-chunks/{chunk-W5M6NPS3.js → chunk-ZHKZKFY4.js} +7 -6
- package/dist/_node-chunks/{attached-runtime-O4YTVUKE.js → attached-runtime-J2AKT5WI.js} +30 -30
- package/dist/_node-chunks/builder-manager-Z4RWF4ZH.js +1139 -0
- package/dist/_node-chunks/{chunk-XURIZ7IC.js → chunk-2U5J7YTA.js} +8 -8
- package/dist/_node-chunks/{chunk-PBMWZVLD.js → chunk-2WVLC5M2.js} +6 -6
- package/dist/_node-chunks/{chunk-SVZ6Q3CS.js → chunk-2YNXKY72.js} +6 -6
- package/dist/_node-chunks/{chunk-CYPPELO4.js → chunk-32FLWHUC.js} +22 -32
- package/dist/_node-chunks/{chunk-XTTAS346.js → chunk-36LPBTLF.js} +6 -6
- package/dist/_node-chunks/{chunk-ILWHW4HU.js → chunk-3EBGFRAH.js} +15 -15
- package/dist/_node-chunks/{chunk-I2ANCID7.js → chunk-3IIQSDCO.js} +66 -145
- package/dist/_node-chunks/{chunk-G6PUNHCI.js → chunk-3NST2GUZ.js} +6 -6
- package/dist/_node-chunks/{chunk-YWMICX2T.js → chunk-46Y5H6X5.js} +12 -12
- package/dist/_node-chunks/{chunk-5WHA37KG.js → chunk-4D325SMT.js} +102 -40
- package/dist/_node-chunks/{chunk-2XDUXZGI.js → chunk-54EHKXV7.js} +8 -8
- package/dist/_node-chunks/{chunk-AWJOXJAZ.js → chunk-55S3GGGC.js} +8 -8
- package/dist/_node-chunks/{chunk-QMU5ODXZ.js → chunk-5GOXN5M4.js} +7 -7
- package/dist/_node-chunks/{chunk-AWXGCPW6.js → chunk-5JLVSH44.js} +6 -6
- package/dist/_node-chunks/{chunk-BENYUF74.js → chunk-5P4N734V.js} +77 -78
- package/dist/_node-chunks/{chunk-PEIAGMSR.js → chunk-6E34W4UX.js} +6 -6
- package/dist/_node-chunks/chunk-6UAJLEIO.js +28 -0
- package/dist/_node-chunks/chunk-6UASHVMR.js +620 -0
- package/dist/_node-chunks/{chunk-R5FYRP6X.js → chunk-76KKKLEE.js} +7 -7
- package/dist/_node-chunks/{chunk-DWE36J35.js → chunk-7IOSIYW2.js} +7 -7
- package/dist/_node-chunks/chunk-7YQTID2W.js +25 -0
- package/dist/_node-chunks/{chunk-A724RK5H.js → chunk-A7GEBS3Q.js} +9 -6
- package/dist/_node-chunks/{chunk-6EJ5NPEM.js → chunk-AKMPPLT5.js} +7 -7
- package/dist/_node-chunks/{chunk-2BJIHWOK.js → chunk-ALGQMFMN.js} +6 -6
- package/dist/_node-chunks/{chunk-JEC2OK5B.js → chunk-APPFF22V.js} +7 -7
- package/dist/_node-chunks/chunk-APXRPW7A.js +11 -0
- package/dist/_node-chunks/{chunk-IZISFDKM.js → chunk-AVL7GUOZ.js} +161 -145
- package/dist/_node-chunks/chunk-BBU2FUPC.js +495 -0
- package/dist/_node-chunks/{chunk-Y2GH4XO7.js → chunk-BKND5XP2.js} +650 -9
- package/dist/_node-chunks/{chunk-2UG3IYCC.js → chunk-BSQB5B57.js} +6 -6
- package/dist/_node-chunks/{chunk-ULW4SLMN.js → chunk-C5OFHB3N.js} +34 -949
- package/dist/_node-chunks/{chunk-5RNOGGO6.js → chunk-CEYSYQLV.js} +6 -6
- package/dist/_node-chunks/{chunk-NIHZECYO.js → chunk-D5ADPGA4.js} +6 -6
- package/dist/_node-chunks/{chunk-3CLITGI2.js → chunk-DGWKJQ6G.js} +6 -6
- package/dist/_node-chunks/{chunk-EWXASIWR.js → chunk-ER3X3AQ7.js} +7 -7
- package/dist/_node-chunks/{chunk-JBCKN6P4.js → chunk-FB2BOL6I.js} +6 -6
- package/dist/_node-chunks/{chunk-4PK3LUHM.js → chunk-FEC5PGJO.js} +7 -7
- package/dist/_node-chunks/{chunk-NZ3GOT7V.js → chunk-FTYDKQCO.js} +6 -6
- package/dist/_node-chunks/chunk-FUG5LYKS.js +532 -0
- package/dist/_node-chunks/{chunk-ASJFOW6O.js → chunk-GGCOG7OV.js} +8 -8
- package/dist/_node-chunks/{chunk-GVSFRNWZ.js → chunk-GMKLTDKN.js} +6 -6
- package/dist/_node-chunks/{chunk-JE6JEGXA.js → chunk-GO3YSBPE.js} +9 -9
- package/dist/_node-chunks/chunk-GTXZNA2L.js +347 -0
- package/dist/_node-chunks/{chunk-XJSYJTBD.js → chunk-GYFR2JLS.js} +7 -7
- package/dist/_node-chunks/{chunk-HKUNJELN.js → chunk-IFAV3CER.js} +8 -8
- package/dist/_node-chunks/{chunk-IJL5JOLL.js → chunk-IRPQQARO.js} +7 -7
- package/dist/_node-chunks/{chunk-M2BRIUUP.js → chunk-IVAOJWPF.js} +7 -7
- package/dist/_node-chunks/{chunk-RHG33T7C.js → chunk-J3SM62J3.js} +10 -10
- package/dist/_node-chunks/{chunk-7TSL7D5D.js → chunk-LAIED5XU.js} +6 -6
- package/dist/_node-chunks/{chunk-RJUHZH32.js → chunk-LHNHFYK3.js} +6 -6
- package/dist/_node-chunks/{chunk-B6SKX4JF.js → chunk-LKITAODU.js} +7 -7
- package/dist/_node-chunks/{chunk-7LLQDMVS.js → chunk-MBIVTOJK.js} +6 -6
- package/dist/_node-chunks/{chunk-X6OWHTYE.js → chunk-MI7WBXWX.js} +6 -6
- package/dist/_node-chunks/{chunk-CDRLLNRQ.js → chunk-MW4OAPPD.js} +11 -11
- package/dist/_node-chunks/{chunk-ZMEGPR47.js → chunk-MXLHIEXC.js} +6 -6
- package/dist/_node-chunks/{chunk-RJXEPYEN.js → chunk-NFDQT7UW.js} +64 -21
- package/dist/_node-chunks/{chunk-CWD5A6NI.js → chunk-NIQSBBT2.js} +7 -7
- package/dist/_node-chunks/{chunk-MJ2UD7FU.js → chunk-NLLM4MDK.js} +7 -7
- package/dist/_node-chunks/{chunk-US7L4S72.js → chunk-NLNAIU4I.js} +9 -9
- package/dist/_node-chunks/{chunk-AANHLH5M.js → chunk-OJWUUSA4.js} +6 -6
- package/dist/_node-chunks/{chunk-CXLL2F6O.js → chunk-OPT5A55S.js} +25 -8
- package/dist/_node-chunks/{chunk-RQVK2TOI.js → chunk-OXT6T4AS.js} +14 -13
- package/dist/_node-chunks/{chunk-7DCDBICW.js → chunk-PQTEFQIJ.js} +13 -13
- package/dist/_node-chunks/{chunk-5GN5N22E.js → chunk-PXOD36TR.js} +131 -148
- package/dist/_node-chunks/{chunk-5J3O7EDY.js → chunk-PYVGF5F2.js} +6 -6
- package/dist/_node-chunks/{chunk-ICADUNQM.js → chunk-QHBQRPDP.js} +6 -6
- package/dist/_node-chunks/{chunk-VXDWOVWD.js → chunk-R7VDUSKY.js} +29843 -51588
- package/dist/_node-chunks/chunk-REIDJUVJ.js +2609 -0
- package/dist/_node-chunks/{chunk-KGOAOPKR.js → chunk-RNRGXAFV.js} +6 -6
- package/dist/_node-chunks/{chunk-6APBQVEX.js → chunk-S3NDLFYL.js} +7 -7
- package/dist/_node-chunks/chunk-SJXLINHV.js +57 -0
- package/dist/_node-chunks/chunk-SMBAR4G6.js +18 -0
- package/dist/_node-chunks/{chunk-R7CY5LX6.js → chunk-SRDKK3SG.js} +6 -6
- package/dist/_node-chunks/{chunk-G5OYQQDY.js → chunk-T6P2EJD2.js} +6 -6
- package/dist/_node-chunks/{chunk-7BVUZZIY.js → chunk-TAMTPVYZ.js} +7 -7
- package/dist/_node-chunks/{chunk-ILVD64RB.js → chunk-TKMXEHM4.js} +8 -8
- package/dist/_node-chunks/{chunk-XCGMRAV5.js → chunk-V5IMPC3J.js} +7 -7
- package/dist/_node-chunks/{chunk-2QTI45JU.js → chunk-VKRGTLQJ.js} +35 -35
- package/dist/_node-chunks/{chunk-QVMUIU7S.js → chunk-VZG3OKFO.js} +6 -6
- package/dist/_node-chunks/{chunk-2JSABFAM.js → chunk-W3KFVTWV.js} +10 -10
- package/dist/_node-chunks/{chunk-U4GKV7GZ.js → chunk-W7HY3ELZ.js} +10 -10
- package/dist/_node-chunks/{chunk-NKAUZU4C.js → chunk-WBCKO5LP.js} +6 -6
- package/dist/_node-chunks/{chunk-JVQYQTTM.js → chunk-WO4UEQI6.js} +42 -87
- package/dist/_node-chunks/{chunk-SRXCCL2O.js → chunk-XCJ2ZIQ4.js} +7 -7
- package/dist/_node-chunks/{chunk-MDKFZRYG.js → chunk-XH5CXH53.js} +8 -8
- package/dist/_node-chunks/{chunk-4TV3Z3S3.js → chunk-XICRXTTE.js} +6 -6
- package/dist/_node-chunks/{chunk-GSWBRZLU.js → chunk-XO54HM4P.js} +9 -17
- package/dist/_node-chunks/{chunk-URRTQ2QM.js → chunk-XSVOMORJ.js} +8 -8
- package/dist/_node-chunks/{chunk-WQ7PSP6H.js → chunk-XVOIYGTJ.js} +6 -6
- package/dist/_node-chunks/chunk-Y4W4B3E7.js +20 -0
- package/dist/_node-chunks/{chunk-HKQEE62W.js → chunk-YBG7HVP7.js} +8 -8
- package/dist/_node-chunks/chunk-YIAUHGY2.js +69 -0
- package/dist/_node-chunks/{chunk-GP5YLBNS.js → chunk-Z2ZTDQDY.js} +8 -8
- package/dist/_node-chunks/{chunk-GT5EHMNM.js → chunk-ZEYODVQT.js} +7 -7
- package/dist/_node-chunks/dist-C5QIQD3G.js +27 -0
- package/dist/_node-chunks/dist-NBRPZCHX.js +16 -0
- package/dist/_node-chunks/{local-runtime-4UNT5EZJ.js → local-runtime-YDAW5RJV.js} +20 -20
- package/dist/_node-chunks/{mdx-plugin-ZY6XLLA4.js → mdx-plugin-XLDET5LV.js} +2263 -130
- package/dist/_node-chunks/{monorepo-B65J4UFS.js → monorepo-NWMAHGOM.js} +12 -12
- package/dist/_node-chunks/{monorepo-optimized-tests-relaxed-limits-no-story-deletion-45ZTNWJS.js → monorepo-optimized-tests-relaxed-limits-no-story-deletion-4B6IZ7JD.js} +12 -12
- package/dist/_node-chunks/optimized-tests-EIPJR7HA.js +22 -0
- package/dist/_node-chunks/{pattern-copy-play-LOHSM7ID.js → pattern-copy-play-PJC4PO6A.js} +12 -12
- package/dist/_node-chunks/postinstallAddon-EOAAURMG.js +20 -0
- package/dist/_node-chunks/{rehype-external-links-22ZBI6K4.js → rehype-external-links-4CWXZ35U.js} +9 -9
- package/dist/_node-chunks/{rehype-slug-ROZVEEFZ.js → rehype-slug-QZ2PWSJH.js} +9 -9
- package/dist/_node-chunks/{relaxed-limits-EDE2B34G.js → relaxed-limits-ZQR4ER7L.js} +12 -12
- package/dist/_node-chunks/{run-IR3BRDJV.js → run-BMXB2BW2.js} +17 -17
- package/dist/_node-chunks/{run-372BSBV5.js → run-U63AXEKZ.js} +273 -13
- package/dist/_node-chunks/session-id-HEW5JUNB.js +23 -0
- package/dist/_node-chunks/{setup-6TMCKUTA.js → setup-NCUTUBNN.js} +9 -9
- package/dist/_node-chunks/{vitest.config.4.template-QJBEVCKG.js → vitest.config.4.template-4XHF7XPS.js} +9 -9
- package/dist/actions/decorator.js +3 -2
- package/dist/actions/index.d.ts +1 -1
- package/dist/actions/index.js +3 -2
- package/dist/addon-a11y/index.d.ts +3 -3
- package/dist/addon-a11y/index.js +2 -1
- package/dist/addon-a11y/manager.js +40 -37
- package/dist/addon-a11y/preset.js +7 -7
- package/dist/addon-a11y/preview.js +2 -1
- package/dist/addon-docs/blocks.d.ts +20 -1
- package/dist/addon-docs/blocks.js +150 -74
- package/dist/addon-docs/index.d.ts +19 -19
- package/dist/addon-docs/manager.js +6 -6
- package/dist/addon-docs/preset.js +10 -10
- 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 +29 -21
- package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +37 -82
- 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/manager.js +2 -2
- package/dist/addon-pseudo-states/preview.d.ts +1 -1
- package/dist/addon-themes/index.d.ts +1 -1
- 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 +21 -21
- package/dist/addon-vitest/node/coverage-reporter.js +8 -8
- package/dist/addon-vitest/node/vitest.js +17 -17
- package/dist/addon-vitest/postinstall.js +10 -10
- package/dist/addon-vitest/preset.js +15 -16
- package/dist/addon-vitest/vitest-plugin/global-setup.js +8 -8
- package/dist/addon-vitest/vitest-plugin/index.js +23 -23
- 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 +91 -842
- package/dist/babel/index.js +13 -19
- package/dist/backgrounds/index.d.ts +1 -1
- package/dist/bin/core.js +65 -64
- package/dist/bin/dispatcher.js +18 -16
- package/dist/bin/loader.js +17 -16
- package/dist/builder-vite/index.js +17 -17
- package/dist/builder-vite/preset.js +13 -13
- package/dist/channels/index.js +6 -6
- package/dist/{chunk-BTVrWliM.d.ts → chunk-BGhyFTJO.d.ts} +2 -2
- package/dist/{chunk-DtHByo32.d.ts → chunk-CFk6djyM.d.ts} +5 -5
- package/dist/{chunk-CwQKNaYL.d.ts → chunk-CNqjcOmK.d.ts} +1 -1
- package/dist/{chunk-CMeX4WRe.d.ts → chunk-CT2iXaHz.d.ts} +1 -1
- package/dist/chunk-CV4-Z2pn.d.ts +30 -0
- package/dist/{chunk-B2t1tGRh.d.ts → chunk-CYuvV2sR.d.ts} +11 -13
- package/dist/{chunk-DEVFdzxR.d.ts → chunk-D0NUmzXp.d.ts} +1 -1
- package/dist/{chunk-DzuY9DXg.d.ts → chunk-DDd8BhTY.d.ts} +2 -2
- package/dist/{chunk-Dw1z1Pki.d.ts → chunk-DROZ9oel.d.ts} +50 -314
- 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-C2p5r3Vt.d.ts → chunk-Fg1Fm__9.d.ts} +119 -29
- package/dist/chunk-Susgfkap.d.ts +20 -0
- package/dist/cli/index.d.ts +13 -866
- package/dist/cli/index.js +44 -4954
- package/dist/cli/skills/content/index.d.ts +1 -1
- package/dist/cli/skills/content/index.js +2 -2
- package/dist/cli/tools/sdk/child-host.d.ts +1 -1
- package/dist/cli/tools/sdk/child-host.js +17 -17
- package/dist/cli/tools/sdk/index.d.ts +1 -1
- package/dist/cli/tools/sdk/index.js +18 -18
- package/dist/cli-commands/bin/index.js +7 -7
- package/dist/client-logger/index.js +3 -1
- package/dist/common/index.d.ts +17 -29
- package/dist/common/index.js +36 -42
- package/dist/components/index.d.ts +41 -238
- package/dist/components/index.js +2738 -8515
- package/dist/core-events/index.d.ts +4 -3
- package/dist/core-events/index.js +3 -1
- package/dist/core-server/index.d.ts +7 -6
- package/dist/core-server/index.js +665 -250
- package/dist/core-server/presets/common-manager.js +603 -1027
- package/dist/core-server/presets/common-override-preset.js +12 -10
- package/dist/core-server/presets/common-preset.js +55 -48
- package/dist/create/bin/index.js +7 -7
- package/dist/create/index.js +15 -15
- package/dist/csf/index.d.ts +5 -5
- package/dist/csf/index.js +55 -120
- package/dist/csf-tools/index.d.ts +17 -13
- package/dist/csf-tools/index.js +17 -15
- package/dist/docs-tools/index.js +2 -2
- package/dist/highlight/index.d.ts +1 -1
- package/dist/instrumenter/index.js +8 -6
- package/dist/manager/_manager-chunks/{globals-runtime-B0I9dSVs.js → globals-runtime-BSj0mCjE.js} +824 -727
- package/dist/manager/_manager-chunks/globals-runtime-BY3epqww.js +1807 -0
- package/dist/manager/_manager-chunks/globals-runtime-Bj5KDUJi.js +8935 -0
- package/dist/manager/_manager-chunks/{globals-runtime-ZHrQFa3-.js → globals-runtime-Bs75QQ_I.js} +77 -553
- package/dist/manager/_manager-chunks/{globals-runtime-f5oIrim0.js → globals-runtime-Bu9eGDTe.js} +394 -189
- package/dist/manager/_manager-chunks/{globals-runtime-FC201B7s.js → globals-runtime-BweHuXkK.js} +2 -1
- package/dist/manager/_manager-chunks/{globals-runtime-BQCkfH1B.js → globals-runtime-C5gK7HhH.js} +1 -1
- package/dist/manager/_manager-chunks/{globals-runtime-BmphMP6z.js → globals-runtime-C92M_Vnq.js} +10 -10
- package/dist/manager/_manager-chunks/{globals-runtime-eLPTIfX-.js → globals-runtime-CA8AuIRT.js} +3 -145
- package/dist/manager/_manager-chunks/globals-runtime-CBviMKtt.js +446 -0
- package/dist/manager/_manager-chunks/{globals-runtime-C02fvgcd.js → globals-runtime-CCTA-XPa.js} +410 -379
- package/dist/manager/_manager-chunks/{globals-runtime-CXoVXiJA.js → globals-runtime-CHjExYMv.js} +324 -118
- package/dist/manager/_manager-chunks/{globals-runtime-BvM-NY2g.js → globals-runtime-DvV_TF3-.js} +638 -1731
- package/dist/manager/_manager-chunks/{globals-runtime-8HkdnU2F.js → globals-runtime-WZKaeKm9.js} +93 -2146
- package/dist/manager/_manager-chunks/globals-runtime-wjkxyMn0.js +5283 -0
- package/dist/manager/_manager-chunks/{runtime-DtyerpFe.js → runtime--hR2NZFd.js} +124 -80
- package/dist/manager/_manager-chunks/{runtime-DMig8mT7.js → runtime-5o_11Jae.js} +4 -3
- package/dist/manager/_manager-chunks/{runtime-D94Vq3oR.js → runtime-B6NL14pz.js} +5 -531
- package/dist/manager/_manager-chunks/{runtime-eDVAYF7N.js → runtime-BAsOe1C_.js} +10 -29
- package/dist/manager/_manager-chunks/{runtime-EITvVbkG.js → runtime-BdGkqNEt.js} +1 -2
- package/dist/manager/_manager-chunks/{runtime-DcJBhKG9.js → runtime-CJQZFUUj.js} +200 -376
- package/dist/manager/_manager-chunks/{runtime-Bry1Biu7.js → runtime-CgRqs_SK.js} +989 -915
- package/dist/manager/_manager-chunks/{runtime-i-PDAHLR.js → runtime-Dem2xJbS.js} +5 -147
- package/dist/manager/_manager-chunks/runtime-Dtbhxq5m.js +1158 -0
- package/dist/manager/_manager-chunks/runtime-DvB1axgp.js +197 -0
- package/dist/manager/_manager-chunks/runtime-EPerAEAs.js +294 -0
- package/dist/manager/_manager-chunks/runtime-P663lpsR.js +528 -0
- package/dist/manager/globals-runtime.js +1 -1
- package/dist/manager/globals.d.ts +12 -12
- package/dist/manager/globals.js +12 -12
- package/dist/manager/runtime.js +1 -1
- package/dist/manager-api/index.d.ts +1 -1
- package/dist/manager-api/index.js +72 -82
- package/dist/manager-errors.d.ts +1 -1
- package/dist/manager-errors.js +2 -2
- package/dist/mcp/index.js +8 -8
- package/dist/mocking-utils/index.d.ts +2 -2
- package/dist/mocking-utils/index.js +22 -17
- package/dist/mocking-utils/mocker-runtime.js +2 -2
- package/dist/nextjs-vite/index.d.ts +2 -2
- package/dist/nextjs-vite/index.js +4 -3
- 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 +93 -14
- package/dist/nextjs-vite/preview.js +1 -1
- package/dist/nextjs-vite/vite-plugin/index.js +7 -7
- package/dist/nextjs-vite-plugin/index.d.ts +2 -3
- package/dist/nextjs-vite-plugin/index.js +15 -30
- 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/node-logger/index.d.ts +65 -72
- package/dist/node-logger/index.js +11 -12
- package/dist/oxc-parser/index.js +11 -13
- package/dist/oxc-parser/worker.js +10 -10
- package/dist/preview/_chunks/{runtime-DrTjJkPY.js → runtime-BJwGQok8.js} +77 -76
- package/dist/preview/_chunks/{runtime-BIzIdDbb.js → runtime-BPwAnlRx.js} +482 -334
- package/dist/preview/_chunks/{runtime-q3wt0e_N.js → runtime-BUnOhg9h.js} +2 -2
- package/dist/preview/_chunks/{runtime-CxZK_Ln3.js → runtime-BZ4pNS3g.js} +2 -2
- package/dist/preview/_chunks/runtime-Bcv1hJky.js +6305 -0
- package/dist/preview/_chunks/{runtime-iXdo8CR8.js → runtime-BgPhfM5P.js} +54 -8
- package/dist/preview/_chunks/{runtime-CsV4HZPV.js → runtime-BhSZ1Mwt.js} +335 -137
- package/dist/preview/_chunks/{runtime-BwSxqk3t.js → runtime-BsMjBzuq.js} +6 -16
- package/dist/preview/_chunks/{runtime-CqHxptiK.js → runtime-C1jgT6tJ.js} +93 -2145
- package/dist/preview/_chunks/{runtime-DuHdxMFA.js → runtime-CkOhMcXf.js} +8 -8
- package/dist/preview/_chunks/{runtime-BZSnICCg.js → runtime-WapFVPAh.js} +29 -29
- 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 +1 -1
- package/dist/preview-api/index.js +11 -9
- 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.js +2 -1
- package/dist/react/index.d.ts +4 -4
- package/dist/react/index.js +6 -4
- package/dist/react/preset.js +13 -14
- package/dist/react/preview.d.ts +1 -1
- package/dist/react/preview.js +3 -2
- package/dist/react-native/bin/get-stories.js +12 -12
- package/dist/react-native/index.d.ts +11 -11
- package/dist/react-native/index.js +46 -231
- package/dist/react-native/metro/node.d.ts +2 -2
- package/dist/react-native/metro/node.js +10 -9
- package/dist/react-native/metro/{withStorybook.d.ts → withForkbook.d.ts} +11 -11
- package/dist/react-native/metro/{withStorybook.js → withForkbook.js} +22 -21
- 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 +6 -7
- package/dist/react-native-ui/index.js +207 -624
- package/dist/react-native-ui-common/index.d.ts +2 -3
- 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.js +7 -7
- package/dist/router/index.d.ts +69 -1
- package/dist/router/index.js +52 -10
- package/dist/server-errors.d.ts +1 -1
- package/dist/server-errors.js +9 -9
- package/dist/shared/open-service/index.d.ts +1 -1
- 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 +21 -21
- package/dist/telemetry/index.d.ts +3 -3
- package/dist/telemetry/index.js +43 -45
- package/dist/test/index.js +810 -575
- package/dist/theming/create.js +2 -1
- package/dist/theming/index.d.ts +5 -5
- 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 +36 -81
- 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.stories.js +2 -2
- package/template/nextjs-vite/cli/js/Page.jsx +2 -2
- 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/Configure.mdx +84 -84
- package/template/nextjs-vite/cli/ts/Header.stories.ts +2 -2
- package/template/nextjs-vite/cli/ts/Page.stories.ts +2 -2
- package/template/nextjs-vite/cli/ts/Page.tsx +2 -2
- package/template/react/cli/js/Button.stories.js +6 -6
- package/template/react/cli/js/Header.stories.js +2 -2
- package/template/react/cli/js/Page.jsx +2 -2
- 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/Header.stories.ts +2 -2
- package/template/react/cli/ts/Page.stories.ts +2 -2
- package/template/react/cli/ts/Page.tsx +2 -2
- package/template/react-vite/cli/js/Button.stories.js +6 -6
- package/template/react-vite/cli/js/Header.stories.js +2 -2
- package/template/react-vite/cli/js/Page.jsx +2 -2
- 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/Header.stories.ts +2 -2
- package/template/react-vite/cli/ts/Page.stories.ts +2 -2
- package/template/react-vite/cli/ts/Page.tsx +2 -2
- 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-GZSSFOG3.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-FPV2L36T.js +0 -1661
- package/dist/_node-chunks/chunk-356LV3NX.js +0 -36
- package/dist/_node-chunks/chunk-5BTU7UZ5.js +0 -1877
- package/dist/_node-chunks/chunk-5J3BMBMY.js +0 -51
- package/dist/_node-chunks/chunk-BCRWDMAU.js +0 -11
- package/dist/_node-chunks/chunk-BE6ULVPN.js +0 -662
- package/dist/_node-chunks/chunk-CSXS6LVI.js +0 -29
- package/dist/_node-chunks/chunk-DUOXRUVQ.js +0 -18
- package/dist/_node-chunks/chunk-FUYZNTIS.js +0 -23
- package/dist/_node-chunks/chunk-TB6Y6NSL.js +0 -3837
- package/dist/_node-chunks/chunk-VQEQ7ZLS.js +0 -4731
- package/dist/_node-chunks/chunk-WVCU34IS.js +0 -23
- package/dist/_node-chunks/chunk-Y2DEKWVE.js +0 -3008
- package/dist/_node-chunks/chunk-ZBAIFZNB.js +0 -5414
- package/dist/_node-chunks/dist-ZGSN23B7.js +0 -16
- package/dist/_node-chunks/globby-HWZL7XSQ.js +0 -2884
- package/dist/_node-chunks/jiti-GNDCTFYU.js +0 -3848
- package/dist/_node-chunks/lib-DI662U2R.js +0 -366
- package/dist/_node-chunks/optimized-tests-ZMNICF4R.js +0 -22
- package/dist/_node-chunks/postinstallAddon-NT5XE7IT.js +0 -20
- package/dist/_node-chunks/session-id-OO2WQF5N.js +0 -23
- package/dist/chunk-BfBzpgct.d.ts +0 -916
- package/dist/chunk-BxWufQms.d.ts +0 -142
- 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/runtime-B1L9TH89.js +0 -452
- package/dist/manager/_manager-chunks/runtime-Bly6WJLN.js +0 -998
- package/dist/manager/_manager-chunks/runtime-DpgBAFGf.js +0 -22
- package/dist/preview/_chunks/runtime-BTPtVY1p.js +0 -1102
- package/dist/preview/_chunks/runtime-DZToXfvO.js +0 -9767
|
@@ -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-WBLVFDJT.js";
|
|
15
14
|
import "../../_browser-chunks/chunk-PJSMZ27A.js";
|
|
16
|
-
import "../../_browser-chunks/chunk-
|
|
15
|
+
import "../../_browser-chunks/chunk-OZZPSYQR.js";
|
|
16
|
+
import "../../_browser-chunks/chunk-6ELMKWKX.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";
|
|
26
|
+
import {
|
|
27
|
+
CompositeRoot,
|
|
28
|
+
useCompositeItem,
|
|
29
|
+
useControlled
|
|
30
|
+
} from "../../_browser-chunks/chunk-OOETBSA7.js";
|
|
31
|
+
import {
|
|
32
|
+
EMPTY_ARRAY,
|
|
33
|
+
EMPTY_OBJECT,
|
|
34
|
+
createChangeEventDetails,
|
|
35
|
+
error,
|
|
36
|
+
reason_parts_exports,
|
|
37
|
+
useBaseUiId,
|
|
38
|
+
useButton,
|
|
39
|
+
useRenderElement,
|
|
40
|
+
useStableCallback
|
|
41
|
+
} from "../../_browser-chunks/chunk-XTQCLWVH.js";
|
|
23
42
|
import "../../_browser-chunks/chunk-CNED6RYH.js";
|
|
24
43
|
import {
|
|
25
|
-
dequal,
|
|
26
44
|
registerService
|
|
27
|
-
} from "../../_browser-chunks/chunk-
|
|
45
|
+
} from "../../_browser-chunks/chunk-NGMQJMCY.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-KYSD26D6.js";
|
|
62
|
+
import "../../_browser-chunks/chunk-N3NRW5XX.js";
|
|
45
63
|
import "../../_browser-chunks/chunk-QC4HFS6K.js";
|
|
46
|
-
import "../../_browser-chunks/chunk-
|
|
64
|
+
import "../../_browser-chunks/chunk-76222HQR.js";
|
|
47
65
|
import {
|
|
48
66
|
mergeServiceArgTypes
|
|
49
|
-
} from "../../_browser-chunks/chunk-
|
|
67
|
+
} from "../../_browser-chunks/chunk-GRO2ZYEJ.js";
|
|
50
68
|
import "../../_browser-chunks/chunk-2JDQ35OA.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
|
-
// storybook-css:/
|
|
248
|
+
// storybook-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", actions: "fb-zEgyLq-actions", slideIn: "fb-zEgyLq-slideIn", info: "fb-zEgyLq-info", bar: "fb-zEgyLq-bar", container: "fb-zEgyLq-container", modalInput: "fb-zEgyLq-modalInput", label: "fb-zEgyLq-label" };
|
|
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
|
-
// storybook-css:/
|
|
339
|
+
// storybook-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
|
{
|
|
@@ -688,7 +474,7 @@ async function trySelectStory(selectStory, storyId, attempt = 1) {
|
|
|
688
474
|
}
|
|
689
475
|
|
|
690
476
|
// src/controls/stringifyArgs.tsx
|
|
691
|
-
var stringifyArgs = (args) => JSON.stringify(args, (_, value) => typeof value == "function" ? "
|
|
477
|
+
var stringifyArgs = (args) => JSON.stringify(args, (_, value) => typeof value == "function" ? "__fb_empty_function_arg__" : value);
|
|
692
478
|
|
|
693
479
|
// src/controls/manager.tsx
|
|
694
480
|
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
@@ -702,14 +488,14 @@ var manager_default3 = addons3.register(ADDON_ID9, (api) => {
|
|
|
702
488
|
let response = await experimental_requestResponse(channel, SAVE_STORY_REQUEST, SAVE_STORY_RESPONSE, {
|
|
703
489
|
// Only send updated args
|
|
704
490
|
args: stringifyArgs(
|
|
705
|
-
Object.entries(data.args || {}).reduce((acc, [key, value]) => (
|
|
491
|
+
Object.entries(data.args || {}).reduce((acc, [key, value]) => (isEqual(value, data.initialArgs?.[key]) || (acc[key] = value), acc), {})
|
|
706
492
|
),
|
|
707
493
|
csfId: data.id,
|
|
708
494
|
importPath: data.importPath
|
|
709
495
|
});
|
|
710
496
|
api.addNotification({
|
|
711
497
|
id: "save-story-success",
|
|
712
|
-
icon: jsx4(
|
|
498
|
+
icon: jsx4(CircleCheckIcon, { color: color.positive }),
|
|
713
499
|
content: {
|
|
714
500
|
headline: "Story saved",
|
|
715
501
|
subHeadline: jsxs4(Fragment2, { children: [
|
|
@@ -720,16 +506,16 @@ var manager_default3 = addons3.register(ADDON_ID9, (api) => {
|
|
|
720
506
|
},
|
|
721
507
|
duration: 8e3
|
|
722
508
|
});
|
|
723
|
-
} catch (
|
|
509
|
+
} catch (error2) {
|
|
724
510
|
throw api.addNotification({
|
|
725
511
|
id: "save-story-error",
|
|
726
|
-
icon: jsx4(
|
|
512
|
+
icon: jsx4(CircleXIcon, { color: color.negative }),
|
|
727
513
|
content: {
|
|
728
514
|
headline: "Failed to save story",
|
|
729
|
-
subHeadline:
|
|
515
|
+
subHeadline: error2?.message || "Check the Forkbook process on the command line for more details."
|
|
730
516
|
},
|
|
731
517
|
duration: 8e3
|
|
732
|
-
}),
|
|
518
|
+
}), error2;
|
|
733
519
|
}
|
|
734
520
|
}, createStory = async (name) => {
|
|
735
521
|
let data = api.getCurrentStoryData();
|
|
@@ -743,7 +529,7 @@ var manager_default3 = addons3.register(ADDON_ID9, (api) => {
|
|
|
743
529
|
});
|
|
744
530
|
api.addNotification({
|
|
745
531
|
id: "save-story-success",
|
|
746
|
-
icon: jsx4(
|
|
532
|
+
icon: jsx4(CircleCheckIcon, { color: color.positive }),
|
|
747
533
|
content: {
|
|
748
534
|
headline: "Story created",
|
|
749
535
|
subHeadline: jsxs4(Fragment2, { children: [
|
|
@@ -836,24 +622,24 @@ import React11, { useCallback as useCallback22, useState as useState22 } from "r
|
|
|
836
622
|
import React15 from "react";
|
|
837
623
|
import React14 from "react";
|
|
838
624
|
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,
|
|
625
|
+
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
626
|
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:
|
|
627
|
+
}, __export = (target, all) => {
|
|
628
|
+
for (var name in all)
|
|
629
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
844
630
|
}, __copyProps = (to, from, except, desc) => {
|
|
845
631
|
if (from && typeof from == "object" || typeof from == "function")
|
|
846
632
|
for (let key of __getOwnPropNames(from))
|
|
847
633
|
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
848
634
|
return to;
|
|
849
|
-
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target, mod)), require_is_object =
|
|
635
|
+
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target, mod)), require_is_object = __commonJS({
|
|
850
636
|
"node_modules/is-object/index.js"(exports, module) {
|
|
851
637
|
"use strict";
|
|
852
638
|
module.exports = function(x) {
|
|
853
639
|
return typeof x == "object" && x !== null;
|
|
854
640
|
};
|
|
855
641
|
}
|
|
856
|
-
}), require_is_window =
|
|
642
|
+
}), require_is_window = __commonJS({
|
|
857
643
|
"node_modules/is-window/index.js"(exports, module) {
|
|
858
644
|
"use strict";
|
|
859
645
|
module.exports = function(obj) {
|
|
@@ -863,11 +649,11 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
|
|
|
863
649
|
return o === o.window;
|
|
864
650
|
};
|
|
865
651
|
}
|
|
866
|
-
}), require_is_dom =
|
|
652
|
+
}), require_is_dom = __commonJS({
|
|
867
653
|
"node_modules/is-dom/index.js"(exports, module) {
|
|
868
|
-
var
|
|
654
|
+
var isObject = require_is_object(), isWindow = require_is_window();
|
|
869
655
|
function isNode(val) {
|
|
870
|
-
return !
|
|
656
|
+
return !isObject(val) || !isWindow(window) || typeof window.Node != "function" ? !1 : typeof val.nodeType == "number" && typeof val.nodeName == "string";
|
|
871
657
|
}
|
|
872
658
|
module.exports = isNode;
|
|
873
659
|
}
|
|
@@ -1793,13 +1579,13 @@ var DataContainer = ({ rows, columns, rowsData }) => {
|
|
|
1793
1579
|
// src/actions/components/ActionLogger/index.tsx
|
|
1794
1580
|
import { useTheme } from "@aussieljk/forkbook/theming";
|
|
1795
1581
|
|
|
1796
|
-
// storybook-css:/
|
|
1582
|
+
// storybook-css:/home/runner/work/forkbook/forkbook/code/core/src/actions/components/ActionLogger/index.module.css
|
|
1797
1583
|
var id3 = "core/src/actions/components/ActionLogger/index.module.css";
|
|
1798
|
-
if (typeof document < "u" && !document.querySelector(`style[data-
|
|
1584
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id3}"]`)) {
|
|
1799
1585
|
let style = document.createElement("style");
|
|
1800
|
-
style.setAttribute("data-
|
|
1586
|
+
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
1587
|
}
|
|
1802
|
-
var ActionLogger_default = {
|
|
1588
|
+
var ActionLogger_default = { inspectorContainer: "fb-IaeYrG-inspectorContainer", counter: "fb-IaeYrG-counter", wrapper: "fb-IaeYrG-wrapper", action: "fb-IaeYrG-action" };
|
|
1803
1589
|
|
|
1804
1590
|
// src/actions/components/ActionLogger/index.tsx
|
|
1805
1591
|
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
@@ -1832,7 +1618,7 @@ var ThemedInspector = (props) => {
|
|
|
1832
1618
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1833
1619
|
var safeDeepEqual = (a, b) => {
|
|
1834
1620
|
try {
|
|
1835
|
-
return
|
|
1621
|
+
return isEqual(a, b);
|
|
1836
1622
|
} catch {
|
|
1837
1623
|
return !1;
|
|
1838
1624
|
}
|
|
@@ -1887,7 +1673,7 @@ import { AddonPanel as AddonPanel2 } from "@aussieljk/forkbook/internal/componen
|
|
|
1887
1673
|
import { Consumer, addons as addons5, types as types3 } from "@aussieljk/forkbook/manager-api";
|
|
1888
1674
|
|
|
1889
1675
|
// src/component-testing/components/Panel.tsx
|
|
1890
|
-
import { Fragment as Fragment8, memo as memo4, useEffect as
|
|
1676
|
+
import { Fragment as Fragment8, memo as memo4, useEffect as useEffect6, useMemo as useMemo4, useRef as useRef2, useState as useState7 } from "react";
|
|
1891
1677
|
import {
|
|
1892
1678
|
FORCE_REMOUNT,
|
|
1893
1679
|
PLAY_FUNCTION_THREW_EXCEPTION,
|
|
@@ -1895,7 +1681,6 @@ import {
|
|
|
1895
1681
|
STORY_THREW_EXCEPTION,
|
|
1896
1682
|
UNHANDLED_ERRORS_WHILE_PLAYING
|
|
1897
1683
|
} from "@aussieljk/forkbook/internal/core-events";
|
|
1898
|
-
import { global as global2 } from "@storybook/global";
|
|
1899
1684
|
import {
|
|
1900
1685
|
experimental_useStatusStore,
|
|
1901
1686
|
useAddonState as useAddonState2,
|
|
@@ -1906,7 +1691,7 @@ import {
|
|
|
1906
1691
|
} from "@aussieljk/forkbook/manager-api";
|
|
1907
1692
|
|
|
1908
1693
|
// src/component-testing/components/InteractionsPanel.tsx
|
|
1909
|
-
import * as
|
|
1694
|
+
import * as React23 from "react";
|
|
1910
1695
|
|
|
1911
1696
|
// src/component-testing/utils.ts
|
|
1912
1697
|
var import_ansi_to_html = __toESM(require_ansi_to_html(), 1);
|
|
@@ -1930,14 +1715,14 @@ function stripAnsi(string2) {
|
|
|
1930
1715
|
function isInteractionsDisabled(parameters) {
|
|
1931
1716
|
return !!parameters?.[PARAM_KEY5]?.disable;
|
|
1932
1717
|
}
|
|
1933
|
-
function isTestAssertionError(
|
|
1934
|
-
return isChaiError(
|
|
1718
|
+
function isTestAssertionError(error2) {
|
|
1719
|
+
return isChaiError(error2) || isJestError(error2);
|
|
1935
1720
|
}
|
|
1936
|
-
function isChaiError(
|
|
1937
|
-
return
|
|
1721
|
+
function isChaiError(error2) {
|
|
1722
|
+
return error2 && typeof error2 == "object" && "name" in error2 && typeof error2.name == "string" && error2.name === "AssertionError";
|
|
1938
1723
|
}
|
|
1939
|
-
function isJestError(
|
|
1940
|
-
return
|
|
1724
|
+
function isJestError(error2) {
|
|
1725
|
+
return error2 && typeof error2 == "object" && "message" in error2 && typeof error2.message == "string" && stripAnsi(error2.message).startsWith("expect(");
|
|
1941
1726
|
}
|
|
1942
1727
|
function createAnsiToHtmlFilter(theme3) {
|
|
1943
1728
|
return new import_ansi_to_html.default({
|
|
@@ -1954,13 +1739,13 @@ function useAnsiToHtmlFilter() {
|
|
|
1954
1739
|
// src/component-testing/components/DetachedDebuggerMessage.tsx
|
|
1955
1740
|
import { Link } from "@aussieljk/forkbook/internal/components";
|
|
1956
1741
|
|
|
1957
|
-
// storybook-css:/
|
|
1742
|
+
// storybook-css:/home/runner/work/forkbook/forkbook/code/core/src/component-testing/components/DetachedDebuggerMessage.module.css
|
|
1958
1743
|
var id4 = "core/src/component-testing/components/DetachedDebuggerMessage.module.css";
|
|
1959
|
-
if (typeof document < "u" && !document.querySelector(`style[data-
|
|
1744
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id4}"]`)) {
|
|
1960
1745
|
let style = document.createElement("style");
|
|
1961
|
-
style.setAttribute("data-
|
|
1746
|
+
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
1747
|
}
|
|
1963
|
-
var DetachedDebuggerMessage_default = { message: "
|
|
1748
|
+
var DetachedDebuggerMessage_default = { message: "fb-McV2ua-message" };
|
|
1964
1749
|
|
|
1965
1750
|
// src/component-testing/components/DetachedDebuggerMessage.tsx
|
|
1966
1751
|
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
@@ -1982,16 +1767,16 @@ var DetachedDebuggerMessage = ({ storyUrl }) => jsxs7("div", { className: Detach
|
|
|
1982
1767
|
// src/component-testing/components/EmptyState.tsx
|
|
1983
1768
|
import { useEffect as useEffect4, useState as useState5 } from "react";
|
|
1984
1769
|
import { EmptyTabContent, Link as Link2 } from "@aussieljk/forkbook/internal/components";
|
|
1985
|
-
import {
|
|
1770
|
+
import { FileTextIcon } from "lucide-react";
|
|
1986
1771
|
import { useStorybookApi as useStorybookApi4 } from "@aussieljk/forkbook/manager-api";
|
|
1987
1772
|
|
|
1988
|
-
// storybook-css:/
|
|
1773
|
+
// storybook-css:/home/runner/work/forkbook/forkbook/code/core/src/component-testing/components/EmptyState.module.css
|
|
1989
1774
|
var id5 = "core/src/component-testing/components/EmptyState.module.css";
|
|
1990
|
-
if (typeof document < "u" && !document.querySelector(`style[data-
|
|
1775
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id5}"]`)) {
|
|
1991
1776
|
let style = document.createElement("style");
|
|
1992
|
-
style.setAttribute("data-
|
|
1777
|
+
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
1778
|
}
|
|
1994
|
-
var EmptyState_default = { links: "
|
|
1779
|
+
var EmptyState_default = { links: "fb-m4u5Jq-links" };
|
|
1995
1780
|
|
|
1996
1781
|
// src/component-testing/components/EmptyState.tsx
|
|
1997
1782
|
import { Fragment as Fragment4, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
@@ -2012,7 +1797,7 @@ var Empty = () => {
|
|
|
2012
1797
|
title: "Interactions",
|
|
2013
1798
|
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
1799
|
footer: jsx10("div", { className: EmptyState_default.links, children: jsxs8(Link2, { href: docsUrl, target: "_blank", withArrow: !0, children: [
|
|
2015
|
-
jsx10(
|
|
1800
|
+
jsx10(FileTextIcon, {}),
|
|
2016
1801
|
" Read docs"
|
|
2017
1802
|
] }) })
|
|
2018
1803
|
}
|
|
@@ -2020,583 +1805,14 @@ var Empty = () => {
|
|
|
2020
1805
|
};
|
|
2021
1806
|
|
|
2022
1807
|
// src/component-testing/components/Interaction.tsx
|
|
2023
|
-
import * as
|
|
1808
|
+
import * as React21 from "react";
|
|
2024
1809
|
import { Button as Button2 } from "@aussieljk/forkbook/internal/components";
|
|
2025
|
-
import { ChevronDownIcon, ChevronUpIcon } from "
|
|
1810
|
+
import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
2026
1811
|
|
|
2027
1812
|
// src/component-testing/components/MethodCall.tsx
|
|
2028
|
-
import
|
|
1813
|
+
import React20, { Fragment as Fragment5 } from "react";
|
|
2029
1814
|
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";
|
|
1815
|
+
import { useTheme as useTheme3 } from "@aussieljk/forkbook/theming";
|
|
2600
1816
|
import { Fragment as Fragment6, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2601
1817
|
var colorsLight = {
|
|
2602
1818
|
base: "#444",
|
|
@@ -2649,7 +1865,7 @@ var colorsLight = {
|
|
|
2649
1865
|
meta: "#FAD483",
|
|
2650
1866
|
method: "#5EC1FF"
|
|
2651
1867
|
}, useThemeColors = () => {
|
|
2652
|
-
let { base } =
|
|
1868
|
+
let { base } = useTheme3();
|
|
2653
1869
|
return base === "dark" ? colorsDark : colorsLight;
|
|
2654
1870
|
}, special = /[^A-Z0-9]/i, trimEnd = /[\s.,…]+$/gm, ellipsize = (string2, maxlength) => {
|
|
2655
1871
|
if (string2.length <= maxlength)
|
|
@@ -2665,7 +1881,7 @@ var colorsLight = {
|
|
|
2665
1881
|
return String(value);
|
|
2666
1882
|
}
|
|
2667
1883
|
}, interleave = (nodes, separator) => nodes.flatMap(
|
|
2668
|
-
(node, index) => index === nodes.length - 1 ? [node] : [node,
|
|
1884
|
+
(node, index) => index === nodes.length - 1 ? [node] : [node, React20.cloneElement(separator, { key: `sep${index}` })]
|
|
2669
1885
|
), Node2 = ({
|
|
2670
1886
|
value,
|
|
2671
1887
|
nested,
|
|
@@ -2756,17 +1972,16 @@ var colorsLight = {
|
|
|
2756
1972
|
callsById,
|
|
2757
1973
|
nested = !1
|
|
2758
1974
|
}) => {
|
|
2759
|
-
let
|
|
1975
|
+
let { base, addonActionsTheme } = useTheme3(), isDarkMode = base === "dark", colors = useThemeColors();
|
|
2760
1976
|
if (showInspector)
|
|
2761
|
-
return jsx11(Fragment6, { children: jsx11(
|
|
2762
|
-
|
|
1977
|
+
return jsx11(Fragment6, { children: jsx11("span", { id: "interactions-object-inspector", children: jsx11(
|
|
1978
|
+
themedObjectInspector,
|
|
2763
1979
|
{
|
|
2764
|
-
id: "interactions-object-inspector",
|
|
2765
1980
|
data: value,
|
|
2766
|
-
|
|
2767
|
-
|
|
1981
|
+
showNonenumerable: !1,
|
|
1982
|
+
theme: addonActionsTheme ?? (isDarkMode ? "chromeDark" : "chromeLight")
|
|
2768
1983
|
}
|
|
2769
|
-
) });
|
|
1984
|
+
) }) });
|
|
2770
1985
|
if (nested)
|
|
2771
1986
|
return jsx11("span", { style: { color: colors.base }, children: "{\u2026}" });
|
|
2772
1987
|
let nodelist = interleave(
|
|
@@ -2800,7 +2015,7 @@ var colorsLight = {
|
|
|
2800
2015
|
}, ElementNode = ({
|
|
2801
2016
|
prefix,
|
|
2802
2017
|
localName,
|
|
2803
|
-
id:
|
|
2018
|
+
id: id14,
|
|
2804
2019
|
classNames = [],
|
|
2805
2020
|
innerText
|
|
2806
2021
|
}) => {
|
|
@@ -2808,9 +2023,9 @@ var colorsLight = {
|
|
|
2808
2023
|
return jsxs9("span", { style: { wordBreak: "keep-all" }, children: [
|
|
2809
2024
|
jsx11("span", { style: { color: colors.muted }, children: "<" }, `${name}_lt`),
|
|
2810
2025
|
jsx11("span", { style: { color: colors.tag.name }, children: name }, `${name}_tag`),
|
|
2811
|
-
jsx11("span", { style: { color: colors.tag.suffix }, children:
|
|
2026
|
+
jsx11("span", { style: { color: colors.tag.suffix }, children: id14 ? `#${id14}` : classNames.reduce((acc, className) => `${acc}.${className}`, "") }, `${name}_suffix`),
|
|
2812
2027
|
jsx11("span", { style: { color: colors.muted }, children: ">" }, `${name}_gt`),
|
|
2813
|
-
!
|
|
2028
|
+
!id14 && classNames.length === 0 && innerText && jsxs9(Fragment6, { children: [
|
|
2814
2029
|
jsx11("span", { children: innerText }, `${name}_text`),
|
|
2815
2030
|
jsx11("span", { style: { color: colors.muted }, children: "<" }, `${name}_close_lt`),
|
|
2816
2031
|
jsxs9("span", { style: { color: colors.tag.name }, children: [
|
|
@@ -2867,7 +2082,7 @@ var colorsLight = {
|
|
|
2867
2082
|
let colors = useThemeColors();
|
|
2868
2083
|
return jsx11("span", { style: { color: colors.meta }, children: stringify(value) });
|
|
2869
2084
|
}, StepNode = ({ label }) => {
|
|
2870
|
-
let colors = useThemeColors(), { typography } =
|
|
2085
|
+
let colors = useThemeColors(), { typography } = useTheme3();
|
|
2871
2086
|
return jsx11(
|
|
2872
2087
|
"span",
|
|
2873
2088
|
{
|
|
@@ -2911,13 +2126,13 @@ var colorsLight = {
|
|
|
2911
2126
|
] });
|
|
2912
2127
|
};
|
|
2913
2128
|
|
|
2914
|
-
// storybook-css:/
|
|
2129
|
+
// storybook-css:/home/runner/work/forkbook/forkbook/code/core/src/component-testing/components/MatcherResult.module.css
|
|
2915
2130
|
var id6 = "core/src/component-testing/components/MatcherResult.module.css";
|
|
2916
|
-
if (typeof document < "u" && !document.querySelector(`style[data-
|
|
2131
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id6}"]`)) {
|
|
2917
2132
|
let style = document.createElement("style");
|
|
2918
|
-
style.setAttribute("data-
|
|
2133
|
+
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
2134
|
}
|
|
2920
|
-
var MatcherResult_default = {
|
|
2135
|
+
var MatcherResult_default = { received: "fb-cs81pG-received", expected: "fb-cs81pG-expected" };
|
|
2921
2136
|
|
|
2922
2137
|
// src/component-testing/components/MatcherResult.tsx
|
|
2923
2138
|
import { Fragment as Fragment7, jsx as jsx12 } from "react/jsx-runtime";
|
|
@@ -2944,7 +2159,7 @@ var getParams = (line, fromIndex = 0) => {
|
|
|
2944
2159
|
style: {
|
|
2945
2160
|
margin: 0,
|
|
2946
2161
|
padding: "8px 10px 8px 36px",
|
|
2947
|
-
fontSize: "var(--
|
|
2162
|
+
fontSize: "var(--fb-size-s1)",
|
|
2948
2163
|
...style
|
|
2949
2164
|
},
|
|
2950
2165
|
children: lines.flatMap((line, index) => {
|
|
@@ -3006,16 +2221,16 @@ var getParams = (line, fromIndex = 0) => {
|
|
|
3006
2221
|
};
|
|
3007
2222
|
|
|
3008
2223
|
// src/component-testing/components/StatusIcon.tsx
|
|
3009
|
-
import { CheckIcon as CheckIcon2, CircleIcon, PlayIcon,
|
|
3010
|
-
import { useTheme as
|
|
2224
|
+
import { CheckIcon as CheckIcon2, CircleIcon, PlayIcon, CircleStopIcon } from "lucide-react";
|
|
2225
|
+
import { useTheme as useTheme4 } from "@aussieljk/forkbook/theming";
|
|
3011
2226
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
3012
2227
|
var StatusIcon = ({ status }) => {
|
|
3013
|
-
let theme3 =
|
|
2228
|
+
let theme3 = useTheme4();
|
|
3014
2229
|
switch (status) {
|
|
3015
2230
|
case "done" /* DONE */:
|
|
3016
2231
|
return jsx13(CheckIcon2, { color: theme3.color.positive, "data-testid": "icon-done" });
|
|
3017
2232
|
case "error" /* ERROR */:
|
|
3018
|
-
return jsx13(
|
|
2233
|
+
return jsx13(CircleStopIcon, { color: theme3.color.negative, "data-testid": "icon-error" });
|
|
3019
2234
|
case "active" /* ACTIVE */:
|
|
3020
2235
|
return jsx13(PlayIcon, { color: theme3.color.secondary, "data-testid": "icon-active" });
|
|
3021
2236
|
case "waiting" /* WAITING */:
|
|
@@ -3038,13 +2253,13 @@ var StatusIcon = ({ status }) => {
|
|
|
3038
2253
|
}
|
|
3039
2254
|
};
|
|
3040
2255
|
|
|
3041
|
-
// storybook-css:/
|
|
2256
|
+
// storybook-css:/home/runner/work/forkbook/forkbook/code/core/src/component-testing/components/Interaction.module.css
|
|
3042
2257
|
var id7 = "core/src/component-testing/components/Interaction.module.css";
|
|
3043
|
-
if (typeof document < "u" && !document.querySelector(`style[data-
|
|
2258
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id7}"]`)) {
|
|
3044
2259
|
let style = document.createElement("style");
|
|
3045
|
-
style.setAttribute("data-
|
|
2260
|
+
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
2261
|
}
|
|
3047
|
-
var Interaction_default = {
|
|
2262
|
+
var Interaction_default = { row: "fb-PYwdvq-row", rowMessage: "fb-PYwdvq-rowMessage", errorName: "fb-PYwdvq-errorName", methodCall: "fb-PYwdvq-methodCall", errorExplainer: "fb-PYwdvq-errorExplainer", rowActions: "fb-PYwdvq-rowActions", button: "fb-PYwdvq-button", rowHeader: "fb-PYwdvq-rowHeader", rowLabel: "fb-PYwdvq-rowLabel", errorMessage: "fb-PYwdvq-errorMessage" };
|
|
3048
2263
|
|
|
3049
2264
|
// src/component-testing/components/Interaction.tsx
|
|
3050
2265
|
import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
@@ -3116,7 +2331,7 @@ ${exception.diff}` : ""}`,
|
|
|
3116
2331
|
toggleCollapsed,
|
|
3117
2332
|
pausedAt
|
|
3118
2333
|
}) => {
|
|
3119
|
-
let [isHovered, setIsHovered] =
|
|
2334
|
+
let [isHovered, setIsHovered] = React21.useState(!1), isNavigationDisabled = !controlStates.goto || !call.interceptable || !!call.ancestors?.length, stepName = extractStepName(call), interactionStatus = getInteractionStatusText(call);
|
|
3120
2335
|
return isHidden || call.id === INTERNAL_RENDER_CALL_ID ? null : jsxs10(
|
|
3121
2336
|
"li",
|
|
3122
2337
|
{
|
|
@@ -3177,13 +2392,13 @@ ${exception.diff}` : ""}`,
|
|
|
3177
2392
|
import { Link as Link3 } from "@aussieljk/forkbook/internal/components";
|
|
3178
2393
|
import { useStorybookApi as useStorybookApi5 } from "@aussieljk/forkbook/manager-api";
|
|
3179
2394
|
|
|
3180
|
-
// storybook-css:/
|
|
2395
|
+
// storybook-css:/home/runner/work/forkbook/forkbook/code/core/src/component-testing/components/TestDiscrepancyMessage.module.css
|
|
3181
2396
|
var id8 = "core/src/component-testing/components/TestDiscrepancyMessage.module.css";
|
|
3182
|
-
if (typeof document < "u" && !document.querySelector(`style[data-
|
|
2397
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id8}"]`)) {
|
|
3183
2398
|
let style = document.createElement("style");
|
|
3184
|
-
style.setAttribute("data-
|
|
2399
|
+
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
2400
|
}
|
|
3186
|
-
var TestDiscrepancyMessage_default = { message: "
|
|
2401
|
+
var TestDiscrepancyMessage_default = { message: "fb-wob9GG-message" };
|
|
3187
2402
|
|
|
3188
2403
|
// src/component-testing/components/TestDiscrepancyMessage.tsx
|
|
3189
2404
|
import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
@@ -3212,24 +2427,24 @@ import {
|
|
|
3212
2427
|
Toolbar as SharedToolbar
|
|
3213
2428
|
} from "@aussieljk/forkbook/internal/components";
|
|
3214
2429
|
import {
|
|
2430
|
+
RefreshCwIcon,
|
|
3215
2431
|
FastForwardIcon,
|
|
3216
|
-
PlayBackIcon,
|
|
3217
|
-
PlayNextIcon,
|
|
3218
2432
|
RewindIcon,
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
2433
|
+
SkipBackIcon,
|
|
2434
|
+
SkipForwardIcon
|
|
2435
|
+
} from "lucide-react";
|
|
2436
|
+
import { useTheme as useTheme5 } from "@aussieljk/forkbook/theming";
|
|
3222
2437
|
|
|
3223
2438
|
// src/component-testing/components/StatusBadge.tsx
|
|
3224
2439
|
import { TooltipNote, WithTooltip } from "@aussieljk/forkbook/internal/components";
|
|
3225
2440
|
|
|
3226
|
-
// storybook-css:/
|
|
2441
|
+
// storybook-css:/home/runner/work/forkbook/forkbook/code/core/src/component-testing/components/StatusBadge.module.css
|
|
3227
2442
|
var id9 = "core/src/component-testing/components/StatusBadge.module.css";
|
|
3228
|
-
if (typeof document < "u" && !document.querySelector(`style[data-
|
|
2443
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id9}"]`)) {
|
|
3229
2444
|
let style = document.createElement("style");
|
|
3230
|
-
style.setAttribute("data-
|
|
2445
|
+
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
2446
|
}
|
|
3232
|
-
var StatusBadge_default = { badge: "
|
|
2447
|
+
var StatusBadge_default = { badge: "fb-R5-BBa-badge" };
|
|
3233
2448
|
|
|
3234
2449
|
// src/component-testing/components/StatusBadge.tsx
|
|
3235
2450
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
@@ -3264,7 +2479,7 @@ var StatusColorMapping = {
|
|
|
3264
2479
|
"div",
|
|
3265
2480
|
{
|
|
3266
2481
|
className: StatusBadge_default.badge,
|
|
3267
|
-
style: { backgroundColor: `var(--
|
|
2482
|
+
style: { backgroundColor: `var(--fb-color-${StatusColorMapping[status]})` },
|
|
3268
2483
|
"aria-label": `Story status: ${badgeText}`,
|
|
3269
2484
|
children: badgeText
|
|
3270
2485
|
}
|
|
@@ -3273,13 +2488,13 @@ var StatusColorMapping = {
|
|
|
3273
2488
|
);
|
|
3274
2489
|
};
|
|
3275
2490
|
|
|
3276
|
-
// storybook-css:/
|
|
2491
|
+
// storybook-css:/home/runner/work/forkbook/forkbook/code/core/src/component-testing/components/Toolbar.module.css
|
|
3277
2492
|
var id10 = "core/src/component-testing/components/Toolbar.module.css";
|
|
3278
|
-
if (typeof document < "u" && !document.querySelector(`style[data-
|
|
2493
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id10}"]`)) {
|
|
3279
2494
|
let style = document.createElement("style");
|
|
3280
|
-
style.setAttribute("data-
|
|
2495
|
+
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
2496
|
}
|
|
3282
|
-
var Toolbar_default = { rewindButton: "
|
|
2497
|
+
var Toolbar_default = { wrapper: "fb-W9rv1G-wrapper", rewindButton: "fb-W9rv1G-rewindButton fb-W9rv1G-iconButton", openInEditorButton: "fb-W9rv1G-openInEditorButton", controlsGroup: "fb-W9rv1G-controlsGroup", jumpToEndButton: "fb-W9rv1G-jumpToEndButton", location: "fb-W9rv1G-location", iconButton: "fb-W9rv1G-iconButton" };
|
|
3283
2498
|
|
|
3284
2499
|
// src/component-testing/components/Toolbar.tsx
|
|
3285
2500
|
import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
@@ -3293,7 +2508,7 @@ var Toolbar = ({
|
|
|
3293
2508
|
canOpenInEditor,
|
|
3294
2509
|
api
|
|
3295
2510
|
}) => {
|
|
3296
|
-
let buttonText = status === "errored" ? "Scroll to error" : "Scroll to end", theme3 =
|
|
2511
|
+
let buttonText = status === "errored" ? "Scroll to error" : "Scroll to end", theme3 = useTheme5(), preventFocusLoss = (e) => e.preventDefault();
|
|
3297
2512
|
return jsx17("div", { className: Toolbar_default.wrapper, children: jsxs12(
|
|
3298
2513
|
SharedToolbar,
|
|
3299
2514
|
{
|
|
@@ -3338,7 +2553,7 @@ var Toolbar = ({
|
|
|
3338
2553
|
onClick: controls.back,
|
|
3339
2554
|
onPointerDown: preventFocusLoss,
|
|
3340
2555
|
disabled: !controlStates.back,
|
|
3341
|
-
children: jsx17(
|
|
2556
|
+
children: jsx17(SkipBackIcon, {})
|
|
3342
2557
|
}
|
|
3343
2558
|
),
|
|
3344
2559
|
jsx17(
|
|
@@ -3351,7 +2566,7 @@ var Toolbar = ({
|
|
|
3351
2566
|
onClick: controls.next,
|
|
3352
2567
|
onPointerDown: preventFocusLoss,
|
|
3353
2568
|
disabled: !controlStates.next,
|
|
3354
|
-
children: jsx17(
|
|
2569
|
+
children: jsx17(SkipForwardIcon, {})
|
|
3355
2570
|
}
|
|
3356
2571
|
),
|
|
3357
2572
|
jsx17(
|
|
@@ -3376,7 +2591,7 @@ var Toolbar = ({
|
|
|
3376
2591
|
ariaLabel: "Rerun",
|
|
3377
2592
|
onClick: controls.rerun,
|
|
3378
2593
|
onPointerDown: preventFocusLoss,
|
|
3379
|
-
children: jsx17(
|
|
2594
|
+
children: jsx17(RefreshCwIcon, {})
|
|
3380
2595
|
}
|
|
3381
2596
|
)
|
|
3382
2597
|
] }),
|
|
@@ -3401,13 +2616,13 @@ var Toolbar = ({
|
|
|
3401
2616
|
) });
|
|
3402
2617
|
};
|
|
3403
2618
|
|
|
3404
|
-
// storybook-css:/
|
|
2619
|
+
// storybook-css:/home/runner/work/forkbook/forkbook/code/core/src/component-testing/components/InteractionsPanel.module.css
|
|
3405
2620
|
var id11 = "core/src/component-testing/components/InteractionsPanel.module.css";
|
|
3406
|
-
if (typeof document < "u" && !document.querySelector(`style[data-
|
|
2621
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id11}"]`)) {
|
|
3407
2622
|
let style = document.createElement("style");
|
|
3408
|
-
style.setAttribute("data-
|
|
2623
|
+
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
2624
|
}
|
|
3410
|
-
var InteractionsPanel_default = {
|
|
2625
|
+
var InteractionsPanel_default = { caughtExceptionDescription: "fb-RpIDLa-caughtExceptionDescription", list: "fb-RpIDLa-list", section: "fb-RpIDLa-section", heading: "fb-RpIDLa-heading", caughtExceptionTitle: "fb-RpIDLa-caughtExceptionTitle", caughtException: "fb-RpIDLa-caughtException", container: "fb-RpIDLa-container", caughtExceptionCode: "fb-RpIDLa-caughtExceptionCode", caughtExceptionStack: "fb-RpIDLa-caughtExceptionStack" };
|
|
3411
2626
|
|
|
3412
2627
|
// src/component-testing/components/InteractionsPanel.tsx
|
|
3413
2628
|
import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
@@ -3417,7 +2632,7 @@ var StatusAnnouncementMapping = {
|
|
|
3417
2632
|
completed: "Component test completed successfully.",
|
|
3418
2633
|
errored: "Component test failed.",
|
|
3419
2634
|
aborted: "Component test was aborted."
|
|
3420
|
-
}, getStatusAnnouncement = (status, hasException) => status === "completed" && hasException ? StatusAnnouncementMapping.errored : StatusAnnouncementMapping[status], InteractionsPanel =
|
|
2635
|
+
}, getStatusAnnouncement = (status, hasException) => status === "completed" && hasException ? StatusAnnouncementMapping.errored : StatusAnnouncementMapping[status], InteractionsPanel = React23.memo(
|
|
3421
2636
|
function({
|
|
3422
2637
|
storyUrl,
|
|
3423
2638
|
status,
|
|
@@ -3439,7 +2654,7 @@ var StatusAnnouncementMapping = {
|
|
|
3439
2654
|
api
|
|
3440
2655
|
}) {
|
|
3441
2656
|
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
|
|
2657
|
+
return React23.useEffect(() => {
|
|
3443
2658
|
announce(statusAnnouncement, isStatusAlert ? "assertive" : "polite");
|
|
3444
2659
|
}, [statusAnnouncement, isStatusAlert]), jsxs13("div", { className: InteractionsPanel_default.container, children: [
|
|
3445
2660
|
hasResultMismatch && jsx18(TestDiscrepancyMessage, { browserTestStatus }),
|
|
@@ -3507,15 +2722,15 @@ var StatusAnnouncementMapping = {
|
|
|
3507
2722
|
jsx18("code", { className: InteractionsPanel_default.caughtExceptionCode, children: "true" }),
|
|
3508
2723
|
"."
|
|
3509
2724
|
] }),
|
|
3510
|
-
unhandledErrors.map((
|
|
2725
|
+
unhandledErrors.map((error2, i) => jsx18("pre", { className: InteractionsPanel_default.caughtExceptionStack, "data-chromatic": "ignore", children: printSerializedError(error2) }, i))
|
|
3511
2726
|
] }),
|
|
3512
2727
|
jsx18("div", { ref: endRef }),
|
|
3513
2728
|
status === "completed" && !caughtException && !hasRealInteractions && jsx18(Empty, {})
|
|
3514
2729
|
] });
|
|
3515
2730
|
}
|
|
3516
2731
|
);
|
|
3517
|
-
function printSerializedError(
|
|
3518
|
-
return
|
|
2732
|
+
function printSerializedError(error2) {
|
|
2733
|
+
return error2.stack || `${error2.name}: ${error2.message}`;
|
|
3519
2734
|
}
|
|
3520
2735
|
|
|
3521
2736
|
// src/component-testing/components/Panel.tsx
|
|
@@ -3606,7 +2821,7 @@ var INITIAL_CONTROL_STATES = {
|
|
|
3606
2821
|
statusValue: storyStatus?.value,
|
|
3607
2822
|
testRunId: storyStatus?.data?.testRunId
|
|
3608
2823
|
};
|
|
3609
|
-
}), state = useStorybookState2(), api = useStorybookApi6(), importPath = api.getData(state.storyId, state.refId)?.importPath, canOpenInEditor =
|
|
2824
|
+
}), 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
2825
|
status: "rendering",
|
|
3611
2826
|
controlStates: INITIAL_CONTROL_STATES,
|
|
3612
2827
|
interactions: [],
|
|
@@ -3615,7 +2830,7 @@ var INITIAL_CONTROL_STATES = {
|
|
|
3615
2830
|
pausedAt: void 0,
|
|
3616
2831
|
caughtException: void 0,
|
|
3617
2832
|
unhandledErrors: void 0
|
|
3618
|
-
}), [scrollTarget, setScrollTarget] =
|
|
2833
|
+
}), [scrollTarget, setScrollTarget] = useState7(void 0), [collapsed, setCollapsed] = useState7(/* @__PURE__ */ new Set()), [hasResultMismatch, setResultMismatch] = useState7(!1), {
|
|
3619
2834
|
status = "rendering",
|
|
3620
2835
|
controlStates = INITIAL_CONTROL_STATES,
|
|
3621
2836
|
interactions = [],
|
|
@@ -3625,11 +2840,11 @@ var INITIAL_CONTROL_STATES = {
|
|
|
3625
2840
|
} = panelState, log = useRef2([getInternalRenderLogItem("active" /* ACTIVE */)]), calls = useRef2(
|
|
3626
2841
|
/* @__PURE__ */ new Map([[INTERNAL_RENDER_CALL_ID, getInternalRenderCall(storyId)]])
|
|
3627
2842
|
), setCall = ({ status: status2, ...call }) => calls.current.set(call.id, call), endRef = useRef2();
|
|
3628
|
-
|
|
2843
|
+
useEffect6(() => {
|
|
3629
2844
|
let observer;
|
|
3630
|
-
return
|
|
2845
|
+
return global.IntersectionObserver && (observer = new global.IntersectionObserver(
|
|
3631
2846
|
([end]) => setScrollTarget(end.isIntersecting ? void 0 : end.target),
|
|
3632
|
-
{ root:
|
|
2847
|
+
{ root: global.document.querySelector('#storybook-panel-root [role="tabpanel"]') }
|
|
3633
2848
|
), endRef.current && observer.observe(endRef.current)), () => observer?.disconnect();
|
|
3634
2849
|
}, []);
|
|
3635
2850
|
let renderTracker = useRef2({ renderId: 0 }), emit = useChannel3(
|
|
@@ -3692,7 +2907,7 @@ var INITIAL_CONTROL_STATES = {
|
|
|
3692
2907
|
},
|
|
3693
2908
|
[collapsed, storyId]
|
|
3694
2909
|
);
|
|
3695
|
-
|
|
2910
|
+
useEffect6(() => {
|
|
3696
2911
|
set(
|
|
3697
2912
|
(state2) => getPanelState(state2, { log: log.current, calls: calls.current, collapsed, setCollapsed })
|
|
3698
2913
|
);
|
|
@@ -3710,7 +2925,7 @@ var INITIAL_CONTROL_STATES = {
|
|
|
3710
2925
|
}),
|
|
3711
2926
|
[emit, storyId]
|
|
3712
2927
|
), 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
|
|
2928
|
+
return useEffect6(() => {
|
|
3714
2929
|
if (browserTestStatus && statusValue && statusValue !== "status-value:pending" && statusValue !== storyStatusMap[browserTestStatus]) {
|
|
3715
2930
|
let timeout = setTimeout(
|
|
3716
2931
|
() => setResultMismatch((currentValue) => (currentValue || emit(FORKBOOK_ADDON_TEST_CHANNEL, {
|
|
@@ -3794,7 +3009,7 @@ import { addons as addons6, types as types4 } from "@aussieljk/forkbook/manager-
|
|
|
3794
3009
|
// src/backgrounds/components/Tool.tsx
|
|
3795
3010
|
import { Fragment as Fragment9, memo as memo5, useCallback as useCallback5 } from "react";
|
|
3796
3011
|
import { Select, ToggleButton } from "@aussieljk/forkbook/internal/components";
|
|
3797
|
-
import { CircleIcon as CircleIcon2,
|
|
3012
|
+
import { CircleIcon as CircleIcon2, Grid2x2Icon, ImageIcon } from "lucide-react";
|
|
3798
3013
|
import { useGlobals as useGlobals2, useParameter as useParameter4 } from "@aussieljk/forkbook/manager-api";
|
|
3799
3014
|
import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3800
3015
|
var BackgroundTool = memo5(function() {
|
|
@@ -3845,7 +3060,7 @@ var BackgroundTool = memo5(function() {
|
|
|
3845
3060
|
ariaLabel: isLocked ? "Grid set by story parameters" : "Grid visibility",
|
|
3846
3061
|
tooltip: isLocked ? "Grid set by story parameters" : "Toggle grid visibility",
|
|
3847
3062
|
onClick: () => update({ value: backgroundName, grid: !isGrid }),
|
|
3848
|
-
children: jsx22(
|
|
3063
|
+
children: jsx22(Grid2x2Icon, {})
|
|
3849
3064
|
},
|
|
3850
3065
|
"grid"
|
|
3851
3066
|
),
|
|
@@ -3855,7 +3070,7 @@ var BackgroundTool = memo5(function() {
|
|
|
3855
3070
|
resetLabel: "Reset background",
|
|
3856
3071
|
onReset: () => update(void 0),
|
|
3857
3072
|
disabled: isLocked,
|
|
3858
|
-
icon: jsx22(
|
|
3073
|
+
icon: jsx22(ImageIcon, {}),
|
|
3859
3074
|
ariaLabel: isLocked ? "Background set by story parameters" : "Preview background",
|
|
3860
3075
|
tooltip: isLocked ? "Background set by story parameters" : "Change background",
|
|
3861
3076
|
defaultOptions: backgroundName,
|
|
@@ -3882,9 +3097,9 @@ var manager_default6 = addons6.register(ADDON_ID3, () => {
|
|
|
3882
3097
|
import { addons as addons7, types as types5 } from "@aussieljk/forkbook/manager-api";
|
|
3883
3098
|
|
|
3884
3099
|
// src/measure/Tool.tsx
|
|
3885
|
-
import { useCallback as useCallback6, useEffect as
|
|
3100
|
+
import { useCallback as useCallback6, useEffect as useEffect7 } from "react";
|
|
3886
3101
|
import { ToggleButton as ToggleButton2 } from "@aussieljk/forkbook/internal/components";
|
|
3887
|
-
import { RulerIcon } from "
|
|
3102
|
+
import { RulerIcon } from "lucide-react";
|
|
3888
3103
|
import { useGlobals as useGlobals3, useParameter as useParameter5, useStorybookApi as useStorybookApi8 } from "@aussieljk/forkbook/manager-api";
|
|
3889
3104
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
3890
3105
|
var Tool = () => {
|
|
@@ -3894,7 +3109,7 @@ var Tool = () => {
|
|
|
3894
3109
|
}),
|
|
3895
3110
|
[updateGlobals, measureEnabled]
|
|
3896
3111
|
);
|
|
3897
|
-
return
|
|
3112
|
+
return useEffect7(() => {
|
|
3898
3113
|
isDisabled || api.setAddonShortcut(ADDON_ID4, {
|
|
3899
3114
|
label: "Toggle Measure",
|
|
3900
3115
|
defaultShortcut: ["M"],
|
|
@@ -3933,9 +3148,9 @@ var manager_default7 = addons7.register(ADDON_ID4, () => {
|
|
|
3933
3148
|
import { addons as addons8, types as types6 } from "@aussieljk/forkbook/manager-api";
|
|
3934
3149
|
|
|
3935
3150
|
// src/outline/OutlineSelector.tsx
|
|
3936
|
-
import { memo as memo6, useCallback as useCallback7, useEffect as
|
|
3151
|
+
import { memo as memo6, useCallback as useCallback7, useEffect as useEffect8 } from "react";
|
|
3937
3152
|
import { ToggleButton as ToggleButton3 } from "@aussieljk/forkbook/internal/components";
|
|
3938
|
-
import {
|
|
3153
|
+
import { SquareDashedIcon } from "lucide-react";
|
|
3939
3154
|
import { useGlobals as useGlobals4, useParameter as useParameter6, useStorybookApi as useStorybookApi9 } from "@aussieljk/forkbook/manager-api";
|
|
3940
3155
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
3941
3156
|
var OutlineSelector = memo6(function() {
|
|
@@ -3945,7 +3160,7 @@ var OutlineSelector = memo6(function() {
|
|
|
3945
3160
|
}),
|
|
3946
3161
|
[isActive, updateGlobals]
|
|
3947
3162
|
);
|
|
3948
|
-
return
|
|
3163
|
+
return useEffect8(() => {
|
|
3949
3164
|
isDisabled || api.setAddonShortcut(ADDON_ID5, {
|
|
3950
3165
|
label: "Toggle Outline",
|
|
3951
3166
|
defaultShortcut: ["alt", "O"],
|
|
@@ -3963,7 +3178,7 @@ var OutlineSelector = memo6(function() {
|
|
|
3963
3178
|
ariaDescription: "When enabled, this tool displays the outline of every element in the preview area, which helps understand their layout.",
|
|
3964
3179
|
tooltip: "Toggle outline",
|
|
3965
3180
|
onClick: toggleOutline,
|
|
3966
|
-
children: jsx26(
|
|
3181
|
+
children: jsx26(SquareDashedIcon, {})
|
|
3967
3182
|
},
|
|
3968
3183
|
"outline"
|
|
3969
3184
|
);
|
|
@@ -3983,13 +3198,8 @@ var manager_default8 = addons8.register(ADDON_ID5, () => {
|
|
|
3983
3198
|
// src/viewport/manager.tsx
|
|
3984
3199
|
import { addons as addons9, types as types7 } from "@aussieljk/forkbook/manager-api";
|
|
3985
3200
|
|
|
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
3201
|
// src/viewport/useViewport.ts
|
|
3992
|
-
import { useCallback as useCallback8, useEffect as
|
|
3202
|
+
import { useCallback as useCallback8, useEffect as useEffect9, useMemo as useMemo5, useRef as useRef3 } from "react";
|
|
3993
3203
|
import { useGlobals as useGlobals5, useParameter as useParameter7, useStorybookApi as useStorybookApi10 } from "@aussieljk/forkbook/manager-api";
|
|
3994
3204
|
var cycle = (viewports, current, direction = 1) => {
|
|
3995
3205
|
let keys = Object.keys(viewports), nextIndex = (current ? keys.indexOf(current) : -1) + direction;
|
|
@@ -4013,9 +3223,9 @@ var cycle = (viewports, current, direction = 1) => {
|
|
|
4013
3223
|
},
|
|
4014
3224
|
[update, isRotated]
|
|
4015
3225
|
);
|
|
4016
|
-
return
|
|
3226
|
+
return useEffect9(() => {
|
|
4017
3227
|
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]),
|
|
3228
|
+
}, [parameter, storyGlobals, options, option, update]), useEffect9(() => {
|
|
4019
3229
|
api.setAddonShortcut(ADDON_ID, {
|
|
4020
3230
|
label: "Next viewport",
|
|
4021
3231
|
defaultShortcut: ["alt", "V"],
|
|
@@ -4069,85 +3279,451 @@ var cycle = (viewports, current, direction = 1) => {
|
|
|
4069
3279
|
);
|
|
4070
3280
|
};
|
|
4071
3281
|
|
|
3282
|
+
// src/viewport/components/FrameSize.tsx
|
|
3283
|
+
import { useEffect as useEffect10, useState as useState8 } from "react";
|
|
3284
|
+
|
|
3285
|
+
// storybook-css:/home/runner/work/forkbook/forkbook/code/core/src/viewport/components/FrameSize.module.css
|
|
3286
|
+
var id12 = "core/src/viewport/components/FrameSize.module.css";
|
|
3287
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id12}"]`)) {
|
|
3288
|
+
let style = document.createElement("style");
|
|
3289
|
+
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);
|
|
3290
|
+
}
|
|
3291
|
+
var FrameSize_default = { value: "fb-bVlzdq-value", wrapper: "fb-bVlzdq-wrapper", input: "fb-bVlzdq-input", times: "fb-bVlzdq-times" };
|
|
3292
|
+
|
|
3293
|
+
// src/viewport/components/FrameSize.tsx
|
|
3294
|
+
import { jsx as jsx28, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3295
|
+
var PREVIEW_IFRAME_ID = "storybook-preview-iframe", usePreviewFrameSize = (id14 = PREVIEW_IFRAME_ID) => {
|
|
3296
|
+
let [size, setSize] = useState8();
|
|
3297
|
+
return useEffect10(() => {
|
|
3298
|
+
let observed = null, resizeObserver = new ResizeObserver(() => {
|
|
3299
|
+
observed && setSize({ width: observed.clientWidth, height: observed.clientHeight });
|
|
3300
|
+
}), attach = () => {
|
|
3301
|
+
let el = document.getElementById(id14);
|
|
3302
|
+
el !== observed && (observed && resizeObserver.unobserve(observed), observed = el, el && resizeObserver.observe(el));
|
|
3303
|
+
};
|
|
3304
|
+
attach();
|
|
3305
|
+
let mutationObserver = new MutationObserver(attach);
|
|
3306
|
+
return mutationObserver.observe(document.body, { childList: !0, subtree: !0 }), () => {
|
|
3307
|
+
mutationObserver.disconnect(), resizeObserver.disconnect();
|
|
3308
|
+
};
|
|
3309
|
+
}, [id14]), size;
|
|
3310
|
+
}, Dimension = ({
|
|
3311
|
+
label,
|
|
3312
|
+
value,
|
|
3313
|
+
disabled,
|
|
3314
|
+
onApply
|
|
3315
|
+
}) => {
|
|
3316
|
+
let [draft, setDraft] = useState8();
|
|
3317
|
+
if (draft === void 0)
|
|
3318
|
+
return jsx28(
|
|
3319
|
+
"button",
|
|
3320
|
+
{
|
|
3321
|
+
type: "button",
|
|
3322
|
+
className: FrameSize_default.value,
|
|
3323
|
+
"aria-label": `${label}: ${value}px. Click to edit.`,
|
|
3324
|
+
disabled,
|
|
3325
|
+
onClick: () => setDraft(String(value)),
|
|
3326
|
+
children: value
|
|
3327
|
+
}
|
|
3328
|
+
);
|
|
3329
|
+
let apply = () => {
|
|
3330
|
+
let next = Math.round(Number(draft));
|
|
3331
|
+
setDraft(void 0), draft.trim() !== "" && Number.isFinite(next) && next > 0 && next !== value && onApply(next);
|
|
3332
|
+
}, onKeyDown = (e) => {
|
|
3333
|
+
e.key === "Enter" ? (e.preventDefault(), apply()) : e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), setDraft(void 0));
|
|
3334
|
+
};
|
|
3335
|
+
return jsx28(
|
|
3336
|
+
"input",
|
|
3337
|
+
{
|
|
3338
|
+
className: FrameSize_default.input,
|
|
3339
|
+
"aria-label": label,
|
|
3340
|
+
type: "number",
|
|
3341
|
+
min: 1,
|
|
3342
|
+
autoFocus: !0,
|
|
3343
|
+
value: draft,
|
|
3344
|
+
style: { width: `${Math.max(draft.length, 2) + 2}ch` },
|
|
3345
|
+
onChange: (e) => setDraft(e.target.value),
|
|
3346
|
+
onFocus: (e) => e.target.select(),
|
|
3347
|
+
onBlur: apply,
|
|
3348
|
+
onKeyDown
|
|
3349
|
+
}
|
|
3350
|
+
);
|
|
3351
|
+
}, FrameSize = ({
|
|
3352
|
+
size,
|
|
3353
|
+
disabled,
|
|
3354
|
+
onApply
|
|
3355
|
+
}) => size ? jsxs16("span", { className: FrameSize_default.wrapper, "data-testid": "frame-size", children: [
|
|
3356
|
+
jsx28(
|
|
3357
|
+
Dimension,
|
|
3358
|
+
{
|
|
3359
|
+
label: "Frame width",
|
|
3360
|
+
value: size.width,
|
|
3361
|
+
disabled,
|
|
3362
|
+
onApply: (width) => onApply({ ...size, width })
|
|
3363
|
+
}
|
|
3364
|
+
),
|
|
3365
|
+
jsx28("span", { "aria-hidden": !0, className: FrameSize_default.times, children: "\xD7" }),
|
|
3366
|
+
jsx28(
|
|
3367
|
+
Dimension,
|
|
3368
|
+
{
|
|
3369
|
+
label: "Frame height",
|
|
3370
|
+
value: size.height,
|
|
3371
|
+
disabled,
|
|
3372
|
+
onApply: (height) => onApply({ ...size, height })
|
|
3373
|
+
}
|
|
3374
|
+
)
|
|
3375
|
+
] }) : null;
|
|
3376
|
+
|
|
3377
|
+
// src/viewport/components/ViewportSegments.tsx
|
|
3378
|
+
import { useMemo as useMemo8 } from "react";
|
|
3379
|
+
import { Button as Button4, Select as Select2 } from "@aussieljk/forkbook/internal/components";
|
|
3380
|
+
|
|
3381
|
+
// ../../node_modules/@base-ui/react/toggle/Toggle.mjs
|
|
3382
|
+
import * as React30 from "react";
|
|
3383
|
+
|
|
3384
|
+
// ../../node_modules/@base-ui/react/toggle-group/ToggleGroupContext.mjs
|
|
3385
|
+
import * as React29 from "react";
|
|
3386
|
+
var ToggleGroupContext = React29.createContext(void 0);
|
|
3387
|
+
process.env.NODE_ENV !== "production" && (ToggleGroupContext.displayName = "ToggleGroupContext");
|
|
3388
|
+
function useToggleGroupContext() {
|
|
3389
|
+
return React29.useContext(ToggleGroupContext);
|
|
3390
|
+
}
|
|
3391
|
+
|
|
3392
|
+
// ../../node_modules/@base-ui/react/internals/composite/item/CompositeItem.mjs
|
|
3393
|
+
function CompositeItem(componentProps) {
|
|
3394
|
+
let {
|
|
3395
|
+
render,
|
|
3396
|
+
className,
|
|
3397
|
+
style,
|
|
3398
|
+
state = EMPTY_OBJECT,
|
|
3399
|
+
props = EMPTY_ARRAY,
|
|
3400
|
+
refs = EMPTY_ARRAY,
|
|
3401
|
+
metadata,
|
|
3402
|
+
stateAttributesMapping,
|
|
3403
|
+
tag = "div",
|
|
3404
|
+
...elementProps
|
|
3405
|
+
} = componentProps, {
|
|
3406
|
+
compositeProps,
|
|
3407
|
+
compositeRef
|
|
3408
|
+
} = useCompositeItem({
|
|
3409
|
+
metadata
|
|
3410
|
+
});
|
|
3411
|
+
return useRenderElement(tag, componentProps, {
|
|
3412
|
+
state,
|
|
3413
|
+
// The composite ref attaches first so an outer item wins when nested items share a DOM node.
|
|
3414
|
+
ref: [compositeRef, ...refs],
|
|
3415
|
+
props: [compositeProps, ...props, elementProps],
|
|
3416
|
+
stateAttributesMapping
|
|
3417
|
+
});
|
|
3418
|
+
}
|
|
3419
|
+
|
|
3420
|
+
// ../../node_modules/@base-ui/react/toggle/Toggle.mjs
|
|
3421
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3422
|
+
var Toggle = React30.forwardRef(function(componentProps, forwardedRef) {
|
|
3423
|
+
let {
|
|
3424
|
+
className,
|
|
3425
|
+
defaultPressed = !1,
|
|
3426
|
+
disabled: disabledProp = !1,
|
|
3427
|
+
form,
|
|
3428
|
+
// never participates in form validation
|
|
3429
|
+
onPressedChange,
|
|
3430
|
+
pressed: pressedProp,
|
|
3431
|
+
render,
|
|
3432
|
+
type,
|
|
3433
|
+
// cannot change button type
|
|
3434
|
+
value: valueProp,
|
|
3435
|
+
nativeButton = !0,
|
|
3436
|
+
style,
|
|
3437
|
+
...elementProps
|
|
3438
|
+
} = componentProps, value = useBaseUiId(valueProp || void 0), groupContext = useToggleGroupContext(), groupValue = groupContext?.value ?? [], disabled = (disabledProp || groupContext?.disabled) ?? !1;
|
|
3439
|
+
process.env.NODE_ENV !== "production" && React30.useEffect(() => {
|
|
3440
|
+
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.");
|
|
3441
|
+
}, [groupContext, valueProp, groupContext?.isValueInitialized]);
|
|
3442
|
+
let [pressed, setPressedState] = useControlled({
|
|
3443
|
+
controlled: groupContext ? value !== void 0 && groupValue.indexOf(value) > -1 : pressedProp,
|
|
3444
|
+
default: defaultPressed,
|
|
3445
|
+
name: "Toggle",
|
|
3446
|
+
state: "pressed"
|
|
3447
|
+
}), {
|
|
3448
|
+
getButtonProps,
|
|
3449
|
+
buttonRef
|
|
3450
|
+
} = useButton({
|
|
3451
|
+
disabled,
|
|
3452
|
+
native: nativeButton
|
|
3453
|
+
}), state = {
|
|
3454
|
+
disabled,
|
|
3455
|
+
pressed
|
|
3456
|
+
}, refs = [buttonRef, forwardedRef], props = [{
|
|
3457
|
+
"aria-pressed": pressed,
|
|
3458
|
+
onClick(event) {
|
|
3459
|
+
let nextPressed = !pressed, details = createChangeEventDetails(reason_parts_exports.none, event.nativeEvent);
|
|
3460
|
+
onPressedChange?.(nextPressed, details), !details.isCanceled && (value && groupContext?.setGroupValue?.(value, nextPressed, details), !details.isCanceled && setPressedState(nextPressed));
|
|
3461
|
+
}
|
|
3462
|
+
}, elementProps, getButtonProps], element = useRenderElement("button", componentProps, {
|
|
3463
|
+
enabled: !groupContext,
|
|
3464
|
+
state,
|
|
3465
|
+
ref: refs,
|
|
3466
|
+
props
|
|
3467
|
+
}), itemMetadata = React30.useMemo(() => ({
|
|
3468
|
+
disabled,
|
|
3469
|
+
focusableWhenDisabled: !1
|
|
3470
|
+
}), [disabled]);
|
|
3471
|
+
return groupContext ? _jsx(CompositeItem, {
|
|
3472
|
+
tag: "button",
|
|
3473
|
+
render,
|
|
3474
|
+
className,
|
|
3475
|
+
style,
|
|
3476
|
+
metadata: itemMetadata,
|
|
3477
|
+
state,
|
|
3478
|
+
refs,
|
|
3479
|
+
props
|
|
3480
|
+
}) : element;
|
|
3481
|
+
});
|
|
3482
|
+
process.env.NODE_ENV !== "production" && (Toggle.displayName = "Toggle");
|
|
3483
|
+
|
|
3484
|
+
// ../../node_modules/@base-ui/react/toggle-group/ToggleGroup.mjs
|
|
3485
|
+
import * as React32 from "react";
|
|
3486
|
+
|
|
3487
|
+
// ../../node_modules/@base-ui/react/toolbar/group/ToolbarGroupContext.mjs
|
|
3488
|
+
import * as React31 from "react";
|
|
3489
|
+
var ToolbarGroupContext = React31.createContext(void 0);
|
|
3490
|
+
process.env.NODE_ENV !== "production" && (ToolbarGroupContext.displayName = "ToolbarGroupContext");
|
|
3491
|
+
function useToolbarGroupContext() {
|
|
3492
|
+
return React31.useContext(ToolbarGroupContext);
|
|
3493
|
+
}
|
|
3494
|
+
|
|
3495
|
+
// ../../node_modules/@base-ui/react/toggle-group/ToggleGroup.mjs
|
|
3496
|
+
import { jsx as _jsx2 } from "react/jsx-runtime";
|
|
3497
|
+
var ToggleGroup = React32.forwardRef(function(componentProps, forwardedRef) {
|
|
3498
|
+
let {
|
|
3499
|
+
defaultValue: defaultValueProp,
|
|
3500
|
+
disabled: disabledProp = !1,
|
|
3501
|
+
loopFocus = !0,
|
|
3502
|
+
onValueChange,
|
|
3503
|
+
orientation = "horizontal",
|
|
3504
|
+
multiple = !1,
|
|
3505
|
+
value: valueProp,
|
|
3506
|
+
className,
|
|
3507
|
+
render,
|
|
3508
|
+
style,
|
|
3509
|
+
...elementProps
|
|
3510
|
+
} = 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({
|
|
3511
|
+
controlled: valueProp,
|
|
3512
|
+
default: defaultValue,
|
|
3513
|
+
name: "ToggleGroup",
|
|
3514
|
+
state: "value"
|
|
3515
|
+
}), setGroupValue = useStableCallback((newValue, nextPressed, eventDetails) => {
|
|
3516
|
+
let newGroupValue;
|
|
3517
|
+
multiple ? (newGroupValue = groupValue.slice(), nextPressed ? newGroupValue.push(newValue) : newGroupValue.splice(groupValue.indexOf(newValue), 1)) : newGroupValue = nextPressed ? [newValue] : [], onValueChange?.(newGroupValue, eventDetails), !eventDetails.isCanceled && setValueState(newGroupValue);
|
|
3518
|
+
}), state = {
|
|
3519
|
+
disabled,
|
|
3520
|
+
multiple,
|
|
3521
|
+
orientation
|
|
3522
|
+
}, contextValue = React32.useMemo(() => ({
|
|
3523
|
+
disabled,
|
|
3524
|
+
setGroupValue,
|
|
3525
|
+
value: groupValue,
|
|
3526
|
+
isValueInitialized
|
|
3527
|
+
}), [disabled, setGroupValue, groupValue, isValueInitialized]), defaultProps = {
|
|
3528
|
+
role: "group"
|
|
3529
|
+
}, element = useRenderElement("div", componentProps, {
|
|
3530
|
+
enabled: !!toolbarContext,
|
|
3531
|
+
state,
|
|
3532
|
+
ref: forwardedRef,
|
|
3533
|
+
props: [defaultProps, elementProps]
|
|
3534
|
+
});
|
|
3535
|
+
return _jsx2(ToggleGroupContext.Provider, {
|
|
3536
|
+
value: contextValue,
|
|
3537
|
+
children: toolbarContext ? element : _jsx2(CompositeRoot, {
|
|
3538
|
+
render,
|
|
3539
|
+
className,
|
|
3540
|
+
style,
|
|
3541
|
+
state,
|
|
3542
|
+
refs: [forwardedRef],
|
|
3543
|
+
props: [defaultProps, elementProps],
|
|
3544
|
+
loopFocus,
|
|
3545
|
+
enableHomeAndEndKeys: !0,
|
|
3546
|
+
orientation
|
|
3547
|
+
})
|
|
3548
|
+
});
|
|
3549
|
+
});
|
|
3550
|
+
process.env.NODE_ENV !== "production" && (ToggleGroup.displayName = "ToggleGroup");
|
|
3551
|
+
|
|
3552
|
+
// src/viewport/components/ViewportSegments.tsx
|
|
3553
|
+
import { EllipsisIcon, Maximize2Icon, MonitorIcon, SmartphoneIcon as SmartphoneIcon2, TabletIcon as TabletIcon2 } from "lucide-react";
|
|
3554
|
+
|
|
4072
3555
|
// src/viewport/viewportIcons.tsx
|
|
4073
|
-
import {
|
|
4074
|
-
import { jsx as
|
|
3556
|
+
import { AppWindowIcon, SmartphoneIcon, TabletIcon, DiamondIcon, WatchIcon } from "lucide-react";
|
|
3557
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
4075
3558
|
var iconsMap = {
|
|
4076
|
-
desktop:
|
|
4077
|
-
mobile:
|
|
4078
|
-
tablet:
|
|
4079
|
-
watch:
|
|
4080
|
-
other:
|
|
3559
|
+
desktop: jsx29(AppWindowIcon, {}),
|
|
3560
|
+
mobile: jsx29(SmartphoneIcon, {}),
|
|
3561
|
+
tablet: jsx29(TabletIcon, {}),
|
|
3562
|
+
watch: jsx29(WatchIcon, {}),
|
|
3563
|
+
other: jsx29(DiamondIcon, {})
|
|
4081
3564
|
};
|
|
4082
3565
|
|
|
4083
|
-
//
|
|
4084
|
-
var
|
|
4085
|
-
|
|
3566
|
+
// src/viewport/components/segments.ts
|
|
3567
|
+
var SEGMENT_KINDS = ["mobile", "tablet", "desktop"], NAME_PATTERNS = {
|
|
3568
|
+
mobile: /mobile|phone/i,
|
|
3569
|
+
tablet: /tablet|ipad/i,
|
|
3570
|
+
desktop: /desktop|laptop/i
|
|
3571
|
+
}, mapSegments = (viewports) => {
|
|
3572
|
+
let keys = Object.keys(viewports), used = /* @__PURE__ */ new Set(), segments = {}, pick = (kind, test) => {
|
|
3573
|
+
if (segments[kind])
|
|
3574
|
+
return;
|
|
3575
|
+
let key = keys.find((k) => !used.has(k) && test(k));
|
|
3576
|
+
key && (segments[kind] = key, used.add(key));
|
|
3577
|
+
};
|
|
3578
|
+
for (let kind of SEGMENT_KINDS)
|
|
3579
|
+
pick(kind, (k) => viewports[k].type === kind);
|
|
3580
|
+
for (let kind of SEGMENT_KINDS)
|
|
3581
|
+
pick(kind, (k) => NAME_PATTERNS[kind].test(`${k} ${viewports[k].name}`));
|
|
3582
|
+
return { segments, overflow: keys.filter((k) => !used.has(k)) };
|
|
3583
|
+
};
|
|
3584
|
+
|
|
3585
|
+
// storybook-css:/home/runner/work/forkbook/forkbook/code/core/src/viewport/components/Tool.module.css
|
|
3586
|
+
var id13 = "core/src/viewport/components/Tool.module.css";
|
|
3587
|
+
if (typeof document < "u" && !document.querySelector(`style[data-fb-css="${id13}"]`)) {
|
|
4086
3588
|
let style = document.createElement("style");
|
|
4087
|
-
style.setAttribute("data-
|
|
3589
|
+
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
3590
|
}
|
|
4089
|
-
var Tool_default = { dimensions: "
|
|
3591
|
+
var Tool_default = { segments: "fb-vBOFLW-segments", segment: "fb-vBOFLW-segment", dimensions: "fb-vBOFLW-dimensions" };
|
|
3592
|
+
|
|
3593
|
+
// src/viewport/components/ViewportSegments.tsx
|
|
3594
|
+
import { Fragment as Fragment10, jsx as jsx30, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3595
|
+
var FULL = "full", SEGMENT_ICONS = {
|
|
3596
|
+
mobile: jsx30(SmartphoneIcon2, {}),
|
|
3597
|
+
tablet: jsx30(TabletIcon2, {}),
|
|
3598
|
+
desktop: jsx30(MonitorIcon, {})
|
|
3599
|
+
}, SEGMENT_LABELS = {
|
|
3600
|
+
mobile: "Mobile",
|
|
3601
|
+
tablet: "Tablet",
|
|
3602
|
+
desktop: "Desktop"
|
|
3603
|
+
}, ViewportSegments = ({
|
|
3604
|
+
viewports,
|
|
3605
|
+
value,
|
|
3606
|
+
isDefault,
|
|
3607
|
+
isLocked = !1,
|
|
3608
|
+
onSelect,
|
|
3609
|
+
onReset
|
|
3610
|
+
}) => {
|
|
3611
|
+
let { segments, overflow } = useMemo8(() => mapSegments(viewports), [viewports]), pressed = isDefault ? FULL : SEGMENT_KINDS.find((kind) => segments[kind] === value), overflowOptions = useMemo8(
|
|
3612
|
+
() => overflow.map((key) => ({
|
|
3613
|
+
value: key,
|
|
3614
|
+
title: viewports[key].name,
|
|
3615
|
+
icon: iconsMap[viewports[key].type ?? "other"],
|
|
3616
|
+
right: jsxs17("div", { className: Tool_default.dimensions, children: [
|
|
3617
|
+
jsx30("span", { children: viewports[key].styles.width.replace("px", "") }),
|
|
3618
|
+
jsx30("span", { children: "\xD7" }),
|
|
3619
|
+
jsx30("span", { children: viewports[key].styles.height.replace("px", "") })
|
|
3620
|
+
] })
|
|
3621
|
+
})),
|
|
3622
|
+
[overflow, viewports]
|
|
3623
|
+
), lockedNote = isLocked ? " (set by story parameters)" : "";
|
|
3624
|
+
return jsxs17(Fragment10, { children: [
|
|
3625
|
+
jsxs17(
|
|
3626
|
+
ToggleGroup,
|
|
3627
|
+
{
|
|
3628
|
+
className: Tool_default.segments,
|
|
3629
|
+
"aria-label": `Viewport size${lockedNote}`,
|
|
3630
|
+
value: pressed ? [pressed] : [],
|
|
3631
|
+
disabled: isLocked,
|
|
3632
|
+
onValueChange: (next) => {
|
|
3633
|
+
let [picked] = next;
|
|
3634
|
+
picked === FULL ? onReset() : picked && segments[picked] && onSelect(segments[picked]);
|
|
3635
|
+
},
|
|
3636
|
+
children: [
|
|
3637
|
+
SEGMENT_KINDS.filter((kind) => segments[kind]).map((kind) => jsx30(
|
|
3638
|
+
Toggle,
|
|
3639
|
+
{
|
|
3640
|
+
value: kind,
|
|
3641
|
+
className: Tool_default.segment,
|
|
3642
|
+
render: jsx30(
|
|
3643
|
+
Button4,
|
|
3644
|
+
{
|
|
3645
|
+
variant: "ghost",
|
|
3646
|
+
padding: "small",
|
|
3647
|
+
size: "small",
|
|
3648
|
+
ariaLabel: `${SEGMENT_LABELS[kind]}: ${viewports[segments[kind]].name}${lockedNote}`
|
|
3649
|
+
}
|
|
3650
|
+
),
|
|
3651
|
+
children: SEGMENT_ICONS[kind]
|
|
3652
|
+
},
|
|
3653
|
+
kind
|
|
3654
|
+
)),
|
|
3655
|
+
jsx30(
|
|
3656
|
+
Toggle,
|
|
3657
|
+
{
|
|
3658
|
+
value: FULL,
|
|
3659
|
+
className: Tool_default.segment,
|
|
3660
|
+
render: jsx30(
|
|
3661
|
+
Button4,
|
|
3662
|
+
{
|
|
3663
|
+
variant: "ghost",
|
|
3664
|
+
padding: "small",
|
|
3665
|
+
size: "small",
|
|
3666
|
+
ariaLabel: `Full size (reset viewport)${lockedNote}`
|
|
3667
|
+
}
|
|
3668
|
+
),
|
|
3669
|
+
children: jsx30(Maximize2Icon, {})
|
|
3670
|
+
}
|
|
3671
|
+
)
|
|
3672
|
+
]
|
|
3673
|
+
}
|
|
3674
|
+
),
|
|
3675
|
+
overflowOptions.length > 0 && jsx30(
|
|
3676
|
+
Select2,
|
|
3677
|
+
{
|
|
3678
|
+
padding: "small",
|
|
3679
|
+
disabled: isLocked,
|
|
3680
|
+
ariaLabel: `More viewports${lockedNote}`,
|
|
3681
|
+
tooltip: "More viewports",
|
|
3682
|
+
defaultOptions: value && overflow.includes(value) ? value : void 0,
|
|
3683
|
+
options: overflowOptions,
|
|
3684
|
+
onSelect: (selected) => onSelect(selected),
|
|
3685
|
+
icon: jsx30(EllipsisIcon, {})
|
|
3686
|
+
},
|
|
3687
|
+
"viewport-more"
|
|
3688
|
+
)
|
|
3689
|
+
] });
|
|
3690
|
+
};
|
|
4090
3691
|
|
|
4091
3692
|
// src/viewport/components/Tool.tsx
|
|
4092
|
-
import { jsx as
|
|
3693
|
+
import { Fragment as Fragment11, jsx as jsx31, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4093
3694
|
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,
|
|
3695
|
+
let { option, isDefault, isLocked, options, reset, resize, select } = useViewport(), frameSize = usePreviewFrameSize();
|
|
3696
|
+
return jsxs18(Fragment11, { children: [
|
|
3697
|
+
jsx31(
|
|
3698
|
+
ViewportSegments,
|
|
4116
3699
|
{
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
3700
|
+
viewports: options,
|
|
3701
|
+
value: option,
|
|
3702
|
+
isDefault,
|
|
3703
|
+
isLocked,
|
|
3704
|
+
onSelect: select,
|
|
3705
|
+
onReset: reset
|
|
4121
3706
|
}
|
|
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
|
-
);
|
|
3707
|
+
),
|
|
3708
|
+
jsx31(
|
|
3709
|
+
FrameSize,
|
|
3710
|
+
{
|
|
3711
|
+
size: frameSize,
|
|
3712
|
+
disabled: isLocked,
|
|
3713
|
+
onApply: ({ width, height }) => resize(`${width}px`, `${height}px`)
|
|
3714
|
+
}
|
|
3715
|
+
)
|
|
3716
|
+
] });
|
|
4141
3717
|
};
|
|
4142
3718
|
|
|
4143
3719
|
// src/viewport/manager.tsx
|
|
4144
|
-
import { jsx as
|
|
3720
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
4145
3721
|
var manager_default9 = addons9.register(ADDON_ID, () => {
|
|
4146
3722
|
globalThis?.FEATURES?.viewport && addons9.add(TOOL_ID, {
|
|
4147
3723
|
title: "viewport / media-queries",
|
|
4148
3724
|
type: types7.TOOL,
|
|
4149
3725
|
match: ({ viewMode }) => viewMode === "story",
|
|
4150
|
-
render: () =>
|
|
3726
|
+
render: () => jsx32(ViewportTool, {})
|
|
4151
3727
|
});
|
|
4152
3728
|
});
|
|
4153
3729
|
|