@forgeax/view 0.2.1-beta-20260924075842
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/CHANGELOG.md +11 -0
- package/README.md +742 -0
- package/dist/modules/backend.mjs +54 -0
- package/dist/modules/backend.mjs.map +7 -0
- package/dist/modules/browser.mjs +180 -0
- package/dist/modules/browser.mjs.map +7 -0
- package/dist/modules/carrier-contract.mjs +38 -0
- package/dist/modules/carrier-contract.mjs.map +7 -0
- package/dist/modules/carrier.mjs +13 -0
- package/dist/modules/carrier.mjs.map +7 -0
- package/dist/modules/chunks/chunk-2ASWB6IX.mjs +225 -0
- package/dist/modules/chunks/chunk-2ASWB6IX.mjs.map +7 -0
- package/dist/modules/chunks/chunk-2IJKOG2F.mjs +801 -0
- package/dist/modules/chunks/chunk-2IJKOG2F.mjs.map +7 -0
- package/dist/modules/chunks/chunk-2K3BBJ5S.mjs +9 -0
- package/dist/modules/chunks/chunk-2K3BBJ5S.mjs.map +7 -0
- package/dist/modules/chunks/chunk-32GD5LL6.mjs +482 -0
- package/dist/modules/chunks/chunk-32GD5LL6.mjs.map +7 -0
- package/dist/modules/chunks/chunk-3B4KFAEC.mjs +10 -0
- package/dist/modules/chunks/chunk-3B4KFAEC.mjs.map +7 -0
- package/dist/modules/chunks/chunk-46O5WX43.mjs +25 -0
- package/dist/modules/chunks/chunk-46O5WX43.mjs.map +7 -0
- package/dist/modules/chunks/chunk-47J5JXAB.mjs +237 -0
- package/dist/modules/chunks/chunk-47J5JXAB.mjs.map +7 -0
- package/dist/modules/chunks/chunk-4BXQOUDQ.mjs +17 -0
- package/dist/modules/chunks/chunk-4BXQOUDQ.mjs.map +7 -0
- package/dist/modules/chunks/chunk-4GQWYU2V.mjs +126 -0
- package/dist/modules/chunks/chunk-4GQWYU2V.mjs.map +7 -0
- package/dist/modules/chunks/chunk-4N5X2PRQ.mjs +48 -0
- package/dist/modules/chunks/chunk-4N5X2PRQ.mjs.map +7 -0
- package/dist/modules/chunks/chunk-4WXD2KYX.mjs +56 -0
- package/dist/modules/chunks/chunk-4WXD2KYX.mjs.map +7 -0
- package/dist/modules/chunks/chunk-6ZWWVAZK.mjs +468 -0
- package/dist/modules/chunks/chunk-6ZWWVAZK.mjs.map +7 -0
- package/dist/modules/chunks/chunk-73UZNRHN.mjs +296 -0
- package/dist/modules/chunks/chunk-73UZNRHN.mjs.map +7 -0
- package/dist/modules/chunks/chunk-7ITLCRND.mjs +10 -0
- package/dist/modules/chunks/chunk-7ITLCRND.mjs.map +7 -0
- package/dist/modules/chunks/chunk-7TGVWKH7.mjs +59 -0
- package/dist/modules/chunks/chunk-7TGVWKH7.mjs.map +7 -0
- package/dist/modules/chunks/chunk-7URFF53W.mjs +42 -0
- package/dist/modules/chunks/chunk-7URFF53W.mjs.map +7 -0
- package/dist/modules/chunks/chunk-7YSDRIFN.mjs +14 -0
- package/dist/modules/chunks/chunk-7YSDRIFN.mjs.map +7 -0
- package/dist/modules/chunks/chunk-AAFVCQPK.mjs +52 -0
- package/dist/modules/chunks/chunk-AAFVCQPK.mjs.map +7 -0
- package/dist/modules/chunks/chunk-AEK7ZESQ.mjs +18 -0
- package/dist/modules/chunks/chunk-AEK7ZESQ.mjs.map +7 -0
- package/dist/modules/chunks/chunk-AL6ZWIEU.mjs +42 -0
- package/dist/modules/chunks/chunk-AL6ZWIEU.mjs.map +7 -0
- package/dist/modules/chunks/chunk-ALT7XVMQ.mjs +73 -0
- package/dist/modules/chunks/chunk-ALT7XVMQ.mjs.map +7 -0
- package/dist/modules/chunks/chunk-ASI2HBE6.mjs +116 -0
- package/dist/modules/chunks/chunk-ASI2HBE6.mjs.map +7 -0
- package/dist/modules/chunks/chunk-ATWGCH7I.mjs +174 -0
- package/dist/modules/chunks/chunk-ATWGCH7I.mjs.map +7 -0
- package/dist/modules/chunks/chunk-C45U6IIY.mjs +692 -0
- package/dist/modules/chunks/chunk-C45U6IIY.mjs.map +7 -0
- package/dist/modules/chunks/chunk-C7R3YRA7.mjs +98 -0
- package/dist/modules/chunks/chunk-C7R3YRA7.mjs.map +7 -0
- package/dist/modules/chunks/chunk-CRMICXKN.mjs +87 -0
- package/dist/modules/chunks/chunk-CRMICXKN.mjs.map +7 -0
- package/dist/modules/chunks/chunk-CUH2G6UF.mjs +81 -0
- package/dist/modules/chunks/chunk-CUH2G6UF.mjs.map +7 -0
- package/dist/modules/chunks/chunk-D7GWRZLL.mjs +77 -0
- package/dist/modules/chunks/chunk-D7GWRZLL.mjs.map +7 -0
- package/dist/modules/chunks/chunk-DBWUIBE3.mjs +10 -0
- package/dist/modules/chunks/chunk-DBWUIBE3.mjs.map +7 -0
- package/dist/modules/chunks/chunk-DQWVWWUU.mjs +77 -0
- package/dist/modules/chunks/chunk-DQWVWWUU.mjs.map +7 -0
- package/dist/modules/chunks/chunk-DZZ2WFEU.mjs +122 -0
- package/dist/modules/chunks/chunk-DZZ2WFEU.mjs.map +7 -0
- package/dist/modules/chunks/chunk-E4UIAN26.mjs +58 -0
- package/dist/modules/chunks/chunk-E4UIAN26.mjs.map +7 -0
- package/dist/modules/chunks/chunk-EJGBVKFE.mjs +77 -0
- package/dist/modules/chunks/chunk-EJGBVKFE.mjs.map +7 -0
- package/dist/modules/chunks/chunk-EPSTTHWV.mjs +173 -0
- package/dist/modules/chunks/chunk-EPSTTHWV.mjs.map +7 -0
- package/dist/modules/chunks/chunk-ER7T6QJ3.mjs +64 -0
- package/dist/modules/chunks/chunk-ER7T6QJ3.mjs.map +7 -0
- package/dist/modules/chunks/chunk-FD4BAJ6K.mjs +389 -0
- package/dist/modules/chunks/chunk-FD4BAJ6K.mjs.map +7 -0
- package/dist/modules/chunks/chunk-FJM6WWIY.mjs +80 -0
- package/dist/modules/chunks/chunk-FJM6WWIY.mjs.map +7 -0
- package/dist/modules/chunks/chunk-FKCQYDLX.mjs +162 -0
- package/dist/modules/chunks/chunk-FKCQYDLX.mjs.map +7 -0
- package/dist/modules/chunks/chunk-FLGC65SR.mjs +10 -0
- package/dist/modules/chunks/chunk-FLGC65SR.mjs.map +7 -0
- package/dist/modules/chunks/chunk-FMCACPX5.mjs +289 -0
- package/dist/modules/chunks/chunk-FMCACPX5.mjs.map +7 -0
- package/dist/modules/chunks/chunk-FOBRLUQV.mjs +51 -0
- package/dist/modules/chunks/chunk-FOBRLUQV.mjs.map +7 -0
- package/dist/modules/chunks/chunk-FV3DSKZB.mjs +33 -0
- package/dist/modules/chunks/chunk-FV3DSKZB.mjs.map +7 -0
- package/dist/modules/chunks/chunk-G7BAFAGO.mjs +98 -0
- package/dist/modules/chunks/chunk-G7BAFAGO.mjs.map +7 -0
- package/dist/modules/chunks/chunk-GQBZMCTK.mjs +145 -0
- package/dist/modules/chunks/chunk-GQBZMCTK.mjs.map +7 -0
- package/dist/modules/chunks/chunk-GYWIY7AL.mjs +131 -0
- package/dist/modules/chunks/chunk-GYWIY7AL.mjs.map +7 -0
- package/dist/modules/chunks/chunk-H3KNBALD.mjs +256 -0
- package/dist/modules/chunks/chunk-H3KNBALD.mjs.map +7 -0
- package/dist/modules/chunks/chunk-H3M22JDL.mjs +144 -0
- package/dist/modules/chunks/chunk-H3M22JDL.mjs.map +7 -0
- package/dist/modules/chunks/chunk-HES3DNTM.mjs +40 -0
- package/dist/modules/chunks/chunk-HES3DNTM.mjs.map +7 -0
- package/dist/modules/chunks/chunk-I5BFP7SS.mjs +2392 -0
- package/dist/modules/chunks/chunk-I5BFP7SS.mjs.map +7 -0
- package/dist/modules/chunks/chunk-IGRMZYRD.mjs +15 -0
- package/dist/modules/chunks/chunk-IGRMZYRD.mjs.map +7 -0
- package/dist/modules/chunks/chunk-IKNGC766.mjs +321 -0
- package/dist/modules/chunks/chunk-IKNGC766.mjs.map +7 -0
- package/dist/modules/chunks/chunk-IVHNYKZB.mjs +35 -0
- package/dist/modules/chunks/chunk-IVHNYKZB.mjs.map +7 -0
- package/dist/modules/chunks/chunk-JHOURMYW.mjs +101 -0
- package/dist/modules/chunks/chunk-JHOURMYW.mjs.map +7 -0
- package/dist/modules/chunks/chunk-JURXMRFA.mjs +282 -0
- package/dist/modules/chunks/chunk-JURXMRFA.mjs.map +7 -0
- package/dist/modules/chunks/chunk-JWZIREC3.mjs +18 -0
- package/dist/modules/chunks/chunk-JWZIREC3.mjs.map +7 -0
- package/dist/modules/chunks/chunk-KHRTIZ56.mjs +1400 -0
- package/dist/modules/chunks/chunk-KHRTIZ56.mjs.map +7 -0
- package/dist/modules/chunks/chunk-KLJZZ23J.mjs +102 -0
- package/dist/modules/chunks/chunk-KLJZZ23J.mjs.map +7 -0
- package/dist/modules/chunks/chunk-KNBAYU5I.mjs +49 -0
- package/dist/modules/chunks/chunk-KNBAYU5I.mjs.map +7 -0
- package/dist/modules/chunks/chunk-KSZNCFU4.mjs +125 -0
- package/dist/modules/chunks/chunk-KSZNCFU4.mjs.map +7 -0
- package/dist/modules/chunks/chunk-L45W6KM6.mjs +158 -0
- package/dist/modules/chunks/chunk-L45W6KM6.mjs.map +7 -0
- package/dist/modules/chunks/chunk-LERMYZRC.mjs +239 -0
- package/dist/modules/chunks/chunk-LERMYZRC.mjs.map +7 -0
- package/dist/modules/chunks/chunk-LKJCXYSJ.mjs +91 -0
- package/dist/modules/chunks/chunk-LKJCXYSJ.mjs.map +7 -0
- package/dist/modules/chunks/chunk-MBS3EICT.mjs +25 -0
- package/dist/modules/chunks/chunk-MBS3EICT.mjs.map +7 -0
- package/dist/modules/chunks/chunk-MUOQZPVH.mjs +609 -0
- package/dist/modules/chunks/chunk-MUOQZPVH.mjs.map +7 -0
- package/dist/modules/chunks/chunk-MVEPGFSB.mjs +1 -0
- package/dist/modules/chunks/chunk-MVEPGFSB.mjs.map +7 -0
- package/dist/modules/chunks/chunk-NBJKLWJ5.mjs +42 -0
- package/dist/modules/chunks/chunk-NBJKLWJ5.mjs.map +7 -0
- package/dist/modules/chunks/chunk-NBLGKTEM.mjs +86 -0
- package/dist/modules/chunks/chunk-NBLGKTEM.mjs.map +7 -0
- package/dist/modules/chunks/chunk-NI7CS3I2.mjs +110 -0
- package/dist/modules/chunks/chunk-NI7CS3I2.mjs.map +7 -0
- package/dist/modules/chunks/chunk-NJH2OJFC.mjs +2113 -0
- package/dist/modules/chunks/chunk-NJH2OJFC.mjs.map +7 -0
- package/dist/modules/chunks/chunk-OBK4LIJB.mjs +20 -0
- package/dist/modules/chunks/chunk-OBK4LIJB.mjs.map +7 -0
- package/dist/modules/chunks/chunk-PEUT3FW7.mjs +1 -0
- package/dist/modules/chunks/chunk-PEUT3FW7.mjs.map +7 -0
- package/dist/modules/chunks/chunk-PRZOWPDN.mjs +66 -0
- package/dist/modules/chunks/chunk-PRZOWPDN.mjs.map +7 -0
- package/dist/modules/chunks/chunk-Q4RXBGQS.mjs +55 -0
- package/dist/modules/chunks/chunk-Q4RXBGQS.mjs.map +7 -0
- package/dist/modules/chunks/chunk-QBHBKOIL.mjs +55 -0
- package/dist/modules/chunks/chunk-QBHBKOIL.mjs.map +7 -0
- package/dist/modules/chunks/chunk-QD6CCRMG.mjs +20 -0
- package/dist/modules/chunks/chunk-QD6CCRMG.mjs.map +7 -0
- package/dist/modules/chunks/chunk-QF4V23GW.mjs +39 -0
- package/dist/modules/chunks/chunk-QF4V23GW.mjs.map +7 -0
- package/dist/modules/chunks/chunk-QK6W7MJO.mjs +42 -0
- package/dist/modules/chunks/chunk-QK6W7MJO.mjs.map +7 -0
- package/dist/modules/chunks/chunk-QL7V6DK7.mjs +34 -0
- package/dist/modules/chunks/chunk-QL7V6DK7.mjs.map +7 -0
- package/dist/modules/chunks/chunk-QLBQQKRI.mjs +25 -0
- package/dist/modules/chunks/chunk-QLBQQKRI.mjs.map +7 -0
- package/dist/modules/chunks/chunk-QLZQGZDC.mjs +418 -0
- package/dist/modules/chunks/chunk-QLZQGZDC.mjs.map +7 -0
- package/dist/modules/chunks/chunk-QSKQZGK7.mjs +1625 -0
- package/dist/modules/chunks/chunk-QSKQZGK7.mjs.map +7 -0
- package/dist/modules/chunks/chunk-QURKBAG4.mjs +25 -0
- package/dist/modules/chunks/chunk-QURKBAG4.mjs.map +7 -0
- package/dist/modules/chunks/chunk-R274XBEH.mjs +53 -0
- package/dist/modules/chunks/chunk-R274XBEH.mjs.map +7 -0
- package/dist/modules/chunks/chunk-R4I4JEY5.mjs +77 -0
- package/dist/modules/chunks/chunk-R4I4JEY5.mjs.map +7 -0
- package/dist/modules/chunks/chunk-RR6L6VVR.mjs +9 -0
- package/dist/modules/chunks/chunk-RR6L6VVR.mjs.map +7 -0
- package/dist/modules/chunks/chunk-RXF7SBBZ.mjs +125 -0
- package/dist/modules/chunks/chunk-RXF7SBBZ.mjs.map +7 -0
- package/dist/modules/chunks/chunk-SR66S6EJ.mjs +138 -0
- package/dist/modules/chunks/chunk-SR66S6EJ.mjs.map +7 -0
- package/dist/modules/chunks/chunk-SSQMQJ52.mjs +27 -0
- package/dist/modules/chunks/chunk-SSQMQJ52.mjs.map +7 -0
- package/dist/modules/chunks/chunk-TP26TASL.mjs +20 -0
- package/dist/modules/chunks/chunk-TP26TASL.mjs.map +7 -0
- package/dist/modules/chunks/chunk-TSAEK5P3.mjs +50 -0
- package/dist/modules/chunks/chunk-TSAEK5P3.mjs.map +7 -0
- package/dist/modules/chunks/chunk-UAY27HT3.mjs +68 -0
- package/dist/modules/chunks/chunk-UAY27HT3.mjs.map +7 -0
- package/dist/modules/chunks/chunk-UDLIWGWS.mjs +103 -0
- package/dist/modules/chunks/chunk-UDLIWGWS.mjs.map +7 -0
- package/dist/modules/chunks/chunk-UDVQHPWV.mjs +89 -0
- package/dist/modules/chunks/chunk-UDVQHPWV.mjs.map +7 -0
- package/dist/modules/chunks/chunk-UM23W3G7.mjs +237 -0
- package/dist/modules/chunks/chunk-UM23W3G7.mjs.map +7 -0
- package/dist/modules/chunks/chunk-VDZJWEAA.mjs +214 -0
- package/dist/modules/chunks/chunk-VDZJWEAA.mjs.map +7 -0
- package/dist/modules/chunks/chunk-VIGOJWSO.mjs +42 -0
- package/dist/modules/chunks/chunk-VIGOJWSO.mjs.map +7 -0
- package/dist/modules/chunks/chunk-VY3S5BWI.mjs +284 -0
- package/dist/modules/chunks/chunk-VY3S5BWI.mjs.map +7 -0
- package/dist/modules/chunks/chunk-VZXGRZYU.mjs +47 -0
- package/dist/modules/chunks/chunk-VZXGRZYU.mjs.map +7 -0
- package/dist/modules/chunks/chunk-W5DMQZB5.mjs +42 -0
- package/dist/modules/chunks/chunk-W5DMQZB5.mjs.map +7 -0
- package/dist/modules/chunks/chunk-WOMHSTVZ.mjs +918 -0
- package/dist/modules/chunks/chunk-WOMHSTVZ.mjs.map +7 -0
- package/dist/modules/chunks/chunk-XFQT7XCG.mjs +42 -0
- package/dist/modules/chunks/chunk-XFQT7XCG.mjs.map +7 -0
- package/dist/modules/chunks/chunk-XJZEVRYX.mjs +98 -0
- package/dist/modules/chunks/chunk-XJZEVRYX.mjs.map +7 -0
- package/dist/modules/chunks/chunk-XUYFV23R.mjs +317 -0
- package/dist/modules/chunks/chunk-XUYFV23R.mjs.map +7 -0
- package/dist/modules/chunks/chunk-Y5HXCPPQ.mjs +58 -0
- package/dist/modules/chunks/chunk-Y5HXCPPQ.mjs.map +7 -0
- package/dist/modules/chunks/chunk-YTHGRKGI.mjs +147 -0
- package/dist/modules/chunks/chunk-YTHGRKGI.mjs.map +7 -0
- package/dist/modules/chunks/chunk-YVQSDKAO.mjs +341 -0
- package/dist/modules/chunks/chunk-YVQSDKAO.mjs.map +7 -0
- package/dist/modules/chunks/chunk-YYXQDUVT.mjs +123 -0
- package/dist/modules/chunks/chunk-YYXQDUVT.mjs.map +7 -0
- package/dist/modules/chunks/chunk-ZFXZ2NUI.mjs +142 -0
- package/dist/modules/chunks/chunk-ZFXZ2NUI.mjs.map +7 -0
- package/dist/modules/chunks/chunk-ZLNWF4ET.mjs +9 -0
- package/dist/modules/chunks/chunk-ZLNWF4ET.mjs.map +7 -0
- package/dist/modules/chunks/chunk-ZLU5QW2O.mjs +9 -0
- package/dist/modules/chunks/chunk-ZLU5QW2O.mjs.map +7 -0
- package/dist/modules/chunks/chunk-ZNZPYE2V.mjs +28 -0
- package/dist/modules/chunks/chunk-ZNZPYE2V.mjs.map +7 -0
- package/dist/modules/chunks/core-564N45MO.mjs +7480 -0
- package/dist/modules/chunks/core-564N45MO.mjs.map +7 -0
- package/dist/modules/chunks/css-BKH4SVJG.mjs +8 -0
- package/dist/modules/chunks/css-BKH4SVJG.mjs.map +7 -0
- package/dist/modules/chunks/engine-javascript-PDVIGNGR.mjs +3241 -0
- package/dist/modules/chunks/engine-javascript-PDVIGNGR.mjs.map +7 -0
- package/dist/modules/chunks/github-dark-default-6HVTHEWF.mjs +8 -0
- package/dist/modules/chunks/github-dark-default-6HVTHEWF.mjs.map +7 -0
- package/dist/modules/chunks/github-light-default-LAXRA6XL.mjs +8 -0
- package/dist/modules/chunks/github-light-default-LAXRA6XL.mjs.map +7 -0
- package/dist/modules/chunks/glsl-UC3YWUD2.mjs +18 -0
- package/dist/modules/chunks/glsl-UC3YWUD2.mjs.map +7 -0
- package/dist/modules/chunks/html-FRVIUV63.mjs +19 -0
- package/dist/modules/chunks/html-FRVIUV63.mjs.map +7 -0
- package/dist/modules/chunks/javascript-LN3OC7S2.mjs +8 -0
- package/dist/modules/chunks/javascript-LN3OC7S2.mjs.map +7 -0
- package/dist/modules/chunks/json-5CUGWTOP.mjs +11 -0
- package/dist/modules/chunks/json-5CUGWTOP.mjs.map +7 -0
- package/dist/modules/chunks/json5-YZQI5VNO.mjs +11 -0
- package/dist/modules/chunks/json5-YZQI5VNO.mjs.map +7 -0
- package/dist/modules/chunks/jsonc-SWID6VOZ.mjs +11 -0
- package/dist/modules/chunks/jsonc-SWID6VOZ.mjs.map +7 -0
- package/dist/modules/chunks/jsx-A7RDCLJO.mjs +11 -0
- package/dist/modules/chunks/jsx-A7RDCLJO.mjs.map +7 -0
- package/dist/modules/chunks/markdown-QTCU5KP5.mjs +11 -0
- package/dist/modules/chunks/markdown-QTCU5KP5.mjs.map +7 -0
- package/dist/modules/chunks/python-LAZONBIB.mjs +11 -0
- package/dist/modules/chunks/python-LAZONBIB.mjs.map +7 -0
- package/dist/modules/chunks/rust-XWTPJFJO.mjs +11 -0
- package/dist/modules/chunks/rust-XWTPJFJO.mjs.map +7 -0
- package/dist/modules/chunks/scss-CFXRHUUW.mjs +15 -0
- package/dist/modules/chunks/scss-CFXRHUUW.mjs.map +7 -0
- package/dist/modules/chunks/shellscript-OHO3LCVU.mjs +11 -0
- package/dist/modules/chunks/shellscript-OHO3LCVU.mjs.map +7 -0
- package/dist/modules/chunks/toml-IOHFZJ5B.mjs +11 -0
- package/dist/modules/chunks/toml-IOHFZJ5B.mjs.map +7 -0
- package/dist/modules/chunks/tsx-2E6WNX2E.mjs +11 -0
- package/dist/modules/chunks/tsx-2E6WNX2E.mjs.map +7 -0
- package/dist/modules/chunks/typescript-PBKAS54P.mjs +11 -0
- package/dist/modules/chunks/typescript-PBKAS54P.mjs.map +7 -0
- package/dist/modules/chunks/wgsl-PS6QPRLZ.mjs +11 -0
- package/dist/modules/chunks/wgsl-PS6QPRLZ.mjs.map +7 -0
- package/dist/modules/chunks/xml-JECR2ACB.mjs +18 -0
- package/dist/modules/chunks/xml-JECR2ACB.mjs.map +7 -0
- package/dist/modules/chunks/yaml-P2SV4LOE.mjs +11 -0
- package/dist/modules/chunks/yaml-P2SV4LOE.mjs.map +7 -0
- package/dist/modules/cli-contributions.mjs +32 -0
- package/dist/modules/cli-contributions.mjs.map +7 -0
- package/dist/modules/cli.mjs +14 -0
- package/dist/modules/cli.mjs.map +7 -0
- package/dist/modules/command-executor.mjs +65 -0
- package/dist/modules/command-executor.mjs.map +7 -0
- package/dist/modules/commands.mjs +10 -0
- package/dist/modules/commands.mjs.map +7 -0
- package/dist/modules/embedded.mjs +18608 -0
- package/dist/modules/embedded.mjs.map +7 -0
- package/dist/modules/extension-bridge.mjs +18 -0
- package/dist/modules/extension-bridge.mjs.map +7 -0
- package/dist/modules/frontend-root.mjs +61 -0
- package/dist/modules/frontend-root.mjs.map +7 -0
- package/dist/modules/index.mjs +784 -0
- package/dist/modules/index.mjs.map +7 -0
- package/dist/modules/page.mjs +45 -0
- package/dist/modules/page.mjs.map +7 -0
- package/dist/modules/pages/scene.mjs +18 -0
- package/dist/modules/pages/scene.mjs.map +7 -0
- package/dist/modules/plugin.mjs +56 -0
- package/dist/modules/plugin.mjs.map +7 -0
- package/dist/modules/plugins/asset/frontend.mjs +23 -0
- package/dist/modules/plugins/asset/frontend.mjs.map +7 -0
- package/dist/modules/plugins/asset/i18n.mjs +15 -0
- package/dist/modules/plugins/asset/i18n.mjs.map +7 -0
- package/dist/modules/plugins/asset/identity.mjs +42 -0
- package/dist/modules/plugins/asset/identity.mjs.map +7 -0
- package/dist/modules/plugins/asset/schema.mjs +10 -0
- package/dist/modules/plugins/asset/schema.mjs.map +7 -0
- package/dist/modules/plugins/asset/ui.mjs +16 -0
- package/dist/modules/plugins/asset/ui.mjs.map +7 -0
- package/dist/modules/plugins/content-browser/frontend.mjs +17 -0
- package/dist/modules/plugins/content-browser/frontend.mjs.map +7 -0
- package/dist/modules/plugins/content-browser/i18n.mjs +15 -0
- package/dist/modules/plugins/content-browser/i18n.mjs.map +7 -0
- package/dist/modules/plugins/content-browser/identity.mjs +22 -0
- package/dist/modules/plugins/content-browser/identity.mjs.map +7 -0
- package/dist/modules/plugins/content-browser/schema.mjs +12 -0
- package/dist/modules/plugins/content-browser/schema.mjs.map +7 -0
- package/dist/modules/plugins/content-browser/ui.mjs +15 -0
- package/dist/modules/plugins/content-browser/ui.mjs.map +7 -0
- package/dist/modules/plugins/display/api.mjs +10 -0
- package/dist/modules/plugins/display/api.mjs.map +7 -0
- package/dist/modules/plugins/display/backend.mjs +16 -0
- package/dist/modules/plugins/display/backend.mjs.map +7 -0
- package/dist/modules/plugins/display/carrier-contract.mjs +38 -0
- package/dist/modules/plugins/display/carrier-contract.mjs.map +7 -0
- package/dist/modules/plugins/display/carrier.mjs +13 -0
- package/dist/modules/plugins/display/carrier.mjs.map +7 -0
- package/dist/modules/plugins/display/effects.mjs +8 -0
- package/dist/modules/plugins/display/effects.mjs.map +7 -0
- package/dist/modules/plugins/display/frontend.mjs +14 -0
- package/dist/modules/plugins/display/frontend.mjs.map +7 -0
- package/dist/modules/plugins/display/i18n.mjs +58 -0
- package/dist/modules/plugins/display/i18n.mjs.map +7 -0
- package/dist/modules/plugins/display/identity.mjs +30 -0
- package/dist/modules/plugins/display/identity.mjs.map +7 -0
- package/dist/modules/plugins/display/page-broker.mjs +12 -0
- package/dist/modules/plugins/display/page-broker.mjs.map +7 -0
- package/dist/modules/plugins/display/schema.mjs +40 -0
- package/dist/modules/plugins/display/schema.mjs.map +7 -0
- package/dist/modules/plugins/display/ui.mjs +9 -0
- package/dist/modules/plugins/display/ui.mjs.map +7 -0
- package/dist/modules/plugins/inspector/frontend.mjs +17 -0
- package/dist/modules/plugins/inspector/frontend.mjs.map +7 -0
- package/dist/modules/plugins/inspector/i18n.mjs +15 -0
- package/dist/modules/plugins/inspector/i18n.mjs.map +7 -0
- package/dist/modules/plugins/inspector/identity.mjs +22 -0
- package/dist/modules/plugins/inspector/identity.mjs.map +7 -0
- package/dist/modules/plugins/inspector/schema.mjs +12 -0
- package/dist/modules/plugins/inspector/schema.mjs.map +7 -0
- package/dist/modules/plugins/inspector/ui.mjs +16 -0
- package/dist/modules/plugins/inspector/ui.mjs.map +7 -0
- package/dist/modules/plugins/material/frontend.mjs +25 -0
- package/dist/modules/plugins/material/frontend.mjs.map +7 -0
- package/dist/modules/plugins/material/i18n.mjs +15 -0
- package/dist/modules/plugins/material/i18n.mjs.map +7 -0
- package/dist/modules/plugins/material/identity.mjs +60 -0
- package/dist/modules/plugins/material/identity.mjs.map +7 -0
- package/dist/modules/plugins/material/schema.mjs +47 -0
- package/dist/modules/plugins/material/schema.mjs.map +7 -0
- package/dist/modules/plugins/material/ui.mjs +28 -0
- package/dist/modules/plugins/material/ui.mjs.map +7 -0
- package/dist/modules/plugins/mesh/frontend.mjs +23 -0
- package/dist/modules/plugins/mesh/frontend.mjs.map +7 -0
- package/dist/modules/plugins/mesh/i18n.mjs +15 -0
- package/dist/modules/plugins/mesh/i18n.mjs.map +7 -0
- package/dist/modules/plugins/mesh/identity.mjs +54 -0
- package/dist/modules/plugins/mesh/identity.mjs.map +7 -0
- package/dist/modules/plugins/mesh/schema.mjs +10 -0
- package/dist/modules/plugins/mesh/schema.mjs.map +7 -0
- package/dist/modules/plugins/mesh/ui.mjs +26 -0
- package/dist/modules/plugins/mesh/ui.mjs.map +7 -0
- package/dist/modules/plugins/plugins/api.mjs +11 -0
- package/dist/modules/plugins/plugins/api.mjs.map +7 -0
- package/dist/modules/plugins/plugins/backend.mjs +21 -0
- package/dist/modules/plugins/plugins/backend.mjs.map +7 -0
- package/dist/modules/plugins/plugins/cli.mjs +12 -0
- package/dist/modules/plugins/plugins/cli.mjs.map +7 -0
- package/dist/modules/plugins/plugins/frontend.mjs +17 -0
- package/dist/modules/plugins/plugins/frontend.mjs.map +7 -0
- package/dist/modules/plugins/plugins/i18n.mjs +15 -0
- package/dist/modules/plugins/plugins/i18n.mjs.map +7 -0
- package/dist/modules/plugins/plugins/identity.mjs +26 -0
- package/dist/modules/plugins/plugins/identity.mjs.map +7 -0
- package/dist/modules/plugins/plugins/runtime.mjs +50 -0
- package/dist/modules/plugins/plugins/runtime.mjs.map +7 -0
- package/dist/modules/plugins/plugins/schema.mjs +12 -0
- package/dist/modules/plugins/plugins/schema.mjs.map +7 -0
- package/dist/modules/plugins/plugins/ui/panel.mjs +14 -0
- package/dist/modules/plugins/plugins/ui/panel.mjs.map +7 -0
- package/dist/modules/plugins/plugins/ui.mjs +15 -0
- package/dist/modules/plugins/plugins/ui.mjs.map +7 -0
- package/dist/modules/plugins/scene/frontend.mjs +18 -0
- package/dist/modules/plugins/scene/frontend.mjs.map +7 -0
- package/dist/modules/plugins/scene/identity.mjs +14 -0
- package/dist/modules/plugins/scene/identity.mjs.map +7 -0
- package/dist/modules/plugins/scene-tree/frontend.mjs +17 -0
- package/dist/modules/plugins/scene-tree/frontend.mjs.map +7 -0
- package/dist/modules/plugins/scene-tree/i18n.mjs +15 -0
- package/dist/modules/plugins/scene-tree/i18n.mjs.map +7 -0
- package/dist/modules/plugins/scene-tree/identity.mjs +22 -0
- package/dist/modules/plugins/scene-tree/identity.mjs.map +7 -0
- package/dist/modules/plugins/scene-tree/schema.mjs +12 -0
- package/dist/modules/plugins/scene-tree/schema.mjs.map +7 -0
- package/dist/modules/plugins/scene-tree/ui.mjs +16 -0
- package/dist/modules/plugins/scene-tree/ui.mjs.map +7 -0
- package/dist/modules/plugins/texture/frontend.mjs +23 -0
- package/dist/modules/plugins/texture/frontend.mjs.map +7 -0
- package/dist/modules/plugins/texture/i18n.mjs +15 -0
- package/dist/modules/plugins/texture/i18n.mjs.map +7 -0
- package/dist/modules/plugins/texture/identity.mjs +54 -0
- package/dist/modules/plugins/texture/identity.mjs.map +7 -0
- package/dist/modules/plugins/texture/schema.mjs +10 -0
- package/dist/modules/plugins/texture/schema.mjs.map +7 -0
- package/dist/modules/plugins/texture/ui.mjs +26 -0
- package/dist/modules/plugins/texture/ui.mjs.map +7 -0
- package/dist/modules/plugins/viewport/frontend.mjs +27 -0
- package/dist/modules/plugins/viewport/frontend.mjs.map +7 -0
- package/dist/modules/plugins/viewport/identity.mjs +28 -0
- package/dist/modules/plugins/viewport/identity.mjs.map +7 -0
- package/dist/modules/plugins/viewport/presentation-identity.mjs +10 -0
- package/dist/modules/plugins/viewport/presentation-identity.mjs.map +7 -0
- package/dist/modules/plugins/viewport/presentation.mjs +18 -0
- package/dist/modules/plugins/viewport/presentation.mjs.map +7 -0
- package/dist/modules/plugins/viewport/schema.mjs +18 -0
- package/dist/modules/plugins/viewport/schema.mjs.map +7 -0
- package/dist/modules/plugins/viewport/workspace-shell.mjs +29 -0
- package/dist/modules/plugins/viewport/workspace-shell.mjs.map +7 -0
- package/dist/modules/shell/contract.mjs +10 -0
- package/dist/modules/shell/contract.mjs.map +7 -0
- package/dist/modules/shell/frontend.mjs +14 -0
- package/dist/modules/shell/frontend.mjs.map +7 -0
- package/dist/modules/shell/layout-zones.mjs +20 -0
- package/dist/modules/shell/layout-zones.mjs.map +7 -0
- package/dist/modules/start-cli.mjs +57 -0
- package/dist/modules/start-cli.mjs.map +7 -0
- package/dist/modules/start.mjs +18 -0
- package/dist/modules/start.mjs.map +7 -0
- package/dist/modules/viewer/catalog/backend.mjs +47 -0
- package/dist/modules/viewer/catalog/backend.mjs.map +7 -0
- package/dist/modules/viewer/catalog/frontend.mjs +55 -0
- package/dist/modules/viewer/catalog/frontend.mjs.map +7 -0
- package/dist/modules/viewer/catalog/shared.mjs +43 -0
- package/dist/modules/viewer/catalog/shared.mjs.map +7 -0
- package/dist/modules/viewer/catalog.mjs +85 -0
- package/dist/modules/viewer/catalog.mjs.map +7 -0
- package/dist/modules/viewer/cli.mjs +23 -0
- package/dist/modules/viewer/cli.mjs.map +7 -0
- package/dist/modules/viewer-host/frontend.mjs +65 -0
- package/dist/modules/viewer-host/frontend.mjs.map +7 -0
- package/dist/modules/viewer-host/page-registry.mjs +27 -0
- package/dist/modules/viewer-host/page-registry.mjs.map +7 -0
- package/dist/modules/viewer-host/slot-registry.mjs +8 -0
- package/dist/modules/viewer-host/slot-registry.mjs.map +7 -0
- package/dist/modules/viewer-host.mjs +43 -0
- package/dist/modules/viewer-host.mjs.map +7 -0
- package/dist/modules/viewer.mjs +85 -0
- package/dist/modules/viewer.mjs.map +7 -0
- package/dist/modules/workspace/adopt-surface.mjs +16 -0
- package/dist/modules/workspace/adopt-surface.mjs.map +7 -0
- package/dist/modules/workspace/api.mjs +8 -0
- package/dist/modules/workspace/api.mjs.map +7 -0
- package/dist/modules/workspace/backend.mjs +23 -0
- package/dist/modules/workspace/backend.mjs.map +7 -0
- package/dist/modules/workspace/broker.mjs +16 -0
- package/dist/modules/workspace/broker.mjs.map +7 -0
- package/dist/modules/workspace/cli.mjs +9 -0
- package/dist/modules/workspace/cli.mjs.map +7 -0
- package/dist/modules/workspace/client.mjs +15 -0
- package/dist/modules/workspace/client.mjs.map +7 -0
- package/dist/modules/workspace/command-error.mjs +16 -0
- package/dist/modules/workspace/command-error.mjs.map +7 -0
- package/dist/modules/workspace/contract.mjs +71 -0
- package/dist/modules/workspace/contract.mjs.map +7 -0
- package/dist/modules/workspace/demo-client.mjs +127 -0
- package/dist/modules/workspace/demo-client.mjs.map +7 -0
- package/dist/modules/workspace/engine-adapter.mjs +16 -0
- package/dist/modules/workspace/engine-adapter.mjs.map +7 -0
- package/dist/modules/workspace/engine-presentation.mjs +10 -0
- package/dist/modules/workspace/engine-presentation.mjs.map +7 -0
- package/dist/modules/workspace/extension-bridge.mjs +18 -0
- package/dist/modules/workspace/extension-bridge.mjs.map +7 -0
- package/dist/modules/workspace/frontend-plugin.mjs +18 -0
- package/dist/modules/workspace/frontend-plugin.mjs.map +7 -0
- package/dist/modules/workspace/frontend.mjs +29 -0
- package/dist/modules/workspace/frontend.mjs.map +7 -0
- package/dist/modules/workspace/id.mjs +8 -0
- package/dist/modules/workspace/id.mjs.map +7 -0
- package/dist/modules/workspace/inspection-presentation.mjs +12 -0
- package/dist/modules/workspace/inspection-presentation.mjs.map +7 -0
- package/dist/modules/workspace/locale-bridge.mjs +14 -0
- package/dist/modules/workspace/locale-bridge.mjs.map +7 -0
- package/dist/modules/workspace/page-title.mjs +13 -0
- package/dist/modules/workspace/page-title.mjs.map +7 -0
- package/dist/modules/workspace/presentation.mjs +18 -0
- package/dist/modules/workspace/presentation.mjs.map +7 -0
- package/dist/modules/workspace/preview-surface.mjs +17 -0
- package/dist/modules/workspace/preview-surface.mjs.map +7 -0
- package/dist/modules/workspace/project-session.mjs +18 -0
- package/dist/modules/workspace/project-session.mjs.map +7 -0
- package/dist/modules/workspace/render-resize-sync.mjs +12 -0
- package/dist/modules/workspace/render-resize-sync.mjs.map +7 -0
- package/dist/modules/workspace/resident.mjs +16 -0
- package/dist/modules/workspace/resident.mjs.map +7 -0
- package/dist/modules/workspace/resource-open.mjs +34 -0
- package/dist/modules/workspace/resource-open.mjs.map +7 -0
- package/dist/modules/workspace/resource-page.mjs +27 -0
- package/dist/modules/workspace/resource-page.mjs.map +7 -0
- package/dist/modules/workspace/tool-runtime.mjs +14 -0
- package/dist/modules/workspace/tool-runtime.mjs.map +7 -0
- package/dist/modules/workspace/view-trace.mjs +60 -0
- package/dist/modules/workspace/view-trace.mjs.map +7 -0
- package/dist/modules/workspace/workspace-client-connection.mjs +22 -0
- package/dist/modules/workspace/workspace-client-connection.mjs.map +7 -0
- package/dist/modules/workspace/workspace-recovery.mjs +35 -0
- package/dist/modules/workspace/workspace-recovery.mjs.map +7 -0
- package/dist/modules/workspace/workspace-state.mjs +12 -0
- package/dist/modules/workspace/workspace-state.mjs.map +7 -0
- package/dist/modules/workspace-frontend.mjs +17 -0
- package/dist/modules/workspace-frontend.mjs.map +7 -0
- package/dist/viewer/assets/chunk-CilyBKbf.js +1 -0
- package/dist/viewer/assets/core-DSQma37-.js +13 -0
- package/dist/viewer/assets/core-DSQma37-.js.map +1 -0
- package/dist/viewer/assets/css-Bq1BXecw.js +2 -0
- package/dist/viewer/assets/css-Bq1BXecw.js.map +1 -0
- package/dist/viewer/assets/css-CWQWazmX.js +1 -0
- package/dist/viewer/assets/embedded-D4ZDx--W.js +2 -0
- package/dist/viewer/assets/embedded-D4ZDx--W.js.map +1 -0
- package/dist/viewer/assets/engine-javascript-BvokIV9O.js +142 -0
- package/dist/viewer/assets/engine-javascript-BvokIV9O.js.map +1 -0
- package/dist/viewer/assets/github-dark-default-DaDlj-WZ.js +2 -0
- package/dist/viewer/assets/github-dark-default-DaDlj-WZ.js.map +1 -0
- package/dist/viewer/assets/github-light-default-BqhWxAZd.js +2 -0
- package/dist/viewer/assets/github-light-default-BqhWxAZd.js.map +1 -0
- package/dist/viewer/assets/glsl-BJgVnv11.js +2 -0
- package/dist/viewer/assets/glsl-BJgVnv11.js.map +1 -0
- package/dist/viewer/assets/html-AaaHGGyt.js +2 -0
- package/dist/viewer/assets/html-AaaHGGyt.js.map +1 -0
- package/dist/viewer/assets/javascript-BX9W64FE.js +1 -0
- package/dist/viewer/assets/javascript-DQODvD07.js +2 -0
- package/dist/viewer/assets/javascript-DQODvD07.js.map +1 -0
- package/dist/viewer/assets/json-CpcIDpT7.js +2 -0
- package/dist/viewer/assets/json-CpcIDpT7.js.map +1 -0
- package/dist/viewer/assets/json5-Czq4A7dk.js +2 -0
- package/dist/viewer/assets/json5-Czq4A7dk.js.map +1 -0
- package/dist/viewer/assets/jsonc-BXDfCMmu.js +2 -0
- package/dist/viewer/assets/jsonc-BXDfCMmu.js.map +1 -0
- package/dist/viewer/assets/jsx-DAWscEnf.js +2 -0
- package/dist/viewer/assets/jsx-DAWscEnf.js.map +1 -0
- package/dist/viewer/assets/main-C-2CHTN_.js +15 -0
- package/dist/viewer/assets/main-C-2CHTN_.js.map +1 -0
- package/dist/viewer/assets/markdown-Cx1FMNw-.js +2 -0
- package/dist/viewer/assets/markdown-Cx1FMNw-.js.map +1 -0
- package/dist/viewer/assets/panels-entry-Ddhfjgf0.js +46 -0
- package/dist/viewer/assets/panels-entry-Ddhfjgf0.js.map +1 -0
- package/dist/viewer/assets/python-CYPKjWV9.js +2 -0
- package/dist/viewer/assets/python-CYPKjWV9.js.map +1 -0
- package/dist/viewer/assets/rust-0e5cNx_V.js +2 -0
- package/dist/viewer/assets/rust-0e5cNx_V.js.map +1 -0
- package/dist/viewer/assets/scss-B-aKzLbT.js +2 -0
- package/dist/viewer/assets/scss-B-aKzLbT.js.map +1 -0
- package/dist/viewer/assets/shellscript-CpXD-pSm.js +2 -0
- package/dist/viewer/assets/shellscript-CpXD-pSm.js.map +1 -0
- package/dist/viewer/assets/style-ClttNKZk.css +2 -0
- package/dist/viewer/assets/styles-BXozhwiU.js +11 -0
- package/dist/viewer/assets/styles-BXozhwiU.js.map +1 -0
- package/dist/viewer/assets/toml-GmchYTXa.js +2 -0
- package/dist/viewer/assets/toml-GmchYTXa.js.map +1 -0
- package/dist/viewer/assets/tsx-Crj1Bi53.js +2 -0
- package/dist/viewer/assets/tsx-Crj1Bi53.js.map +1 -0
- package/dist/viewer/assets/typescript-xi0cSHCO.js +2 -0
- package/dist/viewer/assets/typescript-xi0cSHCO.js.map +1 -0
- package/dist/viewer/assets/wgsl-BoEPRo9U.js +2 -0
- package/dist/viewer/assets/wgsl-BoEPRo9U.js.map +1 -0
- package/dist/viewer/assets/xml-B8JqQrMD.js +2 -0
- package/dist/viewer/assets/xml-B8JqQrMD.js.map +1 -0
- package/dist/viewer/assets/yaml-DsIB85X9.js +2 -0
- package/dist/viewer/assets/yaml-DsIB85X9.js.map +1 -0
- package/dist/viewer/index.html +15 -0
- package/dist/viewer/panels.js +1 -0
- package/host.pack.json +13 -0
- package/package.json +174 -0
- package/skills/forgeax-view-cli/SKILL.md +74 -0
- package/skills/forgeax-view-start/SKILL.md +202 -0
- package/skills/forgeax-view-start/scripts/start-view.mjs +202 -0
|
@@ -0,0 +1,1625 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PAGE_TYPE
|
|
3
|
+
} from "./chunk-TSAEK5P3.mjs";
|
|
4
|
+
import {
|
|
5
|
+
reopenWorkspaceProject
|
|
6
|
+
} from "./chunk-VDZJWEAA.mjs";
|
|
7
|
+
import {
|
|
8
|
+
keepSurfaceInContainer,
|
|
9
|
+
readSceneShell
|
|
10
|
+
} from "./chunk-C7R3YRA7.mjs";
|
|
11
|
+
import {
|
|
12
|
+
selectWorkspaceEditorSurfaceTarget
|
|
13
|
+
} from "./chunk-FKCQYDLX.mjs";
|
|
14
|
+
import {
|
|
15
|
+
isViewTraceEnabled,
|
|
16
|
+
traceInputAttach,
|
|
17
|
+
traceInputCaptureAbort,
|
|
18
|
+
traceInputPointerDown,
|
|
19
|
+
traceInputPointerLockExit,
|
|
20
|
+
traceInputPointerMove,
|
|
21
|
+
traceInputPointerUp,
|
|
22
|
+
tracePresentationAttach,
|
|
23
|
+
traceShellRegisterDomRoot,
|
|
24
|
+
traceShellRender,
|
|
25
|
+
traceShellUpdate,
|
|
26
|
+
traceSyncTargetSurfaces,
|
|
27
|
+
traceView
|
|
28
|
+
} from "./chunk-2IJKOG2F.mjs";
|
|
29
|
+
import {
|
|
30
|
+
reportWorkspaceCommandError
|
|
31
|
+
} from "./chunk-ASI2HBE6.mjs";
|
|
32
|
+
import {
|
|
33
|
+
VIEW_DISPLAY_TAB_ID,
|
|
34
|
+
VIEW_WORKSPACE_TAB_ID,
|
|
35
|
+
cloneWorkspaceValue,
|
|
36
|
+
requireWorkspaceString,
|
|
37
|
+
workspaceUiFingerprint
|
|
38
|
+
} from "./chunk-32GD5LL6.mjs";
|
|
39
|
+
import {
|
|
40
|
+
createWorkspaceId
|
|
41
|
+
} from "./chunk-TP26TASL.mjs";
|
|
42
|
+
|
|
43
|
+
// packages/view-plugin-viewport/src/borrowed-surface.mjs
|
|
44
|
+
function borrowSurface(surface, container) {
|
|
45
|
+
const parent = surface.parentNode;
|
|
46
|
+
const next = surface.nextSibling;
|
|
47
|
+
const attributes = [
|
|
48
|
+
"style",
|
|
49
|
+
"hidden",
|
|
50
|
+
"aria-label",
|
|
51
|
+
"data-forgeax-view-target-id",
|
|
52
|
+
"data-forgeax-view-tab-id",
|
|
53
|
+
"data-forgeax-view-surface",
|
|
54
|
+
"data-forgeax-view-selected"
|
|
55
|
+
].map((name) => [name, surface.getAttribute?.(name)]);
|
|
56
|
+
let restored = false;
|
|
57
|
+
return () => {
|
|
58
|
+
if (restored) return;
|
|
59
|
+
restored = true;
|
|
60
|
+
if (surface.parentNode !== container) return;
|
|
61
|
+
for (const [name, value] of attributes) {
|
|
62
|
+
if (value == null) surface.removeAttribute?.(name);
|
|
63
|
+
else surface.setAttribute?.(name, value);
|
|
64
|
+
}
|
|
65
|
+
if (parent) {
|
|
66
|
+
if (parent.insertBefore) parent.insertBefore(surface, next?.parentNode === parent ? next : null);
|
|
67
|
+
else parent.append?.(surface);
|
|
68
|
+
} else surface.remove?.();
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// packages/view-plugin-viewport/src/workspace-shell.mjs
|
|
73
|
+
function sameTargetIdentity(left, right) {
|
|
74
|
+
return left?.targetId === right?.targetId && left?.generation === right?.generation && left?.surfaceId === right?.surfaceId && left?.leaseId === right?.leaseId;
|
|
75
|
+
}
|
|
76
|
+
function text(document, value) {
|
|
77
|
+
const node = document.createElement("span");
|
|
78
|
+
node.textContent = String(value);
|
|
79
|
+
return node;
|
|
80
|
+
}
|
|
81
|
+
function button(document, label, onClick, { disabled = false } = {}) {
|
|
82
|
+
const node = document.createElement("button");
|
|
83
|
+
node.type = "button";
|
|
84
|
+
node.textContent = label;
|
|
85
|
+
node.disabled = disabled;
|
|
86
|
+
node.addEventListener?.("click", () => void Promise.resolve(onClick()).catch(() => {
|
|
87
|
+
}));
|
|
88
|
+
return node;
|
|
89
|
+
}
|
|
90
|
+
function safeError(error) {
|
|
91
|
+
const message = error?.message ?? String(error);
|
|
92
|
+
const hint = typeof error?.hint === "string" ? error.hint.trim() : "";
|
|
93
|
+
return hint && !message.includes(hint) ? `${message} (${hint})` : message;
|
|
94
|
+
}
|
|
95
|
+
function groupAssetsBySource(assets) {
|
|
96
|
+
const groups = [];
|
|
97
|
+
const index = /* @__PURE__ */ new Map();
|
|
98
|
+
for (const asset of assets ?? []) {
|
|
99
|
+
const key = asset.sourcePath || asset.path || asset.kind || "assets";
|
|
100
|
+
let group = index.get(key);
|
|
101
|
+
if (!group) {
|
|
102
|
+
group = { key, assets: [] };
|
|
103
|
+
index.set(key, group);
|
|
104
|
+
groups.push(group);
|
|
105
|
+
}
|
|
106
|
+
group.assets.push(asset);
|
|
107
|
+
}
|
|
108
|
+
return groups;
|
|
109
|
+
}
|
|
110
|
+
function catalogDdcState(asset, inspection) {
|
|
111
|
+
if (inspection?.guid === asset?.guid && inspection.ddc?.state) return inspection.ddc.state;
|
|
112
|
+
return asset?.ddc?.state;
|
|
113
|
+
}
|
|
114
|
+
function catalogReceipt(asset, inspection) {
|
|
115
|
+
if (inspection?.guid === asset?.guid && inspection.ddc?.receiptUrl) return inspection.ddc.receiptUrl;
|
|
116
|
+
return asset?.cookReceiptUrl ?? asset?.ddc?.receiptUrl;
|
|
117
|
+
}
|
|
118
|
+
function isViewportWorkspaceInputEvent(event, { surface, host } = {}) {
|
|
119
|
+
const eventTarget = event?.target;
|
|
120
|
+
if (event?.defaultPrevented || !eventTarget || typeof eventTarget.closest !== "function") return false;
|
|
121
|
+
if (eventTarget.closest('button,input,a,select,textarea,[contenteditable="true"],.fx-engine-fatal-banner')) return false;
|
|
122
|
+
const page = (host ?? eventTarget).closest?.("[data-forgeax-view-dock-page]");
|
|
123
|
+
if (page?.getAttribute?.("aria-hidden") === "true") return false;
|
|
124
|
+
if (surface) {
|
|
125
|
+
const activePage = host?.ownerDocument?.documentElement?.dataset?.forgeaxViewActivePage;
|
|
126
|
+
if (activePage !== void 0 && activePage !== PAGE_TYPE) return false;
|
|
127
|
+
if (surface.style?.visibility === "hidden" || surface.style?.pointerEvents === "none") return false;
|
|
128
|
+
return eventTarget === surface || surface.contains?.(eventTarget) === true;
|
|
129
|
+
}
|
|
130
|
+
if (!eventTarget.closest('[data-forgeax-view-mount-host="viewport"]')) return false;
|
|
131
|
+
return Boolean(eventTarget.closest('[data-forgeax-view-workspace="preview"]'));
|
|
132
|
+
}
|
|
133
|
+
function createBrowserPagePresentation({ document = globalThis.document } = {}) {
|
|
134
|
+
return Object.freeze({
|
|
135
|
+
surfacePlacement: "owner",
|
|
136
|
+
createSurface({ target, document: suppliedDocument = document } = {}) {
|
|
137
|
+
const surfaceId = target?.surfaceId;
|
|
138
|
+
if (typeof surfaceId !== "string" || surfaceId.length === 0) {
|
|
139
|
+
throw new TypeError("Engine display target must expose its exact surfaceId");
|
|
140
|
+
}
|
|
141
|
+
const ownerDocument = suppliedDocument;
|
|
142
|
+
if (ownerDocument?.querySelectorAll === void 0) return null;
|
|
143
|
+
const matches = [...ownerDocument.querySelectorAll('iframe[data-forgeax-view-surface="engine-target"]')].filter(
|
|
144
|
+
(element) => element.dataset?.forgeaxViewSurface === "engine-target" && element.dataset?.forgeaxViewTargetId === String(target.targetId) && element.dataset?.forgeaxViewLeaseId === String(target.leaseId) && element.dataset?.forgeaxViewGeneration === String(target.generation) && element.id === surfaceId
|
|
145
|
+
);
|
|
146
|
+
if (matches.length > 1) {
|
|
147
|
+
throw new Error(`multiple Engine display surfaces match ${surfaceId}`);
|
|
148
|
+
}
|
|
149
|
+
return matches[0] ?? null;
|
|
150
|
+
},
|
|
151
|
+
attach({ target, element } = {}) {
|
|
152
|
+
if (!element || element.tagName?.toLowerCase?.() !== "iframe" || element.id !== target?.surfaceId || element.dataset?.forgeaxViewLeaseId !== String(target?.leaseId) || element.dataset?.forgeaxViewGeneration !== String(target?.generation)) {
|
|
153
|
+
throw new Error("Engine display surface identity does not match its target");
|
|
154
|
+
}
|
|
155
|
+
return void 0;
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
var ViewWorkspaceInputController = class {
|
|
160
|
+
constructor({
|
|
161
|
+
api,
|
|
162
|
+
targetId,
|
|
163
|
+
targetGeneration,
|
|
164
|
+
tabId = VIEW_WORKSPACE_TAB_ID,
|
|
165
|
+
interactionIdFactory = () => createWorkspaceId("interaction"),
|
|
166
|
+
shouldCapture = () => true,
|
|
167
|
+
onError = () => {
|
|
168
|
+
},
|
|
169
|
+
onFocusSelection = () => {
|
|
170
|
+
},
|
|
171
|
+
onSpeedChange = () => {
|
|
172
|
+
},
|
|
173
|
+
window = globalThis,
|
|
174
|
+
document = globalThis.document
|
|
175
|
+
} = {}) {
|
|
176
|
+
if (!api) throw new TypeError("workspace input controller requires an API client");
|
|
177
|
+
this.api = api;
|
|
178
|
+
this.targetId = requireWorkspaceString(targetId, "targetId");
|
|
179
|
+
this.targetGeneration = targetGeneration;
|
|
180
|
+
this.tabId = tabId;
|
|
181
|
+
this.interactionIdFactory = interactionIdFactory;
|
|
182
|
+
if (typeof this.interactionIdFactory !== "function") {
|
|
183
|
+
throw new TypeError("workspace input controller requires an interactionIdFactory");
|
|
184
|
+
}
|
|
185
|
+
this.shouldCapture = shouldCapture;
|
|
186
|
+
this.onError = onError;
|
|
187
|
+
this.onFocusSelection = onFocusSelection;
|
|
188
|
+
this.onSpeedChange = onSpeedChange;
|
|
189
|
+
this.speed = 4;
|
|
190
|
+
this.held = /* @__PURE__ */ new Set();
|
|
191
|
+
this.shiftHeld = false;
|
|
192
|
+
this.window = window;
|
|
193
|
+
this.document = document;
|
|
194
|
+
this.interaction = null;
|
|
195
|
+
this.pending = Promise.resolve();
|
|
196
|
+
this.inputError = null;
|
|
197
|
+
this.inputQueue = [];
|
|
198
|
+
this.beginPromise = null;
|
|
199
|
+
this.finishPromise = null;
|
|
200
|
+
this.generation = 0;
|
|
201
|
+
this.cancelRequested = false;
|
|
202
|
+
this.disposed = false;
|
|
203
|
+
this.element = null;
|
|
204
|
+
this.bound = false;
|
|
205
|
+
this.pointerLockEngaged = false;
|
|
206
|
+
}
|
|
207
|
+
report(error) {
|
|
208
|
+
if (error === void 0 || error === null) return;
|
|
209
|
+
this.inputError ??= error;
|
|
210
|
+
try {
|
|
211
|
+
this.onError(error);
|
|
212
|
+
} catch {
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
async begin() {
|
|
216
|
+
if (this.abortPromise) await this.abortPromise;
|
|
217
|
+
if (this.finishPromise) await this.finishPromise;
|
|
218
|
+
if (this.disposed) throw new Error("workspace input controller is disposed");
|
|
219
|
+
if (this.interaction) return this.interaction;
|
|
220
|
+
if (this.beginPromise) return this.beginPromise;
|
|
221
|
+
const generation = this.generation;
|
|
222
|
+
this.cancelRequested = false;
|
|
223
|
+
this.beginPromise = (async () => {
|
|
224
|
+
const current = await this.api.getCamera({ targetId: this.targetId, targetGeneration: this.targetGeneration, tabId: this.tabId });
|
|
225
|
+
if (this.disposed || generation !== this.generation || this.cancelRequested) {
|
|
226
|
+
throw new Error("workspace input begin was cancelled");
|
|
227
|
+
}
|
|
228
|
+
const expectedVersion = current.version;
|
|
229
|
+
if (typeof expectedVersion !== "number" || !Number.isSafeInteger(expectedVersion) || expectedVersion < 0) {
|
|
230
|
+
throw new TypeError("workspace camera begin requires getCamera().version");
|
|
231
|
+
}
|
|
232
|
+
const interactionId = this.interactionIdFactory();
|
|
233
|
+
const begun = await this.api.beginCamera({
|
|
234
|
+
targetId: this.targetId,
|
|
235
|
+
targetGeneration: this.targetGeneration,
|
|
236
|
+
tabId: this.tabId,
|
|
237
|
+
baseVersion: expectedVersion,
|
|
238
|
+
interactionId
|
|
239
|
+
});
|
|
240
|
+
this.interaction = { ...begun, interactionId, baseVersion: expectedVersion };
|
|
241
|
+
await this.flushInputQueue();
|
|
242
|
+
if (this.cancelRequested || this.disposed || generation !== this.generation) {
|
|
243
|
+
await this.api.abortCamera({
|
|
244
|
+
targetId: this.targetId,
|
|
245
|
+
targetGeneration: this.targetGeneration,
|
|
246
|
+
tabId: this.tabId,
|
|
247
|
+
interactionId,
|
|
248
|
+
reason: "input-begin-cancelled"
|
|
249
|
+
}).catch((error) => this.report(error));
|
|
250
|
+
this.clearTransaction();
|
|
251
|
+
throw new Error("workspace input begin was cancelled");
|
|
252
|
+
}
|
|
253
|
+
return this.interaction;
|
|
254
|
+
})();
|
|
255
|
+
try {
|
|
256
|
+
return await this.beginPromise;
|
|
257
|
+
} finally {
|
|
258
|
+
this.beginPromise = null;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
async flushInputQueue() {
|
|
262
|
+
this.drainInputQueue();
|
|
263
|
+
await this.pending;
|
|
264
|
+
}
|
|
265
|
+
enqueueUpdate(input) {
|
|
266
|
+
const previous = this.inputQueue.at(-1);
|
|
267
|
+
if (previous?.type === input.type && previous.mode === input.mode && ["look", "orbit", "pan", "dolly"].includes(input.type)) {
|
|
268
|
+
for (const key of ["yaw", "pitch", "x", "y", "amount"]) {
|
|
269
|
+
if (input[key] !== void 0) previous[key] = (previous[key] ?? 0) + input[key];
|
|
270
|
+
}
|
|
271
|
+
} else if (this.inputQueue.length < 64) {
|
|
272
|
+
this.inputQueue.push({ ...input });
|
|
273
|
+
} else {
|
|
274
|
+
this.report(new Error("Viewport input exceeded its bounded queue; gesture cancelled."));
|
|
275
|
+
void this.abort("input-overflow");
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
this.drainInputQueue();
|
|
279
|
+
}
|
|
280
|
+
drainInputQueue() {
|
|
281
|
+
const interaction = this.interaction;
|
|
282
|
+
if (!interaction || this.draining) return;
|
|
283
|
+
const generation = this.generation;
|
|
284
|
+
this.draining = true;
|
|
285
|
+
this.pending = Promise.resolve().then(async () => {
|
|
286
|
+
while (this.inputQueue.length) {
|
|
287
|
+
if (generation !== this.generation || this.cancelRequested || this.disposed || this.interaction !== interaction)
|
|
288
|
+
return;
|
|
289
|
+
const input = this.inputQueue.shift();
|
|
290
|
+
await this.api.updateCamera({
|
|
291
|
+
targetId: this.targetId,
|
|
292
|
+
targetGeneration: this.targetGeneration,
|
|
293
|
+
tabId: this.tabId,
|
|
294
|
+
interactionId: interaction.interactionId,
|
|
295
|
+
input
|
|
296
|
+
});
|
|
297
|
+
if (generation !== this.generation || this.interaction !== interaction) return;
|
|
298
|
+
}
|
|
299
|
+
}).catch((error) => {
|
|
300
|
+
if (generation !== this.generation || this.interaction !== interaction) return;
|
|
301
|
+
this.inputError ??= error;
|
|
302
|
+
this.report(error);
|
|
303
|
+
}).finally(() => {
|
|
304
|
+
this.draining = false;
|
|
305
|
+
if (generation === this.generation && this.inputQueue.length) this.drainInputQueue();
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
/** Current WASD/QE move sample; Shift multiplies speed like Unreal's fast-fly. */
|
|
309
|
+
currentMoveInput() {
|
|
310
|
+
const axes = [
|
|
311
|
+
Number(this.held.has("KeyD")) - Number(this.held.has("KeyA")),
|
|
312
|
+
Number(this.held.has("KeyE")) - Number(this.held.has("KeyQ")),
|
|
313
|
+
Number(this.held.has("KeyS")) - Number(this.held.has("KeyW"))
|
|
314
|
+
];
|
|
315
|
+
const length = Math.hypot(...axes) || 1;
|
|
316
|
+
const boost = this.shiftHeld ? 3 : 1;
|
|
317
|
+
return { type: "move", velocity: axes.map((value) => value * this.speed * boost / length) };
|
|
318
|
+
}
|
|
319
|
+
queueInput(input) {
|
|
320
|
+
if (this.disposed || this.cancelRequested) return;
|
|
321
|
+
const movement = () => this.currentMoveInput();
|
|
322
|
+
let motion;
|
|
323
|
+
if (input.type === "key-down" || input.type === "key-up") {
|
|
324
|
+
const code = input.code || "Key" + String(input.key).toUpperCase();
|
|
325
|
+
if (input.type === "key-down") this.held.add(code);
|
|
326
|
+
else this.held.delete(code);
|
|
327
|
+
motion = movement();
|
|
328
|
+
} else if (input.type === "wheel" && input.mode === "speed") {
|
|
329
|
+
this.speed = Math.max(0.05, Math.min(1024, this.speed * Math.exp(-input.deltaY * 2e-3)));
|
|
330
|
+
this.onSpeedChange(this.speed);
|
|
331
|
+
motion = movement();
|
|
332
|
+
} else if (input.type === "wheel" || input.mode === "dolly") {
|
|
333
|
+
motion = { type: "dolly", amount: Math.max(-4, Math.min(
|
|
334
|
+
4,
|
|
335
|
+
(input.type === "wheel" ? input.deltaY : input.movementY * 4) * 1e-3
|
|
336
|
+
)), distance: 5 };
|
|
337
|
+
} else if (input.mode === "pan") {
|
|
338
|
+
motion = {
|
|
339
|
+
type: "pan",
|
|
340
|
+
x: -(input.movementX ?? 0) * 2e-3,
|
|
341
|
+
y: (input.movementY ?? 0) * 2e-3,
|
|
342
|
+
distance: 5
|
|
343
|
+
};
|
|
344
|
+
} else {
|
|
345
|
+
motion = {
|
|
346
|
+
type: input.mode === "orbit" ? "orbit" : "look",
|
|
347
|
+
yaw: -(input.movementX ?? 0) * 3e-3,
|
|
348
|
+
pitch: -(input.movementY ?? 0) * 3e-3,
|
|
349
|
+
pitchLimit: Math.PI / 2 - 0.01,
|
|
350
|
+
distance: 5
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
this.enqueueUpdate(motion);
|
|
354
|
+
}
|
|
355
|
+
clearTransaction() {
|
|
356
|
+
this.held.clear();
|
|
357
|
+
this.interaction = null;
|
|
358
|
+
this.pending = Promise.resolve();
|
|
359
|
+
this.inputQueue = [];
|
|
360
|
+
this.inputError = null;
|
|
361
|
+
}
|
|
362
|
+
async finish() {
|
|
363
|
+
if (this.finishPromise) return this.finishPromise;
|
|
364
|
+
const generation = this.generation;
|
|
365
|
+
this.finishPromise = (async () => {
|
|
366
|
+
try {
|
|
367
|
+
if (this.beginPromise) await this.beginPromise;
|
|
368
|
+
if (!this.interaction) return;
|
|
369
|
+
await this.flushInputQueue();
|
|
370
|
+
await this.pending;
|
|
371
|
+
if (this.cancelRequested || this.disposed || generation !== this.generation) {
|
|
372
|
+
await this.abort("input-finish-cancelled");
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
if (this.inputError) {
|
|
376
|
+
const error = this.inputError;
|
|
377
|
+
await this.abort("input-update-failed");
|
|
378
|
+
throw error;
|
|
379
|
+
}
|
|
380
|
+
const interaction = this.interaction;
|
|
381
|
+
if (this.cancelRequested || this.disposed || generation !== this.generation) {
|
|
382
|
+
await this.abort("input-finish-cancelled");
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
try {
|
|
386
|
+
await this.api.commitCamera({
|
|
387
|
+
targetId: this.targetId,
|
|
388
|
+
targetGeneration: this.targetGeneration,
|
|
389
|
+
tabId: this.tabId,
|
|
390
|
+
interactionId: interaction.interactionId,
|
|
391
|
+
operationId: this.interactionIdFactory(),
|
|
392
|
+
expectedVersion: interaction.baseVersion
|
|
393
|
+
});
|
|
394
|
+
} catch (error) {
|
|
395
|
+
await this.api.abortCamera({
|
|
396
|
+
targetId: this.targetId,
|
|
397
|
+
targetGeneration: this.targetGeneration,
|
|
398
|
+
tabId: this.tabId,
|
|
399
|
+
interactionId: interaction.interactionId,
|
|
400
|
+
reason: "commit-failed"
|
|
401
|
+
}).catch(() => {
|
|
402
|
+
});
|
|
403
|
+
throw error;
|
|
404
|
+
}
|
|
405
|
+
} finally {
|
|
406
|
+
this.clearTransaction();
|
|
407
|
+
}
|
|
408
|
+
})();
|
|
409
|
+
try {
|
|
410
|
+
return await this.finishPromise;
|
|
411
|
+
} finally {
|
|
412
|
+
this.finishPromise = null;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
async abort(reason = "input-abort") {
|
|
416
|
+
if (this.abortPromise) return this.abortPromise;
|
|
417
|
+
++this.generation;
|
|
418
|
+
this.cancelRequested = true;
|
|
419
|
+
const begin = this.beginPromise;
|
|
420
|
+
this.abortPromise = (async () => {
|
|
421
|
+
if (begin) await begin.catch(() => {
|
|
422
|
+
});
|
|
423
|
+
await this.pending;
|
|
424
|
+
const interaction = this.interaction;
|
|
425
|
+
try {
|
|
426
|
+
if (interaction) {
|
|
427
|
+
await this.api.abortCamera({
|
|
428
|
+
targetId: this.targetId,
|
|
429
|
+
targetGeneration: this.targetGeneration,
|
|
430
|
+
tabId: this.tabId,
|
|
431
|
+
interactionId: interaction.interactionId,
|
|
432
|
+
reason
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
} catch (error) {
|
|
436
|
+
this.report(error);
|
|
437
|
+
} finally {
|
|
438
|
+
this.clearTransaction();
|
|
439
|
+
}
|
|
440
|
+
})();
|
|
441
|
+
try {
|
|
442
|
+
await this.abortPromise;
|
|
443
|
+
} finally {
|
|
444
|
+
this.abortPromise = null;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
async requestPointerLock() {
|
|
448
|
+
if (typeof this.element?.requestPointerLock !== "function") return;
|
|
449
|
+
try {
|
|
450
|
+
await Promise.resolve(this.element.requestPointerLock());
|
|
451
|
+
} catch {
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
trySetPointerCapture(element, pointerId) {
|
|
455
|
+
if (pointerId === void 0 || typeof element?.setPointerCapture !== "function") return;
|
|
456
|
+
try {
|
|
457
|
+
element.setPointerCapture(pointerId);
|
|
458
|
+
} catch {
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
tryReleasePointerCapture(element, pointerId) {
|
|
462
|
+
if (pointerId === void 0 || typeof element?.releasePointerCapture !== "function") return;
|
|
463
|
+
try {
|
|
464
|
+
element.releasePointerCapture(pointerId);
|
|
465
|
+
} catch {
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
attach(element) {
|
|
469
|
+
if (!element || this.bound) return () => {
|
|
470
|
+
};
|
|
471
|
+
this.element = element;
|
|
472
|
+
this.bound = true;
|
|
473
|
+
this.onSpeedChange(this.speed);
|
|
474
|
+
const previousTabIndex = element.getAttribute?.("tabindex");
|
|
475
|
+
if (previousTabIndex == null) element.setAttribute?.("tabindex", "0");
|
|
476
|
+
traceInputAttach(element, { targetId: this.targetId, tabId: this.tabId });
|
|
477
|
+
let gesture = null;
|
|
478
|
+
let selectionRequest;
|
|
479
|
+
let clickStart;
|
|
480
|
+
let consumedClick = false;
|
|
481
|
+
const held = this.held;
|
|
482
|
+
const stop = () => {
|
|
483
|
+
selectionRequest?.abort();
|
|
484
|
+
gesture = null;
|
|
485
|
+
held.clear();
|
|
486
|
+
this.shiftHeld = false;
|
|
487
|
+
if (this.document?.pointerLockElement === element) this.document.exitPointerLock?.();
|
|
488
|
+
void this.finish().catch((error) => this.report(error));
|
|
489
|
+
};
|
|
490
|
+
const down = (event) => {
|
|
491
|
+
if (this.shouldCapture(event)) element.focus?.();
|
|
492
|
+
const accepted = !this.finishPromise && !gesture && (event.button === 2 || event.button === 1 || event.button === 0 && event.altKey) && this.shouldCapture(event);
|
|
493
|
+
consumedClick = event.defaultPrevented === true || accepted;
|
|
494
|
+
clickStart = { x: event.clientX, y: event.clientY };
|
|
495
|
+
traceInputPointerDown(event, { accepted, element });
|
|
496
|
+
if (accepted) {
|
|
497
|
+
selectionRequest?.abort();
|
|
498
|
+
event.preventDefault?.();
|
|
499
|
+
gesture = {
|
|
500
|
+
button: event.button,
|
|
501
|
+
mode: event.button === 1 ? "pan" : event.altKey ? event.button === 0 ? "orbit" : "dolly" : "look"
|
|
502
|
+
};
|
|
503
|
+
element.focus?.();
|
|
504
|
+
void this.begin().catch((error) => this.report(error));
|
|
505
|
+
this.trySetPointerCapture(element, event?.pointerId);
|
|
506
|
+
void this.requestPointerLock();
|
|
507
|
+
traceView("input", "capture-engaged", {
|
|
508
|
+
pointerId: event?.pointerId,
|
|
509
|
+
pointerLockElement: globalThis.document?.pointerLockElement?.tagName
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
};
|
|
513
|
+
const menu = (event) => {
|
|
514
|
+
if (!this.shouldCapture(event)) return;
|
|
515
|
+
event.preventDefault?.();
|
|
516
|
+
};
|
|
517
|
+
const move = (event) => {
|
|
518
|
+
if (clickStart && Math.hypot(event.clientX - clickStart.x, event.clientY - clickStart.y) > 4) consumedClick = true;
|
|
519
|
+
if (!gesture || !this.interaction && !this.beginPromise) return;
|
|
520
|
+
traceInputPointerMove(event, {
|
|
521
|
+
queued: true,
|
|
522
|
+
queueDepth: this.inputQueue.length,
|
|
523
|
+
inFlight: this.draining ? 1 : 0
|
|
524
|
+
});
|
|
525
|
+
this.queueInput({
|
|
526
|
+
type: "pointer-move",
|
|
527
|
+
mode: gesture.mode,
|
|
528
|
+
movementX: Number(event.movementX ?? 0),
|
|
529
|
+
movementY: Number(event.movementY ?? 0)
|
|
530
|
+
});
|
|
531
|
+
};
|
|
532
|
+
const up = (event) => {
|
|
533
|
+
if (!gesture || event.button !== gesture.button) return;
|
|
534
|
+
this.tryReleasePointerCapture(element, event?.pointerId);
|
|
535
|
+
traceInputPointerUp(event, { element });
|
|
536
|
+
stop();
|
|
537
|
+
};
|
|
538
|
+
const keydown = (event) => {
|
|
539
|
+
if (event.key === "Escape" && gesture) {
|
|
540
|
+
stop();
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
543
|
+
if (!this.shouldCapture(event) || event.repeat) return;
|
|
544
|
+
if (!gesture && String(event.key).toLowerCase() === "f") {
|
|
545
|
+
event.preventDefault?.();
|
|
546
|
+
void Promise.resolve().then(this.onFocusSelection).catch((error) => this.report(error));
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
549
|
+
if (event.key === "Shift") {
|
|
550
|
+
this.shiftHeld = true;
|
|
551
|
+
if (held.size) this.enqueueUpdate(this.currentMoveInput());
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
if (!["w", "a", "s", "d", "q", "e"].includes(String(event.key ?? "").toLowerCase())) return;
|
|
555
|
+
event.preventDefault?.();
|
|
556
|
+
held.add(event.code || event.key);
|
|
557
|
+
if (!gesture) void this.begin().catch((error) => this.report(error));
|
|
558
|
+
this.queueInput({ type: "key-down", key: String(event.key ?? ""), code: String(event.code ?? "") });
|
|
559
|
+
};
|
|
560
|
+
const keyup = (event) => {
|
|
561
|
+
if (event.key === "Shift") {
|
|
562
|
+
this.shiftHeld = false;
|
|
563
|
+
if (held.size) this.enqueueUpdate(this.currentMoveInput());
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
if (!held.delete(event.code || event.key)) return;
|
|
567
|
+
if (!this.interaction && !this.beginPromise) return;
|
|
568
|
+
event.preventDefault?.();
|
|
569
|
+
this.queueInput({ type: "key-up", key: String(event.key ?? ""), code: String(event.code ?? "") });
|
|
570
|
+
if (!gesture && held.size === 0) void this.finish().catch((error) => this.report(error));
|
|
571
|
+
};
|
|
572
|
+
const wheel = (event) => {
|
|
573
|
+
if (!this.shouldCapture(event) || this.finishPromise) return;
|
|
574
|
+
selectionRequest?.abort();
|
|
575
|
+
event.preventDefault?.();
|
|
576
|
+
void this.begin().catch((error) => this.report(error));
|
|
577
|
+
this.queueInput({
|
|
578
|
+
type: "wheel",
|
|
579
|
+
mode: gesture?.mode === "look" ? "speed" : "dolly",
|
|
580
|
+
deltaY: Number(event.deltaY ?? 0) * (event.deltaMode === 1 ? 16 : event.deltaMode === 2 ? 800 : 1)
|
|
581
|
+
});
|
|
582
|
+
if (!gesture) void this.finish().catch((error) => this.report(error));
|
|
583
|
+
};
|
|
584
|
+
const abort = (reason = "input-focus-lost") => {
|
|
585
|
+
if (reason !== "pointerlock-exit") traceInputCaptureAbort(reason);
|
|
586
|
+
else traceView("input", "abort", { reason });
|
|
587
|
+
stop();
|
|
588
|
+
};
|
|
589
|
+
const pointerLockChange = () => {
|
|
590
|
+
const locked = this.document?.pointerLockElement === element;
|
|
591
|
+
traceView("input", "pointerlockchange", {
|
|
592
|
+
locked,
|
|
593
|
+
pointerLockElement: this.document?.pointerLockElement?.tagName,
|
|
594
|
+
engaged: this.pointerLockEngaged
|
|
595
|
+
});
|
|
596
|
+
if (locked) this.pointerLockEngaged = true;
|
|
597
|
+
if (this.pointerLockEngaged && !locked) {
|
|
598
|
+
this.pointerLockEngaged = false;
|
|
599
|
+
traceInputPointerLockExit({ locked, element });
|
|
600
|
+
abort("pointerlock-exit");
|
|
601
|
+
}
|
|
602
|
+
};
|
|
603
|
+
const click = (event) => {
|
|
604
|
+
const consumed = consumedClick;
|
|
605
|
+
consumedClick = false;
|
|
606
|
+
const dragged = clickStart && Math.hypot(event.clientX - clickStart.x, event.clientY - clickStart.y) > 4;
|
|
607
|
+
clickStart = void 0;
|
|
608
|
+
if (consumed || dragged) return;
|
|
609
|
+
if (gesture || event.button !== 0 || event.altKey || !this.shouldCapture(event)) return;
|
|
610
|
+
const canvas = element.tagName === "CANVAS" ? element : element.querySelector?.("canvas");
|
|
611
|
+
if (!canvas || event.target !== canvas) return;
|
|
612
|
+
const rect = canvas.getBoundingClientRect();
|
|
613
|
+
if (!(rect.width > 0 && rect.height > 0 && canvas.width > 0 && canvas.height > 0)) return;
|
|
614
|
+
selectionRequest?.abort();
|
|
615
|
+
selectionRequest = new AbortController();
|
|
616
|
+
void this.api.call("scene.pick", {
|
|
617
|
+
targetId: this.targetId,
|
|
618
|
+
targetGeneration: this.targetGeneration,
|
|
619
|
+
tabId: this.tabId,
|
|
620
|
+
x: (event.clientX - rect.left) * canvas.width / rect.width,
|
|
621
|
+
y: (event.clientY - rect.top) * canvas.height / rect.height
|
|
622
|
+
}, { signal: selectionRequest.signal }).catch(() => {
|
|
623
|
+
});
|
|
624
|
+
};
|
|
625
|
+
element.addEventListener?.("click", click);
|
|
626
|
+
element.addEventListener?.("pointerdown", down);
|
|
627
|
+
element.addEventListener?.("pointermove", move);
|
|
628
|
+
element.addEventListener?.("pointerup", up);
|
|
629
|
+
element.addEventListener?.("wheel", wheel, { passive: false });
|
|
630
|
+
element.addEventListener?.("contextmenu", menu);
|
|
631
|
+
const onPointerCancel = () => abort("pointercancel");
|
|
632
|
+
const onWindowBlur = () => abort("window-blur");
|
|
633
|
+
const onFocusOut = (event) => {
|
|
634
|
+
if (!element.contains?.(event.relatedTarget)) abort("focusout");
|
|
635
|
+
};
|
|
636
|
+
const onVisibilityChange = () => {
|
|
637
|
+
if (this.document?.hidden) abort("visibilitychange");
|
|
638
|
+
};
|
|
639
|
+
element.addEventListener?.("pointercancel", onPointerCancel);
|
|
640
|
+
element.addEventListener?.("keydown", keydown);
|
|
641
|
+
this.window?.addEventListener?.("keyup", keyup);
|
|
642
|
+
this.window?.addEventListener?.("pointerup", up);
|
|
643
|
+
this.window?.addEventListener?.("blur", onWindowBlur);
|
|
644
|
+
this.window?.addEventListener?.("focusout", onFocusOut);
|
|
645
|
+
this.document?.addEventListener?.("visibilitychange", onVisibilityChange);
|
|
646
|
+
this.document?.addEventListener?.("pointerlockchange", pointerLockChange);
|
|
647
|
+
const remove = (reason = "input-detached") => {
|
|
648
|
+
if (previousTabIndex == null) element.removeAttribute?.("tabindex");
|
|
649
|
+
selectionRequest?.abort();
|
|
650
|
+
element.removeEventListener?.("click", click);
|
|
651
|
+
element.removeEventListener?.("pointerdown", down);
|
|
652
|
+
element.removeEventListener?.("pointermove", move);
|
|
653
|
+
element.removeEventListener?.("pointerup", up);
|
|
654
|
+
element.removeEventListener?.("wheel", wheel);
|
|
655
|
+
element.removeEventListener?.("contextmenu", menu);
|
|
656
|
+
element.removeEventListener?.("pointercancel", onPointerCancel);
|
|
657
|
+
element.removeEventListener?.("keydown", keydown);
|
|
658
|
+
this.window?.removeEventListener?.("keyup", keyup);
|
|
659
|
+
this.window?.removeEventListener?.("pointerup", up);
|
|
660
|
+
this.window?.removeEventListener?.("blur", onWindowBlur);
|
|
661
|
+
this.window?.removeEventListener?.("focusout", onFocusOut);
|
|
662
|
+
this.document?.removeEventListener?.("visibilitychange", onVisibilityChange);
|
|
663
|
+
this.document?.removeEventListener?.("pointerlockchange", pointerLockChange);
|
|
664
|
+
this.pointerLockEngaged = false;
|
|
665
|
+
if (reason !== "input-disposed") {
|
|
666
|
+
traceInputCaptureAbort(reason);
|
|
667
|
+
void this.abort(reason).catch((error) => this.report(error));
|
|
668
|
+
}
|
|
669
|
+
this.element = null;
|
|
670
|
+
this.bound = false;
|
|
671
|
+
};
|
|
672
|
+
remove.handlesAbort = true;
|
|
673
|
+
return remove;
|
|
674
|
+
}
|
|
675
|
+
dispose() {
|
|
676
|
+
this.disposed = true;
|
|
677
|
+
return this.abort("input-disposed");
|
|
678
|
+
}
|
|
679
|
+
};
|
|
680
|
+
var ViewWorkspaceShell = class {
|
|
681
|
+
constructor({
|
|
682
|
+
document = globalThis.document,
|
|
683
|
+
window = globalThis,
|
|
684
|
+
mountId = "forgeax-view-workspace",
|
|
685
|
+
element,
|
|
686
|
+
api,
|
|
687
|
+
presentation,
|
|
688
|
+
resourceBrowser = false,
|
|
689
|
+
presentationOnly = false,
|
|
690
|
+
inspectorPanel = true,
|
|
691
|
+
onNavigationSpeed = () => {
|
|
692
|
+
},
|
|
693
|
+
inputControllerFactory = (options) => new ViewWorkspaceInputController(options)
|
|
694
|
+
} = {}) {
|
|
695
|
+
this.document = document;
|
|
696
|
+
this.window = window;
|
|
697
|
+
this.mountId = mountId;
|
|
698
|
+
this.api = api;
|
|
699
|
+
this.presentation = presentation;
|
|
700
|
+
this.resourceBrowser = resourceBrowser === true;
|
|
701
|
+
this.presentationOnly = presentationOnly;
|
|
702
|
+
this.inspectorPanel = inspectorPanel !== false;
|
|
703
|
+
this.inputControllerFactory = inputControllerFactory;
|
|
704
|
+
this.onNavigationSpeed = onNavigationSpeed;
|
|
705
|
+
this.state = {
|
|
706
|
+
selectedTabId: VIEW_WORKSPACE_TAB_ID,
|
|
707
|
+
tabs: [],
|
|
708
|
+
project: null,
|
|
709
|
+
projectTarget: null,
|
|
710
|
+
preview: null,
|
|
711
|
+
assets: [],
|
|
712
|
+
inspection: null,
|
|
713
|
+
inspectorError: null,
|
|
714
|
+
error: null,
|
|
715
|
+
projectOpening: false,
|
|
716
|
+
projectReconnecting: false,
|
|
717
|
+
workspaceTargetLost: false
|
|
718
|
+
};
|
|
719
|
+
this.element = null;
|
|
720
|
+
this.rootElement = null;
|
|
721
|
+
this.tabsElement = null;
|
|
722
|
+
this.projectElement = null;
|
|
723
|
+
this.assetsElement = null;
|
|
724
|
+
this.workbenchElement = null;
|
|
725
|
+
this.inspectorElement = null;
|
|
726
|
+
this.inspectorInfoElement = null;
|
|
727
|
+
this.inspectorFieldsElement = null;
|
|
728
|
+
this.inspectorActionsElement = null;
|
|
729
|
+
this.previewElement = null;
|
|
730
|
+
this.previewInfoElement = null;
|
|
731
|
+
this.errorElement = null;
|
|
732
|
+
this.targetContainer = null;
|
|
733
|
+
this.removeSubscription = void 0;
|
|
734
|
+
this.removeDisconnect = void 0;
|
|
735
|
+
this.removeInput = void 0;
|
|
736
|
+
this.inputController = void 0;
|
|
737
|
+
this.inputTargetId = null;
|
|
738
|
+
this.surfaceByTab = /* @__PURE__ */ new Map();
|
|
739
|
+
this.presentationByTab = /* @__PURE__ */ new Map();
|
|
740
|
+
this.presentationPending = /* @__PURE__ */ new Map();
|
|
741
|
+
this.presentationQueueByTab = /* @__PURE__ */ new Map();
|
|
742
|
+
this.presentationGenerationByTab = /* @__PURE__ */ new Map();
|
|
743
|
+
this.surface = null;
|
|
744
|
+
this.surfaceTargetId = null;
|
|
745
|
+
this.presentedTargetId = null;
|
|
746
|
+
this.removeSurfacePresentation = void 0;
|
|
747
|
+
this.renderFingerprint = "";
|
|
748
|
+
this.disposed = false;
|
|
749
|
+
this.stopSceneAdopt = void 0;
|
|
750
|
+
if (document?.createElement) {
|
|
751
|
+
this.element = element ?? document.getElementById?.(mountId) ?? document.createElement("section");
|
|
752
|
+
this.element.id ||= mountId;
|
|
753
|
+
this.element.dataset.forgeaxView = "workspace";
|
|
754
|
+
if (!this.element.parentNode) document.body?.append?.(this.element);
|
|
755
|
+
this.render();
|
|
756
|
+
}
|
|
757
|
+
if (api) this.connect(api);
|
|
758
|
+
}
|
|
759
|
+
connect(api) {
|
|
760
|
+
this.removeSubscription?.();
|
|
761
|
+
this.removeDisconnect?.();
|
|
762
|
+
this.api = api;
|
|
763
|
+
this.disposed = false;
|
|
764
|
+
this.removeSubscription = api.subscribe?.((state) => this.update(state));
|
|
765
|
+
this.removeDisconnect = api.onDisconnect?.((error) => {
|
|
766
|
+
this.detachInput("resident-disconnect");
|
|
767
|
+
this.fail(error);
|
|
768
|
+
});
|
|
769
|
+
void Promise.resolve().then(() => api.getState?.()).then((state) => this.update(state)).then(() => this.state.project ? this.refreshAssets() : void 0).catch((error) => this.fail(error));
|
|
770
|
+
return this;
|
|
771
|
+
}
|
|
772
|
+
update(snapshot = {}) {
|
|
773
|
+
if (this.disposed) return this.snapshot();
|
|
774
|
+
const next = cloneWorkspaceValue(snapshot);
|
|
775
|
+
if (next.selectedTabId !== void 0 && next.selectedTabId !== this.state.selectedTabId) {
|
|
776
|
+
this.detachInput("tab-selection");
|
|
777
|
+
}
|
|
778
|
+
this.state = {
|
|
779
|
+
...this.state,
|
|
780
|
+
...next,
|
|
781
|
+
assets: Array.isArray(next.assets) ? next.assets : next.assets === null ? [] : this.state.assets,
|
|
782
|
+
inspectorError: next.inspection ? null : this.state.inspectorError,
|
|
783
|
+
projectOpening: next.project ? false : this.state.projectOpening,
|
|
784
|
+
projectReconnecting: next.workspaceTargetLost === false ? false : this.state.projectReconnecting,
|
|
785
|
+
workspaceTargetLost: next.workspaceTargetLost === true,
|
|
786
|
+
error: next.project && !next.workspaceTargetLost ? null : this.state.error
|
|
787
|
+
};
|
|
788
|
+
traceShellUpdate({
|
|
789
|
+
selectedTabId: this.state.selectedTabId,
|
|
790
|
+
cameraVersion: this.state.preview?.cameraVersion,
|
|
791
|
+
previewTargetId: this.state.preview?.target?.targetId
|
|
792
|
+
});
|
|
793
|
+
const fingerprint = workspaceUiFingerprint(this.state);
|
|
794
|
+
this.render({ chromeChanged: fingerprint !== this.renderFingerprint });
|
|
795
|
+
this.renderFingerprint = fingerprint;
|
|
796
|
+
return this.snapshot();
|
|
797
|
+
}
|
|
798
|
+
snapshot() {
|
|
799
|
+
return cloneWorkspaceValue(this.state);
|
|
800
|
+
}
|
|
801
|
+
fail(error) {
|
|
802
|
+
this.state = {
|
|
803
|
+
...this.state,
|
|
804
|
+
error: safeError(error),
|
|
805
|
+
projectOpening: false,
|
|
806
|
+
projectReconnecting: false
|
|
807
|
+
};
|
|
808
|
+
if (this.presentationOnly) {
|
|
809
|
+
reportWorkspaceCommandError(error, { operation: "workspace" });
|
|
810
|
+
}
|
|
811
|
+
this.render();
|
|
812
|
+
this.renderFingerprint = workspaceUiFingerprint(this.state);
|
|
813
|
+
return this.snapshot();
|
|
814
|
+
}
|
|
815
|
+
async refreshAssets() {
|
|
816
|
+
if (!this.api || !this.state.project) return;
|
|
817
|
+
try {
|
|
818
|
+
const result = await this.api.listAssets(this.state.project.id, { tabId: VIEW_WORKSPACE_TAB_ID });
|
|
819
|
+
this.state.assets = result.assets ?? [];
|
|
820
|
+
this.state.error = null;
|
|
821
|
+
const fingerprint = workspaceUiFingerprint(this.state);
|
|
822
|
+
this.render({ chromeChanged: fingerprint !== this.renderFingerprint });
|
|
823
|
+
this.renderFingerprint = fingerprint;
|
|
824
|
+
} catch (error) {
|
|
825
|
+
this.fail(error);
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
async openProject(root) {
|
|
829
|
+
if (this.disposed) return this.snapshot();
|
|
830
|
+
if (!this.api) {
|
|
831
|
+
return this.fail(new Error("View workspace API is not connected"));
|
|
832
|
+
}
|
|
833
|
+
if (this.state.projectOpening) return this.snapshot();
|
|
834
|
+
const path = typeof root === "string" ? root.trim() : "";
|
|
835
|
+
if (!path) {
|
|
836
|
+
return this.fail(new Error("Project root is required"));
|
|
837
|
+
}
|
|
838
|
+
this.state = { ...this.state, error: null, projectOpening: true };
|
|
839
|
+
this.render();
|
|
840
|
+
try {
|
|
841
|
+
const opened = await this.api.openProject(path, { tabId: VIEW_WORKSPACE_TAB_ID });
|
|
842
|
+
if (opened?.project) this.update(opened);
|
|
843
|
+
await this.refreshAssets();
|
|
844
|
+
return this.snapshot();
|
|
845
|
+
} catch (error) {
|
|
846
|
+
return this.fail(error);
|
|
847
|
+
} finally {
|
|
848
|
+
this.state = { ...this.state, projectOpening: false };
|
|
849
|
+
this.render();
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
async reconnectProject() {
|
|
853
|
+
if (this.disposed) return this.snapshot();
|
|
854
|
+
if (!this.api) {
|
|
855
|
+
return this.fail(new Error("View workspace API is not connected"));
|
|
856
|
+
}
|
|
857
|
+
if (this.state.projectReconnecting) return this.snapshot();
|
|
858
|
+
this.state = { ...this.state, error: null, projectReconnecting: true };
|
|
859
|
+
this.render();
|
|
860
|
+
try {
|
|
861
|
+
const opened = await reopenWorkspaceProject(this.api, { window: this.window });
|
|
862
|
+
if (opened?.project) this.update(opened);
|
|
863
|
+
await this.refreshAssets();
|
|
864
|
+
return this.snapshot();
|
|
865
|
+
} catch (error) {
|
|
866
|
+
return this.fail(error);
|
|
867
|
+
} finally {
|
|
868
|
+
this.state = { ...this.state, projectReconnecting: false };
|
|
869
|
+
this.render();
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
async openAsset(guid) {
|
|
873
|
+
try {
|
|
874
|
+
await this.api.openAsset(guid, { projectId: this.state.project?.id, tabId: VIEW_WORKSPACE_TAB_ID });
|
|
875
|
+
} catch (error) {
|
|
876
|
+
this.fail(error);
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
async selectAsset(guid) {
|
|
880
|
+
if (!this.api || !this.state.project) return;
|
|
881
|
+
try {
|
|
882
|
+
const inspected = await this.api.inspectAsset(guid, {
|
|
883
|
+
projectId: this.state.project.id,
|
|
884
|
+
tabId: VIEW_WORKSPACE_TAB_ID
|
|
885
|
+
});
|
|
886
|
+
this.state.inspection = inspected.inspection ?? this.state.inspection;
|
|
887
|
+
this.state.inspectorError = null;
|
|
888
|
+
} catch (error) {
|
|
889
|
+
this.state.inspectorError = safeError(error);
|
|
890
|
+
this.render();
|
|
891
|
+
}
|
|
892
|
+
const asset = this.state.assets.find((candidate) => candidate.guid === guid) ?? this.state.inspection?.asset;
|
|
893
|
+
if (this.resourceBrowser) {
|
|
894
|
+
this.render();
|
|
895
|
+
return;
|
|
896
|
+
}
|
|
897
|
+
if (asset?.previewable === false || this.state.preview?.asset?.guid === guid) {
|
|
898
|
+
this.render();
|
|
899
|
+
return;
|
|
900
|
+
}
|
|
901
|
+
await this.openAsset(guid);
|
|
902
|
+
}
|
|
903
|
+
async cookSelected(mode = "rebuild") {
|
|
904
|
+
const guid = this.state.inspection?.guid ?? this.state.preview?.asset?.guid;
|
|
905
|
+
if (!this.api || !this.state.project || !guid) return;
|
|
906
|
+
try {
|
|
907
|
+
const call = mode === "cold-cook" ? this.api.coldCookAssetSource : this.api.rebuildAssetSource;
|
|
908
|
+
if (typeof call !== "function") {
|
|
909
|
+
throw new Error(`Engine ${mode === "cold-cook" ? "asset-source.cold-cook" : "asset-source.rebuild"} is unavailable`);
|
|
910
|
+
}
|
|
911
|
+
await call.call(this.api, guid, {
|
|
912
|
+
projectId: this.state.project.id,
|
|
913
|
+
tabId: VIEW_WORKSPACE_TAB_ID,
|
|
914
|
+
expectedRevision: this.state.inspection?.revision
|
|
915
|
+
});
|
|
916
|
+
this.state.inspectorError = null;
|
|
917
|
+
} catch (error) {
|
|
918
|
+
this.state.inspectorError = safeError(error);
|
|
919
|
+
this.render();
|
|
920
|
+
throw error;
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
async closeProject() {
|
|
924
|
+
try {
|
|
925
|
+
await this.api.closeProject(this.state.project?.id, { tabId: VIEW_WORKSPACE_TAB_ID });
|
|
926
|
+
} catch (error) {
|
|
927
|
+
this.fail(error);
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
async selectTab(tabId) {
|
|
931
|
+
this.detachInput("tab-selection");
|
|
932
|
+
try {
|
|
933
|
+
await this.api.selectTab(tabId);
|
|
934
|
+
} catch (error) {
|
|
935
|
+
this.fail(error);
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
async closePreview() {
|
|
939
|
+
await this.inputController?.abort("preview-close");
|
|
940
|
+
try {
|
|
941
|
+
await this.api.closePreview({ targetId: this.state.preview?.target?.targetId, targetGeneration: this.state.preview?.target?.generation, tabId: VIEW_WORKSPACE_TAB_ID });
|
|
942
|
+
} catch (error) {
|
|
943
|
+
this.fail(error);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
replaceSurface(target) {
|
|
947
|
+
this.ensureSurface(VIEW_WORKSPACE_TAB_ID, target);
|
|
948
|
+
this.setActiveSurface();
|
|
949
|
+
}
|
|
950
|
+
attachSurfacePresentation(target) {
|
|
951
|
+
const entry = this.surfaceByTab.get(VIEW_WORKSPACE_TAB_ID);
|
|
952
|
+
this.attachTargetPresentation(VIEW_WORKSPACE_TAB_ID, target, entry?.surface);
|
|
953
|
+
}
|
|
954
|
+
targetForTab(tabId) {
|
|
955
|
+
if (tabId === VIEW_WORKSPACE_TAB_ID) return selectWorkspaceEditorSurfaceTarget(this.state);
|
|
956
|
+
const tab = (this.state.tabs ?? []).find((candidate) => candidate.tabId === tabId);
|
|
957
|
+
if (!tab) return null;
|
|
958
|
+
if (tab.target) {
|
|
959
|
+
return {
|
|
960
|
+
...tab.target,
|
|
961
|
+
targetId: String(tab.target.targetId ?? tab.targetId ?? ""),
|
|
962
|
+
headed: tab.target.headed !== false,
|
|
963
|
+
width: tab.target.width ?? tab.width ?? 1280,
|
|
964
|
+
height: tab.target.height ?? tab.height ?? 720
|
|
965
|
+
};
|
|
966
|
+
}
|
|
967
|
+
if (tab.targetId === void 0 || tab.targetId === null) return null;
|
|
968
|
+
return {
|
|
969
|
+
targetId: String(tab.targetId),
|
|
970
|
+
headed: true,
|
|
971
|
+
width: tab.width ?? 1280,
|
|
972
|
+
height: tab.height ?? 720
|
|
973
|
+
};
|
|
974
|
+
}
|
|
975
|
+
presentationForTab(tabId) {
|
|
976
|
+
const candidate = tabId === VIEW_DISPLAY_TAB_ID ? this.presentation?.display : this.presentation?.workspace;
|
|
977
|
+
if (candidate && (typeof candidate.attach === "function" || typeof candidate.createSurface === "function"))
|
|
978
|
+
return candidate;
|
|
979
|
+
return this.presentation;
|
|
980
|
+
}
|
|
981
|
+
presentationOwnsPlacement(presentation) {
|
|
982
|
+
return presentation?.surfacePlacement === "owner";
|
|
983
|
+
}
|
|
984
|
+
createPresentedSurface(tabId, target, presentationOverride) {
|
|
985
|
+
const presentation = presentationOverride ?? this.presentationForTab(tabId);
|
|
986
|
+
if (typeof presentation?.createSurface !== "function") return null;
|
|
987
|
+
const surface = presentation.createSurface({
|
|
988
|
+
tabId,
|
|
989
|
+
target,
|
|
990
|
+
document: this.document
|
|
991
|
+
});
|
|
992
|
+
if (surface === null || surface === void 0) return null;
|
|
993
|
+
if (typeof surface !== "object") {
|
|
994
|
+
throw new TypeError("View target presentation createSurface must return a DOM element");
|
|
995
|
+
}
|
|
996
|
+
return surface;
|
|
997
|
+
}
|
|
998
|
+
ensureSurface(tabId, target) {
|
|
999
|
+
const targetId = target?.targetId === void 0 ? null : String(target.targetId);
|
|
1000
|
+
const current = this.surfaceByTab.get(tabId);
|
|
1001
|
+
const presentation = this.presentationForTab(tabId);
|
|
1002
|
+
const surfacePlacement = this.presentationOwnsPlacement(presentation) ? "owner" : "shell";
|
|
1003
|
+
const exactIdentityMatches = sameTargetIdentity(current?.target, target);
|
|
1004
|
+
if (!targetId) {
|
|
1005
|
+
if (current) {
|
|
1006
|
+
if (current.exactSurface) {
|
|
1007
|
+
if (current.targetId !== null) {
|
|
1008
|
+
current.targetId = null;
|
|
1009
|
+
current.target = null;
|
|
1010
|
+
current.reacquire = true;
|
|
1011
|
+
void this.detachTargetPresentation(tabId).catch((error) => this.fail(error));
|
|
1012
|
+
}
|
|
1013
|
+
} else {
|
|
1014
|
+
void this.detachTargetPresentation(tabId).catch((error) => this.fail(error));
|
|
1015
|
+
this.surfaceByTab.delete(tabId);
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
return null;
|
|
1019
|
+
}
|
|
1020
|
+
if (current && current.targetId === targetId && (!current.exactSurface || exactIdentityMatches)) {
|
|
1021
|
+
current.target = target;
|
|
1022
|
+
if (!current.exactSurface) {
|
|
1023
|
+
const width = target?.width ?? current.surface.width ?? 1280;
|
|
1024
|
+
const height = target?.height ?? current.surface.height ?? 720;
|
|
1025
|
+
if (current.surface.width !== width) current.surface.width = width;
|
|
1026
|
+
if (current.surface.height !== height) current.surface.height = height;
|
|
1027
|
+
}
|
|
1028
|
+
return current.surface;
|
|
1029
|
+
}
|
|
1030
|
+
if (current && current.exactSurface) {
|
|
1031
|
+
current.targetId = targetId;
|
|
1032
|
+
current.target = target;
|
|
1033
|
+
current.reacquire = true;
|
|
1034
|
+
current.surfacePlacement = surfacePlacement;
|
|
1035
|
+
return current.surface;
|
|
1036
|
+
}
|
|
1037
|
+
if (current) {
|
|
1038
|
+
void this.detachTargetPresentation(tabId).catch((error) => this.fail(error));
|
|
1039
|
+
}
|
|
1040
|
+
if (!this.document?.createElement) return null;
|
|
1041
|
+
const presentedSurface = this.createPresentedSurface(tabId, target, presentation);
|
|
1042
|
+
if ((surfacePlacement === "owner" || typeof presentation?.createSurface === "function") && presentedSurface === null) {
|
|
1043
|
+
this.surfaceByTab.delete(tabId);
|
|
1044
|
+
return null;
|
|
1045
|
+
}
|
|
1046
|
+
const surface = presentedSurface ?? this.document.createElement("canvas");
|
|
1047
|
+
const exactSurface = presentedSurface !== null;
|
|
1048
|
+
const resolvedSurfacePlacement = exactSurface && surfacePlacement === "owner" ? "owner" : "shell";
|
|
1049
|
+
if (!exactSurface) {
|
|
1050
|
+
this.markSurface(surface, tabId, targetId);
|
|
1051
|
+
surface.width = target?.width ?? 1280;
|
|
1052
|
+
surface.height = target?.height ?? 720;
|
|
1053
|
+
}
|
|
1054
|
+
this.surfaceByTab.set(tabId, {
|
|
1055
|
+
targetId,
|
|
1056
|
+
target,
|
|
1057
|
+
exactSurface,
|
|
1058
|
+
surfacePlacement: resolvedSurfacePlacement,
|
|
1059
|
+
reacquire: false,
|
|
1060
|
+
surface
|
|
1061
|
+
});
|
|
1062
|
+
return surface;
|
|
1063
|
+
}
|
|
1064
|
+
setActiveSurface() {
|
|
1065
|
+
const selected = this.surfaceByTab.get(this.state.selectedTabId);
|
|
1066
|
+
const active = selected?.targetId ? selected : null;
|
|
1067
|
+
this.surface = active?.surface ?? null;
|
|
1068
|
+
this.surfaceTargetId = active?.targetId ?? null;
|
|
1069
|
+
this.presentedTargetId = active?.targetId ?? null;
|
|
1070
|
+
}
|
|
1071
|
+
attachTargetPresentation(tabId, target, surface) {
|
|
1072
|
+
const presentation = this.presentationForTab(tabId);
|
|
1073
|
+
if (!target || !surface || !presentation?.attach && !presentation?.createSurface) return;
|
|
1074
|
+
const current = this.presentationByTab.get(tabId);
|
|
1075
|
+
if (current && sameTargetIdentity(current.target, target) && current.surface === surface && current.generation === this.presentationGenerationByTab.get(tabId)) return;
|
|
1076
|
+
tracePresentationAttach(tabId, String(target.targetId), surface);
|
|
1077
|
+
const pending = this.presentationPending.get(tabId);
|
|
1078
|
+
if (pending && sameTargetIdentity(pending.target, target) && pending.surface === surface && pending.generation === this.presentationGenerationByTab.get(tabId)) return;
|
|
1079
|
+
const generation = (this.presentationGenerationByTab.get(tabId) ?? 0) + 1;
|
|
1080
|
+
this.presentationGenerationByTab.set(tabId, generation);
|
|
1081
|
+
const task = this.enqueuePresentation(tabId, async () => {
|
|
1082
|
+
if (this.disposed || generation !== this.presentationGenerationByTab.get(tabId)) {
|
|
1083
|
+
await this.releaseUnattachedPresentation({ presentation, target, surface, tabId });
|
|
1084
|
+
return;
|
|
1085
|
+
}
|
|
1086
|
+
const previous = this.presentationByTab.get(tabId);
|
|
1087
|
+
if (previous) await this.releasePresentationEntry(tabId, previous);
|
|
1088
|
+
if (this.disposed || generation !== this.presentationGenerationByTab.get(tabId)) {
|
|
1089
|
+
await this.releaseUnattachedPresentation({ presentation, target, surface, tabId });
|
|
1090
|
+
return;
|
|
1091
|
+
}
|
|
1092
|
+
let attachSurface = surface;
|
|
1093
|
+
const surfaceEntry = this.surfaceByTab.get(tabId);
|
|
1094
|
+
if (surfaceEntry?.surface === surface && surfaceEntry.exactSurface && surfaceEntry.reacquire) {
|
|
1095
|
+
const refreshed = this.createPresentedSurface(tabId, target, presentation);
|
|
1096
|
+
if (refreshed !== null) {
|
|
1097
|
+
attachSurface = refreshed;
|
|
1098
|
+
surfaceEntry.surface = refreshed;
|
|
1099
|
+
surfaceEntry.reacquire = false;
|
|
1100
|
+
} else {
|
|
1101
|
+
this.surfaceByTab.delete(tabId);
|
|
1102
|
+
this.setActiveSurface();
|
|
1103
|
+
return;
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
const restore = surfaceEntry?.exactSurface && surfaceEntry.surfacePlacement !== "owner" ? borrowSurface(attachSurface, this.targetContainer) : void 0;
|
|
1107
|
+
this.markSurface(attachSurface, tabId, target.targetId);
|
|
1108
|
+
this.adoptPresentationSurface(attachSurface, {
|
|
1109
|
+
external: surfaceEntry?.surfacePlacement === "owner"
|
|
1110
|
+
});
|
|
1111
|
+
const entry = {
|
|
1112
|
+
target,
|
|
1113
|
+
targetId: String(target.targetId),
|
|
1114
|
+
surface: attachSurface,
|
|
1115
|
+
presentation,
|
|
1116
|
+
surfacePlacement: surfaceEntry?.surfacePlacement ?? "shell",
|
|
1117
|
+
generation,
|
|
1118
|
+
remove: void 0,
|
|
1119
|
+
restore
|
|
1120
|
+
};
|
|
1121
|
+
this.presentationByTab.set(tabId, entry);
|
|
1122
|
+
try {
|
|
1123
|
+
const remove = await presentation.attach?.({ target, element: attachSurface, tabId });
|
|
1124
|
+
if (typeof remove === "function") entry.remove = remove;
|
|
1125
|
+
if (this.presentationByTab.get(tabId) !== entry || entry.generation !== this.presentationGenerationByTab.get(tabId) || this.disposed) {
|
|
1126
|
+
await this.releasePresentationEntry(tabId, entry);
|
|
1127
|
+
return;
|
|
1128
|
+
}
|
|
1129
|
+
entry.ready = true;
|
|
1130
|
+
this.setActiveSurface();
|
|
1131
|
+
this.render({ chromeChanged: false });
|
|
1132
|
+
} catch (error) {
|
|
1133
|
+
await this.releasePresentationEntry(tabId, entry).catch(() => {
|
|
1134
|
+
});
|
|
1135
|
+
entry.remove = () => {
|
|
1136
|
+
};
|
|
1137
|
+
entry.ready = false;
|
|
1138
|
+
this.presentationByTab.set(tabId, entry);
|
|
1139
|
+
throw error;
|
|
1140
|
+
}
|
|
1141
|
+
});
|
|
1142
|
+
const pendingEntry = { target, generation, surface, task };
|
|
1143
|
+
this.presentationPending.set(tabId, pendingEntry);
|
|
1144
|
+
void task.then(
|
|
1145
|
+
() => {
|
|
1146
|
+
if (this.presentationPending.get(tabId) === pendingEntry) this.presentationPending.delete(tabId);
|
|
1147
|
+
},
|
|
1148
|
+
(error) => {
|
|
1149
|
+
if (this.presentationPending.get(tabId) === pendingEntry) this.presentationPending.delete(tabId);
|
|
1150
|
+
this.fail(error);
|
|
1151
|
+
}
|
|
1152
|
+
);
|
|
1153
|
+
}
|
|
1154
|
+
markSurface(surface, tabId, targetId) {
|
|
1155
|
+
surface.dataset.forgeaxViewTargetId = String(targetId);
|
|
1156
|
+
surface.dataset.forgeaxViewTabId = tabId;
|
|
1157
|
+
surface.dataset.forgeaxViewSurface = tabId === VIEW_DISPLAY_TAB_ID ? "engine-target" : "engine-canvas";
|
|
1158
|
+
surface.setAttribute?.("aria-label", `Engine target ${targetId}`);
|
|
1159
|
+
}
|
|
1160
|
+
enqueuePresentation(tabId, operation) {
|
|
1161
|
+
const previous = this.presentationQueueByTab.get(tabId) ?? Promise.resolve();
|
|
1162
|
+
const task = previous.catch(() => {
|
|
1163
|
+
}).then(operation);
|
|
1164
|
+
this.presentationQueueByTab.set(tabId, task);
|
|
1165
|
+
void task.then(
|
|
1166
|
+
() => {
|
|
1167
|
+
if (this.presentationQueueByTab.get(tabId) === task) this.presentationQueueByTab.delete(tabId);
|
|
1168
|
+
},
|
|
1169
|
+
() => {
|
|
1170
|
+
if (this.presentationQueueByTab.get(tabId) === task) this.presentationQueueByTab.delete(tabId);
|
|
1171
|
+
}
|
|
1172
|
+
);
|
|
1173
|
+
return task;
|
|
1174
|
+
}
|
|
1175
|
+
async runPresentationCleanup(remove) {
|
|
1176
|
+
if (typeof remove === "function") await Promise.resolve(remove());
|
|
1177
|
+
}
|
|
1178
|
+
async releaseUnattachedPresentation({ presentation, target, surface, tabId }) {
|
|
1179
|
+
if (this.presentationByTab.get(tabId)?.surface === surface) return;
|
|
1180
|
+
if (typeof presentation?.detach === "function") {
|
|
1181
|
+
await Promise.resolve(presentation.detach({ target, element: surface, tabId })).catch(() => {
|
|
1182
|
+
});
|
|
1183
|
+
return;
|
|
1184
|
+
}
|
|
1185
|
+
if (typeof presentation?.attach === "function") {
|
|
1186
|
+
const remove = await presentation.attach({ target, element: surface, tabId });
|
|
1187
|
+
await this.runPresentationCleanup(remove);
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
adoptPresentationSurface(surface, { external = false } = {}) {
|
|
1191
|
+
if (external || !surface || !this.targetContainer) return;
|
|
1192
|
+
if (surface.parentNode !== this.targetContainer) this.targetContainer.append?.(surface);
|
|
1193
|
+
}
|
|
1194
|
+
async releasePresentationEntry(tabId, entry) {
|
|
1195
|
+
if (this.presentationByTab.get(tabId) === entry) this.presentationByTab.delete(tabId);
|
|
1196
|
+
entry.restore?.();
|
|
1197
|
+
let failure;
|
|
1198
|
+
if (entry.remove) {
|
|
1199
|
+
try {
|
|
1200
|
+
await this.runPresentationCleanup(entry.remove);
|
|
1201
|
+
} catch (error) {
|
|
1202
|
+
failure = error;
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
if (!entry.remove || failure !== void 0) {
|
|
1206
|
+
try {
|
|
1207
|
+
await Promise.resolve(
|
|
1208
|
+
entry.presentation?.detach?.({ target: entry.target, element: entry.surface, tabId })
|
|
1209
|
+
);
|
|
1210
|
+
} catch (error) {
|
|
1211
|
+
failure ??= error;
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
if (failure !== void 0) throw failure;
|
|
1215
|
+
}
|
|
1216
|
+
async detachTargetPresentation(tabId, { invalidate = true } = {}) {
|
|
1217
|
+
if (invalidate) {
|
|
1218
|
+
this.presentationGenerationByTab.set(
|
|
1219
|
+
tabId,
|
|
1220
|
+
(this.presentationGenerationByTab.get(tabId) ?? 0) + 1
|
|
1221
|
+
);
|
|
1222
|
+
}
|
|
1223
|
+
return this.enqueuePresentation(tabId, async () => {
|
|
1224
|
+
const entry = this.presentationByTab.get(tabId);
|
|
1225
|
+
if (entry) await this.releasePresentationEntry(tabId, entry);
|
|
1226
|
+
});
|
|
1227
|
+
}
|
|
1228
|
+
ensureDom() {
|
|
1229
|
+
if (!this.element || !this.document) return false;
|
|
1230
|
+
if (this.rootElement) return true;
|
|
1231
|
+
const root = this.document.createElement("div");
|
|
1232
|
+
root.dataset.forgeaxViewWorkspace = "root";
|
|
1233
|
+
this.rootElement = root;
|
|
1234
|
+
this.tabsElement = this.document.createElement("nav");
|
|
1235
|
+
this.tabsElement.dataset.forgeaxViewWorkspace = "tabs";
|
|
1236
|
+
this.projectElement = this.document.createElement("div");
|
|
1237
|
+
this.projectElement.dataset.forgeaxViewWorkspace = "project";
|
|
1238
|
+
this.workbenchElement = this.document.createElement("div");
|
|
1239
|
+
this.workbenchElement.dataset.forgeaxViewWorkspace = "workbench";
|
|
1240
|
+
const rail = this.document.createElement("div");
|
|
1241
|
+
rail.dataset.forgeaxViewWorkspace = "rail";
|
|
1242
|
+
this.assetsElement = this.document.createElement("ul");
|
|
1243
|
+
this.assetsElement.dataset.forgeaxViewWorkspace = "assets";
|
|
1244
|
+
rail.append?.(this.assetsElement);
|
|
1245
|
+
this.previewElement = this.document.createElement("div");
|
|
1246
|
+
this.previewElement.dataset.forgeaxViewWorkspace = "preview";
|
|
1247
|
+
this.previewInfoElement = this.document.createElement("div");
|
|
1248
|
+
this.previewInfoElement.dataset.forgeaxViewWorkspace = "preview-info";
|
|
1249
|
+
this.targetContainer = this.document.createElement("div");
|
|
1250
|
+
this.targetContainer.dataset.forgeaxViewWorkspace = "targets";
|
|
1251
|
+
if (this.targetContainer.style) this.targetContainer.style.position = "relative";
|
|
1252
|
+
this.previewElement.append?.(...this.presentationOnly ? [] : [this.previewInfoElement], this.targetContainer);
|
|
1253
|
+
this.inspectorElement = this.document.createElement("aside");
|
|
1254
|
+
this.inspectorElement.dataset.forgeaxViewWorkspace = "inspector";
|
|
1255
|
+
this.inspectorInfoElement = this.document.createElement("div");
|
|
1256
|
+
this.inspectorInfoElement.dataset.forgeaxViewWorkspace = "inspector-info";
|
|
1257
|
+
this.inspectorFieldsElement = this.document.createElement("div");
|
|
1258
|
+
this.inspectorFieldsElement.dataset.forgeaxViewWorkspace = "inspector-fields";
|
|
1259
|
+
this.inspectorActionsElement = this.document.createElement("div");
|
|
1260
|
+
this.inspectorActionsElement.dataset.forgeaxViewWorkspace = "inspector-actions";
|
|
1261
|
+
this.inspectorElement.append?.(
|
|
1262
|
+
this.inspectorInfoElement,
|
|
1263
|
+
this.inspectorFieldsElement,
|
|
1264
|
+
this.inspectorActionsElement
|
|
1265
|
+
);
|
|
1266
|
+
this.workbenchElement.append?.(
|
|
1267
|
+
...this.presentationOnly ? [] : [rail],
|
|
1268
|
+
this.previewElement,
|
|
1269
|
+
...this.inspectorPanel ? [this.inspectorElement] : []
|
|
1270
|
+
);
|
|
1271
|
+
if (!this.presentationOnly) {
|
|
1272
|
+
this.errorElement = this.document.createElement("div");
|
|
1273
|
+
this.errorElement.dataset.forgeaxViewWorkspace = "error";
|
|
1274
|
+
this.errorElement.setAttribute?.("role", "alert");
|
|
1275
|
+
}
|
|
1276
|
+
root.append?.(
|
|
1277
|
+
...this.presentationOnly ? [] : [this.tabsElement, this.projectElement],
|
|
1278
|
+
this.workbenchElement,
|
|
1279
|
+
...this.errorElement ? [this.errorElement] : []
|
|
1280
|
+
);
|
|
1281
|
+
if (root.parentNode !== this.element) this.element.append?.(root);
|
|
1282
|
+
this.stopSceneAdopt = keepSurfaceInContainer({
|
|
1283
|
+
document: this.document,
|
|
1284
|
+
getContainer: () => this.disposed ? null : this.targetContainer,
|
|
1285
|
+
getSurface: () => readSceneShell(this.document),
|
|
1286
|
+
onPlace: (surface) => {
|
|
1287
|
+
if (!surface?.style) return;
|
|
1288
|
+
Object.assign(surface.style, {
|
|
1289
|
+
width: "100%",
|
|
1290
|
+
height: "100%",
|
|
1291
|
+
maxWidth: "100%",
|
|
1292
|
+
maxHeight: "100%",
|
|
1293
|
+
position: "relative",
|
|
1294
|
+
transform: "none",
|
|
1295
|
+
overflow: "hidden"
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1298
|
+
});
|
|
1299
|
+
traceShellRegisterDomRoot(root);
|
|
1300
|
+
return true;
|
|
1301
|
+
}
|
|
1302
|
+
syncTargetSurfaces() {
|
|
1303
|
+
const surfaces = this.targetContainer;
|
|
1304
|
+
if (!surfaces) return;
|
|
1305
|
+
let removed = 0;
|
|
1306
|
+
let reordered = 0;
|
|
1307
|
+
const desired = [];
|
|
1308
|
+
for (const tabId of [VIEW_DISPLAY_TAB_ID, VIEW_WORKSPACE_TAB_ID]) {
|
|
1309
|
+
const entry = this.surfaceByTab.get(tabId);
|
|
1310
|
+
if (!entry || !entry.targetId || !entry.target) continue;
|
|
1311
|
+
this.attachTargetPresentation(tabId, entry.target, entry.surface);
|
|
1312
|
+
const attached = this.presentationByTab.get(tabId);
|
|
1313
|
+
if (entry.exactSurface && (!attached?.ready || !sameTargetIdentity(attached.target, entry.target))) continue;
|
|
1314
|
+
const selected = this.state.selectedTabId === tabId && !(tabId === VIEW_WORKSPACE_TAB_ID && this.state.targetBinding === "play");
|
|
1315
|
+
if (entry.exactSurface && tabId === VIEW_DISPLAY_TAB_ID) {
|
|
1316
|
+
if (entry.surface.hidden !== false) entry.surface.hidden = false;
|
|
1317
|
+
if (entry.surface.style) {
|
|
1318
|
+
const visibility = selected ? "visible" : "hidden";
|
|
1319
|
+
const pointerEvents = selected ? "auto" : "none";
|
|
1320
|
+
if (entry.surface.style.visibility !== visibility) entry.surface.style.visibility = visibility;
|
|
1321
|
+
if (entry.surface.style.pointerEvents !== pointerEvents) entry.surface.style.pointerEvents = pointerEvents;
|
|
1322
|
+
}
|
|
1323
|
+
} else {
|
|
1324
|
+
const hidden = !selected;
|
|
1325
|
+
if (entry.surface.hidden !== hidden) entry.surface.hidden = hidden;
|
|
1326
|
+
if (entry.surface.style) {
|
|
1327
|
+
const display = selected ? "" : "none";
|
|
1328
|
+
if (entry.surface.style.display !== display) entry.surface.style.display = display;
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
const selectedMark = selected ? "true" : "false";
|
|
1332
|
+
if (entry.surface.dataset.forgeaxViewSelected !== selectedMark) {
|
|
1333
|
+
entry.surface.dataset.forgeaxViewSelected = selectedMark;
|
|
1334
|
+
}
|
|
1335
|
+
if (entry.surfacePlacement !== "owner") desired.push(entry.surface);
|
|
1336
|
+
}
|
|
1337
|
+
for (const child of [...surfaces.children ?? []]) {
|
|
1338
|
+
if (!desired.includes(child)) {
|
|
1339
|
+
if (child?.id === "app-shell") continue;
|
|
1340
|
+
if ([...this.presentationByTab.values()].some((entry) => entry.surface === child)) continue;
|
|
1341
|
+
child.remove?.();
|
|
1342
|
+
removed += 1;
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
for (let index = 0; index < desired.length; index += 1) {
|
|
1346
|
+
const surface = desired[index];
|
|
1347
|
+
if (surfaces.children?.[index] === surface) continue;
|
|
1348
|
+
reordered += 1;
|
|
1349
|
+
const before = surfaces.children?.[index] ?? null;
|
|
1350
|
+
if (surfaces.insertBefore) surfaces.insertBefore(surface, before);
|
|
1351
|
+
else surfaces.append?.(surface);
|
|
1352
|
+
}
|
|
1353
|
+
traceSyncTargetSurfaces({ removed, reordered, desired: desired.length });
|
|
1354
|
+
}
|
|
1355
|
+
render({ chromeChanged = true } = {}) {
|
|
1356
|
+
if (this.disposed || !this.element || !this.document) return;
|
|
1357
|
+
const renderStarted = isViewTraceEnabled() ? performance.now() : 0;
|
|
1358
|
+
const workspaceTarget = this.targetForTab(VIEW_WORKSPACE_TAB_ID);
|
|
1359
|
+
const displayTarget = this.targetForTab(VIEW_DISPLAY_TAB_ID);
|
|
1360
|
+
this.ensureSurface(VIEW_WORKSPACE_TAB_ID, workspaceTarget);
|
|
1361
|
+
this.ensureSurface(VIEW_DISPLAY_TAB_ID, displayTarget);
|
|
1362
|
+
this.setActiveSurface();
|
|
1363
|
+
const nextTargetId = workspaceTarget?.targetId ?? null;
|
|
1364
|
+
const workspaceSurfaceEntry = this.surfaceByTab.get(VIEW_WORKSPACE_TAB_ID);
|
|
1365
|
+
if (nextTargetId !== this.inputTargetId || workspaceTarget?.generation !== this.inputTargetGeneration || workspaceSurfaceEntry?.surface !== this.inputSurface) {
|
|
1366
|
+
this.detachInput("target-replaced");
|
|
1367
|
+
this.removeInput?.();
|
|
1368
|
+
this.removeInput = void 0;
|
|
1369
|
+
this.inputController = void 0;
|
|
1370
|
+
this.inputTargetId = nextTargetId;
|
|
1371
|
+
this.inputTargetGeneration = workspaceTarget?.generation;
|
|
1372
|
+
this.inputSurface = workspaceSurfaceEntry?.surface;
|
|
1373
|
+
}
|
|
1374
|
+
if (!this.ensureDom()) return;
|
|
1375
|
+
let domReplaceChildren = 0;
|
|
1376
|
+
const tabs = this.tabsElement;
|
|
1377
|
+
const project = this.projectElement;
|
|
1378
|
+
const assets = this.assetsElement;
|
|
1379
|
+
const previewInfo = this.previewInfoElement;
|
|
1380
|
+
const inspectorInfo = this.inspectorInfoElement;
|
|
1381
|
+
const inspectorFields = this.inspectorFieldsElement;
|
|
1382
|
+
const inspectorActions = this.inspectorActionsElement;
|
|
1383
|
+
const error = this.errorElement;
|
|
1384
|
+
if (chromeChanged) {
|
|
1385
|
+
if (tabs?.replaceChildren) {
|
|
1386
|
+
tabs.replaceChildren();
|
|
1387
|
+
domReplaceChildren += 1;
|
|
1388
|
+
}
|
|
1389
|
+
for (const tab of this.state.tabs ?? []) {
|
|
1390
|
+
tabs.append?.(
|
|
1391
|
+
button(this.document, `${tab.kind}: ${tab.tabId}`, () => this.selectTab(tab.tabId), {
|
|
1392
|
+
disabled: tab.selected === true
|
|
1393
|
+
})
|
|
1394
|
+
);
|
|
1395
|
+
}
|
|
1396
|
+
if (project?.replaceChildren) {
|
|
1397
|
+
project.replaceChildren();
|
|
1398
|
+
domReplaceChildren += 1;
|
|
1399
|
+
}
|
|
1400
|
+
if (this.state.project) {
|
|
1401
|
+
project.append?.(text(this.document, `Project: ${this.state.project.name ?? this.state.project.id}`));
|
|
1402
|
+
project.append?.(button(this.document, "Refresh assets", () => this.refreshAssets()));
|
|
1403
|
+
project.append?.(button(this.document, "Close project", () => this.closeProject()));
|
|
1404
|
+
} else {
|
|
1405
|
+
project.append?.(
|
|
1406
|
+
text(this.document, "Project opens from the View owner process.")
|
|
1407
|
+
);
|
|
1408
|
+
}
|
|
1409
|
+
if (this.state.workspaceTargetLost && this.state.project?.root) {
|
|
1410
|
+
const reconnectLabel = this.state.projectReconnecting ? "Reconnecting project\u2026" : "Reconnect project";
|
|
1411
|
+
project.append?.(
|
|
1412
|
+
button(this.document, reconnectLabel, () => this.reconnectProject(), {
|
|
1413
|
+
disabled: this.state.projectReconnecting === true
|
|
1414
|
+
})
|
|
1415
|
+
);
|
|
1416
|
+
}
|
|
1417
|
+
if (assets?.replaceChildren) {
|
|
1418
|
+
assets.replaceChildren();
|
|
1419
|
+
domReplaceChildren += 1;
|
|
1420
|
+
}
|
|
1421
|
+
for (const group of groupAssetsBySource(this.state.assets)) {
|
|
1422
|
+
const item = this.document.createElement("li");
|
|
1423
|
+
item.dataset.forgeaxViewWorkspace = "asset-group";
|
|
1424
|
+
item.dataset.sourcePath = group.key;
|
|
1425
|
+
item.append?.(text(this.document, group.key));
|
|
1426
|
+
const members = this.document.createElement("ul");
|
|
1427
|
+
for (const asset of group.assets) {
|
|
1428
|
+
const member = this.document.createElement("li");
|
|
1429
|
+
member.dataset.forgeaxViewWorkspace = "asset";
|
|
1430
|
+
member.dataset.guid = asset.guid;
|
|
1431
|
+
member.dataset.kind = asset.kind;
|
|
1432
|
+
if (asset.sourceKind) member.dataset.sourceKind = asset.sourceKind;
|
|
1433
|
+
const ddcState = catalogDdcState(asset, this.state.inspection);
|
|
1434
|
+
const receipt = catalogReceipt(asset, this.state.inspection);
|
|
1435
|
+
if (ddcState) member.dataset.ddcState = ddcState;
|
|
1436
|
+
if (receipt) member.dataset.cookReceiptUrl = receipt;
|
|
1437
|
+
const selected = this.state.inspection?.guid === asset.guid;
|
|
1438
|
+
const label = `${asset.name ?? asset.guid} (${asset.kind}${ddcState ? ` \xB7 ${ddcState}` : ""})`;
|
|
1439
|
+
member.append?.(
|
|
1440
|
+
button(this.document, label, () => this.selectAsset(asset.guid), {
|
|
1441
|
+
disabled: selected
|
|
1442
|
+
})
|
|
1443
|
+
);
|
|
1444
|
+
members.append?.(member);
|
|
1445
|
+
}
|
|
1446
|
+
item.append?.(members);
|
|
1447
|
+
assets.append?.(item);
|
|
1448
|
+
}
|
|
1449
|
+
if (previewInfo?.replaceChildren) {
|
|
1450
|
+
previewInfo.replaceChildren();
|
|
1451
|
+
domReplaceChildren += 1;
|
|
1452
|
+
}
|
|
1453
|
+
if (this.state.preview) {
|
|
1454
|
+
previewInfo.append?.(
|
|
1455
|
+
text(this.document, `Target: ${this.state.preview.asset?.name ?? this.state.preview.asset?.guid ?? "Game"}`),
|
|
1456
|
+
...this.state.preview.asset ? [button(this.document, "Close preview", () => this.closePreview())] : []
|
|
1457
|
+
);
|
|
1458
|
+
} else {
|
|
1459
|
+
previewInfo.append?.(text(this.document, "No asset preview open"));
|
|
1460
|
+
}
|
|
1461
|
+
if (inspectorInfo?.replaceChildren) {
|
|
1462
|
+
inspectorInfo.replaceChildren();
|
|
1463
|
+
domReplaceChildren += 1;
|
|
1464
|
+
}
|
|
1465
|
+
if (inspectorFields?.replaceChildren) {
|
|
1466
|
+
inspectorFields.replaceChildren();
|
|
1467
|
+
domReplaceChildren += 1;
|
|
1468
|
+
}
|
|
1469
|
+
if (inspectorActions?.replaceChildren) {
|
|
1470
|
+
inspectorActions.replaceChildren();
|
|
1471
|
+
domReplaceChildren += 1;
|
|
1472
|
+
}
|
|
1473
|
+
const inspection = this.state.inspection;
|
|
1474
|
+
if (this.state.inspectorError) {
|
|
1475
|
+
inspectorInfo?.append?.(text(this.document, `Inspector: ${this.state.inspectorError}`));
|
|
1476
|
+
} else if (inspection) {
|
|
1477
|
+
inspectorInfo?.append?.(
|
|
1478
|
+
text(
|
|
1479
|
+
this.document,
|
|
1480
|
+
`${inspection.asset?.name ?? inspection.guid} \xB7 ${inspection.source?.kind ?? inspection.asset?.sourceKind ?? inspection.asset?.kind} \xB7 ${inspection.source?.path ?? inspection.asset?.sourcePath ?? ""}${inspection.revision ? ` \xB7 rev ${inspection.revision.slice(0, 12)}` : ""}${inspection.ddc?.receiptUrl ? ` \xB7 ${inspection.ddc.receiptUrl}` : ""}`
|
|
1481
|
+
)
|
|
1482
|
+
);
|
|
1483
|
+
const meta = inspection.meta;
|
|
1484
|
+
if (meta) {
|
|
1485
|
+
const identity = this.document.createElement("div");
|
|
1486
|
+
identity.dataset.forgeaxViewWorkspace = "pack-meta";
|
|
1487
|
+
identity.append?.(
|
|
1488
|
+
text(
|
|
1489
|
+
this.document,
|
|
1490
|
+
`${meta.packageId ?? ""} \xB7 ${meta.importer ?? ""} \xB7 ${meta.source ?? ""}`
|
|
1491
|
+
)
|
|
1492
|
+
);
|
|
1493
|
+
inspectorFields?.append?.(identity);
|
|
1494
|
+
for (const sub of meta.subAssets ?? []) {
|
|
1495
|
+
const row = this.document.createElement("div");
|
|
1496
|
+
row.dataset.forgeaxViewWorkspace = "sub-asset";
|
|
1497
|
+
row.dataset.guid = sub.guid;
|
|
1498
|
+
row.dataset.kind = sub.kind;
|
|
1499
|
+
row.append?.(text(this.document, `${sub.name ?? sub.sourceKey} (${sub.kind})`));
|
|
1500
|
+
inspectorFields?.append?.(row);
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
inspectorActions?.append?.(
|
|
1504
|
+
button(this.document, "Rebuild", () => this.cookSelected("rebuild")),
|
|
1505
|
+
button(this.document, "Cold-cook", () => this.cookSelected("cold-cook"))
|
|
1506
|
+
);
|
|
1507
|
+
} else {
|
|
1508
|
+
inspectorInfo?.append?.(text(this.document, "Select an asset to inspect Engine catalog and pack meta"));
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
this.syncTargetSurfaces();
|
|
1512
|
+
const nextError = this.state.error ? `Error: ${this.state.error}` : "";
|
|
1513
|
+
const nextHidden = !this.state.error;
|
|
1514
|
+
if (error) {
|
|
1515
|
+
if (error.hidden !== nextHidden) error.hidden = nextHidden;
|
|
1516
|
+
if (error.textContent !== nextError) error.textContent = nextError;
|
|
1517
|
+
}
|
|
1518
|
+
const workspaceSurface = this.surfaceByTab.get(VIEW_WORKSPACE_TAB_ID)?.surface;
|
|
1519
|
+
if (nextTargetId && workspaceSurface && this.api && this.removeInput === void 0 && (!workspaceSurfaceEntry?.exactSurface || this.presentationByTab.get(VIEW_WORKSPACE_TAB_ID)?.ready && sameTargetIdentity(this.presentationByTab.get(VIEW_WORKSPACE_TAB_ID).target, workspaceTarget)) && this.state.selectedTabId === VIEW_WORKSPACE_TAB_ID) {
|
|
1520
|
+
this.inputController = this.inputControllerFactory({
|
|
1521
|
+
api: this.api,
|
|
1522
|
+
targetId: nextTargetId,
|
|
1523
|
+
targetGeneration: workspaceTarget?.generation,
|
|
1524
|
+
tabId: VIEW_WORKSPACE_TAB_ID,
|
|
1525
|
+
window: this.window,
|
|
1526
|
+
document: this.document,
|
|
1527
|
+
onError: (error2) => this.fail(error2),
|
|
1528
|
+
onSpeedChange: this.onNavigationSpeed,
|
|
1529
|
+
onFocusSelection: () => {
|
|
1530
|
+
const selected = this.state.sceneSelection;
|
|
1531
|
+
if (selected?.primary?.entityId) return this.api.call("entity.focus", {
|
|
1532
|
+
entityId: selected.primary.entityId,
|
|
1533
|
+
targetId: nextTargetId,
|
|
1534
|
+
targetGeneration: workspaceTarget?.generation
|
|
1535
|
+
});
|
|
1536
|
+
},
|
|
1537
|
+
shouldCapture: (event) => isViewportWorkspaceInputEvent(event, { surface: workspaceSurface, host: this.element })
|
|
1538
|
+
});
|
|
1539
|
+
this.removeInput = this.inputController.attach(workspaceSurface);
|
|
1540
|
+
}
|
|
1541
|
+
traceShellRender({
|
|
1542
|
+
durationMs: renderStarted ? Math.round((performance.now() - renderStarted) * 100) / 100 : void 0,
|
|
1543
|
+
workspaceSurface: workspaceSurface?.dataset?.forgeaxViewSurface,
|
|
1544
|
+
exactSurface: this.surfaceByTab.get(VIEW_WORKSPACE_TAB_ID)?.exactSurface,
|
|
1545
|
+
inputBound: this.removeInput !== void 0,
|
|
1546
|
+
presentationOnly: this.presentationOnly,
|
|
1547
|
+
domReplaceChildren,
|
|
1548
|
+
tabCount: (this.state.tabs ?? []).length,
|
|
1549
|
+
assetCount: (this.state.assets ?? []).length
|
|
1550
|
+
});
|
|
1551
|
+
}
|
|
1552
|
+
/** Detach local DOM listeners before a tab/target/disconnect transition. */
|
|
1553
|
+
detachInput(reason = "input-detached") {
|
|
1554
|
+
const controller = this.inputController;
|
|
1555
|
+
const remove = this.removeInput;
|
|
1556
|
+
this.removeInput = void 0;
|
|
1557
|
+
this.inputController = void 0;
|
|
1558
|
+
if (remove) {
|
|
1559
|
+
remove(reason);
|
|
1560
|
+
}
|
|
1561
|
+
if (!remove?.handlesAbort) {
|
|
1562
|
+
void Promise.resolve(controller?.abort?.(reason)).catch((error) => this.fail(error));
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
dispose() {
|
|
1566
|
+
if (this.disposal) return this.disposal;
|
|
1567
|
+
this.disposed = true;
|
|
1568
|
+
this.stopSceneAdopt?.();
|
|
1569
|
+
this.stopSceneAdopt = void 0;
|
|
1570
|
+
for (const entry of this.presentationByTab.values()) entry.restore?.();
|
|
1571
|
+
this.disposal = this.finishDisposal();
|
|
1572
|
+
return this.disposal;
|
|
1573
|
+
}
|
|
1574
|
+
async finishDisposal() {
|
|
1575
|
+
const removeInput = this.removeInput;
|
|
1576
|
+
const inputController = this.inputController;
|
|
1577
|
+
this.removeInput = void 0;
|
|
1578
|
+
removeInput?.("input-disposed");
|
|
1579
|
+
const inputDisposal = inputController?.dispose?.().catch(() => {
|
|
1580
|
+
});
|
|
1581
|
+
this.inputController = void 0;
|
|
1582
|
+
this.removeSubscription?.();
|
|
1583
|
+
this.removeSubscription = void 0;
|
|
1584
|
+
this.removeDisconnect?.();
|
|
1585
|
+
this.removeDisconnect = void 0;
|
|
1586
|
+
const presentationTabs = /* @__PURE__ */ new Set([
|
|
1587
|
+
...this.surfaceByTab.keys(),
|
|
1588
|
+
...this.presentationByTab.keys(),
|
|
1589
|
+
...this.presentationPending.keys(),
|
|
1590
|
+
...this.presentationQueueByTab.keys()
|
|
1591
|
+
]);
|
|
1592
|
+
for (const tabId of presentationTabs) {
|
|
1593
|
+
this.presentationGenerationByTab.set(
|
|
1594
|
+
tabId,
|
|
1595
|
+
(this.presentationGenerationByTab.get(tabId) ?? 0) + 1
|
|
1596
|
+
);
|
|
1597
|
+
}
|
|
1598
|
+
await Promise.all([
|
|
1599
|
+
inputDisposal,
|
|
1600
|
+
...[...presentationTabs].map((tabId) => this.detachTargetPresentation(tabId, { invalidate: false }).catch(() => {
|
|
1601
|
+
}))
|
|
1602
|
+
]);
|
|
1603
|
+
this.presentationPending.clear();
|
|
1604
|
+
this.presentationQueueByTab.clear();
|
|
1605
|
+
this.presentationGenerationByTab.clear();
|
|
1606
|
+
this.surfaceByTab.clear();
|
|
1607
|
+
this.rootElement = null;
|
|
1608
|
+
this.targetContainer = null;
|
|
1609
|
+
this.removeSurfacePresentation = void 0;
|
|
1610
|
+
this.inputTargetId = null;
|
|
1611
|
+
this.surfaceTargetId = null;
|
|
1612
|
+
this.presentedTargetId = null;
|
|
1613
|
+
this.surface = null;
|
|
1614
|
+
this.element?.remove?.();
|
|
1615
|
+
this.element = null;
|
|
1616
|
+
}
|
|
1617
|
+
};
|
|
1618
|
+
|
|
1619
|
+
export {
|
|
1620
|
+
isViewportWorkspaceInputEvent,
|
|
1621
|
+
createBrowserPagePresentation,
|
|
1622
|
+
ViewWorkspaceInputController,
|
|
1623
|
+
ViewWorkspaceShell
|
|
1624
|
+
};
|
|
1625
|
+
//# sourceMappingURL=chunk-QSKQZGK7.mjs.map
|