@aussieljk/forkbook 0.0.0-stage → 0.0.1-2
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 +22 -0
- package/README.md +77 -2
- package/assets/addon-vitest/templates/vitest.config.4.template.ts +36 -0
- package/assets/browser/favicon-wrapper.svg +46 -0
- package/assets/browser/favicon.svg +1 -0
- 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/assets/builder-vite/iframe.html +99 -0
- package/assets/create/rendererAssets/.eslintrc.json +16 -0
- package/assets/create/rendererAssets/common/Configure.mdx +388 -0
- package/assets/create/rendererAssets/common/assets/accessibility.png +0 -0
- package/assets/create/rendererAssets/common/assets/accessibility.svg +1 -0
- package/assets/create/rendererAssets/common/assets/addon-library.png +0 -0
- package/assets/create/rendererAssets/common/assets/assets.png +0 -0
- package/assets/create/rendererAssets/common/assets/avif-test-image.avif +0 -0
- package/assets/create/rendererAssets/common/assets/context.png +0 -0
- package/assets/create/rendererAssets/common/assets/discord.svg +1 -0
- package/assets/create/rendererAssets/common/assets/docs.png +0 -0
- package/assets/create/rendererAssets/common/assets/figma-plugin.png +0 -0
- package/assets/create/rendererAssets/common/assets/github.svg +1 -0
- package/assets/create/rendererAssets/common/assets/share.png +0 -0
- package/assets/create/rendererAssets/common/assets/styling.png +0 -0
- package/assets/create/rendererAssets/common/assets/testing.png +0 -0
- package/assets/create/rendererAssets/common/assets/theming.png +0 -0
- package/assets/create/rendererAssets/common/assets/tutorials.svg +1 -0
- package/assets/create/rendererAssets/common/assets/youtube.svg +1 -0
- package/assets/create/rendererAssets/common/button.css +30 -0
- package/assets/create/rendererAssets/common/header.css +32 -0
- package/assets/create/rendererAssets/common/page.css +68 -0
- package/assets/create/templates/react-native/index.expo.js +20 -0
- package/assets/create/templates/react-native/index.js +25 -0
- package/assets/docs/addon-backgrounds.gif +0 -0
- package/assets/docs/addon-controls-args-annotated.png +0 -0
- package/assets/docs/addon-controls-args-background-color.png +0 -0
- package/assets/docs/addon-controls-args-background-string.png +0 -0
- package/assets/docs/addon-controls-args-docs.png +0 -0
- package/assets/docs/addon-controls-args-logging.png +0 -0
- package/assets/docs/addon-controls-args-no-annotation.png +0 -0
- package/assets/docs/addon-controls-args-reflow-slider.png +0 -0
- package/assets/docs/addon-controls-args-reflow.png +0 -0
- package/assets/docs/addon-controls-args-template.png +0 -0
- package/assets/docs/addon-controls-expanded.png +0 -0
- package/assets/docs/addon-controls-hero.gif +0 -0
- package/assets/docs/addon-controls-install.png +0 -0
- package/assets/docs/hero.gif +0 -0
- package/assets/docs/highlight.png +0 -0
- package/assets/docs/message-reference.png +0 -0
- package/assets/docs/viewport.png +0 -0
- package/assets/react-native/metro-env.d.ts +69 -0
- package/assets/server/addon.tsconfig.json +6 -0
- package/assets/server/base-preview-body.html +116 -0
- package/assets/server/base-preview-head.html +494 -0
- package/assets/server/openBrowser.applescript +94 -0
- package/assets/server/template.ejs +87 -0
- package/dist/.build-stamp +0 -0
- package/dist/_browser-chunks/Color-PCLE2J36.js +1025 -0
- package/dist/_browser-chunks/DocsRenderer-JXND3PVQ.js +10 -0
- package/dist/_browser-chunks/WithTooltip-XSQFTBMB.js +1619 -0
- package/dist/_browser-chunks/chunk-2JDQ35OA.js +247 -0
- package/dist/_browser-chunks/chunk-2JT76G3E.js +104 -0
- package/dist/_browser-chunks/chunk-2MEPHP35.js +17 -0
- package/dist/_browser-chunks/chunk-2SCZVUKW.js +24 -0
- package/dist/_browser-chunks/chunk-46Z7NGAS.js +41 -0
- package/dist/_browser-chunks/chunk-4ATQOMJB.js +30 -0
- package/dist/_browser-chunks/chunk-52CW7FF7.js +49 -0
- package/dist/_browser-chunks/chunk-5I7E4GMO.js +62 -0
- package/dist/_browser-chunks/chunk-5P4QA6MY.js +20 -0
- package/dist/_browser-chunks/chunk-5WMXI5GW.js +816 -0
- package/dist/_browser-chunks/chunk-66OCZ54D.js +2604 -0
- package/dist/_browser-chunks/chunk-6SXYJQST.js +253 -0
- package/dist/_browser-chunks/chunk-AYRF6EJB.js +36 -0
- package/dist/_browser-chunks/chunk-B4AUNNU4.js +156 -0
- package/dist/_browser-chunks/chunk-BCP2FFXF.js +369 -0
- package/dist/_browser-chunks/chunk-C3D4HEFY.js +3396 -0
- package/dist/_browser-chunks/chunk-CFAOWGL7.js +43 -0
- package/dist/_browser-chunks/chunk-CFWWCCZV.js +223 -0
- package/dist/_browser-chunks/chunk-CNED6RYH.js +18 -0
- package/dist/_browser-chunks/chunk-DRQKCCAG.js +136 -0
- package/dist/_browser-chunks/chunk-ECQ75MKQ.js +0 -0
- package/dist/_browser-chunks/chunk-EIYAKDGP.js +302 -0
- package/dist/_browser-chunks/chunk-ENKK74N4.js +12 -0
- package/dist/_browser-chunks/chunk-FENFYI4X.js +698 -0
- package/dist/_browser-chunks/chunk-FJGWSWL5.js +155 -0
- package/dist/_browser-chunks/chunk-FVSEPWWX.js +2810 -0
- package/dist/_browser-chunks/chunk-GNZY6LOW.js +10116 -0
- package/dist/_browser-chunks/chunk-IE4ULIOQ.js +14 -0
- package/dist/_browser-chunks/chunk-IMSF75WX.js +42 -0
- package/dist/_browser-chunks/chunk-IWQGIXJS.js +14 -0
- package/dist/_browser-chunks/chunk-JMC7AIKT.js +108 -0
- package/dist/_browser-chunks/chunk-JPUOQJUI.js +8 -0
- package/dist/_browser-chunks/chunk-JSBKXXXF.js +218 -0
- package/dist/_browser-chunks/chunk-JWSKPMPC.js +73 -0
- package/dist/_browser-chunks/chunk-JYVGARBG.js +2943 -0
- package/dist/_browser-chunks/chunk-KBK7GKBN.js +35 -0
- package/dist/_browser-chunks/chunk-KQ7CRO2B.js +108 -0
- package/dist/_browser-chunks/chunk-LAWXTSXK.js +18 -0
- package/dist/_browser-chunks/chunk-LE2LTDW3.js +14 -0
- package/dist/_browser-chunks/chunk-LEVSOOLQ.js +48 -0
- package/dist/_browser-chunks/chunk-LV5PIKV4.js +93 -0
- package/dist/_browser-chunks/chunk-MDOL7KML.js +56 -0
- package/dist/_browser-chunks/chunk-MFMDGWP6.js +34 -0
- package/dist/_browser-chunks/chunk-MLBOOZL4.js +67 -0
- package/dist/_browser-chunks/chunk-NQUD4B7H.js +91 -0
- package/dist/_browser-chunks/chunk-NULBREPZ.js +43 -0
- package/dist/_browser-chunks/chunk-NZMVUW5T.js +7 -0
- package/dist/_browser-chunks/chunk-OD6IBQCC.js +117 -0
- package/dist/_browser-chunks/chunk-ODVJ3XZJ.js +157 -0
- package/dist/_browser-chunks/chunk-OQWFVDIN.js +386 -0
- package/dist/_browser-chunks/chunk-OVH3USFB.js +20 -0
- package/dist/_browser-chunks/chunk-OZZPSYQR.js +14 -0
- package/dist/_browser-chunks/chunk-P6PK47TQ.js +1970 -0
- package/dist/_browser-chunks/chunk-PFRNG3UC.js +22 -0
- package/dist/_browser-chunks/chunk-PJSMZ27A.js +13 -0
- package/dist/_browser-chunks/chunk-QC4HFS6K.js +41 -0
- package/dist/_browser-chunks/chunk-QDXFODK4.js +274 -0
- package/dist/_browser-chunks/chunk-RBCHTR7C.js +28 -0
- package/dist/_browser-chunks/chunk-RMYQ3QN3.js +294 -0
- package/dist/_browser-chunks/chunk-RNTIV5CE.js +411 -0
- package/dist/_browser-chunks/chunk-RSPAQWVJ.js +80 -0
- package/dist/_browser-chunks/chunk-S6TK43XQ.js +836 -0
- package/dist/_browser-chunks/chunk-SC67XZST.js +18 -0
- package/dist/_browser-chunks/chunk-SFVA4SBT.js +683 -0
- package/dist/_browser-chunks/chunk-SZYFOQMT.js +25 -0
- package/dist/_browser-chunks/chunk-TBJCJXK4.js +18 -0
- package/dist/_browser-chunks/chunk-UMDO3KB7.js +205 -0
- package/dist/_browser-chunks/chunk-V2G23FV7.js +11 -0
- package/dist/_browser-chunks/chunk-V5M7Q4HT.js +88 -0
- package/dist/_browser-chunks/chunk-W5M6NPS3.js +198 -0
- package/dist/_browser-chunks/chunk-W7NE2JXW.js +84 -0
- package/dist/_browser-chunks/chunk-WGVAAM43.js +1110 -0
- package/dist/_browser-chunks/chunk-WHQRNHXD.js +8 -0
- package/dist/_browser-chunks/chunk-WOSOWBCA.js +12 -0
- package/dist/_browser-chunks/chunk-WZ7KR7SH.js +85 -0
- package/dist/_browser-chunks/chunk-YEKO6BHJ.js +20 -0
- package/dist/_browser-chunks/chunk-YI2IBIQS.js +7 -0
- package/dist/_browser-chunks/chunk-YTIT5NA5.js +1966 -0
- package/dist/_browser-chunks/chunk-ZEHRUHTA.js +6 -0
- package/dist/_browser-chunks/chunk-ZTQ5MEJ5.js +203 -0
- package/dist/_browser-chunks/matchers-YLBYSYAF.js +1263 -0
- package/dist/_browser-chunks/react-dom-client-4OHE3QDV.js +9 -0
- package/dist/_node-chunks/attached-runtime-I2G4WLJI.js +282 -0
- package/dist/_node-chunks/builder-manager-VVHYQXCH.js +1661 -0
- package/dist/_node-chunks/chunk-2BUPBPFB.js +82 -0
- package/dist/_node-chunks/chunk-2DSIDINN.js +884 -0
- package/dist/_node-chunks/chunk-2RU7BKEW.js +23 -0
- package/dist/_node-chunks/chunk-34EO2PUT.js +26 -0
- package/dist/_node-chunks/chunk-3BKIBF5S.js +3008 -0
- package/dist/_node-chunks/chunk-3SDUYDXH.js +98 -0
- package/dist/_node-chunks/chunk-3T4ZSNPH.js +662 -0
- package/dist/_node-chunks/chunk-3W7F2B7P.js +79 -0
- package/dist/_node-chunks/chunk-3Y6AAY5H.js +80 -0
- package/dist/_node-chunks/chunk-42UWAGPW.js +1193 -0
- package/dist/_node-chunks/chunk-4FEANXWU.js +1986 -0
- package/dist/_node-chunks/chunk-5DQFEZEA.js +40 -0
- package/dist/_node-chunks/chunk-6KEHV53S.js +1218 -0
- package/dist/_node-chunks/chunk-6LMWA44H.js +3837 -0
- package/dist/_node-chunks/chunk-6YKBRP72.js +20 -0
- package/dist/_node-chunks/chunk-7GUDZVRQ.js +110 -0
- package/dist/_node-chunks/chunk-B5J7Q7J4.js +21 -0
- package/dist/_node-chunks/chunk-BS2WMZMR.js +90 -0
- package/dist/_node-chunks/chunk-BSKFCWQD.js +47 -0
- package/dist/_node-chunks/chunk-BXVYT7SB.js +36 -0
- package/dist/_node-chunks/chunk-CCOTJ4FC.js +688 -0
- package/dist/_node-chunks/chunk-CQKMLL5J.js +33 -0
- package/dist/_node-chunks/chunk-CXRU72ET.js +63 -0
- package/dist/_node-chunks/chunk-DC7DKR5K.js +20 -0
- package/dist/_node-chunks/chunk-DHJFTB4K.js +25 -0
- package/dist/_node-chunks/chunk-DUR55DJJ.js +1094 -0
- package/dist/_node-chunks/chunk-E6YESGLX.js +7032 -0
- package/dist/_node-chunks/chunk-EHUNOMDD.js +52345 -0
- package/dist/_node-chunks/chunk-ET7PWEO7.js +298 -0
- package/dist/_node-chunks/chunk-EWOX7HPJ.js +20 -0
- package/dist/_node-chunks/chunk-F3ZFKBHY.js +844 -0
- package/dist/_node-chunks/chunk-FK7KGTV7.js +26 -0
- package/dist/_node-chunks/chunk-FPZB5OI7.js +35 -0
- package/dist/_node-chunks/chunk-FW2HQUBQ.js +25 -0
- package/dist/_node-chunks/chunk-FY6UXW6G.js +11 -0
- package/dist/_node-chunks/chunk-GEFQN7K3.js +499 -0
- package/dist/_node-chunks/chunk-GRBLDJCR.js +989 -0
- package/dist/_node-chunks/chunk-H32DYT6P.js +87 -0
- package/dist/_node-chunks/chunk-H4PPVMP5.js +23 -0
- package/dist/_node-chunks/chunk-HMP2G23X.js +25 -0
- package/dist/_node-chunks/chunk-ICPBH3E7.js +59 -0
- package/dist/_node-chunks/chunk-IDEL2J23.js +23 -0
- package/dist/_node-chunks/chunk-IK4FGZLR.js +223 -0
- package/dist/_node-chunks/chunk-JDXXX6LB.js +68 -0
- package/dist/_node-chunks/chunk-JGGFYIG5.js +5468 -0
- package/dist/_node-chunks/chunk-JPAZLYJ3.js +29 -0
- package/dist/_node-chunks/chunk-JZOO7GGC.js +48 -0
- package/dist/_node-chunks/chunk-KISMCCP5.js +4744 -0
- package/dist/_node-chunks/chunk-LCK4ZQKG.js +115 -0
- package/dist/_node-chunks/chunk-LO56I6E2.js +132 -0
- package/dist/_node-chunks/chunk-LXBD4UL4.js +104 -0
- package/dist/_node-chunks/chunk-MA24JW6C.js +7162 -0
- package/dist/_node-chunks/chunk-MK2KYAI6.js +5414 -0
- package/dist/_node-chunks/chunk-NDWKJ4CL.js +2102 -0
- package/dist/_node-chunks/chunk-NIBT7XDZ.js +168 -0
- package/dist/_node-chunks/chunk-NPO45IMH.js +33 -0
- package/dist/_node-chunks/chunk-OISX4AGQ.js +414 -0
- package/dist/_node-chunks/chunk-OUW6R7C3.js +26 -0
- package/dist/_node-chunks/chunk-OWNFOGTA.js +194 -0
- package/dist/_node-chunks/chunk-Q7QNUM5H.js +49 -0
- package/dist/_node-chunks/chunk-QEQLR22M.js +1877 -0
- package/dist/_node-chunks/chunk-RRN2V55B.js +45 -0
- package/dist/_node-chunks/chunk-RWFIFGO5.js +144 -0
- package/dist/_node-chunks/chunk-RXNJDRGO.js +209 -0
- package/dist/_node-chunks/chunk-RZMQ7S3L.js +92 -0
- package/dist/_node-chunks/chunk-SIEXZVCR.js +51 -0
- package/dist/_node-chunks/chunk-SLWQNBGO.js +2034 -0
- package/dist/_node-chunks/chunk-SVTBJ7Q3.js +35 -0
- package/dist/_node-chunks/chunk-SWO5CDYU.js +32 -0
- package/dist/_node-chunks/chunk-TD5PLLQG.js +121 -0
- package/dist/_node-chunks/chunk-TEQGGSP7.js +33 -0
- package/dist/_node-chunks/chunk-TFCEV2XX.js +155 -0
- package/dist/_node-chunks/chunk-TFEWM4E3.js +1073 -0
- package/dist/_node-chunks/chunk-TINO74G5.js +21 -0
- package/dist/_node-chunks/chunk-TNJIXE37.js +40 -0
- package/dist/_node-chunks/chunk-TWI4GVH7.js +19 -0
- package/dist/_node-chunks/chunk-U5W53R2J.js +1011 -0
- package/dist/_node-chunks/chunk-UBOGWBEA.js +148 -0
- package/dist/_node-chunks/chunk-UMUBKI6E.js +3787 -0
- package/dist/_node-chunks/chunk-UVINFLGY.js +56 -0
- package/dist/_node-chunks/chunk-V2DY426G.js +1133 -0
- package/dist/_node-chunks/chunk-VLOXOXXE.js +45 -0
- package/dist/_node-chunks/chunk-W4OMYLSP.js +1297 -0
- package/dist/_node-chunks/chunk-WAXVSN3O.js +18 -0
- package/dist/_node-chunks/chunk-WCULS5TP.js +3767 -0
- package/dist/_node-chunks/chunk-WNZ2UMFM.js +153 -0
- package/dist/_node-chunks/chunk-WZJF2OUH.js +74 -0
- package/dist/_node-chunks/chunk-XGIUVY52.js +611 -0
- package/dist/_node-chunks/chunk-XHL2LVBM.js +415 -0
- package/dist/_node-chunks/chunk-XI6B6P47.js +59 -0
- package/dist/_node-chunks/chunk-XLP2ZKXV.js +60 -0
- package/dist/_node-chunks/chunk-YCMRA6RX.js +95 -0
- package/dist/_node-chunks/chunk-YZFWBA5L.js +2700 -0
- package/dist/_node-chunks/chunk-ZMAMXQKP.js +4731 -0
- package/dist/_node-chunks/chunk-ZWBCQ4MJ.js +110 -0
- package/dist/_node-chunks/dist-VTSTZKUB.js +16 -0
- package/dist/_node-chunks/globby-OEMHPBFY.js +2884 -0
- package/dist/_node-chunks/jiti-NFX6UU74.js +3848 -0
- package/dist/_node-chunks/lib-MDVARD7W.js +366 -0
- package/dist/_node-chunks/local-runtime-NTKIN2QT.js +78 -0
- package/dist/_node-chunks/mdx-plugin-MWISDWDQ.js +5680 -0
- package/dist/_node-chunks/monorepo-LIRFMQXE.js +121 -0
- package/dist/_node-chunks/monorepo-optimized-tests-relaxed-limits-no-story-deletion-CPDW4XTW.js +121 -0
- package/dist/_node-chunks/optimized-tests-HDOLR3EY.js +22 -0
- package/dist/_node-chunks/pattern-copy-play-EKHIUAU2.js +807 -0
- package/dist/_node-chunks/postinstallAddon-GYGMWDL6.js +20 -0
- package/dist/_node-chunks/rehype-external-links-BUN3HUCO.js +121 -0
- package/dist/_node-chunks/rehype-slug-PLADX223.js +52 -0
- package/dist/_node-chunks/relaxed-limits-GBHW6KIQ.js +117 -0
- package/dist/_node-chunks/run-KDTIZNSY.js +103 -0
- package/dist/_node-chunks/run-NL66VTNR.js +4532 -0
- package/dist/_node-chunks/session-id-KIIVOQLR.js +23 -0
- package/dist/_node-chunks/setup-MGC7BQO6.js +278 -0
- package/dist/_node-chunks/vitest.config.4.template-JH2THZFG.js +54 -0
- package/dist/actions/decorator.d.ts +7 -0
- package/dist/actions/decorator.js +43 -0
- package/dist/actions/index.d.ts +67 -0
- package/dist/actions/index.js +28 -0
- package/dist/addon-a11y/index.d.ts +52 -0
- package/dist/addon-a11y/index.js +16 -0
- package/dist/addon-a11y/manager.js +1429 -0
- package/dist/addon-a11y/preset.js +18 -0
- package/dist/addon-a11y/preview.d.ts +17 -0
- package/dist/addon-a11y/preview.js +15 -0
- package/dist/addon-docs/blocks.d.ts +1061 -0
- package/dist/addon-docs/blocks.js +2461 -0
- package/dist/addon-docs/index.d.ts +236 -0
- package/dist/addon-docs/index.js +16 -0
- package/dist/addon-docs/manager.js +90 -0
- package/dist/addon-docs/mdx-react-shim.d.ts +1 -0
- package/dist/addon-docs/mdx-react-shim.js +2 -0
- package/dist/addon-docs/preset.js +378 -0
- package/dist/addon-docs/preview.d.ts +4 -0
- package/dist/addon-docs/preview.js +7 -0
- package/dist/addon-links/index.d.ts +22 -0
- package/dist/addon-links/index.js +20 -0
- package/dist/addon-links/manager.js +14 -0
- package/dist/addon-links/preview.d.ts +6 -0
- package/dist/addon-links/preview.js +9 -0
- package/dist/addon-links/react/index.d.ts +25 -0
- package/dist/addon-links/react/index.js +52 -0
- package/dist/addon-mcp/preset.js +1345 -0
- package/dist/addon-mcp/preview.js +29 -0
- package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +1153 -0
- package/dist/addon-ondevice-actions/index.d.ts +4 -0
- package/dist/addon-ondevice-actions/index.js +7 -0
- package/dist/addon-ondevice-actions/register.js +7 -0
- package/dist/addon-ondevice-controls/index.d.ts +6 -0
- package/dist/addon-ondevice-controls/index.js +14 -0
- package/dist/addon-ondevice-controls/register.js +10 -0
- package/dist/addon-pseudo-states/index.d.ts +35 -0
- package/dist/addon-pseudo-states/index.js +15 -0
- package/dist/addon-pseudo-states/manager.js +53 -0
- package/dist/addon-pseudo-states/preview.d.ts +9 -0
- package/dist/addon-pseudo-states/preview.js +10 -0
- package/dist/addon-themes/index.d.ts +80 -0
- package/dist/addon-themes/index.js +104 -0
- package/dist/addon-themes/manager.js +97 -0
- package/dist/addon-themes/postinstall.js +33 -0
- package/dist/addon-themes/preview.d.ts +6 -0
- package/dist/addon-themes/preview.js +8 -0
- package/dist/addon-vitest/constants.d.ts +132 -0
- package/dist/addon-vitest/constants.js +66 -0
- package/dist/addon-vitest/index.d.ts +4 -0
- package/dist/addon-vitest/index.js +8 -0
- package/dist/addon-vitest/manager.js +665 -0
- package/dist/addon-vitest/node/coverage-reporter.js +1284 -0
- package/dist/addon-vitest/node/vitest.js +674 -0
- package/dist/addon-vitest/postinstall.js +24 -0
- package/dist/addon-vitest/preset.js +943 -0
- package/dist/addon-vitest/vitest-plugin/global-setup.js +162 -0
- package/dist/addon-vitest/vitest-plugin/index.d.ts +56 -0
- package/dist/addon-vitest/vitest-plugin/index.js +463 -0
- package/dist/addon-vitest/vitest-plugin/setup-file-with-project-annotations.js +9 -0
- package/dist/addon-vitest/vitest-plugin/setup-file.browser.4.js +20 -0
- package/dist/addon-vitest/vitest-plugin/setup-file.js +50 -0
- package/dist/addon-vitest/vitest-plugin/test-utils.js +128 -0
- package/dist/babel/index.d.ts +2301 -0
- package/dist/babel/index.js +61 -0
- package/dist/backgrounds/index.d.ts +6 -0
- package/dist/backgrounds/index.js +15 -0
- package/dist/bin/core.js +1705 -0
- package/dist/bin/dispatcher.js +43 -0
- package/dist/bin/loader.js +115 -0
- package/dist/builder-vite/index.d.ts +50 -0
- package/dist/builder-vite/index.js +245 -0
- package/dist/builder-vite/preset.js +27 -0
- package/dist/channels/index.d.ts +2 -0
- package/dist/channels/index.js +352 -0
- package/dist/chunk-B2t1tGRh.d.ts +284 -0
- package/dist/chunk-BCoJQE-f.d.ts +602 -0
- package/dist/chunk-BGkgZp-H.d.ts +214 -0
- package/dist/chunk-BTVrWliM.d.ts +115 -0
- package/dist/chunk-BXLImeLy.d.ts +197 -0
- package/dist/chunk-BfBzpgct.d.ts +916 -0
- package/dist/chunk-Bpi2tz-6.d.ts +511 -0
- package/dist/chunk-BxWufQms.d.ts +142 -0
- package/dist/chunk-C-bavsOH.d.ts +34 -0
- package/dist/chunk-C2p5r3Vt.d.ts +13001 -0
- package/dist/chunk-C6PAgHLT.d.ts +12 -0
- package/dist/chunk-CMeX4WRe.d.ts +179 -0
- package/dist/chunk-Ct9xd6IM.d.ts +65 -0
- package/dist/chunk-CwQKNaYL.d.ts +15 -0
- package/dist/chunk-D7DwV41f.d.ts +3622 -0
- package/dist/chunk-DEVFdzxR.d.ts +253 -0
- package/dist/chunk-DaVb55-_.d.ts +124 -0
- package/dist/chunk-DgRNfmj_.d.ts +40 -0
- package/dist/chunk-DoIGKY33.d.ts +666 -0
- package/dist/chunk-Dr3R0DXk.d.ts +40 -0
- package/dist/chunk-DtHByo32.d.ts +55 -0
- package/dist/chunk-Dw1z1Pki.d.ts +933 -0
- package/dist/chunk-DzuY9DXg.d.ts +79 -0
- package/dist/chunk-FjDVzZTj.d.ts +62 -0
- package/dist/chunk-Kt1tW-D1.d.ts +59 -0
- package/dist/chunk-XP8oHzpE.d.ts +6 -0
- package/dist/chunk-gCX81nOr.d.ts +61 -0
- package/dist/chunk-pcFXCimE.d.ts +741 -0
- package/dist/cli/index.d.ts +1174 -0
- package/dist/cli/index.js +5613 -0
- package/dist/cli/skills/content/index.d.ts +72 -0
- package/dist/cli/skills/content/index.js +335 -0
- package/dist/cli/tools/sdk/child-host.d.ts +61 -0
- package/dist/cli/tools/sdk/child-host.js +131 -0
- package/dist/cli/tools/sdk/index.d.ts +137 -0
- package/dist/cli/tools/sdk/index.js +44 -0
- package/dist/cli-commands/bin/index.js +25 -0
- package/dist/client-logger/index.d.ts +31 -0
- package/dist/client-logger/index.js +63 -0
- package/dist/common/index.d.ts +1103 -0
- package/dist/common/index.js +364 -0
- package/dist/components/index.d.ts +1924 -0
- package/dist/components/index.js +13759 -0
- package/dist/core-events/index.d.ts +155 -0
- package/dist/core-events/index.js +136 -0
- package/dist/core-server/index.d.ts +2200 -0
- package/dist/core-server/index.js +4165 -0
- package/dist/core-server/presets/common-manager.css +170 -0
- package/dist/core-server/presets/common-manager.js +4168 -0
- package/dist/core-server/presets/common-override-preset.js +81 -0
- package/dist/core-server/presets/common-preset.js +2187 -0
- package/dist/create/bin/index.js +23 -0
- package/dist/create/index.js +25 -0
- package/dist/csf/csf-utils.d.ts +2 -0
- package/dist/csf/csf-utils.js +19 -0
- package/dist/csf/index.d.ts +7 -0
- package/dist/csf/index.js +2142 -0
- package/dist/csf-tools/index.d.ts +1157 -0
- package/dist/csf-tools/index.js +736 -0
- package/dist/docs-tools/index.d.ts +197 -0
- package/dist/docs-tools/index.js +61 -0
- package/dist/highlight/index.d.ts +10 -0
- package/dist/highlight/index.js +15 -0
- package/dist/instrumenter/index.d.ts +113 -0
- package/dist/instrumenter/index.js +2595 -0
- package/dist/manager/_manager-chunks/globals-runtime-8HkdnU2F.js +6144 -0
- package/dist/manager/_manager-chunks/globals-runtime-BIKBO23x.js +3389 -0
- package/dist/manager/_manager-chunks/globals-runtime-BdGkqNEt.js +45 -0
- package/dist/manager/_manager-chunks/globals-runtime-BmphMP6z.js +1190 -0
- package/dist/manager/_manager-chunks/globals-runtime-BvM-NY2g.js +13307 -0
- package/dist/manager/_manager-chunks/globals-runtime-C02fvgcd.js +9243 -0
- package/dist/manager/_manager-chunks/globals-runtime-DkAPXCvc.js +9766 -0
- package/dist/manager/_manager-chunks/globals-runtime-DpNYC-qi.js +5564 -0
- package/dist/manager/_manager-chunks/globals-runtime-DtcOnYHR.js +5357 -0
- package/dist/manager/_manager-chunks/globals-runtime-DwFqpqya.js +722 -0
- package/dist/manager/_manager-chunks/globals-runtime-FC201B7s.js +6837 -0
- package/dist/manager/_manager-chunks/globals-runtime-Rp_zjGnh.js +121 -0
- package/dist/manager/_manager-chunks/globals-runtime-ZHrQFa3-.js +10463 -0
- package/dist/manager/_manager-chunks/globals-runtime-eLPTIfX-.js +7759 -0
- package/dist/manager/_manager-chunks/globals-runtime-qKvCZHFY.js +4468 -0
- package/dist/manager/_manager-chunks/globals-runtime-sGpNlIJ1.js +5102 -0
- package/dist/manager/_manager-chunks/runtime-B1L9TH89.js +452 -0
- package/dist/manager/_manager-chunks/runtime-BK0zF7FN.js +22 -0
- package/dist/manager/_manager-chunks/runtime-BhkT2CXl.js +1408 -0
- package/dist/manager/_manager-chunks/runtime-Bly6WJLN.js +998 -0
- package/dist/manager/_manager-chunks/runtime-D0UOWx0U.js +979 -0
- package/dist/manager/_manager-chunks/runtime-D94Vq3oR.js +4014 -0
- package/dist/manager/_manager-chunks/runtime-DMig8mT7.js +77 -0
- package/dist/manager/_manager-chunks/runtime-EITvVbkG.js +46 -0
- package/dist/manager/_manager-chunks/runtime-cp5pazY2.js +8936 -0
- package/dist/manager/_manager-chunks/runtime-eDVAYF7N.js +6860 -0
- package/dist/manager/_manager-chunks/runtime-i-PDAHLR.js +2493 -0
- package/dist/manager/globals-runtime.js +2 -0
- package/dist/manager/globals.d.ts +23 -0
- package/dist/manager/globals.js +26 -0
- package/dist/manager/manager-stores.d.ts +2 -0
- package/dist/manager/manager-stores.js +19 -0
- package/dist/manager/runtime.js +2 -0
- package/dist/manager-api/index.d.ts +2 -0
- package/dist/manager-api/index.js +3257 -0
- package/dist/manager-errors.d.ts +89 -0
- package/dist/manager-errors.js +20 -0
- package/dist/mcp/index.d.ts +270 -0
- package/dist/mcp/index.js +305 -0
- package/dist/mocking-utils/index.d.ts +689 -0
- package/dist/mocking-utils/index.js +521 -0
- package/dist/mocking-utils/mocker-runtime.js +1254 -0
- package/dist/nextjs-vite/config/preview.js +3 -0
- package/dist/nextjs-vite/export-mocks/cache/index.d.ts +25 -0
- package/dist/nextjs-vite/export-mocks/cache/index.js +29 -0
- package/dist/nextjs-vite/export-mocks/headers/index.d.ts +37 -0
- package/dist/nextjs-vite/export-mocks/headers/index.js +54 -0
- package/dist/nextjs-vite/export-mocks/link/index.d.ts +9 -0
- package/dist/nextjs-vite/export-mocks/link/index.js +59 -0
- package/dist/nextjs-vite/export-mocks/navigation/index.d.ts +28 -0
- package/dist/nextjs-vite/export-mocks/navigation/index.js +58 -0
- package/dist/nextjs-vite/export-mocks/router/index.d.ts +34 -0
- package/dist/nextjs-vite/export-mocks/router/index.js +63 -0
- package/dist/nextjs-vite/index.d.ts +92 -0
- package/dist/nextjs-vite/index.js +58 -0
- package/dist/nextjs-vite/node/index.d.ts +6 -0
- package/dist/nextjs-vite/node/index.js +20 -0
- package/dist/nextjs-vite/preset.js +648 -0
- package/dist/nextjs-vite/preview.d.ts +20 -0
- package/dist/nextjs-vite/preview.js +11 -0
- package/dist/nextjs-vite/vite-plugin/index.d.ts +6 -0
- package/dist/nextjs-vite/vite-plugin/index.js +19 -0
- package/dist/nextjs-vite-plugin/index.d.ts +28 -0
- package/dist/nextjs-vite-plugin/index.js +923 -0
- package/dist/nextjs-vite-plugin/mocks/storybook.global.js +29 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/image-context.js +8 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/image-default-loader.js +23 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-image.js +28 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-legacy-image.js +17 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/cache/index.js +29 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/dynamic/index.js +40 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/headers/index.js +55 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/link/index.js +63 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/navigation/index.js +71 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/router/index.js +74 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/rsc/server-only.js +7 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/safe-stable-stringify/index.js +13 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/compatibility/draft-mode.compat.js +7 -0
- package/dist/node-logger/index.d.ts +495 -0
- package/dist/node-logger/index.js +42 -0
- package/dist/oxc-parser/index.d.ts +99 -0
- package/dist/oxc-parser/index.js +275 -0
- package/dist/oxc-parser/worker.js +37 -0
- package/dist/preview/_chunks/runtime-BIzIdDbb.js +10263 -0
- package/dist/preview/_chunks/runtime-BTPtVY1p.js +1102 -0
- package/dist/preview/_chunks/runtime-BZSnICCg.js +8484 -0
- package/dist/preview/_chunks/runtime-BdGkqNEt.js +45 -0
- package/dist/preview/_chunks/runtime-BwSxqk3t.js +63 -0
- package/dist/preview/_chunks/runtime-CqHxptiK.js +6143 -0
- package/dist/preview/_chunks/runtime-CsV4HZPV.js +5064 -0
- package/dist/preview/_chunks/runtime-CxZK_Ln3.js +284 -0
- package/dist/preview/_chunks/runtime-DZToXfvO.js +9767 -0
- package/dist/preview/_chunks/runtime-DrTjJkPY.js +3872 -0
- package/dist/preview/_chunks/runtime-DuHdxMFA.js +387 -0
- package/dist/preview/_chunks/runtime-iXdo8CR8.js +3635 -0
- package/dist/preview/_chunks/runtime-q3wt0e_N.js +6838 -0
- package/dist/preview/globals.d.ts +16 -0
- package/dist/preview/globals.js +20 -0
- package/dist/preview/runtime.js +6 -0
- package/dist/preview-api/index.d.ts +4 -0
- package/dist/preview-api/index.js +147 -0
- package/dist/preview-errors.d.ts +186 -0
- package/dist/preview-errors.js +56 -0
- package/dist/react/docgen/docgen-worker.js +38 -0
- package/dist/react/entry-preview-argtypes.js +9 -0
- package/dist/react/entry-preview-docs.js +12 -0
- package/dist/react/entry-preview-rsc.js +11 -0
- package/dist/react/entry-preview.js +21 -0
- package/dist/react/index.d.ts +119 -0
- package/dist/react/index.js +26 -0
- package/dist/react/preset.js +301 -0
- package/dist/react/preview.d.ts +2 -0
- package/dist/react/preview.js +11 -0
- package/dist/react-native/bin/get-stories.js +34 -0
- package/dist/react-native/index.d.ts +160 -0
- package/dist/react-native/index.js +1547 -0
- package/dist/react-native/metro/node.d.ts +83 -0
- package/dist/react-native/metro/node.js +21 -0
- package/dist/react-native/metro/withStorybook.d.ts +2269 -0
- package/dist/react-native/metro/withStorybook.js +138 -0
- package/dist/react-native/preview.d.ts +6 -0
- package/dist/react-native/preview.js +20 -0
- package/dist/react-native/scripts/generate.d.ts +22 -0
- package/dist/react-native/scripts/generate.js +18 -0
- package/dist/react-native/stub.js +20 -0
- package/dist/react-native-theming/index.d.ts +175 -0
- package/dist/react-native-theming/index.js +2591 -0
- package/dist/react-native-ui/index.d.ts +130 -0
- package/dist/react-native-ui/index.js +1448 -0
- package/dist/react-native-ui-common/index.d.ts +230 -0
- package/dist/react-native-ui-common/index.js +514 -0
- package/dist/react-vite/index.d.ts +4 -0
- package/dist/react-vite/index.js +8 -0
- package/dist/react-vite/node/index.d.ts +6 -0
- package/dist/react-vite/node/index.js +20 -0
- package/dist/react-vite/preset.d.ts +6 -0
- package/dist/react-vite/preset.js +21 -0
- package/dist/router/index.d.ts +141 -0
- package/dist/router/index.js +1217 -0
- package/dist/server-errors.d.ts +2 -0
- package/dist/server-errors.js +149 -0
- package/dist/shared/open-service/index.d.ts +3 -0
- package/dist/shared/open-service/index.js +115 -0
- package/dist/shared/open-service/services/docgen/worker/docgen-worker.js +75 -0
- package/dist/shared/open-service/toolsets/docs/public.d.ts +1296 -0
- package/dist/shared/open-service/toolsets/docs/public.js +991 -0
- package/dist/telemetry/index.d.ts +314 -0
- package/dist/telemetry/index.js +103 -0
- package/dist/test/index.d.ts +158 -0
- package/dist/test/index.js +19421 -0
- package/dist/theming/create.d.ts +15 -0
- package/dist/theming/create.js +11 -0
- package/dist/theming/index.d.ts +54 -0
- package/dist/theming/index.js +511 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +48 -0
- package/dist/viewport/index.d.ts +275 -0
- package/dist/viewport/index.js +21 -0
- package/package.json +1054 -4
- package/template/nextjs-vite/cli/.eslintrc.json +6 -0
- package/template/nextjs-vite/cli/js/Button.jsx +42 -0
- package/template/nextjs-vite/cli/js/Button.stories.js +49 -0
- package/template/nextjs-vite/cli/js/Configure.mdx +470 -0
- package/template/nextjs-vite/cli/js/Header.jsx +58 -0
- package/template/nextjs-vite/cli/js/Header.stories.js +30 -0
- package/template/nextjs-vite/cli/js/Page.jsx +68 -0
- package/template/nextjs-vite/cli/js/Page.stories.js +28 -0
- package/template/nextjs-vite/cli/ts/Button.stories.ts +54 -0
- package/template/nextjs-vite/cli/ts/Button.tsx +39 -0
- package/template/nextjs-vite/cli/ts/Configure.mdx +446 -0
- package/template/nextjs-vite/cli/ts/Header.stories.ts +34 -0
- package/template/nextjs-vite/cli/ts/Header.tsx +54 -0
- package/template/nextjs-vite/cli/ts/Page.stories.ts +33 -0
- package/template/nextjs-vite/cli/ts/Page.tsx +73 -0
- package/template/react/cli/.eslintrc.json +5 -0
- package/template/react/cli/js/Button.jsx +39 -0
- package/template/react/cli/js/Button.stories.js +49 -0
- package/template/react/cli/js/Header.jsx +56 -0
- package/template/react/cli/js/Header.stories.js +29 -0
- package/template/react/cli/js/Page.jsx +69 -0
- package/template/react/cli/js/Page.stories.js +28 -0
- package/template/react/cli/ts/Button.stories.ts +54 -0
- package/template/react/cli/ts/Button.tsx +37 -0
- package/template/react/cli/ts/Header.stories.ts +34 -0
- package/template/react/cli/ts/Header.tsx +56 -0
- package/template/react/cli/ts/Page.stories.ts +33 -0
- package/template/react/cli/ts/Page.tsx +73 -0
- package/template/react-vite/cli/.eslintrc.json +5 -0
- package/template/react-vite/cli/js/Button.jsx +39 -0
- package/template/react-vite/cli/js/Button.stories.js +49 -0
- package/template/react-vite/cli/js/Header.jsx +56 -0
- package/template/react-vite/cli/js/Header.stories.js +29 -0
- package/template/react-vite/cli/js/Page.jsx +69 -0
- package/template/react-vite/cli/js/Page.stories.js +28 -0
- package/template/react-vite/cli/ts/Button.stories.ts +54 -0
- package/template/react-vite/cli/ts/Button.tsx +37 -0
- package/template/react-vite/cli/ts/Header.stories.ts +34 -0
- package/template/react-vite/cli/ts/Header.tsx +56 -0
- package/template/react-vite/cli/ts/Page.stories.ts +33 -0
- package/template/react-vite/cli/ts/Page.tsx +73 -0
|
@@ -0,0 +1,1448 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PortalHost
|
|
3
|
+
} from "../_browser-chunks/chunk-UMDO3KB7.js";
|
|
4
|
+
import {
|
|
5
|
+
curriedTransparentize$1
|
|
6
|
+
} from "../_browser-chunks/chunk-S6TK43XQ.js";
|
|
7
|
+
import "../_browser-chunks/chunk-LE2LTDW3.js";
|
|
8
|
+
import "../_browser-chunks/chunk-IMSF75WX.js";
|
|
9
|
+
|
|
10
|
+
// src/react-native-ui/TreeNode.tsx
|
|
11
|
+
import { styled as styled2, useTheme as useTheme2 } from "@aussieljk/forkbook/internal/react-native-theming";
|
|
12
|
+
import React, { forwardRef, useMemo } from "react";
|
|
13
|
+
|
|
14
|
+
// src/react-native-ui/icon/index.tsx
|
|
15
|
+
import { styled, useTheme } from "@aussieljk/forkbook/internal/react-native-theming";
|
|
16
|
+
import { SymbolView } from "expo-symbols";
|
|
17
|
+
import { jsx } from "react/jsx-runtime";
|
|
18
|
+
function symbolIcon(name, size, defaultColor) {
|
|
19
|
+
return ({ color, width }) => {
|
|
20
|
+
let theme = useTheme();
|
|
21
|
+
return jsx(
|
|
22
|
+
SymbolView,
|
|
23
|
+
{
|
|
24
|
+
name,
|
|
25
|
+
size: Number(width ?? size),
|
|
26
|
+
tintColor: color === "currentColor" || !color ? defaultColor(theme) : color
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
var text = (theme) => theme.color.defaultText, SearchIcon = symbolIcon("magnifyingglass", 14, (theme) => theme.color.dark), CloseIcon = symbolIcon("xmark.circle", 14, text), MenuIcon = symbolIcon("line.3.horizontal", 14, text), FullscreenIcon = symbolIcon("arrow.up.left.and.arrow.down.right", 14, text), CloseFullscreenIcon = symbolIcon("arrow.down.right.and.arrow.up.left", 14, text), BottomBarToggleIcon = symbolIcon("rectangle.bottomthird.inset.filled", 14, text), ExpandAllIcon = symbolIcon("rectangle.expand.vertical", 14, text), CollapseAllIcon = symbolIcon("rectangle.compress.vertical", 14, text), ComponentIcon = symbolIcon("square.grid.2x2", 12, () => "#029CFD"), GroupIcon = symbolIcon("folder", 14, () => "#6F2CAC"), StoryIcon = symbolIcon("bookmark", 12, () => "#37D5D3"), Chevron = symbolIcon("chevron.right", 8, (theme) => theme.textMutedColor), CollapseIconWrapper = styled.View(({ isExpanded }) => ({
|
|
32
|
+
width: 8,
|
|
33
|
+
height: 8,
|
|
34
|
+
justifyContent: "center",
|
|
35
|
+
alignItems: "center",
|
|
36
|
+
transform: isExpanded ? "rotateZ(90deg)" : "none"
|
|
37
|
+
})), CollapseIcon = ({ isExpanded }) => jsx(CollapseIconWrapper, { isExpanded, children: jsx(Chevron, {}) });
|
|
38
|
+
|
|
39
|
+
// src/react-native-ui/TreeNode.tsx
|
|
40
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
41
|
+
var BranchNodeText = styled2.Text(({ theme }) => ({
|
|
42
|
+
textAlign: "left",
|
|
43
|
+
fontSize: theme.typography.size.s2,
|
|
44
|
+
flexShrink: 1,
|
|
45
|
+
color: theme.color.defaultText
|
|
46
|
+
})), BranchNode = styled2.TouchableOpacity(
|
|
47
|
+
({ depth = 0, isExpandable = !1, theme }) => ({
|
|
48
|
+
width: "100%",
|
|
49
|
+
border: "none",
|
|
50
|
+
cursor: "pointer",
|
|
51
|
+
display: "flex",
|
|
52
|
+
flexDirection: "row",
|
|
53
|
+
alignItems: "flex-start",
|
|
54
|
+
alignSelf: "flex-start",
|
|
55
|
+
paddingLeft: (isExpandable ? 8 : 22) + depth * 18,
|
|
56
|
+
backgroundColor: "transparent",
|
|
57
|
+
minHeight: 28,
|
|
58
|
+
borderRadius: 4,
|
|
59
|
+
gap: 6,
|
|
60
|
+
paddingTop: 5,
|
|
61
|
+
paddingBottom: 4,
|
|
62
|
+
// will this actually do anything?
|
|
63
|
+
"&:hover, &:focus": {
|
|
64
|
+
backgroundColor: curriedTransparentize$1(0.93, theme.color.secondary),
|
|
65
|
+
outline: "none"
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
), LeafNode = styled2.TouchableOpacity(({ depth = 0, selected, theme }) => ({
|
|
69
|
+
alignSelf: "flex-start",
|
|
70
|
+
cursor: "pointer",
|
|
71
|
+
color: "inherit",
|
|
72
|
+
display: "flex",
|
|
73
|
+
gap: 6,
|
|
74
|
+
flexDirection: "row",
|
|
75
|
+
alignItems: "flex-start",
|
|
76
|
+
paddingLeft: 22 + depth * 18,
|
|
77
|
+
paddingTop: 5,
|
|
78
|
+
paddingBottom: 4,
|
|
79
|
+
backgroundColor: selected ? theme.color.secondary : void 0,
|
|
80
|
+
// not sure 👇
|
|
81
|
+
width: "100%",
|
|
82
|
+
borderRadius: 4,
|
|
83
|
+
paddingRight: 20,
|
|
84
|
+
minHeight: 28
|
|
85
|
+
})), LeafNodeText = styled2.Text(({ theme, selected }) => ({
|
|
86
|
+
fontSize: theme.typography.size.s2,
|
|
87
|
+
flexShrink: 1,
|
|
88
|
+
fontWeight: selected ? "bold" : "normal",
|
|
89
|
+
color: selected ? theme.color.lightest : theme.color.defaultText
|
|
90
|
+
})), Wrapper = styled2.View({
|
|
91
|
+
display: "flex",
|
|
92
|
+
flexDirection: "row",
|
|
93
|
+
alignItems: "center",
|
|
94
|
+
gap: 6,
|
|
95
|
+
marginTop: 2
|
|
96
|
+
}), GroupNode = React.memo(function({
|
|
97
|
+
children,
|
|
98
|
+
isExpanded = !1,
|
|
99
|
+
isExpandable = !1,
|
|
100
|
+
...props
|
|
101
|
+
}) {
|
|
102
|
+
let theme = useTheme2(), color = useMemo(() => theme.base === "dark" ? theme.color.primary : theme.color.ultraviolet, [theme.base, theme.color.primary, theme.color.ultraviolet]);
|
|
103
|
+
return jsxs(BranchNode, { isExpandable, ...props, children: [
|
|
104
|
+
jsxs(Wrapper, { children: [
|
|
105
|
+
isExpandable && jsx2(CollapseIcon, { isExpanded: !!isExpanded }),
|
|
106
|
+
jsx2(GroupIcon, { width: 14, height: 14, color })
|
|
107
|
+
] }),
|
|
108
|
+
jsx2(BranchNodeText, { children })
|
|
109
|
+
] });
|
|
110
|
+
}), ComponentNode = React.memo(function({
|
|
111
|
+
children,
|
|
112
|
+
isExpanded,
|
|
113
|
+
isExpandable,
|
|
114
|
+
...props
|
|
115
|
+
}) {
|
|
116
|
+
let theme = useTheme2(), color = useMemo(() => theme.color.secondary, [theme.color.secondary]);
|
|
117
|
+
return jsxs(BranchNode, { isExpandable, ...props, children: [
|
|
118
|
+
jsxs(Wrapper, { children: [
|
|
119
|
+
isExpandable && jsx2(CollapseIcon, { isExpanded: !!isExpanded }),
|
|
120
|
+
jsx2(ComponentIcon, { width: 12, height: 12, color })
|
|
121
|
+
] }),
|
|
122
|
+
jsx2(BranchNodeText, { children })
|
|
123
|
+
] });
|
|
124
|
+
}), StoryNode = React.memo(
|
|
125
|
+
forwardRef(function({ children, ...props }, ref) {
|
|
126
|
+
let theme = useTheme2(), color = useMemo(() => props.selected ? theme.color.lightest : theme.color.seafoam, [props.selected, theme.color.lightest, theme.color.seafoam]);
|
|
127
|
+
return jsxs(LeafNode, { ...props, ref, children: [
|
|
128
|
+
jsx2(Wrapper, { children: jsx2(StoryIcon, { width: 14, height: 14, color }) }),
|
|
129
|
+
jsx2(LeafNodeText, { selected: props.selected, children })
|
|
130
|
+
] });
|
|
131
|
+
})
|
|
132
|
+
);
|
|
133
|
+
StoryNode.displayName = "StoryNode";
|
|
134
|
+
|
|
135
|
+
// src/react-native-ui/Tree.tsx
|
|
136
|
+
import { styled as styled3 } from "@aussieljk/forkbook/internal/react-native-theming";
|
|
137
|
+
import React2, { useCallback as useCallback2, useMemo as useMemo2, useRef as useRef2 } from "react";
|
|
138
|
+
import {
|
|
139
|
+
IconButton,
|
|
140
|
+
useExpanded,
|
|
141
|
+
createId,
|
|
142
|
+
getAncestorIds,
|
|
143
|
+
getDescendantIds,
|
|
144
|
+
isStoryHoistable,
|
|
145
|
+
startCase
|
|
146
|
+
} from "@aussieljk/forkbook/internal/react-native-ui-common";
|
|
147
|
+
|
|
148
|
+
// src/react-native-ui/SelectedNodeProvider.tsx
|
|
149
|
+
import { createContext, useCallback, useContext, useRef } from "react";
|
|
150
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
151
|
+
var SelectedNodeContext = createContext({
|
|
152
|
+
nodeRef: { current: null },
|
|
153
|
+
setNodeRef: () => {
|
|
154
|
+
},
|
|
155
|
+
scrollToSelectedNode: () => {
|
|
156
|
+
},
|
|
157
|
+
scrollRef: { current: null }
|
|
158
|
+
}), SelectedNodeProvider = ({ children }) => {
|
|
159
|
+
let nodeRef = useRef(null), setNodeRef = useCallback((node) => {
|
|
160
|
+
nodeRef.current = node;
|
|
161
|
+
}, []), scrollRef = useRef(null), scrollToSelectedNode = useCallback(() => {
|
|
162
|
+
setTimeout(() => {
|
|
163
|
+
if (nodeRef?.current && scrollRef?.current)
|
|
164
|
+
try {
|
|
165
|
+
nodeRef.current.measureLayout?.(scrollRef.current, (_x, y) => {
|
|
166
|
+
scrollRef.current?.scrollTo({ y: y - 100, animated: !0 });
|
|
167
|
+
});
|
|
168
|
+
} catch {
|
|
169
|
+
}
|
|
170
|
+
}, 100);
|
|
171
|
+
}, []);
|
|
172
|
+
return jsx3(
|
|
173
|
+
SelectedNodeContext.Provider,
|
|
174
|
+
{
|
|
175
|
+
value: {
|
|
176
|
+
nodeRef,
|
|
177
|
+
setNodeRef,
|
|
178
|
+
scrollToSelectedNode,
|
|
179
|
+
scrollRef
|
|
180
|
+
},
|
|
181
|
+
children
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
}, useSelectedNode = () => useContext(SelectedNodeContext);
|
|
185
|
+
|
|
186
|
+
// src/react-native-ui/Tree.tsx
|
|
187
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
188
|
+
var Node = React2.memo(function({
|
|
189
|
+
item,
|
|
190
|
+
refId,
|
|
191
|
+
isOrphan,
|
|
192
|
+
isDisplayed,
|
|
193
|
+
isSelected,
|
|
194
|
+
isFullyExpanded,
|
|
195
|
+
color: _2,
|
|
196
|
+
setFullyExpanded,
|
|
197
|
+
isExpanded,
|
|
198
|
+
setExpanded,
|
|
199
|
+
onSelectStoryId
|
|
200
|
+
}) {
|
|
201
|
+
let { setNodeRef } = useSelectedNode(), setRef = useCallback2(
|
|
202
|
+
(node) => {
|
|
203
|
+
isSelected && node && setNodeRef(node);
|
|
204
|
+
},
|
|
205
|
+
[isSelected, setNodeRef]
|
|
206
|
+
);
|
|
207
|
+
if (!isDisplayed)
|
|
208
|
+
return null;
|
|
209
|
+
let id = createId(item.id, refId);
|
|
210
|
+
if (item.type === "story")
|
|
211
|
+
return jsx4(LeafNodeStyleWrapper, { children: jsx4(
|
|
212
|
+
StoryNode,
|
|
213
|
+
{
|
|
214
|
+
ref: setRef,
|
|
215
|
+
selected: isSelected,
|
|
216
|
+
id,
|
|
217
|
+
depth: isOrphan ? item.depth : item.depth - 1,
|
|
218
|
+
onPress: () => {
|
|
219
|
+
onSelectStoryId(item.id);
|
|
220
|
+
},
|
|
221
|
+
children: item.renderLabel?.(item) || item.name
|
|
222
|
+
},
|
|
223
|
+
id
|
|
224
|
+
) });
|
|
225
|
+
if (item.type === "root")
|
|
226
|
+
return jsxs2(RootNode, { id, children: [
|
|
227
|
+
jsxs2(
|
|
228
|
+
CollapseButton,
|
|
229
|
+
{
|
|
230
|
+
"data-action": "collapse-root",
|
|
231
|
+
onPress: (event) => {
|
|
232
|
+
event.preventDefault(), setExpanded({ ids: [item.id], value: !isExpanded });
|
|
233
|
+
},
|
|
234
|
+
"aria-expanded": isExpanded,
|
|
235
|
+
children: [
|
|
236
|
+
jsx4(CollapseIcon, { isExpanded }),
|
|
237
|
+
jsx4(RootNodeText, { children: startCase(item.name) })
|
|
238
|
+
]
|
|
239
|
+
}
|
|
240
|
+
),
|
|
241
|
+
isExpanded && jsx4(
|
|
242
|
+
IconButton,
|
|
243
|
+
{
|
|
244
|
+
"aria-label": isFullyExpanded ? "Expand" : "Collapse",
|
|
245
|
+
"data-action": "expand-all",
|
|
246
|
+
"data-expanded": isFullyExpanded,
|
|
247
|
+
onPress: (event) => {
|
|
248
|
+
event.preventDefault(), setFullyExpanded?.();
|
|
249
|
+
},
|
|
250
|
+
children: isFullyExpanded ? jsx4(CollapseAllIcon, {}) : jsx4(ExpandAllIcon, {})
|
|
251
|
+
}
|
|
252
|
+
)
|
|
253
|
+
] }, id);
|
|
254
|
+
if (item.type === "component" || item.type === "group") {
|
|
255
|
+
let BranchNode2 = item.type === "component" ? ComponentNode : GroupNode;
|
|
256
|
+
return jsx4(
|
|
257
|
+
BranchNode2,
|
|
258
|
+
{
|
|
259
|
+
id,
|
|
260
|
+
"aria-controls": item.children && item.children[0],
|
|
261
|
+
"aria-expanded": isExpanded,
|
|
262
|
+
depth: isOrphan ? item.depth : item.depth - 1,
|
|
263
|
+
isComponent: item.type === "component",
|
|
264
|
+
isExpandable: item.children && item.children.length > 0,
|
|
265
|
+
isExpanded,
|
|
266
|
+
onPress: (event) => {
|
|
267
|
+
event.preventDefault(), setExpanded({ ids: [item.id], value: !isExpanded });
|
|
268
|
+
},
|
|
269
|
+
children: startCase(item.name)
|
|
270
|
+
},
|
|
271
|
+
id
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
return null;
|
|
275
|
+
}), LeafNodeStyleWrapper = styled3.View(({ theme }) => ({
|
|
276
|
+
position: "relative",
|
|
277
|
+
display: "flex",
|
|
278
|
+
flexDirection: "row",
|
|
279
|
+
justifyContent: "space-between",
|
|
280
|
+
alignItems: "center",
|
|
281
|
+
paddingRight: 20,
|
|
282
|
+
color: theme.color.defaultText,
|
|
283
|
+
backgroundColor: "transparent",
|
|
284
|
+
minHeight: 28,
|
|
285
|
+
borderRadius: 4
|
|
286
|
+
})), RootNode = styled3.View(() => ({
|
|
287
|
+
display: "flex",
|
|
288
|
+
flexDirection: "row",
|
|
289
|
+
alignItems: "center",
|
|
290
|
+
justifyContent: "space-between",
|
|
291
|
+
marginTop: 16,
|
|
292
|
+
marginBottom: 4,
|
|
293
|
+
minHeight: 28
|
|
294
|
+
})), RootNodeText = styled3.Text(({ theme }) => ({
|
|
295
|
+
fontSize: theme.typography.size.s1,
|
|
296
|
+
fontWeight: theme.typography.weight.bold,
|
|
297
|
+
color: theme.textMutedColor,
|
|
298
|
+
lineHeight: 16,
|
|
299
|
+
letterSpacing: 2.5,
|
|
300
|
+
textTransform: "uppercase"
|
|
301
|
+
})), CollapseButton = styled3.TouchableOpacity(() => ({
|
|
302
|
+
display: "flex",
|
|
303
|
+
flexDirection: "row",
|
|
304
|
+
paddingVertical: 0,
|
|
305
|
+
paddingHorizontal: 8,
|
|
306
|
+
borderRadius: 4,
|
|
307
|
+
gap: 6,
|
|
308
|
+
alignItems: "center",
|
|
309
|
+
cursor: "pointer",
|
|
310
|
+
height: 28
|
|
311
|
+
})), Tree = React2.memo(function({ isMain, refId, data, status, docsMode, selectedStoryId, onSelectStoryId }) {
|
|
312
|
+
let containerRef = useRef2(null), [rootIds, orphanIds, initialExpanded] = useMemo2(
|
|
313
|
+
() => Object.keys(data).reduce(
|
|
314
|
+
(acc, id) => {
|
|
315
|
+
let item = data[id];
|
|
316
|
+
return item.type === "root" ? acc[0].push(id) : item.parent || acc[1].push(id), item.type === "root" && item.startCollapsed && (acc[2][id] = !1), acc;
|
|
317
|
+
},
|
|
318
|
+
[[], [], {}]
|
|
319
|
+
),
|
|
320
|
+
[data]
|
|
321
|
+
), { expandableDescendants } = useMemo2(() => [...orphanIds, ...rootIds].reduce(
|
|
322
|
+
(acc, nodeId) => (acc.expandableDescendants[nodeId] = getDescendantIds(data, nodeId, !1).filter(
|
|
323
|
+
(d) => !["story", "docs"].includes(data[d].type)
|
|
324
|
+
), acc),
|
|
325
|
+
{ orphansFirst: [], expandableDescendants: {} }
|
|
326
|
+
), [data, rootIds, orphanIds]), singleStoryComponentIds = useMemo2(() => Object.keys(data).filter((id) => {
|
|
327
|
+
let entry = data[id];
|
|
328
|
+
if (entry.type !== "component") return !1;
|
|
329
|
+
let { children = [], name } = entry;
|
|
330
|
+
if (children.length !== 1) return !1;
|
|
331
|
+
let onlyChild = data[children[0]];
|
|
332
|
+
return onlyChild.type === "docs" ? !0 : onlyChild.type === "story" ? isStoryHoistable(onlyChild.name, name) : !1;
|
|
333
|
+
}), [data]), collapsedItems = useMemo2(
|
|
334
|
+
() => Object.keys(data).filter((id) => !singleStoryComponentIds.includes(id)),
|
|
335
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
336
|
+
[singleStoryComponentIds]
|
|
337
|
+
), collapsedData = useMemo2(() => singleStoryComponentIds.reduce(
|
|
338
|
+
(acc, id) => {
|
|
339
|
+
let { children, parent, name } = data[id], [childId] = children;
|
|
340
|
+
if (parent) {
|
|
341
|
+
let siblings = [...data[parent].children];
|
|
342
|
+
siblings[siblings.indexOf(id)] = childId, acc[parent] = { ...data[parent], children: siblings };
|
|
343
|
+
}
|
|
344
|
+
return acc[childId] = {
|
|
345
|
+
...data[childId],
|
|
346
|
+
name,
|
|
347
|
+
parent,
|
|
348
|
+
depth: data[childId].depth - 1
|
|
349
|
+
}, acc;
|
|
350
|
+
},
|
|
351
|
+
{ ...data }
|
|
352
|
+
), [data]), ancestry = useMemo2(() => collapsedItems.reduce(
|
|
353
|
+
(acc, id) => Object.assign(acc, { [id]: getAncestorIds(collapsedData, id) }),
|
|
354
|
+
{}
|
|
355
|
+
), [collapsedItems, collapsedData]), [expanded, setExpanded] = useExpanded({
|
|
356
|
+
refId,
|
|
357
|
+
data: collapsedData,
|
|
358
|
+
initialExpanded,
|
|
359
|
+
rootIds,
|
|
360
|
+
selectedStoryId,
|
|
361
|
+
onSelectStoryId
|
|
362
|
+
}), treeItems = useMemo2(() => collapsedItems.map((itemId) => {
|
|
363
|
+
let item = collapsedData[itemId], id = createId(itemId, refId);
|
|
364
|
+
if (item.type === "root") {
|
|
365
|
+
let descendants = expandableDescendants[item.id], isFullyExpanded = descendants.every((d) => expanded[d]);
|
|
366
|
+
return jsx4(
|
|
367
|
+
Root,
|
|
368
|
+
{
|
|
369
|
+
item,
|
|
370
|
+
refId,
|
|
371
|
+
isOrphan: !1,
|
|
372
|
+
isDisplayed: !0,
|
|
373
|
+
isSelected: selectedStoryId === itemId,
|
|
374
|
+
isExpanded: !!expanded[itemId],
|
|
375
|
+
setExpanded,
|
|
376
|
+
isFullyExpanded,
|
|
377
|
+
expandableDescendants: descendants,
|
|
378
|
+
onSelectStoryId,
|
|
379
|
+
docsMode: !1,
|
|
380
|
+
color: "",
|
|
381
|
+
status: {}
|
|
382
|
+
},
|
|
383
|
+
id
|
|
384
|
+
);
|
|
385
|
+
}
|
|
386
|
+
let isDisplayed = !item.parent || ancestry[itemId].every((a) => expanded[a]);
|
|
387
|
+
return jsx4(
|
|
388
|
+
Node,
|
|
389
|
+
{
|
|
390
|
+
item,
|
|
391
|
+
status: status?.[itemId],
|
|
392
|
+
refId,
|
|
393
|
+
color: void 0,
|
|
394
|
+
docsMode,
|
|
395
|
+
isOrphan: orphanIds.some((oid) => itemId === oid || itemId.startsWith(`${oid}-`)),
|
|
396
|
+
isDisplayed,
|
|
397
|
+
isSelected: selectedStoryId === itemId,
|
|
398
|
+
isExpanded: !!expanded[itemId],
|
|
399
|
+
setExpanded,
|
|
400
|
+
onSelectStoryId
|
|
401
|
+
},
|
|
402
|
+
id
|
|
403
|
+
);
|
|
404
|
+
}), [
|
|
405
|
+
ancestry,
|
|
406
|
+
collapsedData,
|
|
407
|
+
collapsedItems,
|
|
408
|
+
docsMode,
|
|
409
|
+
expandableDescendants,
|
|
410
|
+
expanded,
|
|
411
|
+
onSelectStoryId,
|
|
412
|
+
orphanIds,
|
|
413
|
+
refId,
|
|
414
|
+
selectedStoryId,
|
|
415
|
+
setExpanded,
|
|
416
|
+
status
|
|
417
|
+
]);
|
|
418
|
+
return jsx4(Container, { ref: containerRef, hasOrphans: isMain && orphanIds.length > 0, children: treeItems });
|
|
419
|
+
}), Container = styled3.View((props) => ({
|
|
420
|
+
marginTop: props.hasOrphans ? 20 : 0,
|
|
421
|
+
marginBottom: 20
|
|
422
|
+
})), Root = React2.memo(function({
|
|
423
|
+
setExpanded,
|
|
424
|
+
isFullyExpanded,
|
|
425
|
+
expandableDescendants,
|
|
426
|
+
...props
|
|
427
|
+
}) {
|
|
428
|
+
let setFullyExpanded = useCallback2(
|
|
429
|
+
() => setExpanded({ ids: expandableDescendants, value: !isFullyExpanded }),
|
|
430
|
+
[setExpanded, isFullyExpanded, expandableDescendants]
|
|
431
|
+
);
|
|
432
|
+
return jsx4(
|
|
433
|
+
Node,
|
|
434
|
+
{
|
|
435
|
+
...props,
|
|
436
|
+
setExpanded,
|
|
437
|
+
isFullyExpanded,
|
|
438
|
+
setFullyExpanded
|
|
439
|
+
}
|
|
440
|
+
);
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
// src/react-native-ui/Explorer.tsx
|
|
444
|
+
import React4, { useRef as useRef3 } from "react";
|
|
445
|
+
|
|
446
|
+
// src/react-native-ui/Refs.tsx
|
|
447
|
+
import React3, { useMemo as useMemo3, useCallback as useCallback3, useEffect, useState } from "react";
|
|
448
|
+
import { styled as styled4 } from "@aussieljk/forkbook/internal/react-native-theming";
|
|
449
|
+
import { getStateType } from "@aussieljk/forkbook/internal/react-native-ui-common";
|
|
450
|
+
import { Fragment, jsx as jsx5 } from "react/jsx-runtime";
|
|
451
|
+
var Wrapper2 = styled4.View(() => ({
|
|
452
|
+
position: "relative"
|
|
453
|
+
})), Ref = React3.memo(
|
|
454
|
+
function(props) {
|
|
455
|
+
let {
|
|
456
|
+
index,
|
|
457
|
+
id: refId,
|
|
458
|
+
title = refId,
|
|
459
|
+
isLoading: isLoadingMain,
|
|
460
|
+
isBrowsing,
|
|
461
|
+
selectedStoryId,
|
|
462
|
+
loginUrl,
|
|
463
|
+
type,
|
|
464
|
+
expanded = !0,
|
|
465
|
+
indexError,
|
|
466
|
+
previewInitialized,
|
|
467
|
+
setSelection
|
|
468
|
+
} = props, length = useMemo3(() => index ? Object.keys(index).length : 0, [index]), isLoading = isLoadingMain || (type === "auto-inject" && !previewInitialized || type === "server-checked") || type === "unknown", state = getStateType(isLoading, !!loginUrl && length === 0, !!indexError, !isLoading && length === 0), [isExpanded, setExpanded] = useState(expanded);
|
|
469
|
+
useEffect(() => {
|
|
470
|
+
index && selectedStoryId && index[selectedStoryId] && setExpanded(!0);
|
|
471
|
+
}, [setExpanded, index, selectedStoryId]);
|
|
472
|
+
let onSelectStoryId = useCallback3(
|
|
473
|
+
(storyId) => {
|
|
474
|
+
setSelection({ refId, storyId });
|
|
475
|
+
},
|
|
476
|
+
[refId, setSelection]
|
|
477
|
+
);
|
|
478
|
+
return jsx5(Fragment, { children: isExpanded && jsx5(Wrapper2, { "data-title": title, isMain: !0, children: state === "ready" && jsx5(
|
|
479
|
+
Tree,
|
|
480
|
+
{
|
|
481
|
+
status: props.status,
|
|
482
|
+
isBrowsing,
|
|
483
|
+
isMain: !0,
|
|
484
|
+
refId,
|
|
485
|
+
data: index,
|
|
486
|
+
docsMode: !1,
|
|
487
|
+
selectedStoryId,
|
|
488
|
+
onSelectStoryId
|
|
489
|
+
}
|
|
490
|
+
) }) });
|
|
491
|
+
}
|
|
492
|
+
);
|
|
493
|
+
|
|
494
|
+
// src/react-native-ui/Explorer.tsx
|
|
495
|
+
import { View } from "react-native";
|
|
496
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
497
|
+
import { createElement } from "react";
|
|
498
|
+
var Explorer = React4.memo(function({
|
|
499
|
+
isLoading,
|
|
500
|
+
isBrowsing,
|
|
501
|
+
dataset,
|
|
502
|
+
selected,
|
|
503
|
+
setSelection
|
|
504
|
+
}) {
|
|
505
|
+
let containerRef = useRef3(null);
|
|
506
|
+
return jsx6(View, { ref: containerRef, id: "storybook-explorer-tree", children: dataset.entries.map(([refId, ref]) => createElement(
|
|
507
|
+
Ref,
|
|
508
|
+
{
|
|
509
|
+
...ref,
|
|
510
|
+
key: refId,
|
|
511
|
+
isLoading,
|
|
512
|
+
isBrowsing,
|
|
513
|
+
selectedStoryId: selected?.refId === ref.id ? selected.storyId : null,
|
|
514
|
+
setSelection
|
|
515
|
+
}
|
|
516
|
+
)) });
|
|
517
|
+
});
|
|
518
|
+
|
|
519
|
+
// src/react-native-ui/Sidebar.tsx
|
|
520
|
+
import React7, { useMemo as useMemo5 } from "react";
|
|
521
|
+
import { styled as styled7 } from "@aussieljk/forkbook/internal/react-native-theming";
|
|
522
|
+
|
|
523
|
+
// src/react-native-ui/Search.tsx
|
|
524
|
+
import { styled as styled5 } from "@aussieljk/forkbook/internal/react-native-theming";
|
|
525
|
+
import { useFuzzySearchList } from "@nozbe/microfuzz/react";
|
|
526
|
+
import React5, {
|
|
527
|
+
useCallback as useCallback4,
|
|
528
|
+
useDeferredValue,
|
|
529
|
+
useMemo as useMemo4,
|
|
530
|
+
useRef as useRef4,
|
|
531
|
+
useState as useState2
|
|
532
|
+
} from "react";
|
|
533
|
+
import { TextInput, View as View2 } from "react-native";
|
|
534
|
+
import {
|
|
535
|
+
isExpandType,
|
|
536
|
+
searchItem
|
|
537
|
+
} from "@aussieljk/forkbook/internal/react-native-ui-common";
|
|
538
|
+
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
539
|
+
var DEFAULT_MAX_SEARCH_RESULTS = 50, SearchIconWrapper = styled5.View({
|
|
540
|
+
position: "absolute",
|
|
541
|
+
top: 0,
|
|
542
|
+
left: 8,
|
|
543
|
+
zIndex: 1,
|
|
544
|
+
pointerEvents: "none",
|
|
545
|
+
display: "flex",
|
|
546
|
+
flexDirection: "row",
|
|
547
|
+
alignItems: "center",
|
|
548
|
+
height: "100%"
|
|
549
|
+
}), SearchField = styled5.View({
|
|
550
|
+
display: "flex",
|
|
551
|
+
flexDirection: "column",
|
|
552
|
+
position: "relative"
|
|
553
|
+
}), Input = styled5(TextInput)(({ theme }) => ({
|
|
554
|
+
height: 32,
|
|
555
|
+
paddingLeft: 28,
|
|
556
|
+
paddingRight: 28,
|
|
557
|
+
borderWidth: 1,
|
|
558
|
+
borderColor: theme.appBorderColor,
|
|
559
|
+
backgroundColor: "transparent",
|
|
560
|
+
borderRadius: 6,
|
|
561
|
+
fontSize: theme.typography.size.s1 + 1,
|
|
562
|
+
color: theme.color.defaultText,
|
|
563
|
+
width: "100%"
|
|
564
|
+
})), ClearIcon = styled5.TouchableOpacity(({ theme }) => ({
|
|
565
|
+
position: "absolute",
|
|
566
|
+
top: 0,
|
|
567
|
+
bottom: 0,
|
|
568
|
+
right: 8,
|
|
569
|
+
zIndex: 1,
|
|
570
|
+
color: theme.textMutedColor,
|
|
571
|
+
cursor: "pointer",
|
|
572
|
+
display: "flex",
|
|
573
|
+
alignItems: "center",
|
|
574
|
+
justifyContent: "center",
|
|
575
|
+
height: "100%"
|
|
576
|
+
})), Search = React5.memo(function({ children, dataset, setSelection, getLastViewed, initialQuery = "" }) {
|
|
577
|
+
let inputRef = useRef4(null), [inputValue, setInputValue] = useState2(initialQuery), [isOpen, setIsOpen] = useState2(!1), [allComponents, showAllComponents] = useState2(!1), { scrollToSelectedNode } = useSelectedNode(), selectStory = useCallback4(
|
|
578
|
+
(id, refId) => {
|
|
579
|
+
setSelection({ storyId: id, refId }), inputRef.current?.blur(), setIsOpen(!1), showAllComponents(!1), scrollToSelectedNode();
|
|
580
|
+
},
|
|
581
|
+
[scrollToSelectedNode, setSelection]
|
|
582
|
+
), getItemProps = useCallback4(
|
|
583
|
+
({ item: result }) => ({
|
|
584
|
+
icon: result?.item?.type === "component" ? "component" : "story",
|
|
585
|
+
onPress: () => {
|
|
586
|
+
result?.item?.type === "story" ? selectStory(result.item.id, result.item.refId) : result?.item?.type === "component" ? selectStory(result.item.children[0], result.item.refId) : isExpandType(result) && result.showAll && result.showAll();
|
|
587
|
+
},
|
|
588
|
+
score: result.score,
|
|
589
|
+
item: result.item,
|
|
590
|
+
matches: result.matches,
|
|
591
|
+
isHighlighted: !1
|
|
592
|
+
}),
|
|
593
|
+
[selectStory]
|
|
594
|
+
), deferredDataset = useDeferredValue(dataset), searchList = useMemo4(() => deferredDataset.entries.reduce((acc, [refId, { index }]) => (index && acc.push(
|
|
595
|
+
...Object.values(index).map((item) => searchItem(item, deferredDataset.hash[refId]))
|
|
596
|
+
), acc), []), [deferredDataset]), deferredQuery = useDeferredValue(inputValue), queryText = useMemo4(() => deferredQuery ? deferredQuery.trim() : "", [deferredQuery]), getText = useCallback4((item) => [item.name, item.path?.join(" ") ?? ""], []), mapResultItem = useCallback4(
|
|
597
|
+
({ item, score, matches }) => ({
|
|
598
|
+
item,
|
|
599
|
+
score,
|
|
600
|
+
matches: matches ?? []
|
|
601
|
+
}),
|
|
602
|
+
[]
|
|
603
|
+
), fuzzyResults = useFuzzySearchList({
|
|
604
|
+
list: searchList,
|
|
605
|
+
queryText,
|
|
606
|
+
getText,
|
|
607
|
+
mapResultItem
|
|
608
|
+
}), results = useMemo4(() => {
|
|
609
|
+
if (!queryText) return [];
|
|
610
|
+
let maxResults = allComponents ? 1e3 : DEFAULT_MAX_SEARCH_RESULTS, processedResults = [], resultIds = /* @__PURE__ */ new Set(), totalDistinctCount = 0;
|
|
611
|
+
for (let result of fuzzyResults) {
|
|
612
|
+
let { item } = result;
|
|
613
|
+
if (!(!(item.type === "component" || item.type === "docs" || item.type === "story") || resultIds.has(item.parent)) && (resultIds.add(item.id), totalDistinctCount++, processedResults.length < maxResults && processedResults.push(result), allComponents && processedResults.length >= maxResults))
|
|
614
|
+
break;
|
|
615
|
+
}
|
|
616
|
+
return !allComponents && totalDistinctCount > DEFAULT_MAX_SEARCH_RESULTS && processedResults.push({
|
|
617
|
+
showAll: () => showAllComponents(!0),
|
|
618
|
+
totalCount: totalDistinctCount,
|
|
619
|
+
moreCount: totalDistinctCount - DEFAULT_MAX_SEARCH_RESULTS
|
|
620
|
+
}), processedResults;
|
|
621
|
+
}, [queryText, fuzzyResults, allComponents]);
|
|
622
|
+
return jsxs3(View2, { style: { flex: 1 }, children: [
|
|
623
|
+
jsxs3(SearchField, { children: [
|
|
624
|
+
jsx7(SearchIconWrapper, { children: jsx7(SearchIcon, {}) }),
|
|
625
|
+
jsx7(
|
|
626
|
+
Input,
|
|
627
|
+
{
|
|
628
|
+
ref: inputRef,
|
|
629
|
+
onChangeText: setInputValue,
|
|
630
|
+
onFocus: () => setIsOpen(!0),
|
|
631
|
+
onBlur: () => setIsOpen(!1)
|
|
632
|
+
}
|
|
633
|
+
),
|
|
634
|
+
isOpen && jsx7(
|
|
635
|
+
ClearIcon,
|
|
636
|
+
{
|
|
637
|
+
onPress: () => {
|
|
638
|
+
setInputValue(""), inputRef.current?.clear();
|
|
639
|
+
},
|
|
640
|
+
children: jsx7(CloseIcon, {})
|
|
641
|
+
}
|
|
642
|
+
)
|
|
643
|
+
] }),
|
|
644
|
+
children({
|
|
645
|
+
query: queryText,
|
|
646
|
+
// The last result can be the "show all" item (ExpandType). SearchResults checks for it.
|
|
647
|
+
results,
|
|
648
|
+
isBrowsing: !isOpen || !inputValue.length,
|
|
649
|
+
closeMenu: () => {
|
|
650
|
+
},
|
|
651
|
+
getItemProps,
|
|
652
|
+
highlightedIndex: null
|
|
653
|
+
})
|
|
654
|
+
] });
|
|
655
|
+
});
|
|
656
|
+
|
|
657
|
+
// src/react-native-ui/SearchResults.tsx
|
|
658
|
+
import { styled as styled6 } from "@aussieljk/forkbook/internal/react-native-theming";
|
|
659
|
+
import React6, { useCallback as useCallback5 } from "react";
|
|
660
|
+
import {
|
|
661
|
+
isExpandType as isExpandType2,
|
|
662
|
+
IconButton as IconButton2,
|
|
663
|
+
Button
|
|
664
|
+
} from "@aussieljk/forkbook/internal/react-native-ui-common";
|
|
665
|
+
import { View as View3 } from "react-native";
|
|
666
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
667
|
+
import { createElement as createElement2 } from "react";
|
|
668
|
+
var ResultsList = styled6.View({
|
|
669
|
+
margin: 0,
|
|
670
|
+
padding: 0,
|
|
671
|
+
marginTop: 8
|
|
672
|
+
}), ResultRow = styled6.TouchableOpacity(
|
|
673
|
+
({ theme, isHighlighted }) => ({
|
|
674
|
+
width: "100%",
|
|
675
|
+
border: "none",
|
|
676
|
+
cursor: "pointer",
|
|
677
|
+
display: "flex",
|
|
678
|
+
flexDirection: "row",
|
|
679
|
+
alignItems: "flex-start",
|
|
680
|
+
textAlign: "left",
|
|
681
|
+
color: theme.color.defaultText,
|
|
682
|
+
fontSize: theme.typography.size.s2,
|
|
683
|
+
backgroundColor: isHighlighted ? theme.background.hoverable : "transparent",
|
|
684
|
+
minHeight: 28,
|
|
685
|
+
borderRadius: 4,
|
|
686
|
+
gap: 6,
|
|
687
|
+
paddingTop: 7,
|
|
688
|
+
paddingBottom: 7,
|
|
689
|
+
paddingLeft: 8,
|
|
690
|
+
paddingRight: 8,
|
|
691
|
+
"&:hover, &:focus": {
|
|
692
|
+
backgroundColor: curriedTransparentize$1(0.93, theme.color.secondary),
|
|
693
|
+
outline: "none"
|
|
694
|
+
}
|
|
695
|
+
})
|
|
696
|
+
), IconWrapper = styled6.View({
|
|
697
|
+
marginTop: 2
|
|
698
|
+
}), ResultRowContent = styled6.View(() => ({
|
|
699
|
+
display: "flex",
|
|
700
|
+
flexDirection: "column"
|
|
701
|
+
})), NoResults = styled6.View(({ theme }) => ({
|
|
702
|
+
marginTop: 20,
|
|
703
|
+
textAlign: "center",
|
|
704
|
+
fontSize: theme.typography.size.s2,
|
|
705
|
+
lineHeight: 18,
|
|
706
|
+
color: theme.color.defaultText
|
|
707
|
+
})), Mark = styled6.Text(({ theme }) => ({
|
|
708
|
+
backgroundColor: "transparent",
|
|
709
|
+
color: theme.color.secondary
|
|
710
|
+
})), MoreWrapper = styled6.View({
|
|
711
|
+
marginTop: 8
|
|
712
|
+
}), RecentlyOpenedTitle = styled6.View(({ theme }) => ({
|
|
713
|
+
display: "flex",
|
|
714
|
+
flexDirection: "row",
|
|
715
|
+
justifyContent: "space-between",
|
|
716
|
+
fontSize: theme.typography.size.s1 - 1,
|
|
717
|
+
fontWeight: theme.typography.weight.bold,
|
|
718
|
+
minHeight: 28,
|
|
719
|
+
// letterSpacing: '0.16em', <-- todo
|
|
720
|
+
textTransform: "uppercase",
|
|
721
|
+
color: theme.textMutedColor,
|
|
722
|
+
marginTop: 16,
|
|
723
|
+
marginBottom: 4,
|
|
724
|
+
alignItems: "center"
|
|
725
|
+
})), Highlight = React6.memo(
|
|
726
|
+
function({ children, text: text2, ranges }) {
|
|
727
|
+
if (!ranges || ranges.length === 0) return jsx8(Text, { children: children ?? text2 });
|
|
728
|
+
let { nodes: result } = ranges.reduce(
|
|
729
|
+
({ cursor, nodes }, [start, end], index, { length }) => (cursor < start && nodes.push(jsx8(Text, { children: text2.slice(cursor, start) }, `text-${index}`)), nodes.push(jsx8(Mark, { children: text2.slice(start, end + 1) }, `mark-${index}`)), index === length - 1 && end + 1 < text2.length && nodes.push(jsx8(Text, { children: text2.slice(end + 1) }, `last-${index}`)), { cursor: end + 1, nodes }),
|
|
730
|
+
{ cursor: 0, nodes: [] }
|
|
731
|
+
);
|
|
732
|
+
return jsx8(Text, { children: result });
|
|
733
|
+
}
|
|
734
|
+
), Title = styled6.Text(({ theme }) => ({
|
|
735
|
+
justifyContent: "flex-start",
|
|
736
|
+
color: theme.textMutedColor,
|
|
737
|
+
fontSize: theme.typography.size.s2
|
|
738
|
+
})), Path = styled6.View(({ theme }) => ({
|
|
739
|
+
justifyContent: "flex-start",
|
|
740
|
+
marginVertical: 2,
|
|
741
|
+
color: theme.textMutedColor,
|
|
742
|
+
fontSize: theme.typography.size.s1 - 1,
|
|
743
|
+
flexDirection: "row"
|
|
744
|
+
})), PathText = styled6.Text(({ theme }) => ({
|
|
745
|
+
fontSize: theme.typography.size.s1 - 1,
|
|
746
|
+
color: theme.textMutedColor
|
|
747
|
+
})), Result = React6.memo(function({
|
|
748
|
+
item,
|
|
749
|
+
matches,
|
|
750
|
+
icon: _icon,
|
|
751
|
+
onPress,
|
|
752
|
+
...props
|
|
753
|
+
}) {
|
|
754
|
+
let press = useCallback5(
|
|
755
|
+
(event) => {
|
|
756
|
+
event.preventDefault(), onPress?.(event);
|
|
757
|
+
},
|
|
758
|
+
[onPress]
|
|
759
|
+
), nameHighlights = matches?.[0], pathString = item.path?.join(" ") ?? "";
|
|
760
|
+
return jsxs4(ResultRow, { ...props, onPress: press, children: [
|
|
761
|
+
jsxs4(IconWrapper, { children: [
|
|
762
|
+
item.type === "component" && jsx8(ComponentIcon, { width: "14", height: "14" }),
|
|
763
|
+
item.type === "story" && jsx8(StoryIcon, { width: "14", height: "14" })
|
|
764
|
+
] }),
|
|
765
|
+
jsxs4(ResultRowContent, { testID: "search-result-item--label", children: [
|
|
766
|
+
jsx8(Title, { children: jsx8(Highlight, { text: item.name, ranges: nameHighlights, children: item.name }) }),
|
|
767
|
+
jsx8(Path, { children: jsx8(PathText, { children: jsx8(Highlight, { text: pathString, ranges: matches?.[1], children: item.path?.join(" / ") }) }) })
|
|
768
|
+
] })
|
|
769
|
+
] });
|
|
770
|
+
}), Text = styled6.Text(({ theme }) => ({
|
|
771
|
+
color: theme.color.defaultText
|
|
772
|
+
})), SearchResults = React6.memo(function({
|
|
773
|
+
query,
|
|
774
|
+
results,
|
|
775
|
+
closeMenu,
|
|
776
|
+
getItemProps,
|
|
777
|
+
highlightedIndex,
|
|
778
|
+
clearLastViewed
|
|
779
|
+
}) {
|
|
780
|
+
let handleClearLastViewed = () => {
|
|
781
|
+
clearLastViewed?.(), closeMenu();
|
|
782
|
+
};
|
|
783
|
+
return jsxs4(ResultsList, { children: [
|
|
784
|
+
results.length > 0 && !query ? jsxs4(RecentlyOpenedTitle, { children: [
|
|
785
|
+
jsx8(Text, { children: "Recently opened" }),
|
|
786
|
+
jsx8(IconButton2, { onPress: handleClearLastViewed })
|
|
787
|
+
] }) : null,
|
|
788
|
+
results.length === 0 && query ? jsx8(View3, { children: jsxs4(NoResults, { children: [
|
|
789
|
+
jsx8(Text, { style: { marginBottom: 8 }, children: "No components found" }),
|
|
790
|
+
jsx8(Text, { children: "Find components by name or path." })
|
|
791
|
+
] }) }) : null,
|
|
792
|
+
results.map((result, index) => {
|
|
793
|
+
if (isExpandType2(result))
|
|
794
|
+
return jsx8(MoreWrapper, { children: jsx8(
|
|
795
|
+
Button,
|
|
796
|
+
{
|
|
797
|
+
...result,
|
|
798
|
+
...getItemProps({ key: `${index}`, index, item: result }),
|
|
799
|
+
size: "small",
|
|
800
|
+
text: `Show ${result.moreCount} more results`
|
|
801
|
+
}
|
|
802
|
+
) }, "search-result-expand");
|
|
803
|
+
let { item } = result, key = `${item.refId}::${item.id}`;
|
|
804
|
+
return createElement2(
|
|
805
|
+
Result,
|
|
806
|
+
{
|
|
807
|
+
...result,
|
|
808
|
+
...getItemProps({ key, index, item: result }),
|
|
809
|
+
isHighlighted: highlightedIndex === index,
|
|
810
|
+
key: item.id
|
|
811
|
+
}
|
|
812
|
+
);
|
|
813
|
+
})
|
|
814
|
+
] });
|
|
815
|
+
});
|
|
816
|
+
|
|
817
|
+
// src/react-native-ui/Sidebar.tsx
|
|
818
|
+
import { useLastViewed } from "@aussieljk/forkbook/internal/react-native-ui-common";
|
|
819
|
+
|
|
820
|
+
// src/react-native-ui/constants.ts
|
|
821
|
+
var DEFAULT_REF_ID = "storybook_internal";
|
|
822
|
+
|
|
823
|
+
// src/react-native-ui/Sidebar.tsx
|
|
824
|
+
import { View as View4 } from "react-native";
|
|
825
|
+
import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
826
|
+
var Container2 = styled7.View(({ theme }) => ({
|
|
827
|
+
width: "100%",
|
|
828
|
+
height: "100%",
|
|
829
|
+
display: "flex",
|
|
830
|
+
flexDirection: "column",
|
|
831
|
+
backgroundColor: theme.background.content
|
|
832
|
+
})), Top = styled7.View({
|
|
833
|
+
paddingLeft: 4,
|
|
834
|
+
paddingRight: 4,
|
|
835
|
+
paddingTop: 16,
|
|
836
|
+
flex: 1,
|
|
837
|
+
flexDirection: "row"
|
|
838
|
+
}), Swap = React7.memo(function({
|
|
839
|
+
children,
|
|
840
|
+
condition
|
|
841
|
+
}) {
|
|
842
|
+
let [a, b] = React7.Children.toArray(children);
|
|
843
|
+
return jsxs5(Fragment2, { children: [
|
|
844
|
+
jsx9(View4, { style: { display: condition ? "flex" : "none" }, children: a }),
|
|
845
|
+
jsx9(View4, { style: { display: condition ? "none" : "flex" }, children: b })
|
|
846
|
+
] });
|
|
847
|
+
}), useCombination = (index, indexError, previewInitialized, status, refs) => {
|
|
848
|
+
let hash = useMemo5(
|
|
849
|
+
() => ({
|
|
850
|
+
[DEFAULT_REF_ID]: {
|
|
851
|
+
index,
|
|
852
|
+
indexError,
|
|
853
|
+
previewInitialized,
|
|
854
|
+
status,
|
|
855
|
+
title: null,
|
|
856
|
+
id: DEFAULT_REF_ID,
|
|
857
|
+
url: "iframe.html"
|
|
858
|
+
},
|
|
859
|
+
...refs
|
|
860
|
+
}),
|
|
861
|
+
[refs, index, indexError, previewInitialized, status]
|
|
862
|
+
);
|
|
863
|
+
return useMemo5(() => ({ hash, entries: Object.entries(hash) }), [hash]);
|
|
864
|
+
}, Sidebar = React7.memo(function({
|
|
865
|
+
storyId,
|
|
866
|
+
refId = DEFAULT_REF_ID,
|
|
867
|
+
index,
|
|
868
|
+
indexError,
|
|
869
|
+
status,
|
|
870
|
+
previewInitialized,
|
|
871
|
+
refs = {},
|
|
872
|
+
setSelection
|
|
873
|
+
}) {
|
|
874
|
+
let selected = useMemo5(
|
|
875
|
+
() => storyId ? { storyId, refId } : null,
|
|
876
|
+
[storyId, refId]
|
|
877
|
+
), dataset = useCombination(index, indexError, previewInitialized, status, refs), lastViewedProps = useLastViewed(selected);
|
|
878
|
+
return jsx9(Container2, { style: { paddingHorizontal: 10 }, children: jsx9(Top, { children: jsx9(Search, { dataset, setSelection, ...lastViewedProps, children: ({ query, results, isBrowsing, closeMenu, getItemProps, highlightedIndex }) => jsxs5(Swap, { condition: isBrowsing, children: [
|
|
879
|
+
jsx9(
|
|
880
|
+
Explorer,
|
|
881
|
+
{
|
|
882
|
+
dataset,
|
|
883
|
+
selected,
|
|
884
|
+
isLoading: !1,
|
|
885
|
+
isBrowsing,
|
|
886
|
+
setSelection
|
|
887
|
+
}
|
|
888
|
+
),
|
|
889
|
+
jsx9(
|
|
890
|
+
SearchResults,
|
|
891
|
+
{
|
|
892
|
+
query,
|
|
893
|
+
results,
|
|
894
|
+
closeMenu,
|
|
895
|
+
getItemProps,
|
|
896
|
+
highlightedIndex,
|
|
897
|
+
isLoading: !1,
|
|
898
|
+
clearLastViewed: lastViewedProps.clearLastViewed
|
|
899
|
+
}
|
|
900
|
+
)
|
|
901
|
+
] }) }) }) });
|
|
902
|
+
});
|
|
903
|
+
|
|
904
|
+
// src/react-native-ui/Layout.tsx
|
|
905
|
+
import { styled as styled9, ThemeProvider, useTheme as useTheme5 } from "@aussieljk/forkbook/internal/react-native-theming";
|
|
906
|
+
import {
|
|
907
|
+
IconButton as IconButton4,
|
|
908
|
+
LayoutProvider,
|
|
909
|
+
StorageProvider,
|
|
910
|
+
useLayout,
|
|
911
|
+
useStoreBooleanState,
|
|
912
|
+
useStyle as useStyle2
|
|
913
|
+
} from "@aussieljk/forkbook/internal/react-native-ui-common";
|
|
914
|
+
import { useCallback as useCallback7, useLayoutEffect, useMemo as useMemo9, useRef as useRef7, useState as useState4 } from "react";
|
|
915
|
+
import { ScrollView as ScrollView3, Text as Text4, TouchableOpacity as TouchableOpacity2, View as View6 } from "react-native";
|
|
916
|
+
import { SafeAreaProvider, useSafeAreaInsets as useSafeAreaInsets3 } from "react-native-safe-area-context";
|
|
917
|
+
import { SET_CURRENT_STORY } from "@aussieljk/forkbook/internal/core-events";
|
|
918
|
+
import {
|
|
919
|
+
Addon_TypesEnum as Addon_TypesEnum2
|
|
920
|
+
} from "@aussieljk/forkbook/internal/types";
|
|
921
|
+
import { addons as addons2 } from "@aussieljk/forkbook/manager-api";
|
|
922
|
+
|
|
923
|
+
// src/react-native-ui/MobileAddonsPanel.tsx
|
|
924
|
+
import { BottomSheetModal } from "@expo/ui/community/bottom-sheet";
|
|
925
|
+
import { addons } from "@aussieljk/forkbook/manager-api";
|
|
926
|
+
import { styled as styled8, useTheme as useTheme3 } from "@aussieljk/forkbook/internal/react-native-theming";
|
|
927
|
+
import {
|
|
928
|
+
Addon_TypesEnum
|
|
929
|
+
} from "@aussieljk/forkbook/internal/types";
|
|
930
|
+
import { forwardRef as forwardRef2, useImperativeHandle, useMemo as useMemo6, useRef as useRef5, useState as useState3 } from "react";
|
|
931
|
+
import { ScrollView, Text as Text2, View as View5 } from "react-native";
|
|
932
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
933
|
+
import { IconButton as IconButton3, useStyle } from "@aussieljk/forkbook/internal/react-native-ui-common";
|
|
934
|
+
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
935
|
+
var snapPoints = ["25%", "50%", "75%"], MobileAddonsPanel = forwardRef2(
|
|
936
|
+
({ storyId, parameters }, ref) => {
|
|
937
|
+
let theme = useTheme3(), addonsPanelBottomSheetRef = useRef5(null);
|
|
938
|
+
useImperativeHandle(ref, () => ({
|
|
939
|
+
setAddonsPanelOpen: (open) => {
|
|
940
|
+
open ? addonsPanelBottomSheetRef.current?.present() : addonsPanelBottomSheetRef.current?.dismiss();
|
|
941
|
+
}
|
|
942
|
+
}));
|
|
943
|
+
let backgroundStyle = useStyle(() => ({ backgroundColor: theme.background.content }));
|
|
944
|
+
return jsx10(
|
|
945
|
+
BottomSheetModal,
|
|
946
|
+
{
|
|
947
|
+
ref: addonsPanelBottomSheetRef,
|
|
948
|
+
index: 1,
|
|
949
|
+
snapPoints,
|
|
950
|
+
enablePanDownToClose: !0,
|
|
951
|
+
backgroundStyle,
|
|
952
|
+
children: jsx10(
|
|
953
|
+
AddonsTabs,
|
|
954
|
+
{
|
|
955
|
+
onClose: () => {
|
|
956
|
+
addonsPanelBottomSheetRef.current?.dismiss();
|
|
957
|
+
},
|
|
958
|
+
storyId,
|
|
959
|
+
parameters
|
|
960
|
+
}
|
|
961
|
+
)
|
|
962
|
+
}
|
|
963
|
+
);
|
|
964
|
+
}
|
|
965
|
+
);
|
|
966
|
+
MobileAddonsPanel.displayName = "MobileAddonsPanel";
|
|
967
|
+
var addonsTabsContainerStyle = {
|
|
968
|
+
flex: 1
|
|
969
|
+
}, addonsTabsStyle = {
|
|
970
|
+
flexDirection: "row",
|
|
971
|
+
borderBottomWidth: 1,
|
|
972
|
+
borderBottomColor: "lightgrey"
|
|
973
|
+
}, addonsTabsContentContainerStyle = {
|
|
974
|
+
justifyContent: "center"
|
|
975
|
+
}, closeIconStyle = {
|
|
976
|
+
marginRight: 4,
|
|
977
|
+
marginBottom: 4,
|
|
978
|
+
alignItems: "center",
|
|
979
|
+
justifyContent: "center"
|
|
980
|
+
}, addonsScrollStyle = {
|
|
981
|
+
flex: 1
|
|
982
|
+
}, centeredStyle = {
|
|
983
|
+
alignItems: "center",
|
|
984
|
+
justifyContent: "center"
|
|
985
|
+
}, hiddenStyle = {
|
|
986
|
+
display: "none"
|
|
987
|
+
}, hitSlop = { top: 10, right: 10, bottom: 10, left: 10 }, AddonsTabs = ({
|
|
988
|
+
onClose,
|
|
989
|
+
storyId,
|
|
990
|
+
parameters
|
|
991
|
+
}) => {
|
|
992
|
+
let panels = useMemo6(() => {
|
|
993
|
+
let allPanels = addons.getElements(Addon_TypesEnum.PANEL);
|
|
994
|
+
return Object.fromEntries(
|
|
995
|
+
Object.entries(allPanels).filter(([, p]) => !p.paramKey || !parameters?.[p.paramKey]?.disable)
|
|
996
|
+
);
|
|
997
|
+
}, [parameters]), [addonSelected, setAddonSelected] = useState3(Object.keys(panels)[0]), insets = useSafeAreaInsets(), scrollContentContainerStyle = useStyle(() => ({
|
|
998
|
+
paddingBottom: insets.bottom + 16
|
|
999
|
+
})), panelEntries = useMemo6(() => Object.entries(panels), [panels]), activeAddonId = panels[addonSelected] ? addonSelected : panelEntries[0]?.[0];
|
|
1000
|
+
return jsxs6(View5, { style: addonsTabsContainerStyle, children: [
|
|
1001
|
+
jsxs6(View5, { style: addonsTabsStyle, children: [
|
|
1002
|
+
jsx10(
|
|
1003
|
+
ScrollView,
|
|
1004
|
+
{
|
|
1005
|
+
horizontal: !0,
|
|
1006
|
+
showsHorizontalScrollIndicator: !1,
|
|
1007
|
+
contentContainerStyle: addonsTabsContentContainerStyle,
|
|
1008
|
+
children: Object.values(panels).map(({ id, title }) => {
|
|
1009
|
+
let resolvedTitle = typeof title == "function" ? title({}) : title;
|
|
1010
|
+
return jsx10(
|
|
1011
|
+
Tab,
|
|
1012
|
+
{
|
|
1013
|
+
active: id === activeAddonId,
|
|
1014
|
+
onPress: () => setAddonSelected(id),
|
|
1015
|
+
text: String(resolvedTitle)
|
|
1016
|
+
},
|
|
1017
|
+
id
|
|
1018
|
+
);
|
|
1019
|
+
})
|
|
1020
|
+
}
|
|
1021
|
+
),
|
|
1022
|
+
jsx10(
|
|
1023
|
+
IconButton3,
|
|
1024
|
+
{
|
|
1025
|
+
style: closeIconStyle,
|
|
1026
|
+
hitSlop,
|
|
1027
|
+
Icon: CloseIcon,
|
|
1028
|
+
onPress: () => onClose?.(),
|
|
1029
|
+
accessibilityLabel: "Close addons panel"
|
|
1030
|
+
}
|
|
1031
|
+
)
|
|
1032
|
+
] }),
|
|
1033
|
+
jsx10(ScrollView, { style: addonsScrollStyle, contentContainerStyle: scrollContentContainerStyle, children: storyId ? panelEntries.length === 0 ? jsx10(View5, { style: centeredStyle, children: jsx10(Text2, { children: "No addons loaded." }) }) : panelEntries.map(([id, p]) => jsx10(View5, { style: id === activeAddonId ? void 0 : hiddenStyle, children: jsx10(PanelRenderer, { panel: p }) }, id)) : jsx10(View5, { style: centeredStyle, children: jsx10(Text2, { children: "No Story Selected" }) }) })
|
|
1034
|
+
] });
|
|
1035
|
+
}, PanelRenderer = ({ panel }) => panel.render({ active: !0 }), Tab = ({ active, onPress, text: text2 }) => {
|
|
1036
|
+
let testID = `addon-tab-${text2.toLowerCase().replace(/[^a-z0-9]+/g, "-")}`;
|
|
1037
|
+
return jsx10(
|
|
1038
|
+
TabButton,
|
|
1039
|
+
{
|
|
1040
|
+
active,
|
|
1041
|
+
onPress,
|
|
1042
|
+
testID,
|
|
1043
|
+
accessible: !0,
|
|
1044
|
+
accessibilityRole: "tab",
|
|
1045
|
+
accessibilityState: { selected: active },
|
|
1046
|
+
accessibilityLabel: text2,
|
|
1047
|
+
children: jsx10(TabText, { active, children: text2 })
|
|
1048
|
+
}
|
|
1049
|
+
);
|
|
1050
|
+
}, TabButton = styled8.TouchableOpacity(({ theme, active }) => ({
|
|
1051
|
+
borderBottomWidth: active ? 2 : 0,
|
|
1052
|
+
borderBottomColor: active ? theme.barSelectedColor : void 0,
|
|
1053
|
+
overflow: "hidden",
|
|
1054
|
+
paddingHorizontal: 15,
|
|
1055
|
+
justifyContent: "center",
|
|
1056
|
+
alignItems: "center"
|
|
1057
|
+
})), TabText = styled8.Text(({ theme, active }) => ({
|
|
1058
|
+
color: active ? theme.barSelectedColor : theme.color.mediumdark,
|
|
1059
|
+
textAlign: "center",
|
|
1060
|
+
fontWeight: "bold",
|
|
1061
|
+
fontSize: 12,
|
|
1062
|
+
lineHeight: 12
|
|
1063
|
+
}));
|
|
1064
|
+
|
|
1065
|
+
// src/react-native-ui/MobileMenuDrawer.tsx
|
|
1066
|
+
import BottomSheet from "@expo/ui/community/bottom-sheet";
|
|
1067
|
+
import { useTheme as useTheme4 } from "@aussieljk/forkbook/internal/react-native-theming";
|
|
1068
|
+
import {
|
|
1069
|
+
forwardRef as forwardRef3,
|
|
1070
|
+
memo,
|
|
1071
|
+
useCallback as useCallback6,
|
|
1072
|
+
useImperativeHandle as useImperativeHandle2,
|
|
1073
|
+
useMemo as useMemo7,
|
|
1074
|
+
useRef as useRef6
|
|
1075
|
+
} from "react";
|
|
1076
|
+
import { Keyboard, ScrollView as ScrollView2 } from "react-native";
|
|
1077
|
+
import { useSafeAreaInsets as useSafeAreaInsets2 } from "react-native-safe-area-context";
|
|
1078
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1079
|
+
var snapPoints2 = ["50%", "75%"], MobileMenuDrawer = memo(
|
|
1080
|
+
forwardRef3(({ children }, ref) => {
|
|
1081
|
+
let insets = useSafeAreaInsets2(), theme = useTheme4(), menuBottomSheetRef = useRef6(null), { scrollToSelectedNode, scrollRef } = useSelectedNode(), shouldScrollOnOpen = useRef6(!1), handleSheetChange = useCallback6(
|
|
1082
|
+
(index) => {
|
|
1083
|
+
index >= 0 && shouldScrollOnOpen.current && (shouldScrollOnOpen.current = !1, scrollToSelectedNode());
|
|
1084
|
+
},
|
|
1085
|
+
[scrollToSelectedNode]
|
|
1086
|
+
);
|
|
1087
|
+
useImperativeHandle2(ref, () => ({
|
|
1088
|
+
setMobileMenuOpen: (open) => {
|
|
1089
|
+
open ? (shouldScrollOnOpen.current = !0, menuBottomSheetRef.current?.snapToIndex(1)) : (Keyboard.dismiss(), menuBottomSheetRef.current?.close());
|
|
1090
|
+
}
|
|
1091
|
+
}));
|
|
1092
|
+
let bgColorStyle = useMemo7(() => ({ backgroundColor: theme.background.content }), [theme.background.content]), contentContainerStyle = useMemo7(() => ({ paddingBottom: insets.bottom }), [insets.bottom]);
|
|
1093
|
+
return jsx11(
|
|
1094
|
+
BottomSheet,
|
|
1095
|
+
{
|
|
1096
|
+
ref: menuBottomSheetRef,
|
|
1097
|
+
index: -1,
|
|
1098
|
+
snapPoints: snapPoints2,
|
|
1099
|
+
enablePanDownToClose: !0,
|
|
1100
|
+
backgroundStyle: bgColorStyle,
|
|
1101
|
+
onChange: handleSheetChange,
|
|
1102
|
+
children: jsx11(
|
|
1103
|
+
ScrollView2,
|
|
1104
|
+
{
|
|
1105
|
+
ref: scrollRef,
|
|
1106
|
+
keyboardShouldPersistTaps: "handled",
|
|
1107
|
+
contentContainerStyle,
|
|
1108
|
+
children
|
|
1109
|
+
}
|
|
1110
|
+
)
|
|
1111
|
+
}
|
|
1112
|
+
);
|
|
1113
|
+
})
|
|
1114
|
+
);
|
|
1115
|
+
|
|
1116
|
+
// src/react-native-ui/StorybookLogo.tsx
|
|
1117
|
+
import { isValidElement, useEffect as useEffect2, useMemo as useMemo8 } from "react";
|
|
1118
|
+
import { Image, Linking, Text as Text3, TouchableOpacity } from "react-native";
|
|
1119
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1120
|
+
var WIDTH = 125, HEIGHT = 25, NoBrandLogo = ({ theme }) => jsx12(
|
|
1121
|
+
Text3,
|
|
1122
|
+
{
|
|
1123
|
+
style: {
|
|
1124
|
+
height: HEIGHT,
|
|
1125
|
+
color: theme.color.defaultText,
|
|
1126
|
+
fontSize: theme.typography.size.m1,
|
|
1127
|
+
fontWeight: "bold"
|
|
1128
|
+
},
|
|
1129
|
+
children: "Forkbook"
|
|
1130
|
+
}
|
|
1131
|
+
);
|
|
1132
|
+
function isElement(value) {
|
|
1133
|
+
return isValidElement(value);
|
|
1134
|
+
}
|
|
1135
|
+
var BrandLogo = ({ theme }) => {
|
|
1136
|
+
let brand = theme.brand ?? {}, imageHasNoWidthOrHeight = typeof brand.image == "object" && typeof brand.image == "object" && brand.image !== null && "uri" in brand.image && (!("height" in brand.image) || !("width" in brand.image));
|
|
1137
|
+
if (useEffect2(() => {
|
|
1138
|
+
imageHasNoWidthOrHeight && console.warn(
|
|
1139
|
+
`STORYBOOK: When using a remote image as the brand logo, you must also set the width and height.
|
|
1140
|
+
For example: brand: { image: { uri: 'https://sb.com/img.png', height: 25, width: 25}}`
|
|
1141
|
+
);
|
|
1142
|
+
}, [imageHasNoWidthOrHeight]), !brand.image)
|
|
1143
|
+
return null;
|
|
1144
|
+
if (isElement(brand.image))
|
|
1145
|
+
return brand.image;
|
|
1146
|
+
let image = jsx12(
|
|
1147
|
+
Image,
|
|
1148
|
+
{
|
|
1149
|
+
source: brand.image,
|
|
1150
|
+
resizeMode: brand.resizeMode ?? "contain",
|
|
1151
|
+
style: imageHasNoWidthOrHeight ? { width: WIDTH, height: HEIGHT } : void 0
|
|
1152
|
+
}
|
|
1153
|
+
);
|
|
1154
|
+
return brand.url ? jsx12(
|
|
1155
|
+
TouchableOpacity,
|
|
1156
|
+
{
|
|
1157
|
+
onPress: () => {
|
|
1158
|
+
brand.url && Linking.openURL(brand.url);
|
|
1159
|
+
},
|
|
1160
|
+
children: image
|
|
1161
|
+
}
|
|
1162
|
+
) : image;
|
|
1163
|
+
}, BrandTitle = ({ theme }) => {
|
|
1164
|
+
let brandTitleStyle = useMemo8(() => ({
|
|
1165
|
+
width: WIDTH,
|
|
1166
|
+
height: HEIGHT,
|
|
1167
|
+
color: theme.color.defaultText,
|
|
1168
|
+
fontSize: theme.typography.size.m1
|
|
1169
|
+
}), [theme]), title = jsx12(Text3, { style: brandTitleStyle, numberOfLines: 1, ellipsizeMode: "tail", children: theme.brand?.title });
|
|
1170
|
+
return theme.brand?.url ? jsx12(
|
|
1171
|
+
TouchableOpacity,
|
|
1172
|
+
{
|
|
1173
|
+
onPress: () => {
|
|
1174
|
+
theme.brand?.url && Linking.openURL(theme.brand?.url);
|
|
1175
|
+
},
|
|
1176
|
+
children: title
|
|
1177
|
+
}
|
|
1178
|
+
) : title;
|
|
1179
|
+
}, StorybookLogo = ({ theme }) => {
|
|
1180
|
+
let image = useMemo8(() => theme.brand?.image, [theme.brand?.image]), title = useMemo8(() => theme.brand?.title, [theme.brand?.title]);
|
|
1181
|
+
return image ? jsx12(BrandLogo, { theme }) : title ? jsx12(BrandTitle, { theme }) : jsx12(NoBrandLogo, { theme });
|
|
1182
|
+
};
|
|
1183
|
+
|
|
1184
|
+
// src/react-native-ui/Layout.tsx
|
|
1185
|
+
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1186
|
+
var desktopLogoContainer = {
|
|
1187
|
+
flexDirection: "row",
|
|
1188
|
+
alignItems: "center",
|
|
1189
|
+
paddingTop: 10,
|
|
1190
|
+
paddingLeft: 16,
|
|
1191
|
+
paddingBottom: 4,
|
|
1192
|
+
paddingRight: 10,
|
|
1193
|
+
justifyContent: "space-between"
|
|
1194
|
+
}, mobileContentStyle = { flex: 1, overflow: "hidden" }, placeholderObject = {}, iconFloatRightStyle = { marginLeft: "auto" }, navButtonStyle = { flexShrink: 1 }, navButtonHitSlop = { bottom: 10, left: 10, right: 10, top: 10 }, mobileMenuDrawerContentStyle = {
|
|
1195
|
+
paddingLeft: 16,
|
|
1196
|
+
paddingTop: 4,
|
|
1197
|
+
paddingBottom: 4
|
|
1198
|
+
}, flex1 = { flex: 1 }, FullUI = ({
|
|
1199
|
+
storage,
|
|
1200
|
+
theme,
|
|
1201
|
+
storyHash,
|
|
1202
|
+
story,
|
|
1203
|
+
storyBackgroundColor,
|
|
1204
|
+
children
|
|
1205
|
+
}) => jsx13(ThemeProvider, { theme, children: jsx13(SafeAreaProvider, { children: jsx13(View6, { style: flex1, children: jsx13(StorageProvider, { storage, children: jsxs7(LayoutProvider, { children: [
|
|
1206
|
+
jsx13(
|
|
1207
|
+
Layout,
|
|
1208
|
+
{
|
|
1209
|
+
storyHash,
|
|
1210
|
+
story,
|
|
1211
|
+
storyBackgroundColor,
|
|
1212
|
+
children
|
|
1213
|
+
}
|
|
1214
|
+
),
|
|
1215
|
+
jsx13(PortalHost, { name: "storybook-lite-ui-root" })
|
|
1216
|
+
] }) }) }) }) }), Layout = ({
|
|
1217
|
+
storyHash,
|
|
1218
|
+
story,
|
|
1219
|
+
storyBackgroundColor,
|
|
1220
|
+
children
|
|
1221
|
+
}) => {
|
|
1222
|
+
let theme = useTheme5(), mobileMenuDrawerRef = useRef7(null), addonPanelRef = useRef7(null), insets = useSafeAreaInsets3(), { isDesktop } = useLayout(), [desktopSidebarOpen, setDesktopSidebarOpen] = useStoreBooleanState(
|
|
1223
|
+
"desktopSidebarState",
|
|
1224
|
+
!0
|
|
1225
|
+
), [desktopAddonsPanelOpen, setDesktopAddonsPanelOpen] = useStoreBooleanState(
|
|
1226
|
+
"desktopPanelState",
|
|
1227
|
+
!0
|
|
1228
|
+
), hasEnabledPanels = useMemo9(() => {
|
|
1229
|
+
let allPanels = addons2.getElements(Addon_TypesEnum2.PANEL);
|
|
1230
|
+
return Object.values(allPanels).some(
|
|
1231
|
+
(p) => !p.paramKey || !story?.parameters?.[p.paramKey]?.disable
|
|
1232
|
+
);
|
|
1233
|
+
}, [story?.parameters]), [uiHidden, setUiHidden] = useState4(!1);
|
|
1234
|
+
useLayoutEffect(() => {
|
|
1235
|
+
setUiHidden(story?.parameters?.storybookUIVisibility === "hidden");
|
|
1236
|
+
}, [story?.parameters?.storybookUIVisibility]);
|
|
1237
|
+
let desktopSidebarStyle = useStyle2(
|
|
1238
|
+
() => ({
|
|
1239
|
+
width: desktopSidebarOpen ? 240 : void 0,
|
|
1240
|
+
padding: desktopSidebarOpen ? 0 : 10,
|
|
1241
|
+
borderColor: theme.appBorderColor,
|
|
1242
|
+
borderRightWidth: 1
|
|
1243
|
+
}),
|
|
1244
|
+
[desktopSidebarOpen, theme.appBorderColor]
|
|
1245
|
+
), desktopScrollViewContentContainerStyle = useStyle2(
|
|
1246
|
+
() => ({
|
|
1247
|
+
paddingBottom: insets.bottom
|
|
1248
|
+
}),
|
|
1249
|
+
[insets.bottom]
|
|
1250
|
+
), desktopAddonsPanelStyle = useStyle2(
|
|
1251
|
+
() => ({
|
|
1252
|
+
height: desktopAddonsPanelOpen ? 300 : void 0,
|
|
1253
|
+
borderTopWidth: 1,
|
|
1254
|
+
borderColor: theme.appBorderColor,
|
|
1255
|
+
paddingTop: desktopAddonsPanelOpen ? 4 : 0,
|
|
1256
|
+
padding: desktopAddonsPanelOpen ? 0 : 10
|
|
1257
|
+
}),
|
|
1258
|
+
[desktopAddonsPanelOpen, theme.appBorderColor]
|
|
1259
|
+
), containerStyle = useStyle2(() => isDesktop ? {
|
|
1260
|
+
flex: 1,
|
|
1261
|
+
paddingTop: insets.top,
|
|
1262
|
+
backgroundColor: theme.background.content,
|
|
1263
|
+
flexDirection: "row"
|
|
1264
|
+
} : {
|
|
1265
|
+
flex: 1,
|
|
1266
|
+
paddingTop: story?.parameters?.noSafeArea ? 0 : insets.top,
|
|
1267
|
+
backgroundColor: storyBackgroundColor || theme.background.content
|
|
1268
|
+
}, [
|
|
1269
|
+
storyBackgroundColor,
|
|
1270
|
+
theme.background.content,
|
|
1271
|
+
insets.top,
|
|
1272
|
+
story?.parameters?.noSafeArea,
|
|
1273
|
+
isDesktop
|
|
1274
|
+
]), storyContentStyle = useStyle2(
|
|
1275
|
+
() => ({
|
|
1276
|
+
flex: 1,
|
|
1277
|
+
overflow: "hidden",
|
|
1278
|
+
backgroundColor: storyBackgroundColor || theme.background.content
|
|
1279
|
+
}),
|
|
1280
|
+
[storyBackgroundColor, theme.background.content]
|
|
1281
|
+
), fullScreenButtonStyle = useStyle2(
|
|
1282
|
+
() => ({
|
|
1283
|
+
position: "absolute",
|
|
1284
|
+
bottom: uiHidden ? 56 + insets.bottom : 16,
|
|
1285
|
+
right: 16,
|
|
1286
|
+
backgroundColor: theme.background.content,
|
|
1287
|
+
padding: 4,
|
|
1288
|
+
borderRadius: 4,
|
|
1289
|
+
borderWidth: 1,
|
|
1290
|
+
borderColor: theme.appBorderColor
|
|
1291
|
+
}),
|
|
1292
|
+
[uiHidden, insets.bottom, theme.background.content, theme.appBorderColor]
|
|
1293
|
+
), menuContainerStyle = useStyle2(
|
|
1294
|
+
() => ({
|
|
1295
|
+
paddingBottom: insets.bottom
|
|
1296
|
+
}),
|
|
1297
|
+
[insets.bottom]
|
|
1298
|
+
), navButtonTextStyle = useStyle2(
|
|
1299
|
+
() => ({
|
|
1300
|
+
flexShrink: 1,
|
|
1301
|
+
color: theme.barTextColor
|
|
1302
|
+
}),
|
|
1303
|
+
[theme.barTextColor]
|
|
1304
|
+
), openMobileMenu = useCallback7(() => {
|
|
1305
|
+
mobileMenuDrawerRef.current?.setMobileMenuOpen(!0);
|
|
1306
|
+
}, [mobileMenuDrawerRef]), setSelection = useCallback7((selection) => {
|
|
1307
|
+
if (!selection) return;
|
|
1308
|
+
let newStoryId = selection.storyId;
|
|
1309
|
+
addons2.getChannel().emit(SET_CURRENT_STORY, { storyId: newStoryId });
|
|
1310
|
+
}, []);
|
|
1311
|
+
return jsxs7(View6, { style: containerStyle, children: [
|
|
1312
|
+
isDesktop ? jsx13(View6, { style: desktopSidebarStyle, children: desktopSidebarOpen ? jsxs7(
|
|
1313
|
+
ScrollView3,
|
|
1314
|
+
{
|
|
1315
|
+
keyboardShouldPersistTaps: "handled",
|
|
1316
|
+
contentContainerStyle: desktopScrollViewContentContainerStyle,
|
|
1317
|
+
children: [
|
|
1318
|
+
jsxs7(View6, { style: desktopLogoContainer, children: [
|
|
1319
|
+
jsx13(StorybookLogo, { theme }),
|
|
1320
|
+
jsx13(IconButton4, { onPress: () => setDesktopSidebarOpen(!1), Icon: MenuIcon })
|
|
1321
|
+
] }),
|
|
1322
|
+
jsx13(
|
|
1323
|
+
Sidebar,
|
|
1324
|
+
{
|
|
1325
|
+
previewInitialized: !0,
|
|
1326
|
+
indexError: void 0,
|
|
1327
|
+
refs: placeholderObject,
|
|
1328
|
+
setSelection,
|
|
1329
|
+
status: placeholderObject,
|
|
1330
|
+
index: storyHash,
|
|
1331
|
+
storyId: story?.id,
|
|
1332
|
+
refId: DEFAULT_REF_ID
|
|
1333
|
+
}
|
|
1334
|
+
)
|
|
1335
|
+
]
|
|
1336
|
+
}
|
|
1337
|
+
) : jsx13(IconButton4, { onPress: () => setDesktopSidebarOpen(!0), Icon: MenuIcon }) }) : null,
|
|
1338
|
+
jsxs7(View6, { style: mobileContentStyle, children: [
|
|
1339
|
+
jsx13(View6, { style: storyContentStyle, children }),
|
|
1340
|
+
story?.parameters?.hideFullScreenButton || isDesktop ? null : jsx13(
|
|
1341
|
+
TouchableOpacity2,
|
|
1342
|
+
{
|
|
1343
|
+
style: fullScreenButtonStyle,
|
|
1344
|
+
onPress: () => setUiHidden((prev) => !prev),
|
|
1345
|
+
children: uiHidden ? jsx13(CloseFullscreenIcon, { color: theme.color.mediumdark }) : jsx13(FullscreenIcon, { color: theme.color.mediumdark })
|
|
1346
|
+
}
|
|
1347
|
+
),
|
|
1348
|
+
isDesktop && hasEnabledPanels ? jsx13(View6, { style: desktopAddonsPanelStyle, children: desktopAddonsPanelOpen ? jsx13(
|
|
1349
|
+
AddonsTabs,
|
|
1350
|
+
{
|
|
1351
|
+
storyId: story?.id,
|
|
1352
|
+
parameters: story?.parameters,
|
|
1353
|
+
onClose: () => setDesktopAddonsPanelOpen(!1)
|
|
1354
|
+
}
|
|
1355
|
+
) : jsx13(
|
|
1356
|
+
IconButton4,
|
|
1357
|
+
{
|
|
1358
|
+
style: iconFloatRightStyle,
|
|
1359
|
+
onPress: () => setDesktopAddonsPanelOpen(!0),
|
|
1360
|
+
Icon: BottomBarToggleIcon
|
|
1361
|
+
}
|
|
1362
|
+
) }) : null
|
|
1363
|
+
] }),
|
|
1364
|
+
!uiHidden && !isDesktop ? jsx13(Container3, { style: menuContainerStyle, children: jsxs7(Nav, { children: [
|
|
1365
|
+
jsxs7(
|
|
1366
|
+
Button2,
|
|
1367
|
+
{
|
|
1368
|
+
testID: "mobile-menu-button",
|
|
1369
|
+
style: navButtonStyle,
|
|
1370
|
+
hitSlop: navButtonHitSlop,
|
|
1371
|
+
onPress: openMobileMenu,
|
|
1372
|
+
children: [
|
|
1373
|
+
jsx13(MenuIcon, { color: theme.color.mediumdark }),
|
|
1374
|
+
jsxs7(Text4, { style: navButtonTextStyle, numberOfLines: 1, children: [
|
|
1375
|
+
story?.title,
|
|
1376
|
+
"/",
|
|
1377
|
+
story?.name
|
|
1378
|
+
] })
|
|
1379
|
+
]
|
|
1380
|
+
}
|
|
1381
|
+
),
|
|
1382
|
+
hasEnabledPanels && jsx13(
|
|
1383
|
+
IconButton4,
|
|
1384
|
+
{
|
|
1385
|
+
testID: "mobile-addons-button",
|
|
1386
|
+
onPress: () => addonPanelRef.current?.setAddonsPanelOpen(!0),
|
|
1387
|
+
Icon: BottomBarToggleIcon,
|
|
1388
|
+
accessibilityLabel: "Open addons panel"
|
|
1389
|
+
}
|
|
1390
|
+
)
|
|
1391
|
+
] }) }) : null,
|
|
1392
|
+
isDesktop ? null : jsx13(SelectedNodeProvider, { children: jsxs7(MobileMenuDrawer, { ref: mobileMenuDrawerRef, children: [
|
|
1393
|
+
jsx13(View6, { style: mobileMenuDrawerContentStyle, children: jsx13(StorybookLogo, { theme }) }),
|
|
1394
|
+
jsx13(
|
|
1395
|
+
Sidebar,
|
|
1396
|
+
{
|
|
1397
|
+
previewInitialized: !0,
|
|
1398
|
+
indexError: void 0,
|
|
1399
|
+
refs: placeholderObject,
|
|
1400
|
+
setSelection,
|
|
1401
|
+
status: placeholderObject,
|
|
1402
|
+
index: storyHash,
|
|
1403
|
+
storyId: story?.id,
|
|
1404
|
+
refId: DEFAULT_REF_ID
|
|
1405
|
+
}
|
|
1406
|
+
)
|
|
1407
|
+
] }) }),
|
|
1408
|
+
!isDesktop && hasEnabledPanels ? jsx13(MobileAddonsPanel, { ref: addonPanelRef, storyId: story?.id, parameters: story?.parameters }) : null
|
|
1409
|
+
] });
|
|
1410
|
+
}, Nav = styled9.View({
|
|
1411
|
+
display: "flex",
|
|
1412
|
+
flexDirection: "row",
|
|
1413
|
+
alignItems: "center",
|
|
1414
|
+
justifyContent: "space-between",
|
|
1415
|
+
width: "100%",
|
|
1416
|
+
height: 40,
|
|
1417
|
+
paddingHorizontal: 6
|
|
1418
|
+
}), Container3 = styled9.View(({ theme }) => ({
|
|
1419
|
+
alignSelf: "flex-end",
|
|
1420
|
+
width: "100%",
|
|
1421
|
+
backgroundColor: theme.barBg,
|
|
1422
|
+
borderTopColor: theme.appBorderColor,
|
|
1423
|
+
borderTopWidth: 1
|
|
1424
|
+
})), Button2 = styled9.TouchableOpacity(({ theme }) => ({
|
|
1425
|
+
display: "flex",
|
|
1426
|
+
flexDirection: "row",
|
|
1427
|
+
alignItems: "center",
|
|
1428
|
+
gap: 10,
|
|
1429
|
+
color: theme.color.mediumdark,
|
|
1430
|
+
fontSize: theme.typography.size?.s2 - 1,
|
|
1431
|
+
paddingHorizontal: 7,
|
|
1432
|
+
fontWeight: theme.typography.weight.bold
|
|
1433
|
+
}));
|
|
1434
|
+
export {
|
|
1435
|
+
ComponentNode,
|
|
1436
|
+
Explorer,
|
|
1437
|
+
FullUI,
|
|
1438
|
+
GroupNode,
|
|
1439
|
+
Layout,
|
|
1440
|
+
LeafNodeStyleWrapper,
|
|
1441
|
+
Node,
|
|
1442
|
+
RootNode,
|
|
1443
|
+
RootNodeText,
|
|
1444
|
+
Sidebar,
|
|
1445
|
+
StoryNode,
|
|
1446
|
+
Tree,
|
|
1447
|
+
useCombination
|
|
1448
|
+
};
|