@mountaya/studio-react 0.0.0-stage → 0.1.0
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 +54 -0
- package/LICENCE.fr.txt +280 -0
- package/LICENSE.txt +262 -0
- package/README.md +1087 -2
- package/THIRD-PARTY-NOTICES.txt +149 -0
- package/dist/AgentMarkdown-RNLATZYN.cjs +213 -0
- package/dist/AgentMarkdown-RNLATZYN.cjs.map +1 -0
- package/dist/AgentMarkdown-TMN6E2XC.js +206 -0
- package/dist/AgentMarkdown-TMN6E2XC.js.map +1 -0
- package/dist/ContextMenuPopup-EOYN42YZ.js +468 -0
- package/dist/ContextMenuPopup-EOYN42YZ.js.map +1 -0
- package/dist/ContextMenuPopup-VQLAYYYZ.cjs +470 -0
- package/dist/ContextMenuPopup-VQLAYYYZ.cjs.map +1 -0
- package/dist/CopilotPanel-CCLEYZUN.js +29 -0
- package/dist/CopilotPanel-CCLEYZUN.js.map +1 -0
- package/dist/CopilotPanel-LYPMTDKX.cjs +38 -0
- package/dist/CopilotPanel-LYPMTDKX.cjs.map +1 -0
- package/dist/DateTimePickerField-FZRKJ2SU.js +53 -0
- package/dist/DateTimePickerField-FZRKJ2SU.js.map +1 -0
- package/dist/DateTimePickerField-NB456C6F.cjs +55 -0
- package/dist/DateTimePickerField-NB456C6F.cjs.map +1 -0
- package/dist/DirectionsModal-4Y346QFU.cjs +291 -0
- package/dist/DirectionsModal-4Y346QFU.cjs.map +1 -0
- package/dist/DirectionsModal-DRPO2654.js +289 -0
- package/dist/DirectionsModal-DRPO2654.js.map +1 -0
- package/dist/DuplicateItineraryModal-2QGWI7E7.js +321 -0
- package/dist/DuplicateItineraryModal-2QGWI7E7.js.map +1 -0
- package/dist/DuplicateItineraryModal-WFGMU6JL.cjs +323 -0
- package/dist/DuplicateItineraryModal-WFGMU6JL.cjs.map +1 -0
- package/dist/EditCollectionModal-4QYP53SX.js +90 -0
- package/dist/EditCollectionModal-4QYP53SX.js.map +1 -0
- package/dist/EditCollectionModal-T2TMAO53.cjs +92 -0
- package/dist/EditCollectionModal-T2TMAO53.cjs.map +1 -0
- package/dist/EmbedSnippetCode-NMFCQ7TF.cjs +62 -0
- package/dist/EmbedSnippetCode-NMFCQ7TF.cjs.map +1 -0
- package/dist/EmbedSnippetCode-TGBSWDMD.js +60 -0
- package/dist/EmbedSnippetCode-TGBSWDMD.js.map +1 -0
- package/dist/EmbedTablePreview-3RRHM63Q.js +72 -0
- package/dist/EmbedTablePreview-3RRHM63Q.js.map +1 -0
- package/dist/EmbedTablePreview-Z3W62MRV.cjs +74 -0
- package/dist/EmbedTablePreview-Z3W62MRV.cjs.map +1 -0
- package/dist/ExportModal-5NUZZPXN.cjs +267 -0
- package/dist/ExportModal-5NUZZPXN.cjs.map +1 -0
- package/dist/ExportModal-H7OYP6CK.js +265 -0
- package/dist/ExportModal-H7OYP6CK.js.map +1 -0
- package/dist/FileDropzone-GKPMAZF5.cjs +41 -0
- package/dist/FileDropzone-GKPMAZF5.cjs.map +1 -0
- package/dist/FileDropzone-GRXY4FXR.js +39 -0
- package/dist/FileDropzone-GRXY4FXR.js.map +1 -0
- package/dist/LocationPermissionModal-AFHI5J4S.cjs +92 -0
- package/dist/LocationPermissionModal-AFHI5J4S.cjs.map +1 -0
- package/dist/LocationPermissionModal-MURJ5DDB.js +90 -0
- package/dist/LocationPermissionModal-MURJ5DDB.js.map +1 -0
- package/dist/ManageCollectionsModal-E3IUHUTO.cjs +402 -0
- package/dist/ManageCollectionsModal-E3IUHUTO.cjs.map +1 -0
- package/dist/ManageCollectionsModal-FIHSZXSR.js +400 -0
- package/dist/ManageCollectionsModal-FIHSZXSR.js.map +1 -0
- package/dist/NewCollectionModal-7TBWVA3G.js +75 -0
- package/dist/NewCollectionModal-7TBWVA3G.js.map +1 -0
- package/dist/NewCollectionModal-QFQYCKCG.cjs +77 -0
- package/dist/NewCollectionModal-QFQYCKCG.cjs.map +1 -0
- package/dist/RoadAccessModal-DNUJV5PC.js +57 -0
- package/dist/RoadAccessModal-DNUJV5PC.js.map +1 -0
- package/dist/RoadAccessModal-WLLL2ASZ.cjs +59 -0
- package/dist/RoadAccessModal-WLLL2ASZ.cjs.map +1 -0
- package/dist/SegmentColorPicker-7Y4JEPFC.cjs +81 -0
- package/dist/SegmentColorPicker-7Y4JEPFC.cjs.map +1 -0
- package/dist/SegmentColorPicker-UNLPITUA.js +79 -0
- package/dist/SegmentColorPicker-UNLPITUA.js.map +1 -0
- package/dist/SegmentGroupModal-F54FZUR2.cjs +32 -0
- package/dist/SegmentGroupModal-F54FZUR2.cjs.map +1 -0
- package/dist/SegmentGroupModal-KBU7OPNJ.js +23 -0
- package/dist/SegmentGroupModal-KBU7OPNJ.js.map +1 -0
- package/dist/ShareCollectionModal-TWYE6JJ4.cjs +82 -0
- package/dist/ShareCollectionModal-TWYE6JJ4.cjs.map +1 -0
- package/dist/ShareCollectionModal-VXSRHX4S.js +80 -0
- package/dist/ShareCollectionModal-VXSRHX4S.js.map +1 -0
- package/dist/ShareModal-HLYNE7OL.js +115 -0
- package/dist/ShareModal-HLYNE7OL.js.map +1 -0
- package/dist/ShareModal-WISND27S.cjs +117 -0
- package/dist/ShareModal-WISND27S.cjs.map +1 -0
- package/dist/VideoExportWizard-BSDWA3B5.js +44 -0
- package/dist/VideoExportWizard-BSDWA3B5.js.map +1 -0
- package/dist/VideoExportWizard-UOHR4MNS.cjs +53 -0
- package/dist/VideoExportWizard-UOHR4MNS.cjs.map +1 -0
- package/dist/WaypointDetailsModal-LK5LBK6S.js +270 -0
- package/dist/WaypointDetailsModal-LK5LBK6S.js.map +1 -0
- package/dist/WaypointDetailsModal-MEMOLLUY.cjs +272 -0
- package/dist/WaypointDetailsModal-MEMOLLUY.cjs.map +1 -0
- package/dist/WaypointWorkbench-DCCLBURG.cjs +1204 -0
- package/dist/WaypointWorkbench-DCCLBURG.cjs.map +1 -0
- package/dist/WaypointWorkbench-NRCLGU23.js +1202 -0
- package/dist/WaypointWorkbench-NRCLGU23.js.map +1 -0
- package/dist/chunk-22BNE3YV.js +13 -0
- package/dist/chunk-22BNE3YV.js.map +1 -0
- package/dist/chunk-24RNBTO2.cjs +154 -0
- package/dist/chunk-24RNBTO2.cjs.map +1 -0
- package/dist/chunk-2DDL2LIJ.cjs +65 -0
- package/dist/chunk-2DDL2LIJ.cjs.map +1 -0
- package/dist/chunk-2GAMKPS2.cjs +16 -0
- package/dist/chunk-2GAMKPS2.cjs.map +1 -0
- package/dist/chunk-2K4HCCZJ.cjs +51 -0
- package/dist/chunk-2K4HCCZJ.cjs.map +1 -0
- package/dist/chunk-2MHWH3TS.cjs +119 -0
- package/dist/chunk-2MHWH3TS.cjs.map +1 -0
- package/dist/chunk-2MQBPZNR.cjs +12 -0
- package/dist/chunk-2MQBPZNR.cjs.map +1 -0
- package/dist/chunk-2QSPCXLM.js +84 -0
- package/dist/chunk-2QSPCXLM.js.map +1 -0
- package/dist/chunk-32WRG44G.js +66 -0
- package/dist/chunk-32WRG44G.js.map +1 -0
- package/dist/chunk-32XMYLEB.js +9 -0
- package/dist/chunk-32XMYLEB.js.map +1 -0
- package/dist/chunk-3BEHHSVE.cjs +790 -0
- package/dist/chunk-3BEHHSVE.cjs.map +1 -0
- package/dist/chunk-3HF2XZKQ.js +8 -0
- package/dist/chunk-3HF2XZKQ.js.map +1 -0
- package/dist/chunk-3K2NX5FH.js +51 -0
- package/dist/chunk-3K2NX5FH.js.map +1 -0
- package/dist/chunk-3Q23QKNI.cjs +26 -0
- package/dist/chunk-3Q23QKNI.cjs.map +1 -0
- package/dist/chunk-3TQV2M4C.cjs +16 -0
- package/dist/chunk-3TQV2M4C.cjs.map +1 -0
- package/dist/chunk-3XDKDTE6.js +16 -0
- package/dist/chunk-3XDKDTE6.js.map +1 -0
- package/dist/chunk-46EARJWC.js +288 -0
- package/dist/chunk-46EARJWC.js.map +1 -0
- package/dist/chunk-4DQOJIUV.js +96 -0
- package/dist/chunk-4DQOJIUV.js.map +1 -0
- package/dist/chunk-4T52NAVT.js +10 -0
- package/dist/chunk-4T52NAVT.js.map +1 -0
- package/dist/chunk-4TPRVQGY.js +12 -0
- package/dist/chunk-4TPRVQGY.js.map +1 -0
- package/dist/chunk-4TX5E63A.cjs +12 -0
- package/dist/chunk-4TX5E63A.cjs.map +1 -0
- package/dist/chunk-4VKJF24B.js +22 -0
- package/dist/chunk-4VKJF24B.js.map +1 -0
- package/dist/chunk-4Z734K3L.js +15 -0
- package/dist/chunk-4Z734K3L.js.map +1 -0
- package/dist/chunk-4ZRSEOZM.js +629 -0
- package/dist/chunk-4ZRSEOZM.js.map +1 -0
- package/dist/chunk-52T3VZR5.js +55 -0
- package/dist/chunk-52T3VZR5.js.map +1 -0
- package/dist/chunk-56DP2X7U.js +15 -0
- package/dist/chunk-56DP2X7U.js.map +1 -0
- package/dist/chunk-5AHT62LO.js +24 -0
- package/dist/chunk-5AHT62LO.js.map +1 -0
- package/dist/chunk-5BR4CTVV.cjs +17 -0
- package/dist/chunk-5BR4CTVV.cjs.map +1 -0
- package/dist/chunk-5CTZOFDV.cjs +17 -0
- package/dist/chunk-5CTZOFDV.cjs.map +1 -0
- package/dist/chunk-5F55MFIX.cjs +45 -0
- package/dist/chunk-5F55MFIX.cjs.map +1 -0
- package/dist/chunk-5FMQJ4A4.cjs +362 -0
- package/dist/chunk-5FMQJ4A4.cjs.map +1 -0
- package/dist/chunk-5PMEAMHS.js +82 -0
- package/dist/chunk-5PMEAMHS.js.map +1 -0
- package/dist/chunk-676DNRSN.js +85 -0
- package/dist/chunk-676DNRSN.js.map +1 -0
- package/dist/chunk-6H2F7JKL.js +179 -0
- package/dist/chunk-6H2F7JKL.js.map +1 -0
- package/dist/chunk-6HMRMON7.js +10 -0
- package/dist/chunk-6HMRMON7.js.map +1 -0
- package/dist/chunk-6NKPZ3LT.cjs +14 -0
- package/dist/chunk-6NKPZ3LT.cjs.map +1 -0
- package/dist/chunk-6TG2HZDG.js +75 -0
- package/dist/chunk-6TG2HZDG.js.map +1 -0
- package/dist/chunk-6WU7XEQA.cjs +103 -0
- package/dist/chunk-6WU7XEQA.cjs.map +1 -0
- package/dist/chunk-6YD325QI.cjs +90 -0
- package/dist/chunk-6YD325QI.cjs.map +1 -0
- package/dist/chunk-7B6TUEL5.js +20 -0
- package/dist/chunk-7B6TUEL5.js.map +1 -0
- package/dist/chunk-7KS5F27H.js +33 -0
- package/dist/chunk-7KS5F27H.js.map +1 -0
- package/dist/chunk-A2N6553V.cjs +295 -0
- package/dist/chunk-A2N6553V.cjs.map +1 -0
- package/dist/chunk-A66FJAVG.js +44 -0
- package/dist/chunk-A66FJAVG.js.map +1 -0
- package/dist/chunk-AF43JU4W.js +27 -0
- package/dist/chunk-AF43JU4W.js.map +1 -0
- package/dist/chunk-AHGHAWYR.js +99 -0
- package/dist/chunk-AHGHAWYR.js.map +1 -0
- package/dist/chunk-AKN5KIZT.js +1969 -0
- package/dist/chunk-AKN5KIZT.js.map +1 -0
- package/dist/chunk-ANTDR5MJ.cjs +12 -0
- package/dist/chunk-ANTDR5MJ.cjs.map +1 -0
- package/dist/chunk-AQ5JIIAE.js +26 -0
- package/dist/chunk-AQ5JIIAE.js.map +1 -0
- package/dist/chunk-ARHO5MLJ.js +10 -0
- package/dist/chunk-ARHO5MLJ.js.map +1 -0
- package/dist/chunk-BAYGKSWY.cjs +26 -0
- package/dist/chunk-BAYGKSWY.cjs.map +1 -0
- package/dist/chunk-BEJ5I724.js +8 -0
- package/dist/chunk-BEJ5I724.js.map +1 -0
- package/dist/chunk-BFNXXLVV.cjs +34 -0
- package/dist/chunk-BFNXXLVV.cjs.map +1 -0
- package/dist/chunk-BFQJDFGB.js +57 -0
- package/dist/chunk-BFQJDFGB.js.map +1 -0
- package/dist/chunk-CHEQJ6N7.cjs +2214 -0
- package/dist/chunk-CHEQJ6N7.cjs.map +1 -0
- package/dist/chunk-CJOJWZM7.js +92 -0
- package/dist/chunk-CJOJWZM7.js.map +1 -0
- package/dist/chunk-CJRSFC45.cjs +578 -0
- package/dist/chunk-CJRSFC45.cjs.map +1 -0
- package/dist/chunk-CWQ4WHPI.cjs +46 -0
- package/dist/chunk-CWQ4WHPI.cjs.map +1 -0
- package/dist/chunk-D3INXUFT.js +360 -0
- package/dist/chunk-D3INXUFT.js.map +1 -0
- package/dist/chunk-D6CDAYZ6.cjs +18 -0
- package/dist/chunk-D6CDAYZ6.cjs.map +1 -0
- package/dist/chunk-DDPXRXRD.cjs +23 -0
- package/dist/chunk-DDPXRXRD.cjs.map +1 -0
- package/dist/chunk-DUUPWSOZ.cjs +14 -0
- package/dist/chunk-DUUPWSOZ.cjs.map +1 -0
- package/dist/chunk-DVWYOHOB.cjs +43 -0
- package/dist/chunk-DVWYOHOB.cjs.map +1 -0
- package/dist/chunk-DZPHWBMC.cjs +11 -0
- package/dist/chunk-DZPHWBMC.cjs.map +1 -0
- package/dist/chunk-E26FROI3.js +68 -0
- package/dist/chunk-E26FROI3.js.map +1 -0
- package/dist/chunk-E7ZTDAQW.cjs +37 -0
- package/dist/chunk-E7ZTDAQW.cjs.map +1 -0
- package/dist/chunk-ECI4EKIV.cjs +94 -0
- package/dist/chunk-ECI4EKIV.cjs.map +1 -0
- package/dist/chunk-EN5RWYHP.cjs +28 -0
- package/dist/chunk-EN5RWYHP.cjs.map +1 -0
- package/dist/chunk-ET3UASEF.cjs +91 -0
- package/dist/chunk-ET3UASEF.cjs.map +1 -0
- package/dist/chunk-EW5SY246.cjs +97 -0
- package/dist/chunk-EW5SY246.cjs.map +1 -0
- package/dist/chunk-EWWHVV7R.cjs +18 -0
- package/dist/chunk-EWWHVV7R.cjs.map +1 -0
- package/dist/chunk-F2LZZC6X.js +90 -0
- package/dist/chunk-F2LZZC6X.js.map +1 -0
- package/dist/chunk-F6VFOI4U.cjs +12 -0
- package/dist/chunk-F6VFOI4U.cjs.map +1 -0
- package/dist/chunk-FGX3TEU4.cjs +12 -0
- package/dist/chunk-FGX3TEU4.cjs.map +1 -0
- package/dist/chunk-FK4F24KE.js +10 -0
- package/dist/chunk-FK4F24KE.js.map +1 -0
- package/dist/chunk-FLIGKB6K.js +313 -0
- package/dist/chunk-FLIGKB6K.js.map +1 -0
- package/dist/chunk-G2NDWNFB.cjs +185 -0
- package/dist/chunk-G2NDWNFB.cjs.map +1 -0
- package/dist/chunk-G2XORRLH.js +15 -0
- package/dist/chunk-G2XORRLH.js.map +1 -0
- package/dist/chunk-GIZN7NX5.cjs +25 -0
- package/dist/chunk-GIZN7NX5.cjs.map +1 -0
- package/dist/chunk-GM2BQ24D.js +47 -0
- package/dist/chunk-GM2BQ24D.js.map +1 -0
- package/dist/chunk-GMQJZ5N7.cjs +50 -0
- package/dist/chunk-GMQJZ5N7.cjs.map +1 -0
- package/dist/chunk-GT7RJOAA.cjs +315 -0
- package/dist/chunk-GT7RJOAA.cjs.map +1 -0
- package/dist/chunk-GWGUMPOL.js +9 -0
- package/dist/chunk-GWGUMPOL.js.map +1 -0
- package/dist/chunk-GWVKSSE3.cjs +154 -0
- package/dist/chunk-GWVKSSE3.cjs.map +1 -0
- package/dist/chunk-GY7UMPHT.cjs +99 -0
- package/dist/chunk-GY7UMPHT.cjs.map +1 -0
- package/dist/chunk-HMVBS5DU.js +150 -0
- package/dist/chunk-HMVBS5DU.js.map +1 -0
- package/dist/chunk-HXHA2C7C.js +169 -0
- package/dist/chunk-HXHA2C7C.js.map +1 -0
- package/dist/chunk-IHMOFX2A.js +208 -0
- package/dist/chunk-IHMOFX2A.js.map +1 -0
- package/dist/chunk-II6C3LU2.cjs +49 -0
- package/dist/chunk-II6C3LU2.cjs.map +1 -0
- package/dist/chunk-IOOAFCSR.cjs +58 -0
- package/dist/chunk-IOOAFCSR.cjs.map +1 -0
- package/dist/chunk-IQZSIOMM.js +10 -0
- package/dist/chunk-IQZSIOMM.js.map +1 -0
- package/dist/chunk-J2H3WIUM.cjs +12 -0
- package/dist/chunk-J2H3WIUM.cjs.map +1 -0
- package/dist/chunk-J62OBSUE.cjs +54 -0
- package/dist/chunk-J62OBSUE.cjs.map +1 -0
- package/dist/chunk-JFJVSJUX.cjs +16 -0
- package/dist/chunk-JFJVSJUX.cjs.map +1 -0
- package/dist/chunk-JI2M77Y7.cjs +68 -0
- package/dist/chunk-JI2M77Y7.cjs.map +1 -0
- package/dist/chunk-JLSOLL3C.js +31 -0
- package/dist/chunk-JLSOLL3C.js.map +1 -0
- package/dist/chunk-JRME3LCP.cjs +41 -0
- package/dist/chunk-JRME3LCP.cjs.map +1 -0
- package/dist/chunk-JUD3CWTI.cjs +2005 -0
- package/dist/chunk-JUD3CWTI.cjs.map +1 -0
- package/dist/chunk-JVFHF3LE.cjs +11 -0
- package/dist/chunk-JVFHF3LE.cjs.map +1 -0
- package/dist/chunk-JVS2WNKQ.js +26 -0
- package/dist/chunk-JVS2WNKQ.js.map +1 -0
- package/dist/chunk-JXAFIYLV.js +94 -0
- package/dist/chunk-JXAFIYLV.js.map +1 -0
- package/dist/chunk-K2E744ST.cjs +18 -0
- package/dist/chunk-K2E744ST.cjs.map +1 -0
- package/dist/chunk-K2ZEMBJ7.js +56 -0
- package/dist/chunk-K2ZEMBJ7.js.map +1 -0
- package/dist/chunk-KCXNMLKB.js +22 -0
- package/dist/chunk-KCXNMLKB.js.map +1 -0
- package/dist/chunk-KMMDPXY4.js +35 -0
- package/dist/chunk-KMMDPXY4.js.map +1 -0
- package/dist/chunk-KMSGFBAJ.cjs +78 -0
- package/dist/chunk-KMSGFBAJ.cjs.map +1 -0
- package/dist/chunk-KPD7K4XQ.cjs +11 -0
- package/dist/chunk-KPD7K4XQ.cjs.map +1 -0
- package/dist/chunk-KUD3B3BA.js +12 -0
- package/dist/chunk-KUD3B3BA.js.map +1 -0
- package/dist/chunk-L62LSMJ5.js +9 -0
- package/dist/chunk-L62LSMJ5.js.map +1 -0
- package/dist/chunk-LB57H6LF.cjs +261 -0
- package/dist/chunk-LB57H6LF.cjs.map +1 -0
- package/dist/chunk-LCPKNSC4.cjs +48 -0
- package/dist/chunk-LCPKNSC4.cjs.map +1 -0
- package/dist/chunk-LE3W2CSF.cjs +84 -0
- package/dist/chunk-LE3W2CSF.cjs.map +1 -0
- package/dist/chunk-LG736CNC.js +13 -0
- package/dist/chunk-LG736CNC.js.map +1 -0
- package/dist/chunk-LGNTAZ3L.cjs +33 -0
- package/dist/chunk-LGNTAZ3L.cjs.map +1 -0
- package/dist/chunk-LHXINV6N.cjs +47 -0
- package/dist/chunk-LHXINV6N.cjs.map +1 -0
- package/dist/chunk-LLZUTIQB.cjs +24 -0
- package/dist/chunk-LLZUTIQB.cjs.map +1 -0
- package/dist/chunk-LPGXRU7R.cjs +12 -0
- package/dist/chunk-LPGXRU7R.cjs.map +1 -0
- package/dist/chunk-MA2BBWF5.cjs +96 -0
- package/dist/chunk-MA2BBWF5.cjs.map +1 -0
- package/dist/chunk-MLGORMWF.js +23 -0
- package/dist/chunk-MLGORMWF.js.map +1 -0
- package/dist/chunk-MO7XCKLA.js +62 -0
- package/dist/chunk-MO7XCKLA.js.map +1 -0
- package/dist/chunk-N37UE6RQ.cjs +1797 -0
- package/dist/chunk-N37UE6RQ.cjs.map +1 -0
- package/dist/chunk-N6NWKUOR.cjs +60 -0
- package/dist/chunk-N6NWKUOR.cjs.map +1 -0
- package/dist/chunk-NI5CAMFC.js +568 -0
- package/dist/chunk-NI5CAMFC.js.map +1 -0
- package/dist/chunk-NNLCZGZK.js +21 -0
- package/dist/chunk-NNLCZGZK.js.map +1 -0
- package/dist/chunk-NWHFUVYX.js +97 -0
- package/dist/chunk-NWHFUVYX.js.map +1 -0
- package/dist/chunk-OMDB6ZB2.cjs +176 -0
- package/dist/chunk-OMDB6ZB2.cjs.map +1 -0
- package/dist/chunk-P5W4TRJO.cjs +33 -0
- package/dist/chunk-P5W4TRJO.cjs.map +1 -0
- package/dist/chunk-PADS6TDO.js +89 -0
- package/dist/chunk-PADS6TDO.js.map +1 -0
- package/dist/chunk-PFLNOHBT.js +92 -0
- package/dist/chunk-PFLNOHBT.js.map +1 -0
- package/dist/chunk-PTLYNDZS.cjs +13 -0
- package/dist/chunk-PTLYNDZS.cjs.map +1 -0
- package/dist/chunk-QC3X4DAW.cjs +71 -0
- package/dist/chunk-QC3X4DAW.cjs.map +1 -0
- package/dist/chunk-QPTICYGD.cjs +272 -0
- package/dist/chunk-QPTICYGD.cjs.map +1 -0
- package/dist/chunk-QZ7W2E4U.cjs +319 -0
- package/dist/chunk-QZ7W2E4U.cjs.map +1 -0
- package/dist/chunk-RJJPUPOY.cjs +97 -0
- package/dist/chunk-RJJPUPOY.cjs.map +1 -0
- package/dist/chunk-RRSMCCFS.js +43 -0
- package/dist/chunk-RRSMCCFS.js.map +1 -0
- package/dist/chunk-S6VCR6F5.js +91 -0
- package/dist/chunk-S6VCR6F5.js.map +1 -0
- package/dist/chunk-S7Y2GMYJ.cjs +89 -0
- package/dist/chunk-S7Y2GMYJ.cjs.map +1 -0
- package/dist/chunk-SIMEDLX3.cjs +645 -0
- package/dist/chunk-SIMEDLX3.cjs.map +1 -0
- package/dist/chunk-SQYF7HKF.cjs +59 -0
- package/dist/chunk-SQYF7HKF.cjs.map +1 -0
- package/dist/chunk-ST7BNVC2.cjs +13 -0
- package/dist/chunk-ST7BNVC2.cjs.map +1 -0
- package/dist/chunk-SZVRMMLS.js +16 -0
- package/dist/chunk-SZVRMMLS.js.map +1 -0
- package/dist/chunk-T27LICRD.js +2212 -0
- package/dist/chunk-T27LICRD.js.map +1 -0
- package/dist/chunk-TAU5HGJ3.cjs +11 -0
- package/dist/chunk-TAU5HGJ3.cjs.map +1 -0
- package/dist/chunk-TOM7TV5E.js +25 -0
- package/dist/chunk-TOM7TV5E.js.map +1 -0
- package/dist/chunk-TSRUDRT3.js +59 -0
- package/dist/chunk-TSRUDRT3.js.map +1 -0
- package/dist/chunk-U4FX33MW.js +257 -0
- package/dist/chunk-U4FX33MW.js.map +1 -0
- package/dist/chunk-UBOPWQWC.cjs +28 -0
- package/dist/chunk-UBOPWQWC.cjs.map +1 -0
- package/dist/chunk-UFE26GNF.js +42 -0
- package/dist/chunk-UFE26GNF.js.map +1 -0
- package/dist/chunk-UMQQVTEO.js +257 -0
- package/dist/chunk-UMQQVTEO.js.map +1 -0
- package/dist/chunk-UWY3SFAS.js +10 -0
- package/dist/chunk-UWY3SFAS.js.map +1 -0
- package/dist/chunk-V6EIIZPJ.js +57 -0
- package/dist/chunk-V6EIIZPJ.js.map +1 -0
- package/dist/chunk-V6G6W5CF.cjs +61 -0
- package/dist/chunk-V6G6W5CF.cjs.map +1 -0
- package/dist/chunk-VC4ZBWOK.js +152 -0
- package/dist/chunk-VC4ZBWOK.js.map +1 -0
- package/dist/chunk-VJRF6ILX.js +35 -0
- package/dist/chunk-VJRF6ILX.js.map +1 -0
- package/dist/chunk-VNSLCFO4.js +787 -0
- package/dist/chunk-VNSLCFO4.js.map +1 -0
- package/dist/chunk-W7GAP7ST.js +21 -0
- package/dist/chunk-W7GAP7ST.js.map +1 -0
- package/dist/chunk-WFUASJHS.js +64 -0
- package/dist/chunk-WFUASJHS.js.map +1 -0
- package/dist/chunk-WIKSIT3M.js +46 -0
- package/dist/chunk-WIKSIT3M.js.map +1 -0
- package/dist/chunk-WKLZLFLY.cjs +32 -0
- package/dist/chunk-WKLZLFLY.cjs.map +1 -0
- package/dist/chunk-WNB5HYON.cjs +10 -0
- package/dist/chunk-WNB5HYON.cjs.map +1 -0
- package/dist/chunk-WO5P2XBP.js +86 -0
- package/dist/chunk-WO5P2XBP.js.map +1 -0
- package/dist/chunk-WPYC4NGZ.cjs +46 -0
- package/dist/chunk-WPYC4NGZ.cjs.map +1 -0
- package/dist/chunk-WQRYZY67.cjs +89 -0
- package/dist/chunk-WQRYZY67.cjs.map +1 -0
- package/dist/chunk-WVCYVMJU.js +11 -0
- package/dist/chunk-WVCYVMJU.js.map +1 -0
- package/dist/chunk-WX25G2S3.js +116 -0
- package/dist/chunk-WX25G2S3.js.map +1 -0
- package/dist/chunk-X4FE7RRQ.js +23 -0
- package/dist/chunk-X4FE7RRQ.js.map +1 -0
- package/dist/chunk-X6EIJNOQ.cjs +67 -0
- package/dist/chunk-X6EIJNOQ.cjs.map +1 -0
- package/dist/chunk-XUBATJH6.js +1769 -0
- package/dist/chunk-XUBATJH6.js.map +1 -0
- package/dist/chunk-XUMREYMG.js +293 -0
- package/dist/chunk-XUMREYMG.js.map +1 -0
- package/dist/chunk-XYAJ2FS2.js +31 -0
- package/dist/chunk-XYAJ2FS2.js.map +1 -0
- package/dist/chunk-YKES5P4H.cjs +58 -0
- package/dist/chunk-YKES5P4H.cjs.map +1 -0
- package/dist/chunk-YYAQ75AV.cjs +216 -0
- package/dist/chunk-YYAQ75AV.cjs.map +1 -0
- package/dist/chunk-YZ3NJKVV.js +42 -0
- package/dist/chunk-YZ3NJKVV.js.map +1 -0
- package/dist/chunk-Z5ECTUMN.cjs +104 -0
- package/dist/chunk-Z5ECTUMN.cjs.map +1 -0
- package/dist/chunk-ZAKVHYDL.cjs +28 -0
- package/dist/chunk-ZAKVHYDL.cjs.map +1 -0
- package/dist/chunk-ZF34JXGU.js +39 -0
- package/dist/chunk-ZF34JXGU.js.map +1 -0
- package/dist/chunk-ZHGWDP2M.cjs +101 -0
- package/dist/chunk-ZHGWDP2M.cjs.map +1 -0
- package/dist/chunk-ZLHTQQLT.js +13 -0
- package/dist/chunk-ZLHTQQLT.js.map +1 -0
- package/dist/chunk-ZPAMY3IZ.cjs +25 -0
- package/dist/chunk-ZPAMY3IZ.cjs.map +1 -0
- package/dist/chunk-ZR63UB4V.js +42 -0
- package/dist/chunk-ZR63UB4V.js.map +1 -0
- package/dist/chunk-ZRCEB3KL.js +11 -0
- package/dist/chunk-ZRCEB3KL.js.map +1 -0
- package/dist/chunk-ZRGQNRQI.cjs +36 -0
- package/dist/chunk-ZRGQNRQI.cjs.map +1 -0
- package/dist/chunk-ZVY4IL7O.cjs +22 -0
- package/dist/chunk-ZVY4IL7O.cjs.map +1 -0
- package/dist/chunk-ZWIVKODQ.js +49 -0
- package/dist/chunk-ZWIVKODQ.js.map +1 -0
- package/dist/chunk-ZYF2HNMZ.js +10 -0
- package/dist/chunk-ZYF2HNMZ.js.map +1 -0
- package/dist/copilot/index.cjs +43 -0
- package/dist/copilot/index.cjs.map +1 -0
- package/dist/copilot/index.d.cts +66 -0
- package/dist/copilot/index.d.ts +66 -0
- package/dist/copilot/index.js +30 -0
- package/dist/copilot/index.js.map +1 -0
- package/dist/directionsPdf-GITP3SCP.cjs +274 -0
- package/dist/directionsPdf-GITP3SCP.cjs.map +1 -0
- package/dist/directionsPdf-TDKVUBCU.js +272 -0
- package/dist/directionsPdf-TDKVUBCU.js.map +1 -0
- package/dist/embed/index.cjs +1816 -0
- package/dist/embed/index.cjs.map +1 -0
- package/dist/embed/index.d.cts +300 -0
- package/dist/embed/index.d.ts +300 -0
- package/dist/embed/index.js +1809 -0
- package/dist/embed/index.js.map +1 -0
- package/dist/headless/index.cjs +408 -0
- package/dist/headless/index.cjs.map +1 -0
- package/dist/headless/index.d.cts +23 -0
- package/dist/headless/index.d.ts +23 -0
- package/dist/headless/index.js +31 -0
- package/dist/headless/index.js.map +1 -0
- package/dist/hostRegistry-BTG-KkRY.d.cts +115 -0
- package/dist/hostRegistry-BTG-KkRY.d.ts +115 -0
- package/dist/import/index.cjs +433 -0
- package/dist/import/index.cjs.map +1 -0
- package/dist/import/index.d.cts +169 -0
- package/dist/import/index.d.ts +169 -0
- package/dist/import/index.js +421 -0
- package/dist/import/index.js.map +1 -0
- package/dist/index-CELBpE13.d.cts +4198 -0
- package/dist/index-nqc3A-ty.d.ts +4198 -0
- package/dist/index.cjs +10597 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +4949 -0
- package/dist/index.d.ts +4949 -0
- package/dist/index.js +9907 -0
- package/dist/index.js.map +1 -0
- package/dist/map/index.cjs +122 -0
- package/dist/map/index.cjs.map +1 -0
- package/dist/map/index.d.cts +988 -0
- package/dist/map/index.d.ts +988 -0
- package/dist/map/index.js +25 -0
- package/dist/map/index.js.map +1 -0
- package/dist/routingGuidePictures-CxgXiuNd.d.cts +22 -0
- package/dist/routingGuidePictures-CxgXiuNd.d.ts +22 -0
- package/dist/studioStrings-lNvOeC1g.d.cts +72 -0
- package/dist/studioStrings-lNvOeC1g.d.ts +72 -0
- package/dist/styles.css +14677 -0
- package/dist/testing/index.cjs +357 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +319 -0
- package/dist/testing/index.d.ts +319 -0
- package/dist/testing/index.js +344 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/video/index.cjs +53 -0
- package/dist/video/index.cjs.map +1 -0
- package/dist/video/index.d.cts +127 -0
- package/dist/video/index.d.ts +127 -0
- package/dist/video/index.js +44 -0
- package/dist/video/index.js.map +1 -0
- package/package.json +227 -4
- package/src/agent/components/ActivityRow.tsx +226 -0
- package/src/agent/components/AgentEntityIndicator.tsx +67 -0
- package/src/agent/components/AgentMarkdown.tsx +530 -0
- package/src/agent/components/ChatComposer.tsx +161 -0
- package/src/agent/components/ChatTranscript.tsx +1358 -0
- package/src/agent/components/CopilotPanel.tsx +415 -0
- package/src/agent/components/CopilotStates.tsx +238 -0
- package/src/agent/components/CopilotTranscript.tsx +191 -0
- package/src/agent/components/MessageFeedback.tsx +100 -0
- package/src/agent/hooks/useAgentChatTransport.ts +61 -0
- package/src/agent/hooks/useAgentErrorCopy.ts +27 -0
- package/src/agent/hooks/useCopilotOpen.ts +68 -0
- package/src/agent/providers/AgentThreadsProvider.tsx +360 -0
- package/src/agent/providers/PromptPanelConversation.tsx +135 -0
- package/src/agent/rules/drawnNode.ts +24 -0
- package/src/alerts/components/MapAlerts.tsx +127 -0
- package/src/cache/hooks/useStudioCache.ts +40 -0
- package/src/cache/rules/studioCache.ts +145 -0
- package/src/collab/components/PeerEntityIndicator.tsx +150 -0
- package/src/collab/components/PresenceRoster.tsx +113 -0
- package/src/collab/components/peerLock.tsx +59 -0
- package/src/collab/hooks/useCollabOrganizationId.ts +24 -0
- package/src/collab/hooks/usePeerLockLabel.ts +41 -0
- package/src/collections/components/CollectionFormModal.tsx +280 -0
- package/src/collections/components/CollectionMultiSelect.tsx +640 -0
- package/src/collections/components/EditCollectionModal.tsx +114 -0
- package/src/collections/components/ManageCollectionsModal.tsx +692 -0
- package/src/collections/components/NewCollectionModal.tsx +87 -0
- package/src/collections/components/ShareCollectionModal.tsx +150 -0
- package/src/collections/hooks/useEntityCollections.ts +126 -0
- package/src/collections/hooks/useEveryPage.ts +33 -0
- package/src/controls/components/MapControlTooltip.tsx +84 -0
- package/src/controls/components/PoiOverlayMenu.tsx +342 -0
- package/src/controls/components/StudioControls.tsx +278 -0
- package/src/controls/rules/constants.ts +34 -0
- package/src/copilot/hooks/useStudioCopilotInset.ts +39 -0
- package/src/copilot/index.ts +29 -0
- package/src/directions/components/DirectionsModal.tsx +447 -0
- package/src/directions/components/directionsPdf.tsx +557 -0
- package/src/embed/components/DefaultViewControl.tsx +159 -0
- package/src/embed/components/EmbedBaseMapPicker.tsx +107 -0
- package/src/embed/components/EmbedCodeSection.tsx +329 -0
- package/src/embed/components/EmbedColumnsSection.tsx +167 -0
- package/src/embed/components/EmbedConfigForm.tsx +239 -0
- package/src/embed/components/EmbedElementSwitcher.tsx +87 -0
- package/src/embed/components/EmbedFieldControl.tsx +488 -0
- package/src/embed/components/EmbedGeneralSection.tsx +279 -0
- package/src/embed/components/EmbedKeyPanel.tsx +138 -0
- package/src/embed/components/EmbedSnippetCode.tsx +154 -0
- package/src/embed/components/EmbedStage.tsx +505 -0
- package/src/embed/components/EmbedTablePreview.tsx +134 -0
- package/src/embed/components/EmbedThemePicker.tsx +74 -0
- package/src/embed/components/EmbedTintPicker.tsx +76 -0
- package/src/embed/components/EmbedWizard.tsx +1031 -0
- package/src/embed/hooks/useEmbedCode.ts +170 -0
- package/src/embed/hooks/useEmbedCollectionItineraries.ts +42 -0
- package/src/embed/hooks/useEmbedLayerOptions.ts +75 -0
- package/src/embed/hooks/useEmbedPreviewCamera.ts +169 -0
- package/src/embed/index.ts +48 -0
- package/src/fullscreen/components/FullscreenHeader.tsx +77 -0
- package/src/fullscreen/components/FullscreenModal.tsx +80 -0
- package/src/fullscreen/components/WizardLayout.tsx +129 -0
- package/src/guards/components/AgentDrivingGuard.tsx +59 -0
- package/src/guards/components/UnsavedEditsGuard.tsx +210 -0
- package/src/guards/hooks/useReportUnsavedForm.ts +34 -0
- package/src/guards/hooks/useUnsavedEditsGuard.ts +44 -0
- package/src/headless/hooks/useAgentDriving.ts +21 -0
- package/src/headless/hooks/useBeginSegmentEdit.ts +89 -0
- package/src/headless/hooks/useBeginWaypointEdit.ts +74 -0
- package/src/headless/hooks/useCapabilitySet.ts +65 -0
- package/src/headless/hooks/useCollabResources.ts +148 -0
- package/src/headless/hooks/useCollectionScope.ts +37 -0
- package/src/headless/hooks/useEditActions.ts +250 -0
- package/src/headless/hooks/useEscapeKey.ts +43 -0
- package/src/headless/hooks/useInlineRename.ts +276 -0
- package/src/headless/hooks/useLiveAwareSegments.ts +88 -0
- package/src/headless/hooks/useLiveAwareWaypoints.ts +39 -0
- package/src/headless/hooks/useMapHoveredRow.ts +76 -0
- package/src/headless/hooks/usePlatformViewer.ts +452 -0
- package/src/headless/hooks/usePluginSlot.ts +235 -0
- package/src/headless/hooks/useRowEmphasis.ts +66 -0
- package/src/headless/hooks/useSegmentList.ts +428 -0
- package/src/headless/hooks/useSegmentRow.ts +366 -0
- package/src/headless/hooks/useSegmentRowActions.ts +267 -0
- package/src/headless/hooks/useShallowSelector.ts +145 -0
- package/src/headless/hooks/useStableMembers.ts +74 -0
- package/src/headless/hooks/useStoreSlice.ts +52 -0
- package/src/headless/hooks/useStreetViewCorridor.ts +120 -0
- package/src/headless/hooks/useStudioApi.ts +18 -0
- package/src/headless/hooks/useStudioDispatch.ts +181 -0
- package/src/headless/hooks/useStudioDispatchCount.ts +147 -0
- package/src/headless/hooks/useStudioDispatchUnsafe.ts +111 -0
- package/src/headless/hooks/useStudioEntitlement.ts +29 -0
- package/src/headless/hooks/useStudioFailureAlert.ts +67 -0
- package/src/headless/hooks/useStudioObserve.ts +38 -0
- package/src/headless/hooks/useStudioPreferences.ts +8 -0
- package/src/headless/hooks/useStudioSignedIn.ts +12 -0
- package/src/headless/hooks/useStudioStore.ts +72 -0
- package/src/headless/hooks/useStudioUnits.ts +23 -0
- package/src/headless/hooks/useStudioUrl.ts +24 -0
- package/src/headless/hooks/useStudioUserId.ts +5 -0
- package/src/headless/hooks/useStudioVerbHeld.ts +43 -0
- package/src/headless/hooks/useStudioViewer.ts +19 -0
- package/src/headless/hooks/useStudioViewerEntitlement.ts +40 -0
- package/src/headless/hooks/useStudioViewerItineraryLimit.ts +34 -0
- package/src/headless/hooks/useStudioViewerPreferences.ts +44 -0
- package/src/headless/hooks/useStudioViewerUnits.ts +50 -0
- package/src/headless/hooks/useStudioViewerUserId.ts +23 -0
- package/src/headless/hooks/useUiStore.ts +91 -0
- package/src/headless/hooks/useUiStoreShallow.ts +43 -0
- package/src/headless/hooks/useWaypointDetailsDialog.ts +52 -0
- package/src/headless/hooks/useWaypointList.ts +89 -0
- package/src/headless/hooks/useWaypointRow.ts +227 -0
- package/src/headless/hooks/useWaypointRowActions.ts +166 -0
- package/src/headless/index.ts +287 -0
- package/src/headless/providers/billingGate.tsx +129 -0
- package/src/headless/providers/copilot.tsx +155 -0
- package/src/headless/providers/mountayaStudio.tsx +126 -0
- package/src/headless/providers/navigationBlocker.tsx +91 -0
- package/src/headless/providers/notify.tsx +36 -0
- package/src/headless/providers/organizations.tsx +267 -0
- package/src/headless/providers/plugins.tsx +173 -0
- package/src/headless/providers/studio.tsx +1295 -0
- package/src/headless/providers/studioStrings.tsx +243 -0
- package/src/headless/rules/inputMethod.ts +19 -0
- package/src/hooks/useAgreementLimits.ts +165 -0
- package/src/hooks/useLayerCatalogOptions.ts +106 -0
- package/src/host/components/MountayaStudioHost.tsx +1018 -0
- package/src/host/hooks/useEmbeddedStudio.ts +24 -0
- package/src/host/hooks/useItineraryActivation.ts +126 -0
- package/src/host/hooks/useMemberGrants.ts +51 -0
- package/src/host/hooks/useStudioHostSurfaces.ts +100 -0
- package/src/host/hooks/useStudioPluginBinding.ts +133 -0
- package/src/host/hooks/useStudioSessionHeld.ts +111 -0
- package/src/host/hooks/useStudioToolBus.ts +127 -0
- package/src/host/hooks/useStudioToolContext.ts +175 -0
- package/src/host/providers/hostRegistry.tsx +144 -0
- package/src/host/providers/hostSurface.tsx +47 -0
- package/src/host/providers/hostVideo.tsx +73 -0
- package/src/import/components/DraftEntityList.tsx +298 -0
- package/src/import/components/FileDropInput.tsx +261 -0
- package/src/import/components/FileDropzone.tsx +97 -0
- package/src/import/components/ImportItineraryContent.tsx +133 -0
- package/src/import/components/ImportPreviewLegend.tsx +50 -0
- package/src/import/components/ImportPrimer.tsx +113 -0
- package/src/import/index.ts +32 -0
- package/src/import/providers/ImportRoutingGuideProvider.tsx +319 -0
- package/src/import/rules/routingGuidePictures.ts +20 -0
- package/src/index.ts +633 -0
- package/src/internal/components/Glyph.tsx +34 -0
- package/src/internal/components/MarkerGlyph.tsx +23 -0
- package/src/internal/components/MountayaMark.tsx +142 -0
- package/src/internal/hooks/useTextOverflow.ts +90 -0
- package/src/internal/providers/studioEditorRoot.tsx +42 -0
- package/src/internal/rules/editorRoot.ts +9 -0
- package/src/internal/rules/missingSeam.ts +32 -0
- package/src/itinerary/components/ActivityGuideModal.tsx +345 -0
- package/src/itinerary/components/ActivitySelect.tsx +204 -0
- package/src/itinerary/components/AddWaypointButton.tsx +151 -0
- package/src/itinerary/components/AscentInput.tsx +65 -0
- package/src/itinerary/components/Characteristics.tsx +129 -0
- package/src/itinerary/components/CursorReadout.tsx +66 -0
- package/src/itinerary/components/DistanceInput.tsx +67 -0
- package/src/itinerary/components/DraftProvenanceBanner.tsx +79 -0
- package/src/itinerary/components/DuplicateItineraryModal.tsx +341 -0
- package/src/itinerary/components/EditorSaveFooter.tsx +424 -0
- package/src/itinerary/components/ItineraryActionsMenu.tsx +655 -0
- package/src/itinerary/components/ItineraryForm.tsx +887 -0
- package/src/itinerary/components/ItineraryHeaderIdentity.tsx +121 -0
- package/src/itinerary/components/ItineraryHeaderMeta.tsx +68 -0
- package/src/itinerary/components/ItineraryHeaderTitle.tsx +88 -0
- package/src/itinerary/components/ItineraryIdentityFields.tsx +153 -0
- package/src/itinerary/components/ItineraryProfilePanel.tsx +619 -0
- package/src/itinerary/components/ItineraryProfileSheet.tsx +219 -0
- package/src/itinerary/components/ItinerarySubHeader.tsx +236 -0
- package/src/itinerary/components/PendingProfile.tsx +142 -0
- package/src/itinerary/components/PlaceCard.tsx +35 -0
- package/src/itinerary/components/PlaceMark.tsx +76 -0
- package/src/itinerary/components/ProfileAnalysisBars.tsx +84 -0
- package/src/itinerary/components/ProfileBar.tsx +215 -0
- package/src/itinerary/components/ProfileHeaderControls.tsx +116 -0
- package/src/itinerary/components/ProfileHeaderFigures.tsx +119 -0
- package/src/itinerary/components/ProfilePaceControl.tsx +97 -0
- package/src/itinerary/components/ProfileStat.tsx +76 -0
- package/src/itinerary/components/ProfileStatStrip.tsx +38 -0
- package/src/itinerary/components/RoadAccessModal.tsx +76 -0
- package/src/itinerary/components/RouteTypeControl.tsx +73 -0
- package/src/itinerary/components/SegmentGroupModal.tsx +311 -0
- package/src/itinerary/components/SegmentGroupRangePicker.tsx +228 -0
- package/src/itinerary/components/StagingCreateFooter.tsx +185 -0
- package/src/itinerary/components/StudioItineraryProfile.tsx +620 -0
- package/src/itinerary/components/SuggestForm.tsx +256 -0
- package/src/itinerary/components/SuggestFormActions.tsx +124 -0
- package/src/itinerary/components/SuggestionResultRow.tsx +98 -0
- package/src/itinerary/components/SuggestionResultsList.tsx +85 -0
- package/src/itinerary/components/WaypointAmenityPicker.tsx +105 -0
- package/src/itinerary/components/WaypointDetailFields.tsx +604 -0
- package/src/itinerary/components/WaypointDetailsModal.tsx +134 -0
- package/src/itinerary/components/WaypointDetailsRows.tsx +707 -0
- package/src/itinerary/components/WaypointDetailsView.tsx +389 -0
- package/src/itinerary/components/WaypointIconCircle.tsx +211 -0
- package/src/itinerary/components/WaypointIconPicker.tsx +82 -0
- package/src/itinerary/components/WaypointMarkers.tsx +293 -0
- package/src/itinerary/components/WaypointPreviewCard.tsx +56 -0
- package/src/itinerary/components/WaypointSectionNav.tsx +151 -0
- package/src/itinerary/components/WaypointSwitcher.tsx +143 -0
- package/src/itinerary/components/WaypointWorkbench.tsx +263 -0
- package/src/itinerary/hooks/useDuplicateDraft.ts +205 -0
- package/src/itinerary/hooks/useDuplicateSource.ts +69 -0
- package/src/itinerary/hooks/useFriendlyNameBanks.ts +26 -0
- package/src/itinerary/hooks/useItineraryEditable.ts +89 -0
- package/src/itinerary/hooks/useItineraryPace.ts +103 -0
- package/src/itinerary/hooks/useItinerarySubject.ts +117 -0
- package/src/itinerary/hooks/useOpenItineraryEditable.ts +39 -0
- package/src/itinerary/hooks/useProfileOverlay.tsx +61 -0
- package/src/itinerary/hooks/useProfileSeries.ts +95 -0
- package/src/itinerary/hooks/useProfileVisibility.ts +149 -0
- package/src/itinerary/hooks/useSeedDraftOrganization.ts +85 -0
- package/src/itinerary/hooks/useSegmentGroupSave.ts +143 -0
- package/src/itinerary/hooks/useStartFromSuggestion.ts +63 -0
- package/src/itinerary/hooks/useStudioItinerary.ts +35 -0
- package/src/itinerary/hooks/useSuggestionPin.ts +36 -0
- package/src/itinerary/hooks/useWaypointCardWords.ts +51 -0
- package/src/itinerary/hooks/useWaypointCreateFollowUp.ts +158 -0
- package/src/itinerary/hooks/useWaypointDetailsEditor.ts +280 -0
- package/src/itinerary/hooks/useWaypointSectionEntries.ts +114 -0
- package/src/itinerary/providers/ActivityGuideProvider.tsx +113 -0
- package/src/itinerary/providers/ItineraryViewProvider.tsx +146 -0
- package/src/itinerary/rules/amenityGlyphs.ts +25 -0
- package/src/itinerary/rules/cursorReadoutData.ts +34 -0
- package/src/itinerary/rules/profileCursor.ts +11 -0
- package/src/itinerary/rules/profileModel.ts +98 -0
- package/src/itinerary/rules/shownFocus.ts +11 -0
- package/src/itinerary/rules/waypointGlyphs.ts +42 -0
- package/src/itinerary/stores/profileHover.ts +54 -0
- package/src/lists/components/AddSegmentButton.tsx +240 -0
- package/src/lists/components/EditActions.tsx +153 -0
- package/src/lists/components/EditorListSection.tsx +117 -0
- package/src/lists/components/EditorSegmentRow.tsx +458 -0
- package/src/lists/components/ItineraryAddSegmentButton.tsx +66 -0
- package/src/lists/components/ItinerarySegmentList.tsx +301 -0
- package/src/lists/components/ItineraryWaypointList.tsx +257 -0
- package/src/lists/components/SegmentList.tsx +549 -0
- package/src/lists/components/SegmentSeam.tsx +292 -0
- package/src/lists/components/WaypointList.tsx +232 -0
- package/src/map/components/ContextMenuPopup.tsx +913 -0
- package/src/map/components/MapAnchoredPopup.tsx +284 -0
- package/src/map/components/SegmentViaPopup.tsx +133 -0
- package/src/map/hooks/useAccessRestrictions.ts +25 -0
- package/src/map/hooks/useEmbedConstraints.ts +359 -0
- package/src/map/hooks/useEmbedDisplaySeed.ts +61 -0
- package/src/map/hooks/useEmbedReady.ts +137 -0
- package/src/map/hooks/useHeldTileSources.ts +65 -0
- package/src/map/hooks/useSegmentColor.ts +24 -0
- package/src/map/hooks/useSpecificationLayers.ts +25 -0
- package/src/map/hooks/useStudioConstraints.ts +135 -0
- package/src/map/hooks/useStudioContextMenu.ts +34 -0
- package/src/map/hooks/useStudioContextMenuWaypoint.ts +119 -0
- package/src/map/hooks/useStudioEditCommitReporter.ts +56 -0
- package/src/map/hooks/useStudioEditEngine.ts +270 -0
- package/src/map/hooks/useStudioEnrichment.ts +117 -0
- package/src/map/hooks/useStudioItinerarySelection.ts +484 -0
- package/src/map/hooks/useStudioLayersScope.ts +34 -0
- package/src/map/hooks/useStudioMapBindings.ts +178 -0
- package/src/map/hooks/useStudioMapEditSeams.ts +161 -0
- package/src/map/hooks/useStudioMapSync.ts +127 -0
- package/src/map/hooks/useStudioOverlay.ts +75 -0
- package/src/map/hooks/useStudioOverlayWithdrawal.ts +52 -0
- package/src/map/hooks/useStudioOverlaysEntitled.ts +12 -0
- package/src/map/hooks/useStudioPeerDrafts.ts +126 -0
- package/src/map/hooks/useStudioPoiLayers.ts +110 -0
- package/src/map/hooks/useStudioPreviewSync.ts +205 -0
- package/src/map/hooks/useStudioSegmentEditing.ts +239 -0
- package/src/map/hooks/useStudioSegmentViaPrompt.ts +38 -0
- package/src/map/hooks/useStudioSplitPicking.ts +411 -0
- package/src/map/hooks/useStudioSuggestionPicking.ts +178 -0
- package/src/map/hooks/useStudioTimestamp.ts +226 -0
- package/src/map/hooks/useStudioUrlState.ts +340 -0
- package/src/map/hooks/useStudioWaypointEditing.ts +251 -0
- package/src/map/hooks/useStudioZoneEditing.ts +260 -0
- package/src/map/hooks/useStudioZoneOriginPicking.ts +129 -0
- package/src/map/hooks/useStudioZoneSelection.ts +240 -0
- package/src/map/hooks/useTileLayers.ts +33 -0
- package/src/map/index.ts +67 -0
- package/src/map/rules/editKeyboard.ts +216 -0
- package/src/map/rules/editTooltip.ts +222 -0
- package/src/map/rules/nearerEscape.ts +107 -0
- package/src/map/rules/poiGlyphs.ts +40 -0
- package/src/modals/components/AppModal.tsx +280 -0
- package/src/modals/components/ConfirmModal.tsx +223 -0
- package/src/modals/components/ExportModal.tsx +538 -0
- package/src/modals/components/LocationPermissionModal.tsx +129 -0
- package/src/modals/components/ModalFooter.tsx +187 -0
- package/src/modals/hooks/useConfirmGate.tsx +209 -0
- package/src/modals/hooks/useDiscardGuard.tsx +168 -0
- package/src/panels/components/EditShortcutHint.tsx +115 -0
- package/src/panels/components/FloatingOverlay.tsx +243 -0
- package/src/panels/components/GlyphPickerGrid.tsx +84 -0
- package/src/panels/components/PanelRouter.tsx +133 -0
- package/src/panels/components/PickerCard.tsx +108 -0
- package/src/panels/components/RadioOptionCard.tsx +116 -0
- package/src/panels/components/SidenavContentBody.tsx +56 -0
- package/src/panels/components/SidenavContentFooter.tsx +27 -0
- package/src/panels/components/SidenavContentHeader.tsx +172 -0
- package/src/panels/components/SidenavFormActions.tsx +96 -0
- package/src/panels/components/StudioFormStack.tsx +44 -0
- package/src/panels/components/StudioHeader.tsx +117 -0
- package/src/panels/components/StudioLayersPanel.tsx +909 -0
- package/src/panels/components/StudioPreferencesPanel.tsx +199 -0
- package/src/panels/rules/studioHeader.ts +68 -0
- package/src/plugins/components/PluginBoundary.tsx +62 -0
- package/src/plugins/components/PluginContextMenuActions.tsx +73 -0
- package/src/plugins/components/PluginControls.tsx +101 -0
- package/src/plugins/components/PluginHeldView.tsx +77 -0
- package/src/plugins/components/PluginMenuItems.tsx +63 -0
- package/src/plugins/components/PluginProfileHeader.tsx +71 -0
- package/src/plugins/components/PluginProfilePlot.tsx +134 -0
- package/src/plugins/components/PluginSlotItems.tsx +55 -0
- package/src/primitives/components/ActivityIcon.tsx +106 -0
- package/src/primitives/components/AllowlistField.tsx +508 -0
- package/src/primitives/components/CopyIconButton.tsx +80 -0
- package/src/primitives/components/DateTimeInput.tsx +133 -0
- package/src/primitives/components/DateTimePickerField.tsx +101 -0
- package/src/primitives/components/DescriptiveMenuItem.tsx +80 -0
- package/src/primitives/components/DialogSubject.tsx +102 -0
- package/src/primitives/components/DisabledMenuItem.tsx +45 -0
- package/src/primitives/components/DisabledReason.tsx +34 -0
- package/src/primitives/components/EmptyState.tsx +186 -0
- package/src/primitives/components/ErrorAlert.tsx +35 -0
- package/src/primitives/components/ErrorBoundary.tsx +55 -0
- package/src/primitives/components/FieldLabel.tsx +34 -0
- package/src/primitives/components/FormErrorAlert.tsx +33 -0
- package/src/primitives/components/GroupLabelledBy.tsx +31 -0
- package/src/primitives/components/LanguageSelect.tsx +139 -0
- package/src/primitives/components/ListSkeleton.tsx +64 -0
- package/src/primitives/components/MarqueeText.tsx +61 -0
- package/src/primitives/components/OrganizationScopeItem.tsx +146 -0
- package/src/primitives/components/OrganizationSelect.tsx +149 -0
- package/src/primitives/components/PointField.tsx +75 -0
- package/src/primitives/components/PrivacyControl.tsx +127 -0
- package/src/primitives/components/RenameInput.tsx +159 -0
- package/src/primitives/components/RequiredLabelWithHelp.tsx +76 -0
- package/src/primitives/components/SegmentIcon.tsx +43 -0
- package/src/primitives/components/SegmentIconLabel.tsx +37 -0
- package/src/primitives/components/SpeedInput.tsx +222 -0
- package/src/primitives/components/StudioSectionBoundary.tsx +56 -0
- package/src/primitives/components/StudioSegmentedControl.tsx +23 -0
- package/src/primitives/components/UnitPickerField.tsx +62 -0
- package/src/primitives/components/UnitPickerGrid.tsx +71 -0
- package/src/primitives/components/WarningAlert.tsx +34 -0
- package/src/primitives/hooks/useCompactLayout.ts +30 -0
- package/src/primitives/hooks/useSpeedControlLabel.ts +28 -0
- package/src/primitives/rules/activityBadge.ts +87 -0
- package/src/publication/components/PublicationBadge.tsx +42 -0
- package/src/publication/components/PublicationDot.tsx +31 -0
- package/src/publication/components/PublicationNotice.tsx +115 -0
- package/src/publication/components/PublicationSettledPill.tsx +43 -0
- package/src/publication/components/PublicationStatus.tsx +52 -0
- package/src/publication/components/UnpublishedPanel.tsx +133 -0
- package/src/publication/hooks/usePublicationHint.ts +235 -0
- package/src/publication/hooks/usePublishAct.ts +101 -0
- package/src/publication/hooks/usePublishItinerary.ts +27 -0
- package/src/publication/hooks/usePublishZone.ts +27 -0
- package/src/publication/hooks/usePublishableScope.ts +23 -0
- package/src/publication/hooks/usePublishedItinerary.ts +83 -0
- package/src/rows/components/ReadOnlySegmentRow.tsx +155 -0
- package/src/rows/components/RouteMetricLine.tsx +90 -0
- package/src/rows/components/RowMetadata.tsx +92 -0
- package/src/rows/components/SegmentRow.tsx +381 -0
- package/src/rows/components/SegmentRowActions.tsx +187 -0
- package/src/rows/components/SegmentRowBody.tsx +197 -0
- package/src/rows/components/StudioToggleRow.tsx +71 -0
- package/src/rows/components/SuggestionList.tsx +100 -0
- package/src/rows/components/SuggestionRowLayout.tsx +164 -0
- package/src/rows/components/WaypointRow.tsx +175 -0
- package/src/rows/components/WaypointRowLayout.tsx +278 -0
- package/src/rows/components/lockChrome.tsx +106 -0
- package/src/rules/menuActions.ts +149 -0
- package/src/rules/sizing.ts +127 -0
- package/src/rules/studioConfig.ts +719 -0
- package/src/search/components/CategoryTabs.tsx +136 -0
- package/src/search/components/ResultRow.tsx +242 -0
- package/src/search/components/ResultsList.tsx +182 -0
- package/src/search/components/SearchInput.tsx +100 -0
- package/src/search/components/SearchTab.tsx +614 -0
- package/src/sections/components/RailSwitcher.tsx +179 -0
- package/src/sections/components/SectionCard.tsx +48 -0
- package/src/sections/components/SectionHead.tsx +42 -0
- package/src/sections/components/SectionTabs.tsx +231 -0
- package/src/segments/components/SegmentColorCircle.tsx +118 -0
- package/src/segments/components/SegmentColorPicker.tsx +134 -0
- package/src/segments/components/SegmentModeControl.tsx +118 -0
- package/src/segments/components/SegmentRowMenu.tsx +449 -0
- package/src/segments/components/SegmentRowPopover.tsx +163 -0
- package/src/segments/components/SegmentSelect.tsx +116 -0
- package/src/segments/components/SegmentSpeedControl.tsx +299 -0
- package/src/share/components/ShareLinkManage.tsx +699 -0
- package/src/share/components/ShareModal.tsx +182 -0
- package/src/share/components/ShareSheet.tsx +178 -0
- package/src/share/components/ShareViewModal.tsx +131 -0
- package/src/share/hooks/useCanManageShareLink.ts +51 -0
- package/src/studio/components/MountayaStudio.tsx +1170 -0
- package/src/studio/components/MountayaStudioViewer.tsx +775 -0
- package/src/studio/hooks/useEmbeddedStudioConfig.ts +60 -0
- package/src/studio/hooks/useViewerActivation.ts +47 -0
- package/src/studio/hooks/useViewerCollectionSpecification.ts +58 -0
- package/src/studio/hooks/useViewerEmbedConfig.ts +74 -0
- package/src/studio/hooks/useViewerFraming.ts +211 -0
- package/src/studio/hooks/useViewerMapBindings.ts +109 -0
- package/src/styles.css +3993 -0
- package/src/testing/collections.ts +40 -0
- package/src/testing/hostRegistry.tsx +109 -0
- package/src/testing/index.ts +65 -0
- package/src/testing/itinerary.ts +297 -0
- package/src/testing/mountayaClient.tsx +218 -0
- package/src/testing/viewer.tsx +171 -0
- package/src/theme/components/StudioPortalScope.tsx +130 -0
- package/src/theme/hooks/useResolvedStudioTheme.ts +37 -0
- package/src/theme/rules/density.ts +157 -0
- package/src/theme/rules/mountayaStudioTheme.ts +114 -0
- package/src/theme/rules/passwordManager.ts +20 -0
- package/src/theme/rules/tokenStyle.ts +18 -0
- package/src/theme/rules/tokens.ts +71 -0
- package/src/theme/rules/tone.ts +34 -0
- package/src/theme/rules/zIndex.ts +40 -0
- package/src/video/components/CameraStep.tsx +82 -0
- package/src/video/components/DirectingScrim.tsx +28 -0
- package/src/video/components/DirectorChat.tsx +79 -0
- package/src/video/components/FormatStep.tsx +487 -0
- package/src/video/components/ModeCards.tsx +141 -0
- package/src/video/components/PlanNumberField.tsx +54 -0
- package/src/video/components/PreviewControls.tsx +212 -0
- package/src/video/components/PreviewStage.tsx +319 -0
- package/src/video/components/PreviewSurface.tsx +247 -0
- package/src/video/components/PreviewWatermark.tsx +77 -0
- package/src/video/components/ProfileOverlayCanvas.tsx +195 -0
- package/src/video/components/ProfileStep.tsx +254 -0
- package/src/video/components/RecordProgress.tsx +117 -0
- package/src/video/components/ReviewStep.tsx +244 -0
- package/src/video/components/ShotList.tsx +452 -0
- package/src/video/components/VideoExportWizard.tsx +829 -0
- package/src/video/components/WizardDirectingIndicator.tsx +57 -0
- package/src/video/components/WizardFooter.tsx +112 -0
- package/src/video/hooks/usePreviewPlanRefresh.ts +91 -0
- package/src/video/hooks/useVideoItinerarySubject.ts +18 -0
- package/src/video/hooks/useVideoOrganizationId.ts +30 -0
- package/src/video/hooks/useVideoPreviewSeed.ts +203 -0
- package/src/video/hooks/useVideoProfileSeed.ts +53 -0
- package/src/video/hooks/useVideoPublication.ts +29 -0
- package/src/video/hooks/useVideoRouteReady.ts +52 -0
- package/src/video/hooks/useVideoRouteSync.ts +100 -0
- package/src/video/hooks/useVideoTileTransform.ts +88 -0
- package/src/video/index.ts +24 -0
- package/src/video/providers/DirectorChatProvider.tsx +293 -0
- package/src/video/rules/changeTo.ts +20 -0
- package/src/zone/components/ZoneActionsMenu.tsx +305 -0
- package/src/zone/components/ZoneAvailabilityFields.tsx +98 -0
- package/src/zone/components/ZoneForm.tsx +622 -0
- package/src/zone/components/ZoneInheritedContext.tsx +70 -0
- package/src/zone/components/ZoneLevelSelect.tsx +86 -0
- package/src/zone/components/ZoneMetadataFields.tsx +89 -0
- package/src/zone/components/ZoneMethodSelect.tsx +90 -0
- package/src/zone/components/ZoneModeSelect.tsx +98 -0
- package/src/zone/components/ZoneRangeInput.tsx +129 -0
- package/src/zone/components/ZoneReachabilityFields.tsx +120 -0
- package/src/zone/components/ZoneSubHeader.tsx +188 -0
- package/src/zone/components/ZoneVisibility.tsx +94 -0
- package/src/zone/hooks/useStudioReachabilityStart.ts +79 -0
- package/src/zone/hooks/useStudioZonesBrowsed.ts +32 -0
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type QueryClient,
|
|
3
|
+
QueryClientContext,
|
|
4
|
+
type QueryKey,
|
|
5
|
+
skipToken,
|
|
6
|
+
useQuery,
|
|
7
|
+
} from "@tanstack/react-query";
|
|
8
|
+
import { use, useCallback, useLayoutEffect, useMemo, useState, useSyncExternalStore } from "react";
|
|
9
|
+
|
|
10
|
+
import { type Mountaya, type MountayaError, paginate } from "@mountaya/client";
|
|
11
|
+
import { type Membership, MountayaAdmin } from "@mountaya/client/admin";
|
|
12
|
+
import { mountayaKeys, useMountayaOrNull } from "@mountaya/client-react";
|
|
13
|
+
import { MountayaElementsError } from "@mountaya/elements/errors";
|
|
14
|
+
import { useLatestRef } from "@mountaya/elements-react/headless";
|
|
15
|
+
import {
|
|
16
|
+
createPlatformViewer,
|
|
17
|
+
defaultStudioScope,
|
|
18
|
+
type PlatformAnswerReader,
|
|
19
|
+
type PlatformScopeAnswer,
|
|
20
|
+
type StudioViewer,
|
|
21
|
+
} from "@mountaya/studio";
|
|
22
|
+
|
|
23
|
+
import { useStableMembers } from "./useStableMembers.js";
|
|
24
|
+
|
|
25
|
+
/** UsePlatformViewerOptions is what {@link usePlatformViewer} reads. */
|
|
26
|
+
export interface UsePlatformViewerOptions {
|
|
27
|
+
/**
|
|
28
|
+
* The client the memberships are read with. It reads the memberships of the user its session
|
|
29
|
+
* token was minted for, who is the person `viewer` names: a publishable key beside a session
|
|
30
|
+
* token your server minted with that person's `user_id`. A session minted without `user_id`
|
|
31
|
+
* reads none, and the viewer holds nothing.
|
|
32
|
+
*
|
|
33
|
+
* Omitted, the client of the `MountayaProvider` above.
|
|
34
|
+
*/
|
|
35
|
+
readonly client?: Mountaya | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Whether an id names the reader's own space rather than an organization, for a host that
|
|
38
|
+
* spells its personal space with an organization id: the `isPersonalScope` of the roster it
|
|
39
|
+
* hands `MountayaStudioHost`. Read when the viewer is asked, so a predicate written inline is
|
|
40
|
+
* the same viewer at every render. Its answer for an id holds for the mount, or moves only in a
|
|
41
|
+
* render that also changes `organizationId`, `personalSpace` or the memberships: nothing
|
|
42
|
+
* subscribes to the predicate, so a change of its answer alone reaches a surface only when
|
|
43
|
+
* something else renders it.
|
|
44
|
+
*
|
|
45
|
+
* @default Only an absent id, as `defaultStudioScope` of `@mountaya/studio` reads one.
|
|
46
|
+
*/
|
|
47
|
+
readonly isPersonalScope?: ((organizationId: string | null | undefined) => boolean) | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* The scope in view: the organization the studio is showing, or `null` for the reader's own
|
|
50
|
+
* space. A change tells the studio's surfaces once the render that states it commits.
|
|
51
|
+
*
|
|
52
|
+
* It is the `organization_id` the studio's URL names, kept equal to it by the host: the viewer
|
|
53
|
+
* answers what the person holds in this scope, and the studio's surfaces read the URL's scope
|
|
54
|
+
* for everything else, so a studio showing one organization under a viewer answering for
|
|
55
|
+
* another offers what neither scope holds.
|
|
56
|
+
*/
|
|
57
|
+
readonly organizationId: string | null;
|
|
58
|
+
/**
|
|
59
|
+
* The answer for the reader's own space, which no operation of the public contract returns, or
|
|
60
|
+
* `undefined` while the host has none. Left out, the personal space holds no feature and states
|
|
61
|
+
* no ceiling, which is the reading for a publishable key: it never reaches the personal space.
|
|
62
|
+
*
|
|
63
|
+
* A value, as the host's read holds it: an answer written inline, or rebuilt at every render,
|
|
64
|
+
* is the same answer while it states the same ceiling and the same features, and the studio's
|
|
65
|
+
* surfaces are told once the render that changes it commits.
|
|
66
|
+
*/
|
|
67
|
+
readonly personalSpace?: PlatformScopeAnswer | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* The query cache the memberships are read on: the one handed to `MountayaStudioHost` as
|
|
70
|
+
* `data.queryClient`, so the studio and its viewer read one cache.
|
|
71
|
+
*
|
|
72
|
+
* Omitted, the cache of the `QueryClientProvider` above.
|
|
73
|
+
*/
|
|
74
|
+
readonly queryClient?: QueryClient | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* The rest of the viewer, which the host answers itself: who the person is (the user the
|
|
77
|
+
* session token was minted for, whose memberships are read), the units they read in, where a preference is kept, and the
|
|
78
|
+
* subscription that tells their changes. `createMemoryViewer` of `@mountaya/studio` answers it
|
|
79
|
+
* for a host that keeps preferences nowhere.
|
|
80
|
+
*
|
|
81
|
+
* Held by its members, like `data.viewer` on `MountayaStudioHost`.
|
|
82
|
+
*/
|
|
83
|
+
readonly viewer: Pick<
|
|
84
|
+
StudioViewer,
|
|
85
|
+
"getPreferences" | "getUserId" | "setPreferences" | "subscribe"
|
|
86
|
+
>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* PlatformViewerState is what {@link usePlatformViewer} answers: the viewer, and where the read it
|
|
91
|
+
* is built from stands.
|
|
92
|
+
*
|
|
93
|
+
* The viewer alone cannot say why it holds nothing. A read still in flight, a key whose
|
|
94
|
+
* organization or scope does not reach the studio, and a server that failed all leave it holding
|
|
95
|
+
* nothing, as an agreement that covers nothing does, so a host that tells its reader why reads
|
|
96
|
+
* `status` and `error` rather than the viewer.
|
|
97
|
+
*/
|
|
98
|
+
export interface PlatformViewerState {
|
|
99
|
+
/**
|
|
100
|
+
* The read's last failure, as the client raised it: a 402 for an organization that does not hold
|
|
101
|
+
* Embedded Studio, a 403 for a key without the `studio-embedded` scope, a 5xx where the API
|
|
102
|
+
* failed. Null while nothing has failed.
|
|
103
|
+
*/
|
|
104
|
+
readonly error: MountayaError | null;
|
|
105
|
+
/**
|
|
106
|
+
* Where the memberships read stands:
|
|
107
|
+
*
|
|
108
|
+
* - `"pending"`: no answer has landed yet, or nobody is signed in; the viewer holds nothing.
|
|
109
|
+
* - `"error"`: the read failed, and `error` says how; the viewer holds the last answer that
|
|
110
|
+
* landed for this person, or nothing.
|
|
111
|
+
* - `"success"`: the answer landed, and the viewer holds exactly what it lists.
|
|
112
|
+
*/
|
|
113
|
+
readonly status: "error" | "pending" | "success";
|
|
114
|
+
/**
|
|
115
|
+
* The viewer to hand `MountayaStudioHost` as `data.viewer`. It keeps its identity while
|
|
116
|
+
* `UsePlatformViewerOptions.viewer` states the same members, so the studio's context is built
|
|
117
|
+
* once and its surfaces are told of each change through `subscribe`.
|
|
118
|
+
*/
|
|
119
|
+
readonly viewer: StudioViewer;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* MEMBERSHIPS_PAGE is the page the memberships are read in: the largest one, so most people's
|
|
124
|
+
* every membership arrives in one answer. Under a publishable key the answer is the one membership
|
|
125
|
+
* of the key's organization.
|
|
126
|
+
*/
|
|
127
|
+
const MEMBERSHIPS_PAGE = 100;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* EVERY_PAGE_SEGMENT ends the key the walk of every page caches under, after the operation's own
|
|
131
|
+
* key for the page it asks for. The walk holds the memberships, where a read of one page holds the
|
|
132
|
+
* body, so the two are two entries under the operation's prefix rather than one holding two
|
|
133
|
+
* shapes.
|
|
134
|
+
*/
|
|
135
|
+
const EVERY_PAGE_SEGMENT = "every page";
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* membershipsRead reads every membership of the user the client's session token names, page after
|
|
139
|
+
* page until one names no next cursor, an empty page that names one included: a person holding
|
|
140
|
+
* more memberships than a page carries holds them all. It is keyed under the operation's own key,
|
|
141
|
+
* so a host that invalidates `mountayaKeys.operation(scope, "rest", "getMyOrganizations")` drops
|
|
142
|
+
* it, and the client's own retry is the one policy every page is read under.
|
|
143
|
+
*/
|
|
144
|
+
const membershipsRead = (client: Mountaya) => {
|
|
145
|
+
const args = { query: { limit: MEMBERSHIPS_PAGE } };
|
|
146
|
+
|
|
147
|
+
return {
|
|
148
|
+
queryFn: async ({ signal }: { readonly signal: AbortSignal }): Promise<Membership[]> => {
|
|
149
|
+
const memberships: Membership[] = [];
|
|
150
|
+
const { users } = new MountayaAdmin(client);
|
|
151
|
+
for await (const membership of paginate(users.getMyOrganizations, args, {
|
|
152
|
+
pageSize: MEMBERSHIPS_PAGE,
|
|
153
|
+
signal,
|
|
154
|
+
})) {
|
|
155
|
+
memberships.push(membership);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return memberships;
|
|
159
|
+
},
|
|
160
|
+
queryKey: [
|
|
161
|
+
...mountayaKeys.operation(
|
|
162
|
+
client.transport.credentialScope,
|
|
163
|
+
"rest",
|
|
164
|
+
"getMyOrganizations",
|
|
165
|
+
args,
|
|
166
|
+
),
|
|
167
|
+
EVERY_PAGE_SEGMENT,
|
|
168
|
+
],
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* The entry no read is made under: nobody is signed in, so `skipToken` stands in for the read and
|
|
174
|
+
* the entry holds nothing.
|
|
175
|
+
*/
|
|
176
|
+
const unreadMembershipsKey: QueryKey = ["@mountaya/studio-react", "platform viewer", "unread"];
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* sameScopeAnswer reports whether two answers for the personal space state the same thing: both
|
|
180
|
+
* absent, or one ceiling and one list of features in one order. A host that writes the answer
|
|
181
|
+
* inline, or rebuilds it from what it read, hands another object at every render, and only a
|
|
182
|
+
* change of what it states is a change worth telling the studio's surfaces of.
|
|
183
|
+
*/
|
|
184
|
+
const sameScopeAnswer = (
|
|
185
|
+
previous: PlatformScopeAnswer | undefined,
|
|
186
|
+
next: PlatformScopeAnswer | undefined,
|
|
187
|
+
): boolean => {
|
|
188
|
+
if (previous === next) {
|
|
189
|
+
return true;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (previous === undefined || next === undefined) {
|
|
193
|
+
return false;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return (
|
|
197
|
+
Object.is(previous.itinerary_limit, next.itinerary_limit) &&
|
|
198
|
+
previous.studio_entitlements.length === next.studio_entitlements.length &&
|
|
199
|
+
previous.studio_entitlements.every(
|
|
200
|
+
(entitlement, index) => next.studio_entitlements[index] === entitlement,
|
|
201
|
+
)
|
|
202
|
+
);
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
/** A value a render states, held for the viewer's readers until the render that changes it commits. */
|
|
206
|
+
interface CommittedAnswer<T> {
|
|
207
|
+
/** Holds `next` and tells every reader's listener, when it states something else than is held. */
|
|
208
|
+
readonly commit: (next: T) => void;
|
|
209
|
+
/** The reader the viewer is built over. */
|
|
210
|
+
readonly reader: PlatformAnswerReader<T>;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* createCommittedAnswer holds `initial` for a reader and tells its listeners at each commit that
|
|
215
|
+
* changes it, as `same` reads a change. Every listener is told, and the first fault of a round
|
|
216
|
+
* reaches the program as an uncaught error on a microtask, so one listener cannot leave the rest
|
|
217
|
+
* of the studio stale.
|
|
218
|
+
*/
|
|
219
|
+
const createCommittedAnswer = <T>(
|
|
220
|
+
initial: T,
|
|
221
|
+
same: (previous: T, next: T) => boolean,
|
|
222
|
+
): CommittedAnswer<T> => {
|
|
223
|
+
let committed = initial;
|
|
224
|
+
const listeners = new Set<() => void>();
|
|
225
|
+
|
|
226
|
+
return {
|
|
227
|
+
commit: (next) => {
|
|
228
|
+
if (same(committed, next)) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
committed = next;
|
|
233
|
+
let fault: { readonly thrown: unknown } | undefined;
|
|
234
|
+
for (const listener of [...listeners]) {
|
|
235
|
+
try {
|
|
236
|
+
listener();
|
|
237
|
+
} catch (thrown) {
|
|
238
|
+
fault ??= { thrown };
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (fault !== undefined) {
|
|
243
|
+
const { thrown } = fault;
|
|
244
|
+
queueMicrotask(() => {
|
|
245
|
+
throw thrown;
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
reader: {
|
|
250
|
+
read: () => committed,
|
|
251
|
+
subscribe: (onChange) => {
|
|
252
|
+
listeners.add(onChange);
|
|
253
|
+
|
|
254
|
+
return () => {
|
|
255
|
+
listeners.delete(onChange);
|
|
256
|
+
};
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* useCommittedAnswer is a reader over `value` that answers what the last commit stated, and tells
|
|
264
|
+
* its listeners in the commit that changes it, before the browser paints. Two values `same` reads
|
|
265
|
+
* as one are no change, and the reader keeps answering the first.
|
|
266
|
+
*/
|
|
267
|
+
const useCommittedAnswer = <T>(
|
|
268
|
+
value: T,
|
|
269
|
+
same: (previous: T, next: T) => boolean = Object.is,
|
|
270
|
+
): PlatformAnswerReader<T> => {
|
|
271
|
+
const [answer] = useState(() => createCommittedAnswer(value, same));
|
|
272
|
+
|
|
273
|
+
useLayoutEffect(() => {
|
|
274
|
+
answer.commit(value);
|
|
275
|
+
}, [answer, value]);
|
|
276
|
+
|
|
277
|
+
return answer.reader;
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* usePlatformViewer is the viewer of a person whose memberships the client reads, ready for
|
|
282
|
+
* `data.viewer` on `MountayaStudioHost`: what they may use of the studio, and how many
|
|
283
|
+
* itineraries they may keep, as Mountaya answers it for each scope, with where the read stands.
|
|
284
|
+
*
|
|
285
|
+
* It reads `users.getMyOrganizations` of `MountayaAdmin`, the memberships of the user the session
|
|
286
|
+
* token was minted for, while `viewer.getUserId()` names a person, and builds the viewer with
|
|
287
|
+
* `createPlatformViewer` of `@mountaya/studio`, which decides none of it: a feature is held
|
|
288
|
+
* exactly where the membership of the scope in view lists it in `studio_entitlements`. A
|
|
289
|
+
* membership states no itinerary ceiling: the personal space's answer states one. A publishable
|
|
290
|
+
* key carrying the `studio-embedded` scope reads the one membership the session's user holds in
|
|
291
|
+
* the key's organization, so a licensee's studio shows what its agreement covers, narrowed by the
|
|
292
|
+
* organization's safety rules as what the key is served is: `profile-insights` only where
|
|
293
|
+
* `with_profile_analysis` is set, `map-pois` only where the overlay allowlist (`with_overlays`)
|
|
294
|
+
* admits the points of interest, and `map-overlays` only where it admits another overlay. A
|
|
295
|
+
* licensee whose studio draws no overlays checks those rules, not its agreement.
|
|
296
|
+
*
|
|
297
|
+
* Until the read lands, while nobody is signed in or the session is minted without `user_id`, and
|
|
298
|
+
* where it is refused, the viewer holds no entitlement and states no ceiling, and its surfaces are
|
|
299
|
+
* told when the answer arrives. Those states read alike on the viewer and apart on `status` and
|
|
300
|
+
* `error`: a key refused with a 402 or a 403 is a configuration to fix, not an agreement that
|
|
301
|
+
* covers nothing. The answer shows or withholds what the studio offers and authorizes nothing:
|
|
302
|
+
* every request is still refused by its own rule.
|
|
303
|
+
*
|
|
304
|
+
* Every page of the memberships is read, so a person holding more than one page of them holds
|
|
305
|
+
* them all. The read's entry is under the operation's key of `mountayaKeys` of
|
|
306
|
+
* `@mountaya/client-react` (`mountayaKeys.operation(scope, "rest", "getMyOrganizations")`), so a
|
|
307
|
+
* host that changes what a person holds, by accepting an invitation, invalidates that key and the
|
|
308
|
+
* viewer follows. The client repeats a read refused for the quota or by a failing gateway itself,
|
|
309
|
+
* and the hook repeats nothing on top of it: a 500 is reported as the read's `error`.
|
|
310
|
+
*
|
|
311
|
+
* @param options - The client, the query cache, the scope in view, the personal space's answer
|
|
312
|
+
* and the rest of the viewer.
|
|
313
|
+
* @returns The viewer to hand `MountayaStudioHost` as `data.viewer`, and the read's status and
|
|
314
|
+
* error.
|
|
315
|
+
* @throws {MountayaElementsError} While rendering, with no `client` and no `MountayaProvider`
|
|
316
|
+
* above, or with no `queryClient` and no `QueryClientProvider` above.
|
|
317
|
+
* @example
|
|
318
|
+
* ```tsx
|
|
319
|
+
* import { QueryClient } from "@tanstack/react-query";
|
|
320
|
+
* import { useState } from "react";
|
|
321
|
+
*
|
|
322
|
+
* import { Mountaya } from "@mountaya/client/browser";
|
|
323
|
+
* import { createMemoryViewer } from "@mountaya/studio";
|
|
324
|
+
* import { MountayaStudio, MountayaStudioHost, usePlatformViewer } from "@mountaya/studio-react";
|
|
325
|
+
*
|
|
326
|
+
* const ORGANIZATION_ID = "org_…";
|
|
327
|
+
* const USER_ID = "user_…";
|
|
328
|
+
*
|
|
329
|
+
* // A token your server minted with postSession, its user_id set to USER_ID.
|
|
330
|
+
* declare const sessionToken: string;
|
|
331
|
+
*
|
|
332
|
+
* const mountaya = new Mountaya({ credential: { publishableKey: "pk_…", sessionToken } });
|
|
333
|
+
*
|
|
334
|
+
* export const Studio = () => {
|
|
335
|
+
* const [queryClient] = useState(() => new QueryClient());
|
|
336
|
+
* const [person] = useState(() => createMemoryViewer({}, { getUserId: () => USER_ID }));
|
|
337
|
+
* const { error, viewer } = usePlatformViewer({
|
|
338
|
+
* client: mountaya,
|
|
339
|
+
* organizationId: ORGANIZATION_ID,
|
|
340
|
+
* queryClient,
|
|
341
|
+
* viewer: person,
|
|
342
|
+
* });
|
|
343
|
+
*
|
|
344
|
+
* return (
|
|
345
|
+
* <>
|
|
346
|
+
* {error === null ? null : (
|
|
347
|
+
* <p role="alert">The studio cannot read what you may use: {error.message}</p>
|
|
348
|
+
* )}
|
|
349
|
+
* <MountayaStudioHost client={mountaya} data={{ queryClient, viewer }}>
|
|
350
|
+
* <MountayaStudio />
|
|
351
|
+
* </MountayaStudioHost>
|
|
352
|
+
* </>
|
|
353
|
+
* );
|
|
354
|
+
* };
|
|
355
|
+
* ```
|
|
356
|
+
*/
|
|
357
|
+
export const usePlatformViewer = ({
|
|
358
|
+
client,
|
|
359
|
+
isPersonalScope,
|
|
360
|
+
organizationId,
|
|
361
|
+
personalSpace,
|
|
362
|
+
queryClient,
|
|
363
|
+
viewer,
|
|
364
|
+
}: UsePlatformViewerOptions): PlatformViewerState => {
|
|
365
|
+
// Probed rather than read through `useMountaya` and `useQueryClient`, so a host that states
|
|
366
|
+
// both, as one above `MountayaStudioHost` commonly does, needs neither provider.
|
|
367
|
+
const providedClient = useMountayaOrNull();
|
|
368
|
+
const providedQueryClient = use(QueryClientContext);
|
|
369
|
+
const reader = client ?? providedClient;
|
|
370
|
+
const cache = queryClient ?? providedQueryClient;
|
|
371
|
+
|
|
372
|
+
// A missing client or cache is a configuration error rather than a viewer that never settles:
|
|
373
|
+
// the second would show a studio with every gated surface withheld and no reason given.
|
|
374
|
+
if (reader === null) {
|
|
375
|
+
throw new MountayaElementsError(
|
|
376
|
+
"usePlatformViewer has no client to read the memberships with. Pass `client`, or mount a " +
|
|
377
|
+
"<MountayaProvider client={yourClient}> above it.",
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
if (cache === undefined) {
|
|
382
|
+
throw new MountayaElementsError(
|
|
383
|
+
"usePlatformViewer has no query cache to read the memberships on. Pass `queryClient`, the " +
|
|
384
|
+
"one you hand MountayaStudioHost as `data.queryClient`, or mount a <QueryClientProvider> " +
|
|
385
|
+
"above it.",
|
|
386
|
+
);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
const person = useStableMembers(viewer);
|
|
390
|
+
const isPersonal = useLatestRef(isPersonalScope);
|
|
391
|
+
|
|
392
|
+
// Through the members, so a viewer that is an instance keeps its `this`.
|
|
393
|
+
const subscribePerson = useCallback(
|
|
394
|
+
(onChange: () => void) => person.subscribe(onChange),
|
|
395
|
+
[person],
|
|
396
|
+
);
|
|
397
|
+
const readUserId = useCallback(() => person.getUserId(), [person]);
|
|
398
|
+
const userId = useSyncExternalStore(subscribePerson, readUserId, readUserId);
|
|
399
|
+
|
|
400
|
+
// Whether the session names a user, read again each time the credential's scope moves: a
|
|
401
|
+
// session minted without `user_id` is refused the read locally, so it is not asked. Whether the
|
|
402
|
+
// scope is still pending is read the same way, since its first token can settle it without
|
|
403
|
+
// moving it.
|
|
404
|
+
const subscribeScope = useCallback(
|
|
405
|
+
(onChange: () => void) => reader.transport.subscribeCredentialScope(onChange),
|
|
406
|
+
[reader],
|
|
407
|
+
);
|
|
408
|
+
const readActsAsMember = useCallback(() => reader.transport.actsAsMember, [reader]);
|
|
409
|
+
const actsAsMember = useSyncExternalStore(subscribeScope, readActsAsMember, readActsAsMember);
|
|
410
|
+
const readPending = useCallback(() => reader.transport.credentialScopePending, [reader]);
|
|
411
|
+
const pending = useSyncExternalStore(subscribeScope, readPending, readPending);
|
|
412
|
+
|
|
413
|
+
// Not asked while the scope is pending either: the first token names the person the memberships
|
|
414
|
+
// are read for, and the key with them, so a read sent before it would be read again under it.
|
|
415
|
+
const read =
|
|
416
|
+
userId === null || actsAsMember === false || pending ? null : membershipsRead(reader);
|
|
417
|
+
const {
|
|
418
|
+
data: memberships,
|
|
419
|
+
error,
|
|
420
|
+
status,
|
|
421
|
+
} = useQuery<readonly Membership[], MountayaError>(
|
|
422
|
+
{
|
|
423
|
+
queryFn: read?.queryFn ?? skipToken,
|
|
424
|
+
queryKey: read?.queryKey ?? unreadMembershipsKey,
|
|
425
|
+
// The client already repeated what is worth repeating, the quota and a failing gateway:
|
|
426
|
+
// a second policy on top would multiply its attempts, and a 500 is not repeated at all.
|
|
427
|
+
retry: false,
|
|
428
|
+
},
|
|
429
|
+
cache,
|
|
430
|
+
);
|
|
431
|
+
|
|
432
|
+
const membershipsReader = useCommittedAnswer(memberships);
|
|
433
|
+
const personalReader = useCommittedAnswer(personalSpace, sameScopeAnswer);
|
|
434
|
+
const scopeReader = useCommittedAnswer(organizationId);
|
|
435
|
+
|
|
436
|
+
const platformViewer = useMemo(
|
|
437
|
+
() =>
|
|
438
|
+
createPlatformViewer({
|
|
439
|
+
isPersonalScope: (id) => (isPersonal.current ?? defaultStudioScope.isPersonalScope)(id),
|
|
440
|
+
memberships: membershipsReader,
|
|
441
|
+
personalSpace: personalReader,
|
|
442
|
+
scope: scopeReader,
|
|
443
|
+
viewer: person,
|
|
444
|
+
}),
|
|
445
|
+
[isPersonal, membershipsReader, person, personalReader, scopeReader],
|
|
446
|
+
);
|
|
447
|
+
|
|
448
|
+
return useMemo(
|
|
449
|
+
() => ({ error, status, viewer: platformViewer }),
|
|
450
|
+
[error, platformViewer, status],
|
|
451
|
+
);
|
|
452
|
+
};
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { useCallback, useMemo, useRef, useSyncExternalStore } from "react";
|
|
3
|
+
|
|
4
|
+
import { useLatestRef } from "@mountaya/elements-react/headless";
|
|
5
|
+
import { inertViewer, type StudioToolContext, type UiStore } from "@mountaya/studio";
|
|
6
|
+
import type {
|
|
7
|
+
StudioPluginSlot,
|
|
8
|
+
StudioPluginTarget,
|
|
9
|
+
StudioSlotEntry,
|
|
10
|
+
} from "@mountaya/studio/plugins";
|
|
11
|
+
import { availableStudioContributions, StudioPluginEngine } from "@mountaya/studio/plugins";
|
|
12
|
+
|
|
13
|
+
import type { StudioPluginErrorReporter } from "../providers/plugins.js";
|
|
14
|
+
import { useStudioPluginsBinding } from "../providers/plugins.js";
|
|
15
|
+
import { useStudioDispatchSlice, useStudioStoreSeam } from "../providers/studio.js";
|
|
16
|
+
import { useStudioStore } from "./useStudioStore.js";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Reading one slot's contributions, at the place they are about to be drawn.
|
|
20
|
+
*
|
|
21
|
+
* Every surface that renders plugin items calls this and nothing else: it resolves the registry
|
|
22
|
+
* from context, filters on the live gates, applies the agent lock, and hands back items that
|
|
23
|
+
* already know how to run themselves. The call sites then have no plugin vocabulary in them
|
|
24
|
+
* beyond a slot name and a target.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The array a slot with nothing in it answers with, shared and frozen.
|
|
29
|
+
*
|
|
30
|
+
* The same argument the registry's own empty array makes, one level up: this hook is called once
|
|
31
|
+
* per segment row and once per waypoint row, so a fresh `[]` per render would churn every
|
|
32
|
+
* memoised row in a list of forty for a slot nobody has contributed to.
|
|
33
|
+
*/
|
|
34
|
+
const NO_ITEMS: readonly never[] = Object.freeze([]);
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The registry a call outside a host resolves to: empty, and nothing can reach it to install.
|
|
38
|
+
*
|
|
39
|
+
* A module-level instance rather than a branch, so every hook below runs unconditionally. It
|
|
40
|
+
* stays empty forever, because the only way to install is through the provider that is absent.
|
|
41
|
+
*/
|
|
42
|
+
const inertEngine = new StudioPluginEngine<ReactNode>();
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The reporter a call outside a host resolves to.
|
|
46
|
+
*
|
|
47
|
+
* Module-level rather than `binding?.onError` left undefined, so the memo below depends on ONE
|
|
48
|
+
* identity whether or not there is a host above it, and a call site does not pay for the branch
|
|
49
|
+
* with a rebuilt item array on every render.
|
|
50
|
+
*/
|
|
51
|
+
const inertReport: StudioPluginErrorReporter = () => {};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The entries a slot answers before a gate is asked: none, as one shared and frozen array, for a
|
|
55
|
+
* slot with no contribution, a surface outside a host and a surface with no target.
|
|
56
|
+
*/
|
|
57
|
+
const NO_ENTRIES: readonly never[] = Object.freeze([]);
|
|
58
|
+
|
|
59
|
+
/** sameEntries tells whether two lists hold the same entries in the same order. */
|
|
60
|
+
const sameEntries = (held: readonly unknown[], next: readonly unknown[]): boolean =>
|
|
61
|
+
held.length === next.length && held.every((entry, index) => Object.is(entry, next[index]));
|
|
62
|
+
|
|
63
|
+
/** Stable, so `useStudioStore`'s snapshot callback does not rebuild on every render. */
|
|
64
|
+
const selectAgentDriving = (state: UiStore): boolean => state.agentDriving;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* StudioPluginItem is one contribution, ready to draw: what it is, whether it is dimmed, and how
|
|
68
|
+
* to run it.
|
|
69
|
+
*
|
|
70
|
+
* `run` is bound to the live tool context and reads the target at CLICK time rather than at
|
|
71
|
+
* render time, which is both more correct and what keeps the returned array stable across a
|
|
72
|
+
* target rebuilt as a fresh literal every render.
|
|
73
|
+
*/
|
|
74
|
+
export interface StudioPluginItem<TSlot extends StudioPluginSlot> {
|
|
75
|
+
/**
|
|
76
|
+
* True while an agent run drives the studio.
|
|
77
|
+
*
|
|
78
|
+
* The lock DIMS rather than hides, which is the two-state posture this package already keeps:
|
|
79
|
+
* a capability, entitlement or predicate refusal hides (as the video-export item does, because
|
|
80
|
+
* a viewer who cannot have it should not be told about it), and a run in progress dims with a
|
|
81
|
+
* reason (as every row-level control does, because it is coming back in a moment).
|
|
82
|
+
*/
|
|
83
|
+
readonly disabled: boolean;
|
|
84
|
+
/** The contribution as the registry holds it: what it draws, its plugin and its rank. */
|
|
85
|
+
readonly entry: StudioSlotEntry<TSlot, ReactNode>;
|
|
86
|
+
/**
|
|
87
|
+
* What the action says, resolved: never empty.
|
|
88
|
+
*
|
|
89
|
+
* `entry.label` is optional in the CONTRACT, because the component form owes no label, while
|
|
90
|
+
* validation refuses the action form at install without a non-empty label. Resolved once here
|
|
91
|
+
* rather than at each render site, so no renderer keeps a fallback of its own (a fallback of
|
|
92
|
+
* `""` gives a control-rail chip an empty accessible name). The qualified id is the
|
|
93
|
+
* unreachable case's answer, because a name that identifies the plugin beats a name that is
|
|
94
|
+
* not there.
|
|
95
|
+
*/
|
|
96
|
+
readonly label: string;
|
|
97
|
+
/** Runs the contribution's verb. Never throws; a failure reaches the host's `onError`. */
|
|
98
|
+
readonly run: () => void;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* usePluginSlot reads what is installed in one slot, gated and ordered, ready to render.
|
|
103
|
+
*
|
|
104
|
+
* **It is INERT outside a host and never throws**: the opposite of `useStudioPlugins`, and for
|
|
105
|
+
* the opposite reason. A menu still has to render inside a story, a snapshot test or a surface a
|
|
106
|
+
* consumer mounted on its own, and a dropdown that throws because nobody installed a plugin
|
|
107
|
+
* would make this feature a cost every consumer pays.
|
|
108
|
+
*
|
|
109
|
+
* Its snapshot is read off the SLOT'S ARRAY and not off the registry's version, and that is the
|
|
110
|
+
* line that decides what an install costs. The registry rebuilds only the slots a plugin
|
|
111
|
+
* touched, so `at('map.controls')` is referentially identical across the install of a
|
|
112
|
+
* `segment.menu` plugin, and a snapshot that reads it lets React skip the render entirely for
|
|
113
|
+
* every untouched slot. Reading the scalar instead would render again and rebuild the item
|
|
114
|
+
* array in EVERY `usePluginSlot` in the tree on any change: one per segment row, one per
|
|
115
|
+
* waypoint row, plus the fixed sites.
|
|
116
|
+
*
|
|
117
|
+
* **The gates are asked live.** A contribution's gate reads the tool context, whose identity
|
|
118
|
+
* holds while what it answers moves: a viewer's entitlement arrives after the mount, and a
|
|
119
|
+
* plugin's `when` reads the store. So the gates are asked on every render of the surface, and
|
|
120
|
+
* again whenever the registry, the store or the viewer says it changed. The surface renders for
|
|
121
|
+
* it only when the set of contributions that pass is another set: the answer is compared entry
|
|
122
|
+
* by entry, and the array a caller memoizes on is the one it held while the entries stand. A
|
|
123
|
+
* gate is therefore cheap by contract, as the plugin's own documentation of `when` states.
|
|
124
|
+
*
|
|
125
|
+
* Everything else the memo depends on is stable by construction: the registry, the tool context
|
|
126
|
+
* and the slot do not move, the reporter is one function for the life of the host, and the
|
|
127
|
+
* target is absent from the list on purpose.
|
|
128
|
+
*
|
|
129
|
+
* `target` is read through a latest-ref for that last reason. It is the one thing that cannot
|
|
130
|
+
* come from context (which segment, which coordinate is a per-instance fact), and it is also
|
|
131
|
+
* the thing a call site most naturally rebuilds inline. Depending on its identity would re-run
|
|
132
|
+
* this memo on every render of every row.
|
|
133
|
+
*
|
|
134
|
+
* **A NULL target draws nothing**, which is the same answer a null context gets and for the same
|
|
135
|
+
* reason: a contribution acts ON something, and a surface that cannot say what has nothing it can
|
|
136
|
+
* honestly render. It is what a component takes when the seam is optional (a menu published for
|
|
137
|
+
* a consumer to mount directly, where the studio's own row supplies a target and a bare mount
|
|
138
|
+
* does not), and it is cheaper than a sentinel, which would run every gate and bind every
|
|
139
|
+
* closure against a target nobody was going to act on.
|
|
140
|
+
*
|
|
141
|
+
* @param slot - The slot to read, as a plugin names it.
|
|
142
|
+
* @param target - What the contributions act on, or null to draw nothing.
|
|
143
|
+
* @returns The contributions that pass their gates, in order, one array while they stand.
|
|
144
|
+
*/
|
|
145
|
+
export const usePluginSlot = <TSlot extends StudioPluginSlot>(
|
|
146
|
+
slot: TSlot,
|
|
147
|
+
target: StudioPluginTarget<TSlot> | null,
|
|
148
|
+
): readonly StudioPluginItem<TSlot>[] => {
|
|
149
|
+
const binding = useStudioPluginsBinding();
|
|
150
|
+
const registry = binding?.engine ?? inertEngine;
|
|
151
|
+
const onError = binding?.onError ?? inertReport;
|
|
152
|
+
const { context: ctx } = useStudioDispatchSlice<StudioToolContext>();
|
|
153
|
+
const store = useStudioStoreSeam();
|
|
154
|
+
const targetRef = useLatestRef(target);
|
|
155
|
+
|
|
156
|
+
// Whether there is a target, as a BOOLEAN, because that is the half of it the answer depends
|
|
157
|
+
// on. Its identity stays out, since a call site rebuilds the object every render, and a seam
|
|
158
|
+
// that appears or disappears is read at the render that states it.
|
|
159
|
+
const hasTarget = target !== null;
|
|
160
|
+
|
|
161
|
+
// The store is read through the primitive rather than through `useAgentDriving`, which needs
|
|
162
|
+
// one and throws without it. This hook has to answer inertly, so it takes the nullable-store
|
|
163
|
+
// form and the "no run is driving" fallback.
|
|
164
|
+
const agentDriving = useStudioStore(store, selectAgentDriving, false);
|
|
165
|
+
|
|
166
|
+
// The three places a gate's answer can move from. One listener for all of them, so the
|
|
167
|
+
// snapshot below is read again after an install, a write to the store or a word from the
|
|
168
|
+
// viewer.
|
|
169
|
+
const subscribe = useCallback(
|
|
170
|
+
(listener: () => void): (() => void) => {
|
|
171
|
+
const releases = [
|
|
172
|
+
registry.subscribe(listener),
|
|
173
|
+
store?.subscribe(listener),
|
|
174
|
+
// The inert viewer where the context holds none, as `useStudioViewer` reads it: it tells
|
|
175
|
+
// no listener, and a gate on an entitlement is refused by the gate itself.
|
|
176
|
+
(ctx?.viewer ?? inertViewer).subscribe(listener),
|
|
177
|
+
];
|
|
178
|
+
|
|
179
|
+
return () => {
|
|
180
|
+
for (const release of releases) {
|
|
181
|
+
release?.();
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
},
|
|
185
|
+
[ctx, registry, store],
|
|
186
|
+
);
|
|
187
|
+
|
|
188
|
+
// The entries whose gates pass, read at each render and at each notification. A context is
|
|
189
|
+
// required to resolve a gate and to run a verb, and a target is what a verb acts ON, so with
|
|
190
|
+
// either absent there is nothing that can honestly be drawn and no gate is asked. The context
|
|
191
|
+
// case is the common one: this hook outside a host.
|
|
192
|
+
//
|
|
193
|
+
// The held list is handed back for as long as the next one holds the same entries, so the
|
|
194
|
+
// snapshot settles and a notification that moved no gate renders nothing. One getter for both
|
|
195
|
+
// arguments: there is nothing to hydrate differently.
|
|
196
|
+
const held = useRef<readonly StudioSlotEntry<TSlot, ReactNode>[]>(NO_ENTRIES);
|
|
197
|
+
const available = (): readonly StudioSlotEntry<TSlot, ReactNode>[] => {
|
|
198
|
+
const entries = registry.at(slot);
|
|
199
|
+
const next =
|
|
200
|
+
entries.length === 0 || ctx === null || !hasTarget
|
|
201
|
+
? NO_ENTRIES
|
|
202
|
+
: availableStudioContributions(entries, ctx);
|
|
203
|
+
if (!sameEntries(held.current, next)) {
|
|
204
|
+
held.current = next;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return held.current;
|
|
208
|
+
};
|
|
209
|
+
const entries = useSyncExternalStore(subscribe, available, available);
|
|
210
|
+
|
|
211
|
+
return useMemo(() => {
|
|
212
|
+
if (entries.length === 0 || ctx === null) {
|
|
213
|
+
return NO_ITEMS;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return entries.map((entry) => ({
|
|
217
|
+
disabled: agentDriving,
|
|
218
|
+
entry,
|
|
219
|
+
label: entry.label ?? entry.qualifiedId,
|
|
220
|
+
run: () => {
|
|
221
|
+
// Read at CLICK time, and re-checked here rather than closed over: a row whose seam went
|
|
222
|
+
// away while its dropdown was open has nothing to act on, and a click on it is a no-op
|
|
223
|
+
// rather than a verb handed a stale target.
|
|
224
|
+
const current = targetRef.current;
|
|
225
|
+
if (current === null) {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
void registry.run(entry, ctx, current, (error) =>
|
|
230
|
+
onError({ contribution: entry, error, kind: "run" }),
|
|
231
|
+
);
|
|
232
|
+
},
|
|
233
|
+
}));
|
|
234
|
+
}, [agentDriving, ctx, entries, onError, registry, targetRef]);
|
|
235
|
+
};
|