@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,1295 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a studio surface reads: the tool bus it dispatches through, and the seams a studio
|
|
3
|
+
* needs that a control does not.
|
|
4
|
+
*
|
|
5
|
+
* `@mountaya/elements-react`'s root provider carries what an ELEMENT needs: a map, a glyph set,
|
|
6
|
+
* copy. A studio needs more, and each is something an element never has an opinion about:
|
|
7
|
+
*
|
|
8
|
+
* - **the bus**, because a studio's job is to change things, and every change goes through
|
|
9
|
+
* one dispatch surface. It is `@mountaya/studio`'s `ToolBus`, generic over the
|
|
10
|
+
* context a host supplies, so what a consumer registers is theirs and the validation, the
|
|
11
|
+
* capability gate and the confirmation protocol are ours.
|
|
12
|
+
* - **the capabilities** the surface holds, which is how one component tree serves an editor,
|
|
13
|
+
* a viewer and an embed. A read-only surface is not a different tree with the buttons
|
|
14
|
+
* deleted; it is this tree with a smaller set.
|
|
15
|
+
* - **navigation**, because a studio moves between resources and every router disagrees about
|
|
16
|
+
* how. Two functions is the whole seam.
|
|
17
|
+
* - **the activity catalog**, because half the studio's surfaces name an activity and none of
|
|
18
|
+
* them should fetch one. It is data rather than a seam (the host reads it once and hands it
|
|
19
|
+
* down, exactly as it hands down the capabilities), and it is here rather than on the tool
|
|
20
|
+
* context because only React surfaces read it: a handler that needs the catalog reads it
|
|
21
|
+
* through `ctx.api.cache`, where it is already keyed.
|
|
22
|
+
* - **the store**, the studio's own state instance. `@mountaya/studio` composes it
|
|
23
|
+
* and `createUiStore()` builds one; what a host chooses is WHICH instance, because the same
|
|
24
|
+
* object is what the tool bus mutates through its context. A surface reading one store while
|
|
25
|
+
* the bus writes another is a studio that ignores its own edits.
|
|
26
|
+
*
|
|
27
|
+
* NOT here, on purpose: a query client. Data binding is `@mountaya/client-react`'s, and a
|
|
28
|
+
* second provider that also knew how to fetch would be the third data layer in one tree.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
import { createContext, type ReactNode, use, useMemo, useState } from "react";
|
|
32
|
+
|
|
33
|
+
import type { PeerNameResolver } from "@mountaya/elements/collab";
|
|
34
|
+
import { MountayaElementsError } from "@mountaya/elements/errors";
|
|
35
|
+
import type { Translations } from "@mountaya/elements/i18n";
|
|
36
|
+
import type { GeolocationSeam } from "@mountaya/elements/seams";
|
|
37
|
+
import { languageEndonym, type MapLanguage } from "@mountaya/elements/style";
|
|
38
|
+
import { useSettledBundle, useStableBundle } from "@mountaya/elements-react/headless";
|
|
39
|
+
import type {
|
|
40
|
+
CategoryActivities,
|
|
41
|
+
ToolBusContext,
|
|
42
|
+
ToolBusDispatch,
|
|
43
|
+
ToolBusObserveOverrides,
|
|
44
|
+
ToolCapability,
|
|
45
|
+
ToolDispatchRegistry,
|
|
46
|
+
ToolOutputRegistry,
|
|
47
|
+
UiStoreApi,
|
|
48
|
+
} from "@mountaya/studio";
|
|
49
|
+
import {
|
|
50
|
+
type Clock,
|
|
51
|
+
createDefaultStudioSeams,
|
|
52
|
+
type StudioFormatters,
|
|
53
|
+
type StudioLinks,
|
|
54
|
+
type StudioSeams,
|
|
55
|
+
type StudioStorage,
|
|
56
|
+
} from "@mountaya/studio/seams";
|
|
57
|
+
import {
|
|
58
|
+
resolveStudioStrings,
|
|
59
|
+
type StudioStrings,
|
|
60
|
+
type StudioStringsOverrides,
|
|
61
|
+
studioLanguageOptions,
|
|
62
|
+
studioStrings,
|
|
63
|
+
} from "@mountaya/studio/strings";
|
|
64
|
+
|
|
65
|
+
import type { StudioHeaderOverride } from "../../panels/rules/studioHeader.js";
|
|
66
|
+
// Type-only, and the import back into this module from there is type-only too. A cycle of
|
|
67
|
+
// erased imports costs nothing at build (`verbatimModuleSyntax` emits neither side), and it is
|
|
68
|
+
// the honest shape: the config groups are ABOUT these seams, and these seams are declared where
|
|
69
|
+
// their providers are.
|
|
70
|
+
import type {
|
|
71
|
+
StudioAppearanceConfig,
|
|
72
|
+
StudioAssetsConfig,
|
|
73
|
+
StudioBehaviorConfig,
|
|
74
|
+
StudioDataConfig,
|
|
75
|
+
StudioI18nConfig,
|
|
76
|
+
} from "../../rules/studioConfig.js";
|
|
77
|
+
import type { StudioDensity } from "../../theme/rules/density.js";
|
|
78
|
+
import { studioTokenStyle } from "../../theme/rules/tokenStyle.js";
|
|
79
|
+
import type { StudioTokens } from "../../theme/rules/tokens.js";
|
|
80
|
+
import { useCapabilitySet } from "../hooks/useCapabilitySet.js";
|
|
81
|
+
import { useStableMembers } from "../hooks/useStableMembers.js";
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* StudioLayerKind names which catalogue a slug belongs to.
|
|
85
|
+
*
|
|
86
|
+
* Two kinds, because they are two lists a reader chooses from separately (a base map is
|
|
87
|
+
* exclusive and an overlay is not), and their slugs share a namespace with nothing keeping them
|
|
88
|
+
* apart. A host serving both from one directory would silently answer a terrain's picture for
|
|
89
|
+
* an overlay of the same name.
|
|
90
|
+
*/
|
|
91
|
+
export type StudioLayerKind = "overlay" | "terrain";
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* NavigationSeam is how a studio surface moves, without naming a router.
|
|
95
|
+
*
|
|
96
|
+
* `navigate` takes a path the surface built and a `replace` flag, because a studio
|
|
97
|
+
* distinguishes a step the user should be able to go back through (opening an itinerary) from
|
|
98
|
+
* one they should not (normalising a URL after a rename). `location` reads the current path,
|
|
99
|
+
* which is what a surface highlighting its own row needs.
|
|
100
|
+
*
|
|
101
|
+
* A path rather than a route object: a route object is a router's vocabulary, and adopting one
|
|
102
|
+
* would make this seam a re-export of somebody's types rather than a seam.
|
|
103
|
+
*/
|
|
104
|
+
export interface NavigationSeam {
|
|
105
|
+
/** Reads the current path. */
|
|
106
|
+
readonly location: () => string;
|
|
107
|
+
/** Moves to `path`, replacing the current entry where `replace` is true. */
|
|
108
|
+
readonly navigate: (path: string, options?: { readonly replace?: boolean | undefined }) => void;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* StudioControlKind names a control the studio's panels have to point back at.
|
|
113
|
+
*
|
|
114
|
+
* Closed rather than a string, because the register and the read are written in two different
|
|
115
|
+
* files and a typo in either is silent: the panel exempts nothing, the toggle closes it, and the
|
|
116
|
+
* button's own handler reopens it a frame later, which reads as a panel that flickers rather
|
|
117
|
+
* than as a name that did not match.
|
|
118
|
+
*/
|
|
119
|
+
export type StudioControlKind = "layers" | "preferences";
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* StudioControlAnchors is where a floating panel finds the toggle that opened it.
|
|
123
|
+
*
|
|
124
|
+
* A panel positioned somewhere ELSE on the page has to exempt its own toggle from its
|
|
125
|
+
* outside-click handler, or a press closes the panel and the button's handler immediately
|
|
126
|
+
* reopens it. Not a `document.querySelector` on the toggle's `data-mtya-control`, which looks
|
|
127
|
+
* equivalent and is not: it finds the FIRST match in the document, so two studios on one page
|
|
128
|
+
* would exempt each other's button, and it finds nothing at all across a shadow root.
|
|
129
|
+
*
|
|
130
|
+
* Backed by a ref rather than by state, because registering is not a render: a control mounting
|
|
131
|
+
* must not render every surface under the provider again, and the panel reads the anchor during
|
|
132
|
+
* its own render, which always happens after the toggle that opened it mounted.
|
|
133
|
+
*/
|
|
134
|
+
export interface StudioControlAnchors {
|
|
135
|
+
/** The element a panel's outside-click must not treat as outside, or null. */
|
|
136
|
+
readonly anchorFor: (kind: StudioControlKind) => HTMLElement | null;
|
|
137
|
+
/** Records the element a control occupies, or clears it with null on teardown. */
|
|
138
|
+
readonly register: (kind: StudioControlKind, element: HTMLElement | null) => void;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* StudioContextValue is what {@link useStudioContext} resolves: the bus, the tool context, the
|
|
143
|
+
* store and every seam a studio surface reads.
|
|
144
|
+
*
|
|
145
|
+
* `TCtx` is the host's own tool context, the object its handlers receive and the one part of a
|
|
146
|
+
* bus this package cannot know.
|
|
147
|
+
*
|
|
148
|
+
* `TInputs` is the name-to-input map `bus.dispatch` is checked against. It defaults to
|
|
149
|
+
* `ToolDispatchRegistry`, the empty interface a host augments, which fits a host that registered
|
|
150
|
+
* its own tools. A caller that knows the tools it dispatches names that map instead
|
|
151
|
+
* (`StudioToolInputs` for the studio's own) and gets a checked `dispatch` with no global
|
|
152
|
+
* augmented on anyone's behalf.
|
|
153
|
+
*
|
|
154
|
+
* `TOutputs` is the name-to-data map `bus.dispatch` answers by. It defaults to
|
|
155
|
+
* `ToolOutputRegistry`, the second interface a host augments, under which every answer's `data`
|
|
156
|
+
* reads `unknown` until the host merges its outputs. A caller that names a map
|
|
157
|
+
* (`StudioToolOutputs` for the studio's own) takes a member of `result.data` after `result.ok`
|
|
158
|
+
* with no narrowing of its own. The map is a way of reading the bus and no part of its identity:
|
|
159
|
+
* the provider holds one dispatch slice, and each reader types the answers it reads.
|
|
160
|
+
*/
|
|
161
|
+
export interface StudioContextValue<
|
|
162
|
+
TCtx extends ToolBusContext = ToolBusContext,
|
|
163
|
+
TInputs extends object = ToolDispatchRegistry,
|
|
164
|
+
TOutputs extends object = ToolOutputRegistry,
|
|
165
|
+
> {
|
|
166
|
+
/** The activity catalog, empty where the host supplied none. */
|
|
167
|
+
readonly activities: readonly CategoryActivities[];
|
|
168
|
+
/** Where an activity's silhouette is fetched as an image, or null where the host said none. */
|
|
169
|
+
readonly activityIconUrl: ((slug: string) => string | undefined) | null;
|
|
170
|
+
/** The picture of a map layer, or null where the host said none. */
|
|
171
|
+
readonly layerThumbnail: ((kind: StudioLayerKind, slug: string) => string | undefined) | null;
|
|
172
|
+
/** The origin a link that leaves the tab is built from, or null for the page's own. */
|
|
173
|
+
readonly appOrigin: string | null;
|
|
174
|
+
/** The bus every dispatch runs through, or null where none is mounted. */
|
|
175
|
+
readonly bus: (ToolBusDispatch<TCtx, TInputs, TOutputs> & ToolBusObserveOverrides) | null;
|
|
176
|
+
/** What this studio grants. */
|
|
177
|
+
readonly capabilities: ReadonlySet<ToolCapability>;
|
|
178
|
+
/** The tool context each verb is handed, or null where none is mounted. */
|
|
179
|
+
readonly context: TCtx | null;
|
|
180
|
+
/** The elevation raster the maps bake their relief from, or undefined for flat relief. */
|
|
181
|
+
readonly demUrl: string | undefined;
|
|
182
|
+
/**
|
|
183
|
+
* What the host put in place of the studio's lockup: `undefined` where nothing is configured,
|
|
184
|
+
* unlike every other member here, because `null` is a VALUE on this seam (it hides the
|
|
185
|
+
* header), and folding the two together would make "no header" and "the Mountaya header" the
|
|
186
|
+
* same read.
|
|
187
|
+
*/
|
|
188
|
+
readonly header: StudioHeaderOverride | undefined;
|
|
189
|
+
/** The mark a language picker draws beside each language, or null for none. */
|
|
190
|
+
readonly languageMark: ((language: MapLanguage) => ReactNode) | null;
|
|
191
|
+
/** The languages the studio's pickers offer, each labelled by its endonym. */
|
|
192
|
+
readonly languages: readonly { label: string; value: MapLanguage }[];
|
|
193
|
+
/** How a surface moves, or null where the host supplied no router. */
|
|
194
|
+
readonly navigation: NavigationSeam | null;
|
|
195
|
+
/** How a collaborator's id becomes a name, or null where the host supplied no directory. */
|
|
196
|
+
readonly resolvePeerName: StudioPeerNameSeam | null;
|
|
197
|
+
/** Where a floating panel finds the toggle that opened it. */
|
|
198
|
+
readonly controlAnchors: StudioControlAnchors;
|
|
199
|
+
/** How tightly the studio draws its own regions. */
|
|
200
|
+
readonly density: StudioDensity;
|
|
201
|
+
/** The `--mtya-*` overrides the host declared, or null for none. */
|
|
202
|
+
readonly tokens: StudioTokens | null;
|
|
203
|
+
/** The capabilities the studio takes from the world around it, folded onto the defaults. */
|
|
204
|
+
readonly seams: StudioSeams;
|
|
205
|
+
/** The studio's state, or null where no store is mounted. */
|
|
206
|
+
readonly store: UiStoreApi | null;
|
|
207
|
+
/** The studio's own words, in the selected language with every override merged. */
|
|
208
|
+
readonly strings: StudioStrings;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* The empty catalog, as ONE value.
|
|
213
|
+
*
|
|
214
|
+
* A provider given no catalog (and the default context) resolve to this identity rather than
|
|
215
|
+
* to a fresh literal, because the value sits in a memoized context: `activities={data ?? []}`
|
|
216
|
+
* written at a call site would hand a new array on every render of the host, change the context
|
|
217
|
+
* identity, and render every surface beneath it again for a value that did not move. Callers
|
|
218
|
+
* pass the query's own `data`, undefined and all, and the provider substitutes this.
|
|
219
|
+
*/
|
|
220
|
+
const NO_ACTIVITIES: readonly CategoryActivities[] = [];
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* createControlAnchors builds one anchor registry.
|
|
224
|
+
*
|
|
225
|
+
* One per provider, so two studios on a page keep two and neither exempts the other's toggle.
|
|
226
|
+
* The default context gets its own for the same reason a surface outside a provider still
|
|
227
|
+
* renders: an empty registry answers null, and a panel that exempts nothing merely closes on a
|
|
228
|
+
* press it could have ignored.
|
|
229
|
+
*/
|
|
230
|
+
const createControlAnchors = (): StudioControlAnchors => {
|
|
231
|
+
const elements = new Map<StudioControlKind, HTMLElement>();
|
|
232
|
+
|
|
233
|
+
return {
|
|
234
|
+
anchorFor: (kind) => elements.get(kind) ?? null,
|
|
235
|
+
register: (kind, element) => {
|
|
236
|
+
if (element === null) {
|
|
237
|
+
elements.delete(kind);
|
|
238
|
+
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
elements.set(kind, element);
|
|
243
|
+
},
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* StudioSeamOverrides is the `seams` a host states: any of {@link StudioSeams}' members, each
|
|
249
|
+
* present, left out, or written as `undefined`.
|
|
250
|
+
*
|
|
251
|
+
* A member left out or written as `undefined` keeps the default seam of
|
|
252
|
+
* `createDefaultStudioSeams`, so a host forwards a seam it may not hold
|
|
253
|
+
* (`storage: remember ? accountStorage : undefined`) and the studio still has one. Each member
|
|
254
|
+
* states `undefined`, so that line compiles under `exactOptionalPropertyTypes`, which
|
|
255
|
+
* `Partial<StudioSeams>` refuses.
|
|
256
|
+
*
|
|
257
|
+
* The whole set is assignable to it: `createInertStudioSeams()` switches every capability off
|
|
258
|
+
* at once.
|
|
259
|
+
*
|
|
260
|
+
* A provider holds the object for as long as its own members are the ones the render before
|
|
261
|
+
* stated, compared one level deep by `Object.is`. So the object may be written inline, and a
|
|
262
|
+
* member is declared once: a seam built inline is a new one at every render, and the set is
|
|
263
|
+
* folded again for it.
|
|
264
|
+
*/
|
|
265
|
+
export interface StudioSeamOverrides {
|
|
266
|
+
/**
|
|
267
|
+
* Where a Camera Plan is resolved into per-frame poses, and therefore on which thread.
|
|
268
|
+
*
|
|
269
|
+
* @default `synchronousCameraPlanner()`
|
|
270
|
+
*/
|
|
271
|
+
readonly cameraPlanner?: StudioSeams["cameraPlanner"] | undefined;
|
|
272
|
+
/**
|
|
273
|
+
* Where a product-meaningful moment or delay comes from.
|
|
274
|
+
*
|
|
275
|
+
* @default `systemClock()`
|
|
276
|
+
*/
|
|
277
|
+
readonly clock?: StudioSeams["clock"] | undefined;
|
|
278
|
+
/**
|
|
279
|
+
* How a number, a date and a relative moment reach a screen.
|
|
280
|
+
*
|
|
281
|
+
* @default `createIntlFormatters(locale)`, in the provider's locale
|
|
282
|
+
*/
|
|
283
|
+
readonly formatters?: StudioSeams["formatters"] | undefined;
|
|
284
|
+
/**
|
|
285
|
+
* Where a device fix comes from, and whether asking would prompt.
|
|
286
|
+
*
|
|
287
|
+
* @default `browserGeolocation()`
|
|
288
|
+
*/
|
|
289
|
+
readonly geolocation?: StudioSeams["geolocation"] | undefined;
|
|
290
|
+
/**
|
|
291
|
+
* Where a client-side id comes from, for a draft that has no resource to name yet.
|
|
292
|
+
*
|
|
293
|
+
* @default `systemStudioIds`
|
|
294
|
+
*/
|
|
295
|
+
readonly ids?: StudioSeams["ids"] | undefined;
|
|
296
|
+
/**
|
|
297
|
+
* Where a link to somewhere outside the product goes, or that there is none.
|
|
298
|
+
*
|
|
299
|
+
* @default `googleMapsLinks`
|
|
300
|
+
*/
|
|
301
|
+
readonly links?: StudioSeams["links"] | undefined;
|
|
302
|
+
/**
|
|
303
|
+
* Where a file the studio produced goes: a disk, a share sheet, or nowhere.
|
|
304
|
+
*
|
|
305
|
+
* @default `browserSaveFile`
|
|
306
|
+
*/
|
|
307
|
+
readonly saveFile?: StudioSeams["saveFile"] | undefined;
|
|
308
|
+
/**
|
|
309
|
+
* Where a preference that outlives a session is kept.
|
|
310
|
+
*
|
|
311
|
+
* @default `localStudioStorage()`
|
|
312
|
+
*/
|
|
313
|
+
readonly storage?: StudioSeams["storage"] | undefined;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/** isMapLanguage tells a language code the studio has an endonym for from any other string. */
|
|
317
|
+
const isMapLanguage = (value: string): value is MapLanguage =>
|
|
318
|
+
Object.hasOwn(languageEndonym, value);
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* foldSeams lays a host's overrides over the default seams, member by member.
|
|
322
|
+
*
|
|
323
|
+
* A member whose value is `undefined` is an omitted one and keeps its default. A spread copies
|
|
324
|
+
* such a member as it is, and the first surface that read the seam would call into nothing.
|
|
325
|
+
*/
|
|
326
|
+
const foldSeams = (
|
|
327
|
+
defaults: StudioSeams,
|
|
328
|
+
overrides: StudioSeamOverrides | undefined,
|
|
329
|
+
): StudioSeams => ({
|
|
330
|
+
cameraPlanner: overrides?.cameraPlanner ?? defaults.cameraPlanner,
|
|
331
|
+
clock: overrides?.clock ?? defaults.clock,
|
|
332
|
+
formatters: overrides?.formatters ?? defaults.formatters,
|
|
333
|
+
geolocation: overrides?.geolocation ?? defaults.geolocation,
|
|
334
|
+
ids: overrides?.ids ?? defaults.ids,
|
|
335
|
+
links: overrides?.links ?? defaults.links,
|
|
336
|
+
saveFile: overrides?.saveFile ?? defaults.saveFile,
|
|
337
|
+
storage: overrides?.storage ?? defaults.storage,
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* StudioDispatchSlice is the bus a studio surface dispatches through and the tool context it
|
|
342
|
+
* hands each verb, the two members of {@link StudioContextValue} that move together.
|
|
343
|
+
*/
|
|
344
|
+
interface StudioDispatchSlice<
|
|
345
|
+
TCtx extends ToolBusContext = ToolBusContext,
|
|
346
|
+
TInputs extends object = ToolDispatchRegistry,
|
|
347
|
+
TOutputs extends object = ToolOutputRegistry,
|
|
348
|
+
> {
|
|
349
|
+
readonly bus: StudioContextValue<TCtx, TInputs, TOutputs>["bus"];
|
|
350
|
+
readonly context: TCtx | null;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* StudioConfigValue is what a host states about how the studio looks and behaves: every member
|
|
355
|
+
* of {@link StudioContextValue} that is neither the dispatch slice, the grants, the store nor
|
|
356
|
+
* the words.
|
|
357
|
+
*/
|
|
358
|
+
type StudioConfigValue = Omit<
|
|
359
|
+
StudioContextValue,
|
|
360
|
+
"bus" | "capabilities" | "context" | "store" | "strings"
|
|
361
|
+
>;
|
|
362
|
+
|
|
363
|
+
/*
|
|
364
|
+
* The studio's state is carried by several contexts rather than one, each holding one part a
|
|
365
|
+
* provider memoizes over its own members, so a reader renders for the part it reads and for no
|
|
366
|
+
* other: a store reader renders for no tool context the host rebuilt, and a capability reader for
|
|
367
|
+
* no header written inline. `useStudioContext` reads them all, for a reader that asks for
|
|
368
|
+
* everything.
|
|
369
|
+
*
|
|
370
|
+
* Each default is INERT, not empty: no bus, no capabilities, no navigation. A hook read outside a
|
|
371
|
+
* provider therefore reports "you may not do this" rather than throwing, which is what lets a
|
|
372
|
+
* component render in a Storybook story, a unit test, or a print view with no studio around it.
|
|
373
|
+
* Every action hook checks the same way, so the absent-provider case is one behaviour rather than
|
|
374
|
+
* one per hook.
|
|
375
|
+
*/
|
|
376
|
+
|
|
377
|
+
const StudioDispatchContext = createContext<StudioDispatchSlice>({ bus: null, context: null });
|
|
378
|
+
|
|
379
|
+
const StudioStoreContext = createContext<UiStoreApi | null>(null);
|
|
380
|
+
|
|
381
|
+
const StudioCapabilitiesContext = createContext<ReadonlySet<ToolCapability>>(
|
|
382
|
+
new Set<ToolCapability>(),
|
|
383
|
+
);
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* The studio's words for a reader that calls no formatter: held across the renders that restate a
|
|
387
|
+
* formatter written inline, where {@link StudioFollowingWordsContext} follows each one.
|
|
388
|
+
*/
|
|
389
|
+
const StudioWordsContext = createContext<StudioStrings>(studioStrings.en);
|
|
390
|
+
|
|
391
|
+
/** The studio's words for a reader that may call a formatter: the bundle of the latest render. */
|
|
392
|
+
const StudioFollowingWordsContext = createContext<StudioStrings>(studioStrings.en);
|
|
393
|
+
|
|
394
|
+
const StudioConfigContext = createContext<StudioConfigValue>({
|
|
395
|
+
controlAnchors: createControlAnchors(),
|
|
396
|
+
activities: NO_ACTIVITIES,
|
|
397
|
+
activityIconUrl: null,
|
|
398
|
+
appOrigin: null,
|
|
399
|
+
layerThumbnail: null,
|
|
400
|
+
demUrl: undefined,
|
|
401
|
+
header: undefined,
|
|
402
|
+
languageMark: null,
|
|
403
|
+
density: "compact",
|
|
404
|
+
languages: studioLanguageOptions(),
|
|
405
|
+
tokens: null,
|
|
406
|
+
resolvePeerName: null,
|
|
407
|
+
navigation: null,
|
|
408
|
+
// The seams are the one part of the default that is NOT inert, and the asymmetry is
|
|
409
|
+
// deliberate. "No provider" means no bus and no capabilities, so the studio may not act, but a
|
|
410
|
+
// component rendered in a story or a print view still reads a clock and still formats a date,
|
|
411
|
+
// and a default that could not would be a blank readout rather than a refused action.
|
|
412
|
+
seams: createDefaultStudioSeams(),
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* The flat shape this provider's body works in.
|
|
417
|
+
*
|
|
418
|
+
* `StudioProviderProps` below is the CONSUMER's shape (the same config groups
|
|
419
|
+
* `MountayaStudioHost` takes), and the component flattens it into this once. The internals
|
|
420
|
+
* keep one field per seam, which is what a provider body wants; the grouping is a boundary,
|
|
421
|
+
* not a shape the whole file adopts.
|
|
422
|
+
*/
|
|
423
|
+
interface StudioProviderConfig<TCtx extends ToolBusContext = ToolBusContext> {
|
|
424
|
+
/**
|
|
425
|
+
* The language the studio's own sentences are resolved in.
|
|
426
|
+
*
|
|
427
|
+
* Separate from `MountayaElementsProvider`'s, and that is the point rather than an oversight:
|
|
428
|
+
* the elements' words and the studio's are two bundles with two translation schedules, and a
|
|
429
|
+
* host embedding a studio inside a page in one language while the chrome reads another is a
|
|
430
|
+
* real arrangement. A studio mounted with neither is English.
|
|
431
|
+
*/
|
|
432
|
+
readonly language?: MapLanguage | undefined;
|
|
433
|
+
/**
|
|
434
|
+
* The locale a number, a date and a relative moment are WRITTEN in.
|
|
435
|
+
*
|
|
436
|
+
* Defaults to `language`, which is right for almost every product and is not the same
|
|
437
|
+
* decision. A language decides which words a surface says; a locale decides the thousands
|
|
438
|
+
* separator, the calendar, and whether a date reads day-first. A Swiss product reads French
|
|
439
|
+
* words with `de-CH` grouping, and an application whose users pick a language in its own
|
|
440
|
+
* settings and a region in their operating system has to be able to say so.
|
|
441
|
+
*/
|
|
442
|
+
readonly locale?: string | undefined;
|
|
443
|
+
/**
|
|
444
|
+
* Overrides for the studio's own sentences, merged onto the selected language.
|
|
445
|
+
*
|
|
446
|
+
* Either a partial bundle, applied to whatever language is active, or a map of language to
|
|
447
|
+
* partial bundle, applied only when that language is the one selected. An inline object
|
|
448
|
+
* literal is safe: the resolution is cached by CONTENT rather than by identity, so a fresh
|
|
449
|
+
* literal on every render resolves once. A formatter written inline is a new function at each
|
|
450
|
+
* render, and renders only the surfaces that call a formatter.
|
|
451
|
+
*/
|
|
452
|
+
readonly strings?: StudioStringsOverrides | undefined;
|
|
453
|
+
/**
|
|
454
|
+
* The studio's words in each language beyond English the page imported, keyed by language:
|
|
455
|
+
* `{ fr: frStudioStrings }` from `@mountaya/studio/strings/fr`. The pickers offer English and
|
|
456
|
+
* these unless {@link languages} names others. Held by its members, so a set written inline
|
|
457
|
+
* resolves once.
|
|
458
|
+
*/
|
|
459
|
+
readonly studioTranslations?: Translations<StudioStrings> | undefined;
|
|
460
|
+
/**
|
|
461
|
+
* The activity catalog every surface that names an activity reads.
|
|
462
|
+
*
|
|
463
|
+
* Pass the query's own `data` rather than `data ?? []`: the provider substitutes one shared
|
|
464
|
+
* empty catalog itself, and a fresh literal per render would change the context identity and
|
|
465
|
+
* render the tree beneath it again while nothing had actually arrived.
|
|
466
|
+
*
|
|
467
|
+
* Omitted, the catalog is empty, which is a working studio rather than a broken one: an
|
|
468
|
+
* activity picker offers nothing, a row falls back to naming the activity by its id, and
|
|
469
|
+
* every surface that merely displays a route is unaffected.
|
|
470
|
+
*/
|
|
471
|
+
readonly activities?: readonly CategoryActivities[] | null | undefined;
|
|
472
|
+
/**
|
|
473
|
+
* The elevation raster every map in the studio bakes its always-on relief from.
|
|
474
|
+
*
|
|
475
|
+
* A TileJSON URL, and a host fact rather than a studio one: which provider serves elevation
|
|
476
|
+
* tiles, and under whose key, is an account somebody pays for. It sits here rather than on
|
|
477
|
+
* each map because a studio has several (the editor, a mini-map beside a panorama, a
|
|
478
|
+
* recording preview), and relief that appears on one and not another reads as a rendering
|
|
479
|
+
* bug.
|
|
480
|
+
*
|
|
481
|
+
* Omitted, every one of them renders flat, which is what a map does rather than firing a DEM
|
|
482
|
+
* request that cannot succeed.
|
|
483
|
+
*/
|
|
484
|
+
readonly demUrl?: string | undefined;
|
|
485
|
+
/**
|
|
486
|
+
* What `StudioHeader` draws in place of the Mountaya lockup, for a host that mounts one.
|
|
487
|
+
*
|
|
488
|
+
* Gated on the viewer's `white-label` entitlement inside the component rather than here: this
|
|
489
|
+
* provider carries what a host SET, and whether it may take effect is a live read off a seam
|
|
490
|
+
* that resolves after the studio mounts. A gate applied at configuration time would answer
|
|
491
|
+
* from whatever the membership looked like on the first render.
|
|
492
|
+
*/
|
|
493
|
+
readonly header?: StudioHeaderOverride | undefined;
|
|
494
|
+
/**
|
|
495
|
+
* The mark a language picker draws beside each language name.
|
|
496
|
+
*
|
|
497
|
+
* A studio-wide decision rather than a per-picker prop, because a product that draws flags
|
|
498
|
+
* draws them in every picker it has and one that does not draws them in none, and there is
|
|
499
|
+
* more than one picker (the preferences panel, the embed wizard, the video overlay step).
|
|
500
|
+
*
|
|
501
|
+
* Omitted, a picker is a plain list of endonyms, which is a complete language picker: a flag
|
|
502
|
+
* is a COUNTRY and a language is not, so a product serving one language across many countries
|
|
503
|
+
* is right to draw none. Supply a stable function: the picker hands it to a renderer, so a
|
|
504
|
+
* fresh closure per render renders every option row again.
|
|
505
|
+
*/
|
|
506
|
+
readonly languageMark?: ((language: MapLanguage) => ReactNode) | undefined;
|
|
507
|
+
/**
|
|
508
|
+
* Which languages the studio's own language pickers offer. Defaults to English and the
|
|
509
|
+
* languages handed over in {@link studioTranslations}.
|
|
510
|
+
*
|
|
511
|
+
* Any `MapLanguage`, not only the ones Mountaya translates the studio into: `resolveBundle`
|
|
512
|
+
* supports a consumer supplying German through `strings: { de: … }`, so a product that has
|
|
513
|
+
* translated the studio can offer the translation in the studio's own picker.
|
|
514
|
+
*
|
|
515
|
+
* It is still bounded by the WIRE vocabulary: a picker writes a map language, so a consumer
|
|
516
|
+
* cannot offer one the platform does not know. Offering FEWER is the other direction: a
|
|
517
|
+
* product shipped in one language has no business drawing a picker with two in it.
|
|
518
|
+
*
|
|
519
|
+
* A language with no copy and no override falls back to English words under its own tag,
|
|
520
|
+
* which is `resolveBundle`'s rule everywhere else too.
|
|
521
|
+
*/
|
|
522
|
+
readonly languages?: readonly MapLanguage[] | undefined;
|
|
523
|
+
/**
|
|
524
|
+
* How tightly the studio draws its own panels, forms and conversation. Defaults to
|
|
525
|
+
* `compact`, which is what a map studio is: chrome over a map, read at a glance beside the
|
|
526
|
+
* thing it acts on rather than filled in like a page.
|
|
527
|
+
*/
|
|
528
|
+
readonly density?: StudioDensity | undefined;
|
|
529
|
+
/**
|
|
530
|
+
* The `--mtya-*` overrides the host declared, republished so the studio can push them onto
|
|
531
|
+
* the ELEMENT roots it mounts.
|
|
532
|
+
*
|
|
533
|
+
* An element root assigns its own token block rather than inheriting one (on purpose, so a
|
|
534
|
+
* published package never writes to `:root`), which means a value declared on the studio root
|
|
535
|
+
* above it is shadowed and does nothing. The inline `style` is the one place that outranks the
|
|
536
|
+
* block, so the studio has to hand the same tokens down.
|
|
537
|
+
*
|
|
538
|
+
* The object is held for as long as its own members are the ones the render before stated,
|
|
539
|
+
* compared one level deep by `Object.is`: written inline with the same values, it moves
|
|
540
|
+
* nothing beneath the provider.
|
|
541
|
+
*/
|
|
542
|
+
readonly tokens?: StudioTokens | undefined;
|
|
543
|
+
/**
|
|
544
|
+
* How a collaborator's user id becomes a name to put on their draft, their cursor and the
|
|
545
|
+
* lock they hold.
|
|
546
|
+
*
|
|
547
|
+
* A seam because a directory of people is the HOST's: who may be named, and by what (a display
|
|
548
|
+
* name, an email local part, a handle), is an account question with no public read behind it.
|
|
549
|
+
* It sits on the provider rather than on each surface because a studio names peers in several
|
|
550
|
+
* places at once, and an id beside one row with a name beside another reads as a bug in the
|
|
551
|
+
* roster rather than as two components asking differently.
|
|
552
|
+
*
|
|
553
|
+
* Omitted, a peer is drawn with their initials, which is what a studio shows before the
|
|
554
|
+
* member list has landed anyway.
|
|
555
|
+
*/
|
|
556
|
+
readonly resolvePeerName?: StudioPeerNameSeam | undefined;
|
|
557
|
+
/**
|
|
558
|
+
* The capabilities the studio takes from the world around it, wholly or in part.
|
|
559
|
+
*
|
|
560
|
+
* Where a device fix comes from, what time it is, where a preference is kept, whether there is
|
|
561
|
+
* anywhere outside the product to link to, where a produced file goes, and the rest
|
|
562
|
+
* {@link StudioSeamOverrides} lists. A seam whose absence every surface already renders (no
|
|
563
|
+
* fix, no link, no file saved, a preference forgotten) ships an implementation that does
|
|
564
|
+
* nothing, so switching it off needs no new branch anywhere.
|
|
565
|
+
*
|
|
566
|
+
* A PARTIAL, folded onto `createDefaultStudioSeams(locale)`, because a host almost always
|
|
567
|
+
* overrides one: a white-labelled deployment turns the links off and keeps the rest, a kiosk
|
|
568
|
+
* forgets and keeps the rest. Passing `createInertStudioSeams()` switches off at once every
|
|
569
|
+
* seam that has an off state.
|
|
570
|
+
*
|
|
571
|
+
* The object is held for as long as its own members are the ones the render before stated,
|
|
572
|
+
* compared one level deep by `Object.is`: written inline over seams declared once, it folds
|
|
573
|
+
* no new set, and a seam built inline is a new member at every render.
|
|
574
|
+
*/
|
|
575
|
+
readonly seams?: StudioSeamOverrides | undefined;
|
|
576
|
+
/**
|
|
577
|
+
* Where an activity's silhouette can be fetched as an IMAGE, for the two surfaces that
|
|
578
|
+
* cannot render a component.
|
|
579
|
+
*
|
|
580
|
+
* The badge beside a route's name is `<ActivityIcon>`, which draws the same artwork through
|
|
581
|
+
* the marker seam and needs nothing from here. What needs a URL is a COMPOSITOR: the video
|
|
582
|
+
* recorder loads and tints the silhouette onto each output frame, and the elevation
|
|
583
|
+
* profile's follow-marker paints it into the map's own marker image. Neither has a React
|
|
584
|
+
* tree to draw into, so neither can go through a glyph table.
|
|
585
|
+
*
|
|
586
|
+
* A separate seam from the marker icons rather than a second reading of them, because the
|
|
587
|
+
* two answer different questions: a glyph table says which artwork exists and how to paint
|
|
588
|
+
* it in a DOM, and this says where a raster loader can GET it. A studio deriving one from
|
|
589
|
+
* the other would be guessing at a viewBox and a scale, and the failure is a marker
|
|
590
|
+
* composited into a recording at the wrong size.
|
|
591
|
+
*
|
|
592
|
+
* Omitted, or answering undefined for a slug it has no artwork for, both surfaces draw a
|
|
593
|
+
* plain disc, which reads as a route with no activity rather than as a broken image.
|
|
594
|
+
*/
|
|
595
|
+
readonly activityIconUrl?: ((slug: string) => string | undefined) | undefined;
|
|
596
|
+
/**
|
|
597
|
+
* The picture of a map layer, for the card grids that let a reader choose one.
|
|
598
|
+
*
|
|
599
|
+
* A layer is named by a slug the tile catalogue supplies, and what that layer LOOKS like is
|
|
600
|
+
* a raster the host serves: a licensee's basemaps are drawn from their own style, and no
|
|
601
|
+
* studio can produce a thumbnail of one. Every grid that offers a layer (the layers panel's
|
|
602
|
+
* base maps and overlays, the embed wizard's base maps) reads it through one seam, so the
|
|
603
|
+
* same layer cannot show two different pictures in two places.
|
|
604
|
+
*
|
|
605
|
+
* Omitted, or answering undefined for a slug, the cards render their names with no media,
|
|
606
|
+
* which is a working picker rather than a grid of broken images.
|
|
607
|
+
*/
|
|
608
|
+
readonly layerThumbnail?:
|
|
609
|
+
| ((kind: StudioLayerKind, slug: string) => string | undefined)
|
|
610
|
+
| undefined;
|
|
611
|
+
/**
|
|
612
|
+
* The origin every link that has to work OUTSIDE this tab is built from.
|
|
613
|
+
*
|
|
614
|
+
* The surfaces that need one need the SAME one: the embed snippet a publisher pastes into their
|
|
615
|
+
* own site, the share link they send to someone else, and a share view's way back to the
|
|
616
|
+
* studio. It is one prop rather than an `embedOrigin` and a `shareOrigin` because they name one
|
|
617
|
+
* fact (the origin that serves the viewer), and two would let a consumer set them apart with
|
|
618
|
+
* nothing to tell them which is wrong.
|
|
619
|
+
*
|
|
620
|
+
* Omitted, {@link useStudioAppOrigin} answers `window.location.origin`, which is right
|
|
621
|
+
* wherever the studio and the viewer are served together. Pass it where they are not: a
|
|
622
|
+
* development server on a different port is the ordinary case, and the failure is a snippet
|
|
623
|
+
* carrying `localhost` into a publisher's page, which nobody notices until they paste it.
|
|
624
|
+
*/
|
|
625
|
+
readonly appOrigin?: string | null | undefined;
|
|
626
|
+
/**
|
|
627
|
+
* The bus every action hook dispatches through. Omit it and every action becomes a no-op.
|
|
628
|
+
*
|
|
629
|
+
* The type is the dispatch slice WIDENED by the optional observation half rather than a second
|
|
630
|
+
* `observe` prop, and the difference is what a host has to remember: a real bus satisfies both
|
|
631
|
+
* with nothing to wire, so {@link useStudioObserve} works for every consumer who passes one. A
|
|
632
|
+
* host handing down a hand-written dispatch slice (a bridge, a scripted double) simply has no
|
|
633
|
+
* `observe` member, and observation answers "nothing observed" rather than failing.
|
|
634
|
+
*/
|
|
635
|
+
readonly bus?: (ToolBusDispatch<TCtx> & ToolBusObserveOverrides) | null | undefined;
|
|
636
|
+
/**
|
|
637
|
+
* What this studio grants, as an array, a set or an iterator.
|
|
638
|
+
*
|
|
639
|
+
* An array or a set is read at every render of the provider, so one a host mutates in place
|
|
640
|
+
* is followed from the next render. An iterator (what `grants.values()` hands over) yields its
|
|
641
|
+
* members once: it is read once, and its members are held for as long as the host hands the
|
|
642
|
+
* same object.
|
|
643
|
+
*/
|
|
644
|
+
readonly capabilities?: Iterable<ToolCapability> | undefined;
|
|
645
|
+
readonly children: ReactNode;
|
|
646
|
+
/** The tool context handlers receive. Omit it and every action becomes a no-op. */
|
|
647
|
+
readonly context?: TCtx | null | undefined;
|
|
648
|
+
readonly navigation?: NavigationSeam | null | undefined;
|
|
649
|
+
/**
|
|
650
|
+
* The studio's state, from `createUiStore()`. Pass the SAME instance the tool context
|
|
651
|
+
* carries, so a surface reads what the bus writes.
|
|
652
|
+
*
|
|
653
|
+
* Omit it and `useUiStore` and `useUiStoreApi` throw: state has no inert answer.
|
|
654
|
+
* `useStudioStore` is the nullable-store primitive for surfaces that need one.
|
|
655
|
+
*/
|
|
656
|
+
readonly store?: UiStoreApi | null | undefined;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* StudioProviderProps is what a consumer configures the headless studio through.
|
|
661
|
+
*
|
|
662
|
+
* The SAME groups `MountayaStudioHost` takes, out of the same types, which is the point rather
|
|
663
|
+
* than a tidiness: `@mountaya/studio-react/headless` is offered as "our verbs, your design
|
|
664
|
+
* system", and a second spelling here would have a consumer moving over from the assembled
|
|
665
|
+
* studio learn again every decision they have already made. A Dart or Swift port declares one
|
|
666
|
+
* set of structs and both of its surfaces take them.
|
|
667
|
+
*
|
|
668
|
+
* The groups are the SHARED halves rather than the host's. `appearance` carries no Mantine
|
|
669
|
+
* theme, because this path brings no design system; `behavior` carries no handlers or
|
|
670
|
+
* recognizers, because this path brings its own bus. Those are the two things that genuinely
|
|
671
|
+
* differ between the surfaces, and the type difference says so rather than a paragraph.
|
|
672
|
+
*
|
|
673
|
+
* `bus`, `context` and `store` stay on `data` beside the catalog and the grants: they are what
|
|
674
|
+
* this provider is HANDED rather than what it builds, which is the whole of what "headless"
|
|
675
|
+
* means here.
|
|
676
|
+
*/
|
|
677
|
+
export interface StudioProviderProps<TCtx extends ToolBusContext = ToolBusContext> {
|
|
678
|
+
/** What it looks like: the scheme, the density, the tokens, the canvas paint. */
|
|
679
|
+
readonly appearance?: StudioAppearanceConfig | undefined;
|
|
680
|
+
/** Where the pictures come from: the glyph tables, the relief raster, the activity artwork. */
|
|
681
|
+
readonly assets?: StudioAssetsConfig | undefined;
|
|
682
|
+
/** What the studio does, and what you do instead: `seams`, the router, the peer names. */
|
|
683
|
+
readonly behavior?: StudioBehaviorConfig | undefined;
|
|
684
|
+
/** The surfaces that read the studio. */
|
|
685
|
+
readonly children: ReactNode;
|
|
686
|
+
/** What the studio is showing and to whom, plus the bus, the context and the store. */
|
|
687
|
+
readonly data?: StudioProviderDataConfig<TCtx> | undefined;
|
|
688
|
+
/** Which words, and which regional conventions: the language, the locale, both bundles. */
|
|
689
|
+
readonly i18n?: StudioI18nConfig | undefined;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* What the headless provider is SHOWN, plus what it is handed rather than builds.
|
|
694
|
+
*
|
|
695
|
+
* `bus` and `context` have no counterpart on the host's `data`, and that asymmetry is the
|
|
696
|
+
* difference between the two surfaces stated in a type: the host builds a bus out of the
|
|
697
|
+
* handlers and recognizers it was given, and this provider takes one.
|
|
698
|
+
*
|
|
699
|
+
* `capabilities` is read as the host hands it. An array or a set is read at every render of the
|
|
700
|
+
* provider, so one a host mutates in place is followed from the next render. An iterator (what
|
|
701
|
+
* `grants.values()` hands over) yields its members once: the provider reads it once and holds
|
|
702
|
+
* its members for as long as the host hands the same object.
|
|
703
|
+
*/
|
|
704
|
+
export interface StudioProviderDataConfig<TCtx extends ToolBusContext = ToolBusContext>
|
|
705
|
+
extends StudioDataConfig {
|
|
706
|
+
/** The tool bus every dispatch beneath this provider runs through. */
|
|
707
|
+
readonly bus?: (ToolBusDispatch<TCtx> & ToolBusObserveOverrides) | null | undefined;
|
|
708
|
+
/** The tool context handlers receive. Omit it and every action becomes a no-op. */
|
|
709
|
+
readonly context?: TCtx | null | undefined;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
/**
|
|
713
|
+
* flatten unpacks the grouped props into the flat shape the body below takes.
|
|
714
|
+
*
|
|
715
|
+
* The twin of `MountayaStudioHost`'s, and deliberately the same shape of function: one mapping,
|
|
716
|
+
* in one place, total over the groups. A member added to a group without a line here is a prop a
|
|
717
|
+
* consumer can set that reaches nothing.
|
|
718
|
+
*/
|
|
719
|
+
const flatten = <TCtx extends ToolBusContext = ToolBusContext>({
|
|
720
|
+
appearance,
|
|
721
|
+
assets,
|
|
722
|
+
behavior,
|
|
723
|
+
children,
|
|
724
|
+
data,
|
|
725
|
+
i18n,
|
|
726
|
+
}: StudioProviderProps<TCtx>): StudioProviderConfig<TCtx> => ({
|
|
727
|
+
activities: data?.activities,
|
|
728
|
+
activityIconUrl: assets?.activityIconUrl,
|
|
729
|
+
appOrigin: behavior?.appOrigin,
|
|
730
|
+
bus: data?.bus,
|
|
731
|
+
capabilities: data?.capabilities,
|
|
732
|
+
children,
|
|
733
|
+
context: data?.context,
|
|
734
|
+
demUrl: assets?.demUrl,
|
|
735
|
+
density: appearance?.density,
|
|
736
|
+
header: appearance?.header,
|
|
737
|
+
language: i18n?.language,
|
|
738
|
+
languageMark: i18n?.languageMark,
|
|
739
|
+
languages: i18n?.languages,
|
|
740
|
+
layerThumbnail: assets?.layerThumbnail,
|
|
741
|
+
locale: i18n?.locale,
|
|
742
|
+
navigation: behavior?.navigation,
|
|
743
|
+
resolvePeerName: behavior?.resolvePeerName,
|
|
744
|
+
seams: behavior?.seams,
|
|
745
|
+
store: data?.store,
|
|
746
|
+
strings: i18n?.studioStrings,
|
|
747
|
+
studioTranslations: i18n?.studioTranslations,
|
|
748
|
+
tokens: appearance?.tokens,
|
|
749
|
+
});
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* StudioProvider supplies the studio's bus, store, tool context and settings to everything under
|
|
753
|
+
* it.
|
|
754
|
+
*
|
|
755
|
+
* It composes WITH `MountayaElementsProvider` rather than replacing it: a studio needs a map,
|
|
756
|
+
* glyphs and copy too, and duplicating those here would give a consumer two places to set an
|
|
757
|
+
* icon table. Mount both; order does not matter.
|
|
758
|
+
*/
|
|
759
|
+
export const StudioProvider = <TCtx extends ToolBusContext = ToolBusContext>(
|
|
760
|
+
grouped: StudioProviderProps<TCtx>,
|
|
761
|
+
): ReactNode => <StudioProviderBody<TCtx> {...flatten(grouped)} />;
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* The provider's body, over the flat shape.
|
|
765
|
+
*
|
|
766
|
+
* Split from the public component so the grouping costs one mapping and nothing else: every
|
|
767
|
+
* default below (`appOrigin = null`, `density = "compact"`, `language = "en"`) still reads as a
|
|
768
|
+
* default on the field it defaults, which a destructure of nested groups cannot express.
|
|
769
|
+
*/
|
|
770
|
+
const StudioProviderBody = <TCtx extends ToolBusContext = ToolBusContext>({
|
|
771
|
+
activities,
|
|
772
|
+
activityIconUrl,
|
|
773
|
+
appOrigin = null,
|
|
774
|
+
bus = null,
|
|
775
|
+
capabilities,
|
|
776
|
+
children,
|
|
777
|
+
context = null,
|
|
778
|
+
demUrl,
|
|
779
|
+
density = "compact",
|
|
780
|
+
header,
|
|
781
|
+
languageMark,
|
|
782
|
+
languages,
|
|
783
|
+
layerThumbnail,
|
|
784
|
+
language = "en",
|
|
785
|
+
locale,
|
|
786
|
+
navigation = null,
|
|
787
|
+
resolvePeerName,
|
|
788
|
+
seams,
|
|
789
|
+
store = null,
|
|
790
|
+
strings,
|
|
791
|
+
studioTranslations,
|
|
792
|
+
tokens,
|
|
793
|
+
}: StudioProviderConfig<TCtx>): ReactNode => {
|
|
794
|
+
// The capability set is rebuilt only when its MEMBERS change, not when the caller passes a
|
|
795
|
+
// fresh iterable. A studio's capabilities are derived from a membership role and re-derived
|
|
796
|
+
// on every render of whatever owns them; a new Set each time would re-render every action
|
|
797
|
+
// hook in the tree over a value that did not change.
|
|
798
|
+
const resolved = useCapabilitySet(capabilities);
|
|
799
|
+
|
|
800
|
+
const catalog = activities ?? NO_ACTIVITIES;
|
|
801
|
+
|
|
802
|
+
// Resolved by CONTENT rather than by identity, so the documented inline-literal form does not
|
|
803
|
+
// rebuild the context value (and every surface under it) on every render of the host.
|
|
804
|
+
// Held by its members, so a set written inline resolves once; one resolver per set, so the
|
|
805
|
+
// bundle resolves again when the set changes.
|
|
806
|
+
const heldTranslations = useStableMembers(studioTranslations);
|
|
807
|
+
const resolve = useMemo(
|
|
808
|
+
() => (selected: MapLanguage, overrides: StudioStringsOverrides | undefined) =>
|
|
809
|
+
resolveStudioStrings(selected, overrides, heldTranslations),
|
|
810
|
+
[heldTranslations],
|
|
811
|
+
);
|
|
812
|
+
const followingStrings = useStableBundle(language, strings, resolve);
|
|
813
|
+
// A formatter written inline is a new function at every render of the host, so the bundle
|
|
814
|
+
// above follows it. The settled one keeps its identity across those renders, for the readers
|
|
815
|
+
// that call no formatter.
|
|
816
|
+
const settledStrings = useSettledBundle(language, strings, followingStrings, resolve);
|
|
817
|
+
|
|
818
|
+
// `behavior={{ seams: { storage } }}`, `behavior={{ navigation: { location, navigate } }}`,
|
|
819
|
+
// `appearance={{ tokens: { … } }}` and `appearance={{ header: { title } }}` are written in the
|
|
820
|
+
// JSX, a new object at every render of the host that states the same members. Each is held for
|
|
821
|
+
// as long as its members are the ones the render before stated, by the rule the assembled host
|
|
822
|
+
// reads its own props with.
|
|
823
|
+
const heldSeams = useStableMembers(seams);
|
|
824
|
+
const heldTokens = useStableMembers(tokens);
|
|
825
|
+
const heldNavigation = useStableMembers(navigation);
|
|
826
|
+
const heldHeader = useStableMembers(header);
|
|
827
|
+
|
|
828
|
+
// One registry per provider, created once: it is a mutable map behind a stable object, so a
|
|
829
|
+
// fresh one per render would lose every anchor a control registered on mount.
|
|
830
|
+
const [controlAnchors] = useState(createControlAnchors);
|
|
831
|
+
|
|
832
|
+
// Folded onto the defaults rather than replacing them, because a host almost always overrides
|
|
833
|
+
// ONE. Rebuilt only when a member of the override or the locale changes: the default clock and
|
|
834
|
+
// storage each hold state (an armed timer, a memory map), so a fresh set per render would hand
|
|
835
|
+
// every surface below a new one and lose whatever the last one was holding.
|
|
836
|
+
const resolvedSeams = useMemo(
|
|
837
|
+
() => foldSeams(createDefaultStudioSeams(locale ?? language), heldSeams),
|
|
838
|
+
[language, locale, heldSeams],
|
|
839
|
+
);
|
|
840
|
+
|
|
841
|
+
// The option list the pickers draw, derived from the codes a host named rather than taken as
|
|
842
|
+
// a list of its own: the label beside a code is its endonym, which is a fact rather than a
|
|
843
|
+
// choice, and letting a host restate it is letting two pickers disagree about what `fr` is
|
|
844
|
+
// called. Keyed on the joined codes so an inline array literal costs one comparison.
|
|
845
|
+
const languageKey = languages?.join(" ");
|
|
846
|
+
const languageOptions = useMemo(
|
|
847
|
+
() =>
|
|
848
|
+
languageKey === undefined
|
|
849
|
+
? studioLanguageOptions(heldTranslations)
|
|
850
|
+
: languageKey
|
|
851
|
+
.split(" ")
|
|
852
|
+
.filter(isMapLanguage)
|
|
853
|
+
.map((value) => ({ label: languageEndonym[value], value })),
|
|
854
|
+
[languageKey, heldTranslations],
|
|
855
|
+
);
|
|
856
|
+
|
|
857
|
+
const dispatchSlice = useMemo<StudioDispatchSlice>(() => ({ bus, context }), [bus, context]);
|
|
858
|
+
|
|
859
|
+
const config = useMemo<StudioConfigValue>(
|
|
860
|
+
() => ({
|
|
861
|
+
activities: catalog,
|
|
862
|
+
activityIconUrl: activityIconUrl ?? null,
|
|
863
|
+
appOrigin,
|
|
864
|
+
controlAnchors,
|
|
865
|
+
demUrl,
|
|
866
|
+
density,
|
|
867
|
+
header: heldHeader,
|
|
868
|
+
tokens: heldTokens ?? null,
|
|
869
|
+
languageMark: languageMark ?? null,
|
|
870
|
+
languages: languageOptions,
|
|
871
|
+
navigation: heldNavigation,
|
|
872
|
+
layerThumbnail: layerThumbnail ?? null,
|
|
873
|
+
resolvePeerName: resolvePeerName ?? null,
|
|
874
|
+
seams: resolvedSeams,
|
|
875
|
+
}),
|
|
876
|
+
[
|
|
877
|
+
catalog,
|
|
878
|
+
activityIconUrl,
|
|
879
|
+
appOrigin,
|
|
880
|
+
controlAnchors,
|
|
881
|
+
demUrl,
|
|
882
|
+
density,
|
|
883
|
+
heldHeader,
|
|
884
|
+
languageMark,
|
|
885
|
+
languageOptions,
|
|
886
|
+
layerThumbnail,
|
|
887
|
+
heldNavigation,
|
|
888
|
+
resolvePeerName,
|
|
889
|
+
resolvedSeams,
|
|
890
|
+
heldTokens,
|
|
891
|
+
],
|
|
892
|
+
);
|
|
893
|
+
|
|
894
|
+
return (
|
|
895
|
+
<StudioConfigContext value={config}>
|
|
896
|
+
<StudioDispatchContext value={dispatchSlice}>
|
|
897
|
+
<StudioStoreContext value={store}>
|
|
898
|
+
<StudioCapabilitiesContext value={resolved}>
|
|
899
|
+
<StudioWordsContext value={settledStrings}>
|
|
900
|
+
<StudioFollowingWordsContext value={followingStrings}>
|
|
901
|
+
{children}
|
|
902
|
+
</StudioFollowingWordsContext>
|
|
903
|
+
</StudioWordsContext>
|
|
904
|
+
</StudioCapabilitiesContext>
|
|
905
|
+
</StudioStoreContext>
|
|
906
|
+
</StudioDispatchContext>
|
|
907
|
+
</StudioConfigContext>
|
|
908
|
+
);
|
|
909
|
+
};
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* useStudioDispatchSlice reads the bus and the tool context of the nearest provider, and renders
|
|
913
|
+
* its caller for nothing else the provider holds.
|
|
914
|
+
*
|
|
915
|
+
* The type arguments are the reader's, as {@link StudioContextValue} describes them.
|
|
916
|
+
*/
|
|
917
|
+
export const useStudioDispatchSlice = <
|
|
918
|
+
TCtx extends ToolBusContext = ToolBusContext,
|
|
919
|
+
TInputs extends object = ToolDispatchRegistry,
|
|
920
|
+
TOutputs extends object = ToolOutputRegistry,
|
|
921
|
+
>(): StudioDispatchSlice<TCtx, TInputs, TOutputs> =>
|
|
922
|
+
// The context is created once, for every host, so it cannot be declared over a host's own
|
|
923
|
+
// types: the reader names them. The assertion is sound for `TCtx` where the reader names the
|
|
924
|
+
// context its provider holds, and for the two maps because each is a way of reading one
|
|
925
|
+
// dispatch slice and no part of the slice.
|
|
926
|
+
use(StudioDispatchContext) as StudioDispatchSlice<TCtx, TInputs, TOutputs>;
|
|
927
|
+
|
|
928
|
+
/**
|
|
929
|
+
* useStudioProviderStrings reads the provider's words of the kind a reader needs: the bundle that
|
|
930
|
+
* follows each formatter a host restates, or the settled one, which renders its reader for none.
|
|
931
|
+
*
|
|
932
|
+
* @param followsFormatters Whether the reader may call a formatter.
|
|
933
|
+
*/
|
|
934
|
+
export const useStudioProviderStrings = (followsFormatters: boolean): StudioStrings =>
|
|
935
|
+
use(followsFormatters ? StudioFollowingWordsContext : StudioWordsContext);
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* useStudioStoreSeam reads the store of the nearest provider, or null where it carries none, and
|
|
939
|
+
* renders its caller for nothing else the provider holds.
|
|
940
|
+
*/
|
|
941
|
+
export const useStudioStoreSeam = (): UiStoreApi | null => use(StudioStoreContext);
|
|
942
|
+
|
|
943
|
+
/**
|
|
944
|
+
* outsideStudio is what a hook that reads the tool context throws where no provider carries one.
|
|
945
|
+
*
|
|
946
|
+
* It names both remedies: `MountayaStudioHost`, which builds the context from its own props, and
|
|
947
|
+
* the headless `StudioProvider`, which is handed one as `data.context`.
|
|
948
|
+
*
|
|
949
|
+
* @param hook - The hook that refused, named first in the message.
|
|
950
|
+
*/
|
|
951
|
+
export const outsideStudio = (hook: string): MountayaElementsError =>
|
|
952
|
+
new MountayaElementsError(
|
|
953
|
+
`${hook} was called outside a studio. Mount <MountayaStudioHost> above it, or ` +
|
|
954
|
+
"<StudioProvider> carrying `data.context`.",
|
|
955
|
+
);
|
|
956
|
+
|
|
957
|
+
/**
|
|
958
|
+
* useStudioToolContext reads the host's own tool context: the seam bag a handler receives.
|
|
959
|
+
*
|
|
960
|
+
* It THROWS outside a provider carrying one, as `useStudioHostRegistry` does and for the same
|
|
961
|
+
* reason: this is host-shaped WIRING rather than an affordance. A surface reaching for the raw
|
|
962
|
+
* context is passing it somewhere (an agent session, a bridge, a chained dispatch), and a null
|
|
963
|
+
* threaded into one of those has no symptom: the call succeeds, does nothing, and the studio
|
|
964
|
+
* quietly stops responding. A read whose absence degrades into something visible answers inertly
|
|
965
|
+
* instead.
|
|
966
|
+
*
|
|
967
|
+
* Reach for it only when nothing narrower will do. `useStudioDispatch` runs a verb,
|
|
968
|
+
* `useUiStoreApi` reads the store at call time, `useCapability` answers a grant: each of those
|
|
969
|
+
* is the same question asked in a way that cannot be threaded somewhere wrong.
|
|
970
|
+
*
|
|
971
|
+
* @returns The tool context, typed as the caller names it.
|
|
972
|
+
* @throws {MountayaElementsError} When no provider above the caller carries a tool context.
|
|
973
|
+
*/
|
|
974
|
+
export const useStudioToolContext = <TCtx extends ToolBusContext = ToolBusContext>(): TCtx => {
|
|
975
|
+
const { context } = useStudioDispatchSlice<TCtx>();
|
|
976
|
+
if (!context) {
|
|
977
|
+
throw outsideStudio("useStudioToolContext");
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
return context;
|
|
981
|
+
};
|
|
982
|
+
|
|
983
|
+
/**
|
|
984
|
+
* useStudioContext reads everything the nearest {@link StudioProvider} holds: the bus, the tool
|
|
985
|
+
* context, the store and the seams. Outside a provider it answers the inert default and never
|
|
986
|
+
* throws.
|
|
987
|
+
*
|
|
988
|
+
* It renders its caller whenever any of those moves. A reader of one part takes the hook that
|
|
989
|
+
* reads it ({@link useCapability}, {@link useStudioStrings}, `useUiStore`, `useStudioDispatch`),
|
|
990
|
+
* which renders it for that part alone.
|
|
991
|
+
*
|
|
992
|
+
* The three type arguments are the reader's, as {@link StudioContextValue} describes them: the
|
|
993
|
+
* host's tool context, the inputs `bus.dispatch` is checked against and the outputs it answers
|
|
994
|
+
* by. A reader of the studio's own verbs names `StudioToolInputs` and `StudioToolOutputs`, and
|
|
995
|
+
* `useStudioDispatch` is that reader already written.
|
|
996
|
+
*
|
|
997
|
+
* @example
|
|
998
|
+
* ```tsx
|
|
999
|
+
* declare const itineraryId: string;
|
|
1000
|
+
*
|
|
1001
|
+
* const { bus, context } = useStudioContext<
|
|
1002
|
+
* StudioToolContext,
|
|
1003
|
+
* StudioToolInputs,
|
|
1004
|
+
* StudioToolOutputs
|
|
1005
|
+
* >();
|
|
1006
|
+
*
|
|
1007
|
+
* const rename = async (name: string) => {
|
|
1008
|
+
* if (bus === null || context === null) {
|
|
1009
|
+
* return;
|
|
1010
|
+
* }
|
|
1011
|
+
*
|
|
1012
|
+
* const result = await bus.dispatch(context, "studio.itinerary.rename", { itineraryId, name });
|
|
1013
|
+
* console.log(result.ok ? result.summary : result.error);
|
|
1014
|
+
* };
|
|
1015
|
+
* ```
|
|
1016
|
+
*/
|
|
1017
|
+
export const useStudioContext = <
|
|
1018
|
+
TCtx extends ToolBusContext = ToolBusContext,
|
|
1019
|
+
TInputs extends object = ToolDispatchRegistry,
|
|
1020
|
+
TOutputs extends object = ToolOutputRegistry,
|
|
1021
|
+
>(): StudioContextValue<TCtx, TInputs, TOutputs> => {
|
|
1022
|
+
const { bus, context } = useStudioDispatchSlice<TCtx, TInputs, TOutputs>();
|
|
1023
|
+
const store = use(StudioStoreContext);
|
|
1024
|
+
const capabilities = use(StudioCapabilitiesContext);
|
|
1025
|
+
const strings = use(StudioFollowingWordsContext);
|
|
1026
|
+
const config = use(StudioConfigContext);
|
|
1027
|
+
|
|
1028
|
+
// One object for as long as its parts stand, so a reader that hands it on renders what it
|
|
1029
|
+
// is handed to for no part that did not move.
|
|
1030
|
+
return useMemo(
|
|
1031
|
+
() => ({ ...config, bus, capabilities, context, store, strings }),
|
|
1032
|
+
[config, bus, capabilities, context, store, strings],
|
|
1033
|
+
);
|
|
1034
|
+
};
|
|
1035
|
+
|
|
1036
|
+
/**
|
|
1037
|
+
* useStudioActivities reads the activity catalog the host resolved.
|
|
1038
|
+
*
|
|
1039
|
+
* Every surface that names an activity (the picker, the segment list's engine hint, the
|
|
1040
|
+
* elevation panel's speed default, the suggest form's seed) reads it here rather than fetching
|
|
1041
|
+
* one. The catalog is the same for the whole tree and changes about as often as a deploy, so a
|
|
1042
|
+
* component reaching for it independently would be the same request repeated behind a cache
|
|
1043
|
+
* whose absence nothing would notice.
|
|
1044
|
+
*
|
|
1045
|
+
* Always an array, never undefined: a surface outside a provider gets an empty catalog, which
|
|
1046
|
+
* is what an activity picker with no options and a row naming its activity by id already do.
|
|
1047
|
+
* The distinction between "loading" and "loaded empty" belongs to whoever holds the query, and
|
|
1048
|
+
* no surface here branches on it.
|
|
1049
|
+
*/
|
|
1050
|
+
export const useStudioActivities = (): readonly CategoryActivities[] =>
|
|
1051
|
+
use(StudioConfigContext).activities;
|
|
1052
|
+
|
|
1053
|
+
/**
|
|
1054
|
+
* useStudioDemUrl reads the elevation raster the host supplied, for a surface that seeds its own
|
|
1055
|
+
* map rather than going through {@link useStudioMapSync}.
|
|
1056
|
+
*
|
|
1057
|
+
* `undefined` outside a provider and inside one that supplied none: the same answer, because
|
|
1058
|
+
* they mean the same thing: render the relief flat.
|
|
1059
|
+
*/
|
|
1060
|
+
export const useStudioDemUrl = (): string | undefined => use(StudioConfigContext).demUrl;
|
|
1061
|
+
|
|
1062
|
+
/**
|
|
1063
|
+
* useStudioHeader reads what the host put in place of the studio's own brand lockup.
|
|
1064
|
+
*
|
|
1065
|
+
* Three answers rather than two, and keeping them apart is the whole reason this hook does not
|
|
1066
|
+
* collapse to `?? null` the way its neighbours do:
|
|
1067
|
+
*
|
|
1068
|
+
* - `undefined`, "not configured": the Mountaya lockup stands. Outside a provider too,
|
|
1069
|
+
* which is the same answer for the same reason: a header rendered in a story or a print view
|
|
1070
|
+
* is still this package's header.
|
|
1071
|
+
* - `null`: the host asked for NO header.
|
|
1072
|
+
* - anything else: the host's own node, or a `{ icon, title, baseline }` to draw.
|
|
1073
|
+
*
|
|
1074
|
+
* It answers what was SET, not what will be drawn. `StudioHeader` is where the `white-label`
|
|
1075
|
+
* entitlement is read, because that answer moves after the studio mounts and this one does not.
|
|
1076
|
+
*/
|
|
1077
|
+
export const useStudioHeader = (): StudioHeaderOverride | undefined =>
|
|
1078
|
+
use(StudioConfigContext).header;
|
|
1079
|
+
|
|
1080
|
+
/**
|
|
1081
|
+
* useStudioLanguageMark reads the mark a language picker draws beside each language.
|
|
1082
|
+
*
|
|
1083
|
+
* `undefined` outside a provider, and `undefined` inside one that supplied none: the same
|
|
1084
|
+
* answer, because they mean the same thing: draw the names alone. `LanguageSelect` takes this
|
|
1085
|
+
* shape directly as its `renderMark`, so a picker inside a studio needs no prop at all.
|
|
1086
|
+
*/
|
|
1087
|
+
export const useStudioLanguageMark = (): ((language: MapLanguage) => ReactNode) | undefined =>
|
|
1088
|
+
use(StudioConfigContext).languageMark ?? undefined;
|
|
1089
|
+
|
|
1090
|
+
/**
|
|
1091
|
+
* useStudioLanguages reads which languages this studio's pickers offer, already labelled.
|
|
1092
|
+
*
|
|
1093
|
+
* Every picker in the studio reads it rather than building its own list, which is the property
|
|
1094
|
+
* worth having: "which languages is this product available in" is one answer, and a surface that
|
|
1095
|
+
* derives it separately is a surface that can offer a different set. Outside a provider it is
|
|
1096
|
+
* English alone, the one language built in.
|
|
1097
|
+
*/
|
|
1098
|
+
export const useStudioLanguages = (): readonly { label: string; value: MapLanguage }[] =>
|
|
1099
|
+
use(StudioConfigContext).languages;
|
|
1100
|
+
|
|
1101
|
+
/**
|
|
1102
|
+
* useStudioDensity reads which tier the studio's own regions draw at.
|
|
1103
|
+
*
|
|
1104
|
+
* Every surface that mounts a scoped theme reads it rather than importing a constant, so a
|
|
1105
|
+
* host's `density` reaches them all at once, and a surface added later inherits the tier
|
|
1106
|
+
* instead of shipping at whichever one its author happened to copy.
|
|
1107
|
+
*/
|
|
1108
|
+
export const useStudioDensity = (): StudioDensity => use(StudioConfigContext).density;
|
|
1109
|
+
|
|
1110
|
+
/**
|
|
1111
|
+
* useStudioTokens reads the `--mtya-*` overrides the host declared, as a `style` object.
|
|
1112
|
+
*
|
|
1113
|
+
* The studio mounts elements from `@mountaya/elements-react`, and each of those ASSIGNS its own
|
|
1114
|
+
* token block on its root rather than inheriting one, so a token set on the studio root is
|
|
1115
|
+
* shadowed by the element and never reaches it. Handing the same object down as an inline
|
|
1116
|
+
* `style` is what closes that: an inline declaration outranks a class rule, so the element
|
|
1117
|
+
* reads the host's value and falls back to its own block for everything unstated.
|
|
1118
|
+
*
|
|
1119
|
+
* @returns One object per token set the provider holds.
|
|
1120
|
+
*/
|
|
1121
|
+
export const useStudioTokens = (): Record<string, string> => {
|
|
1122
|
+
const { tokens } = use(StudioConfigContext);
|
|
1123
|
+
|
|
1124
|
+
// One object per token set the provider holds, so a memoized element handed it as `style`
|
|
1125
|
+
// renders again only when a token moved.
|
|
1126
|
+
return useMemo(() => studioTokenStyle(tokens ?? undefined), [tokens]);
|
|
1127
|
+
};
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* StudioPeerNameSeam answers who a collaborator IS, for one organization.
|
|
1131
|
+
*
|
|
1132
|
+
* A factory rather than a resolver, because the organization is chosen at render time (the
|
|
1133
|
+
* active zone's, else the active itinerary's), and that lives in the studio's own store, which
|
|
1134
|
+
* the host creates. A seam bound above the host therefore cannot read it.
|
|
1135
|
+
*/
|
|
1136
|
+
export type StudioPeerNameSeam = (organizationId: string | null) => PeerNameResolver;
|
|
1137
|
+
|
|
1138
|
+
/**
|
|
1139
|
+
* inertPeerName is what a studio with no directory of people reads.
|
|
1140
|
+
*
|
|
1141
|
+
* A function rather than `undefined`, for the reason `inertArtwork` below is one: a surface asks
|
|
1142
|
+
* for a name and either gets one or does not, and every caller already handles the null: it
|
|
1143
|
+
* falls back to the peer's initials, which is what a studio shows before a member list lands
|
|
1144
|
+
* anyway. Hoisted at both levels, because both sit behind a `??` and a fresh arrow would be a
|
|
1145
|
+
* new identity on every render.
|
|
1146
|
+
*/
|
|
1147
|
+
const inertPeerName: PeerNameResolver = () => null;
|
|
1148
|
+
const inertPeerNames: StudioPeerNameSeam = () => inertPeerName;
|
|
1149
|
+
|
|
1150
|
+
/**
|
|
1151
|
+
* useStudioPeerName reads how a collaborator's id becomes a name, for ONE organization.
|
|
1152
|
+
*
|
|
1153
|
+
* The seam is the host's because a directory of people is: who may be named, and by what, is an
|
|
1154
|
+
* account question with no public read behind it. Every surface that names a peer (a lock
|
|
1155
|
+
* badge, a ghost label, a roster row) reads THIS one, so the studio never shows an id beside
|
|
1156
|
+
* one row and a name beside another.
|
|
1157
|
+
*
|
|
1158
|
+
* It takes the organization rather than resolving one, for the same reason the billing gate
|
|
1159
|
+
* does: the answer is per-organization and the host cannot know which one in advance. It also
|
|
1160
|
+
* cannot find out: the active resource lives in the studio's STORE, which the host CREATES, so
|
|
1161
|
+
* a binding that read it would be reading a context that does not exist yet where it is bound.
|
|
1162
|
+
*
|
|
1163
|
+
* The host's implementation calls hooks, so this is called unconditionally in a component body
|
|
1164
|
+
* exactly like one, and the seam's identity must be stable across renders.
|
|
1165
|
+
*
|
|
1166
|
+
* @param organizationId - The organization of the resource the surface shows, or null.
|
|
1167
|
+
* @returns The resolver, or one that resolves no name where the host supplied no seam.
|
|
1168
|
+
*/
|
|
1169
|
+
export const useStudioPeerName = (organizationId: string | null): PeerNameResolver =>
|
|
1170
|
+
(use(StudioConfigContext).resolvePeerName ?? inertPeerNames)(organizationId);
|
|
1171
|
+
|
|
1172
|
+
/**
|
|
1173
|
+
* inertArtwork is the resolver a studio with no host artwork of a given kind reads.
|
|
1174
|
+
*
|
|
1175
|
+
* A function rather than `undefined`, so every caller writes one shape: a surface asks for a
|
|
1176
|
+
* URL and either gets one or does not, and the absent-provider case is not a second branch it
|
|
1177
|
+
* has to remember. Hoisted, because it sits behind a `??` that a fresh arrow would make a new
|
|
1178
|
+
* identity on every render, and shared by both artwork seams, which answer the same nothing.
|
|
1179
|
+
*/
|
|
1180
|
+
const inertArtwork = (): undefined => undefined;
|
|
1181
|
+
|
|
1182
|
+
/**
|
|
1183
|
+
* useStudioActivityIconUrl resolves an activity's silhouette to an image URL.
|
|
1184
|
+
*
|
|
1185
|
+
* For the surfaces that composite rather than render: the video recorder's focus marker and
|
|
1186
|
+
* the elevation profile's follow-marker. Everything that draws a badge in a DOM goes through
|
|
1187
|
+
* `<ActivityIcon>` and the marker seam instead.
|
|
1188
|
+
*
|
|
1189
|
+
* Outside a provider, and inside one that supplied no resolver, it answers undefined for every
|
|
1190
|
+
* slug, which both callers already read as "no silhouette", so neither grows a branch.
|
|
1191
|
+
*/
|
|
1192
|
+
export const useStudioActivityIconUrl = (): ((slug: string) => string | undefined) =>
|
|
1193
|
+
use(StudioConfigContext).activityIconUrl ?? inertArtwork;
|
|
1194
|
+
|
|
1195
|
+
/**
|
|
1196
|
+
* useStudioLayerThumbnail resolves a map layer's slug to a picture of it.
|
|
1197
|
+
*
|
|
1198
|
+
* Every card grid that offers a layer reads it, so one layer cannot show two different
|
|
1199
|
+
* pictures in two places.
|
|
1200
|
+
*
|
|
1201
|
+
* Outside a provider, and inside one that supplied no resolver, it answers undefined for every
|
|
1202
|
+
* slug, and the grids render their cards with no media.
|
|
1203
|
+
*/
|
|
1204
|
+
export const useStudioLayerThumbnail = (): ((
|
|
1205
|
+
kind: StudioLayerKind,
|
|
1206
|
+
slug: string,
|
|
1207
|
+
) => string | undefined) => use(StudioConfigContext).layerThumbnail ?? inertArtwork;
|
|
1208
|
+
|
|
1209
|
+
/**
|
|
1210
|
+
* useCapability answers whether the surface may perform a class of action.
|
|
1211
|
+
*
|
|
1212
|
+
* The question a component asks to decide whether to render a control at all. It is not a
|
|
1213
|
+
* substitute for the bus's own gate (dispatch checks again, because a surface that hid a
|
|
1214
|
+
* button has not stopped an agent from asking for the same verb), but rendering a control that
|
|
1215
|
+
* would be refused is its own bug.
|
|
1216
|
+
*
|
|
1217
|
+
* @param capability - The class of action asked about.
|
|
1218
|
+
* @returns Whether the studio above grants it; false outside a provider.
|
|
1219
|
+
*/
|
|
1220
|
+
export const useCapability = (capability: ToolCapability): boolean =>
|
|
1221
|
+
use(StudioCapabilitiesContext).has(capability);
|
|
1222
|
+
|
|
1223
|
+
/**
|
|
1224
|
+
* useStudioAppOrigin answers the origin a link that leaves this tab is built from.
|
|
1225
|
+
*
|
|
1226
|
+
* The provider's own value when it carries one, else `window.location.origin`: right wherever
|
|
1227
|
+
* the studio and the viewer are served together, which is every deployment that has not split
|
|
1228
|
+
* them. Empty outside a browser, so a snippet built server-side yields a relative URL rather
|
|
1229
|
+
* than one naming a host that does not exist.
|
|
1230
|
+
*
|
|
1231
|
+
* NOT `window.location.origin` at the call site, which is the mistake this hook exists to make
|
|
1232
|
+
* unnecessary: a development server answers on a port the published viewer never uses, so a
|
|
1233
|
+
* snippet built from it carries `localhost` into a publisher's page and fails there, silently,
|
|
1234
|
+
* after the paste.
|
|
1235
|
+
*/
|
|
1236
|
+
export const useStudioAppOrigin = (): string =>
|
|
1237
|
+
use(StudioConfigContext).appOrigin ??
|
|
1238
|
+
(typeof window === "undefined" ? "" : window.location.origin);
|
|
1239
|
+
|
|
1240
|
+
/**
|
|
1241
|
+
* The studio's own sentences, in the language the provider selected and with any overrides
|
|
1242
|
+
* merged.
|
|
1243
|
+
*
|
|
1244
|
+
* Beside `useMountayaStrings` rather than folded into it: a control reads the elements' words
|
|
1245
|
+
* and a studio surface reads these, and a consumer who mounts controls and no studio never has
|
|
1246
|
+
* to learn this one exists.
|
|
1247
|
+
*
|
|
1248
|
+
* The whole bundle, formatters included, so it follows each formatter a host restates: a
|
|
1249
|
+
* formatter written inline in `i18n.studioStrings` renders the caller at every render of the
|
|
1250
|
+
* host. A surface that reads some sections takes `useStudioScopedStrings`, which renders it for
|
|
1251
|
+
* no restated formatter where those sections hold none.
|
|
1252
|
+
*/
|
|
1253
|
+
export const useStudioStrings = (): StudioStrings => use(StudioFollowingWordsContext);
|
|
1254
|
+
|
|
1255
|
+
/**
|
|
1256
|
+
* The capabilities the studio takes from the world around it, as this tree was wired with them.
|
|
1257
|
+
*
|
|
1258
|
+
* Published as one object AND as one hook per seam, and neither is redundant. A surface reads
|
|
1259
|
+
* the one it needs (a panel reaching for `useStudioLinks()` names what it uses and reads
|
|
1260
|
+
* nothing else again), and a host wiring their own composition takes the whole set through
|
|
1261
|
+
* `useStudioMapSeams()` to hand on.
|
|
1262
|
+
*
|
|
1263
|
+
* There is no throwing variant. Every seam has a working default, so the default context
|
|
1264
|
+
* carries a working set and a surface outside a provider degrades to the browser's own
|
|
1265
|
+
* behaviour rather than to a blank screen.
|
|
1266
|
+
*/
|
|
1267
|
+
export const useStudioMapSeams = (): StudioSeams => use(StudioConfigContext).seams;
|
|
1268
|
+
|
|
1269
|
+
/** Where a product-meaningful moment or delay comes from. */
|
|
1270
|
+
export const useStudioClock = (): Clock => use(StudioConfigContext).seams.clock;
|
|
1271
|
+
|
|
1272
|
+
/** How a number, a date and a relative moment reach a screen, in this studio's locale. */
|
|
1273
|
+
export const useStudioFormatters = (): StudioFormatters =>
|
|
1274
|
+
use(StudioConfigContext).seams.formatters;
|
|
1275
|
+
|
|
1276
|
+
/** Where a device fix comes from, and whether asking would prompt. */
|
|
1277
|
+
export const useStudioGeolocation = (): GeolocationSeam =>
|
|
1278
|
+
use(StudioConfigContext).seams.geolocation;
|
|
1279
|
+
|
|
1280
|
+
/** Where a link to somewhere outside the product goes, or that there is none. */
|
|
1281
|
+
export const useStudioLinks = (): StudioLinks => use(StudioConfigContext).seams.links;
|
|
1282
|
+
|
|
1283
|
+
/** Where a preference that outlives a session is kept. */
|
|
1284
|
+
export const useStudioStorage = (): StudioStorage => use(StudioConfigContext).seams.storage;
|
|
1285
|
+
|
|
1286
|
+
/**
|
|
1287
|
+
* Where a floating panel finds the toggle that opened it.
|
|
1288
|
+
*
|
|
1289
|
+
* Published because a consumer composing their own control stack and their own panel needs the
|
|
1290
|
+
* same pairing, and because the alternative, reading the button out of the document, finds the
|
|
1291
|
+
* first match on the page, so two studios would exempt each other's button, and it finds
|
|
1292
|
+
* nothing across a shadow root.
|
|
1293
|
+
*/
|
|
1294
|
+
export const useStudioControlAnchors = (): StudioControlAnchors =>
|
|
1295
|
+
use(StudioConfigContext).controlAnchors;
|