@geode/opengeodeweb-front 10.34.0-rc.2 → 10.34.0-rc.4

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.
Files changed (402) hide show
  1. package/README.md +8 -0
  2. package/app/assets/{geode_objects.js → geode_objects.ts} +8 -1
  3. package/app/components/ActionButton.vue +28 -12
  4. package/app/components/Basic/Slider.vue +2 -2
  5. package/app/components/Basic/Switch.vue +2 -2
  6. package/app/components/CameraManager/List.vue +9 -9
  7. package/app/components/CameraManager/Saver.vue +8 -2
  8. package/app/components/CameraManager.vue +20 -10
  9. package/app/components/CameraOrientation.vue +29 -15
  10. package/app/components/ClippingPlaneCard.vue +11 -12
  11. package/app/components/ClippingPlanes.vue +25 -15
  12. package/app/components/CrsSelector.vue +24 -15
  13. package/app/components/DeleteDialog.vue +16 -16
  14. package/app/components/DragAndDrop.vue +53 -33
  15. package/app/components/DragAndDropInternal/DragAndDropInline.vue +29 -16
  16. package/app/components/DragAndDropInternal/DragAndDropOverlay.vue +32 -19
  17. package/app/components/ExtensionSelector.vue +32 -16
  18. package/app/components/FeedBack/ErrorBanner.vue +1 -2
  19. package/app/components/FeedBack/Snackers.vue +3 -3
  20. package/app/components/FetchingData.vue +8 -12
  21. package/app/components/FileSelector.vue +20 -12
  22. package/app/components/FileUploader.vue +45 -24
  23. package/app/components/GlassCard.vue +16 -12
  24. package/app/components/HybridRenderingView.vue +22 -11
  25. package/app/components/HybridViewerTooltip.vue +24 -22
  26. package/app/components/InfraConnected.vue +1 -1
  27. package/app/components/Launcher.vue +11 -9
  28. package/app/components/Loading/EcoMessages.vue +16 -11
  29. package/app/components/Loading/Header.vue +6 -7
  30. package/app/components/Loading/Progress.vue +6 -7
  31. package/app/components/Loading.vue +8 -12
  32. package/app/components/MissingFilesSelector.vue +29 -15
  33. package/app/components/ObjectSelector.vue +33 -18
  34. package/app/components/PackagesVersions.vue +14 -7
  35. package/app/components/Recaptcha.vue +16 -22
  36. package/app/components/RemoteRenderingView.vue +16 -9
  37. package/app/components/Ruler.vue +8 -6
  38. package/app/components/Screenshot.vue +19 -13
  39. package/app/components/SearchBar.vue +10 -6
  40. package/app/components/ShrinkFilter.vue +12 -7
  41. package/app/components/Step.vue +30 -11
  42. package/app/components/Stepper.vue +18 -7
  43. package/app/components/ToolPanel.vue +25 -12
  44. package/app/components/ViewToolbar.vue +33 -21
  45. package/app/components/Viewer/ContextMenu/CenterButton.vue +14 -9
  46. package/app/components/Viewer/ContextMenu/CircularItems.vue +13 -10
  47. package/app/components/Viewer/ContextMenu/ContextMenu.vue +25 -20
  48. package/app/components/Viewer/ContextMenu/ContextMenuItem.vue +21 -9
  49. package/app/components/Viewer/ContextMenu/InfoCard.vue +31 -14
  50. package/app/components/Viewer/EdgedCurve/PointsOptions.vue +8 -5
  51. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +59 -36
  52. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +67 -39
  53. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +61 -38
  54. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +43 -27
  55. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +84 -40
  56. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +67 -38
  57. package/app/components/Viewer/Generic/Model/BlocksOptions.vue +101 -35
  58. package/app/components/Viewer/Generic/Model/CornersOptions.vue +67 -27
  59. package/app/components/Viewer/Generic/Model/EdgesOptions.vue +14 -8
  60. package/app/components/Viewer/Generic/Model/LinesOptions.vue +96 -43
  61. package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +24 -12
  62. package/app/components/Viewer/Generic/Model/ModelStyleOptions.vue +10 -5
  63. package/app/components/Viewer/Generic/Model/PointsOptions.vue +16 -10
  64. package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +105 -31
  65. package/app/components/Viewer/Grid/2D/CellsOptions.vue +8 -5
  66. package/app/components/Viewer/Grid/2D/EdgesOptions.vue +8 -5
  67. package/app/components/Viewer/Grid/2D/PointsOptions.vue +8 -5
  68. package/app/components/Viewer/Grid/3D/CellsOptions.vue +8 -5
  69. package/app/components/Viewer/Grid/3D/EdgesOptions.vue +8 -5
  70. package/app/components/Viewer/Grid/3D/FacetsOptions.vue +8 -5
  71. package/app/components/Viewer/Grid/3D/PointsOptions.vue +8 -5
  72. package/app/components/Viewer/ObjectTree/Base/CommonTreeView.vue +63 -37
  73. package/app/components/Viewer/ObjectTree/Base/Controls.vue +24 -9
  74. package/app/components/Viewer/ObjectTree/Base/ItemLabel.vue +25 -8
  75. package/app/components/Viewer/ObjectTree/Base/StickyHeader.vue +22 -9
  76. package/app/components/Viewer/ObjectTree/Base/TreeRow.vue +26 -11
  77. package/app/components/Viewer/ObjectTree/Box.vue +30 -15
  78. package/app/components/Viewer/ObjectTree/Layout.vue +29 -22
  79. package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +54 -28
  80. package/app/components/Viewer/ObjectTree/Views/ModelCollections.vue +76 -30
  81. package/app/components/Viewer/ObjectTree/Views/ModelComponents.vue +86 -34
  82. package/app/components/Viewer/Options/AttributeColorBar.vue +12 -6
  83. package/app/components/Viewer/Options/AttributeRangeSelector.vue +6 -4
  84. package/app/components/Viewer/Options/AttributeSelector.vue +61 -28
  85. package/app/components/Viewer/Options/ColorMapList.vue +44 -18
  86. package/app/components/Viewer/Options/ColorMapPicker.vue +12 -8
  87. package/app/components/Viewer/Options/ColorPicker.vue +20 -13
  88. package/app/components/Viewer/Options/ColoringTypeSelector.vue +77 -57
  89. package/app/components/Viewer/Options/ColormapQuickPicker.vue +10 -8
  90. package/app/components/Viewer/Options/OptionsSection.vue +6 -4
  91. package/app/components/Viewer/Options/Sliders/Size.vue +3 -3
  92. package/app/components/Viewer/Options/Sliders/Slider.vue +9 -6
  93. package/app/components/Viewer/Options/Sliders/Width.vue +3 -3
  94. package/app/components/Viewer/Options/TextureItem.vue +24 -19
  95. package/app/components/Viewer/Options/TexturesSelector.vue +23 -12
  96. package/app/components/Viewer/Options/VisibilitySwitch.vue +3 -3
  97. package/app/components/Viewer/OverlappingObjectsPicker.vue +28 -12
  98. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +41 -25
  99. package/app/components/Viewer/Solid/EdgesOptions.vue +8 -5
  100. package/app/components/Viewer/Solid/PointsOptions.vue +8 -5
  101. package/app/components/Viewer/Solid/PolygonsOptions.vue +8 -5
  102. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +66 -37
  103. package/app/components/Viewer/Surface/EdgesOptions.vue +8 -5
  104. package/app/components/Viewer/Surface/PointsOptions.vue +8 -5
  105. package/app/components/Viewer/Surface/PolygonsOptions.vue +72 -38
  106. package/app/components/Viewer/Surface/Triangulated/TrianglesOptions.vue +8 -5
  107. package/app/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue +8 -5
  108. package/app/components/Viewer/TetrahedralSolid/TrianglesOptions.vue +8 -5
  109. package/app/components/Viewer/Ui.vue +18 -13
  110. package/app/components/Wrapper.vue +18 -9
  111. package/app/components/ZScaling.vue +15 -9
  112. package/app/components/csv-preview/CsvPreviewer.vue +38 -17
  113. package/app/components/csv-preview/CsvSettings.vue +26 -48
  114. package/app/components/csv-preview/CsvTable.vue +34 -14
  115. package/app/composables/{batch_style.js → batch_style.ts} +4 -1
  116. package/app/composables/{clipping_planes_widget.js → clipping_planes_widget.ts} +105 -42
  117. package/app/composables/{global_attribute_style.js → global_attribute_style.ts} +72 -30
  118. package/app/composables/{hover_highlight.js → hover_highlight.ts} +16 -12
  119. package/app/composables/{model_collections.js → model_collections.ts} +10 -4
  120. package/app/composables/{model_components.js → model_components.ts} +10 -4
  121. package/app/composables/{project_manager.js → project_manager.ts} +1 -1
  122. package/app/composables/{responsive_middle_truncate.js → responsive_middle_truncate.ts} +15 -1
  123. package/app/composables/{run_function_when_microservices_connected.js → run_function_when_microservices_connected.ts} +1 -1
  124. package/app/composables/{stepper_tree.js → stepper_tree.ts} +10 -10
  125. package/app/composables/{tree_filter.js → tree_filter.ts} +49 -15
  126. package/app/composables/{tree_keyboard_nav.js → tree_keyboard_nav.ts} +44 -16
  127. package/app/composables/{tree_scroll.js → tree_scroll.ts} +26 -7
  128. package/app/composables/{use_adaptive_styles.js → use_adaptive_styles.ts} +39 -15
  129. package/app/composables/{use_overlapping_picker.js → use_overlapping_picker.ts} +58 -14
  130. package/app/composables/{use_quick_colormap.js → use_quick_colormap.ts} +15 -3
  131. package/app/composables/{virtual_tree.js → virtual_tree.ts} +69 -21
  132. package/app/plugins/{auto_store_register.js → auto_store_register.ts} +4 -1
  133. package/app/stores/{app.js → app.ts} +98 -37
  134. package/app/stores/{back.js → back.ts} +26 -16
  135. package/app/stores/camera_manager.ts +78 -0
  136. package/app/stores/{cloud.js → cloud.ts} +5 -4
  137. package/app/stores/{data.js → data.ts} +110 -37
  138. package/app/stores/data_helpers/collections.ts +140 -0
  139. package/app/stores/data_helpers/mesh.ts +160 -0
  140. package/app/stores/{data_style.js → data_style.ts} +39 -10
  141. package/app/stores/{feedback.js → feedback.ts} +16 -5
  142. package/app/stores/{hybrid_viewer.js → hybrid_viewer.ts} +29 -14
  143. package/app/stores/{infra.js → infra.ts} +18 -9
  144. package/app/stores/{menu.js → menu.ts} +54 -32
  145. package/app/stores/{treeview.js → treeview.ts} +108 -45
  146. package/app/stores/{viewer.js → viewer.ts} +45 -24
  147. package/app/utils/attributes.ts +40 -0
  148. package/app/utils/{clipping_planes.js → clipping_planes.ts} +30 -15
  149. package/app/utils/{colormap.js → colormap.ts} +29 -14
  150. package/app/utils/default_styles/{constants.js → constants.ts} +25 -12
  151. package/app/utils/default_styles/{index.js → index.ts} +3 -2
  152. package/app/utils/default_styles/{meshes.js → meshes.ts} +27 -48
  153. package/app/utils/default_styles/{models.js → models.ts} +25 -40
  154. package/app/utils/{extension.js → extension.ts} +27 -10
  155. package/app/utils/{import_workflow.js → import_workflow.ts} +24 -17
  156. package/app/utils/{log.js → log.ts} +12 -2
  157. package/app/utils/{name_cleaner.js → name_cleaner.ts} +5 -5
  158. package/app/utils/status.ts +19 -0
  159. package/app/utils/{stores.js → stores.ts} +5 -5
  160. package/app/utils/{string.js → string.ts} +5 -5
  161. package/app/utils/{treeview.js → treeview.ts} +4 -1
  162. package/internal/database/{base_database.js → base_database.ts} +2 -2
  163. package/internal/database/{database.js → database.ts} +30 -18
  164. package/internal/database/{extended_database.js → extended_database.ts} +5 -1
  165. package/internal/database/tables/camera_positions.ts +6 -0
  166. package/internal/database/tables/{data.js → data.ts} +3 -1
  167. package/internal/database/tables/data_style.ts +6 -0
  168. package/internal/database/tables/model_component_datastyle.ts +6 -0
  169. package/internal/database/tables/model_component_type_datastyle.ts +6 -0
  170. package/internal/database/tables/model_components.ts +6 -0
  171. package/internal/database/tables/model_components_relation.ts +6 -0
  172. package/internal/database/tables/table_definition.ts +5 -0
  173. package/internal/stores/data_style/mesh/cells/{cell.js → cell.ts} +83 -36
  174. package/internal/stores/data_style/mesh/cells/{color.js → color.ts} +2 -2
  175. package/internal/stores/data_style/mesh/cells/{common.js → common.ts} +8 -7
  176. package/internal/stores/data_style/mesh/cells/{index.js → index.ts} +5 -5
  177. package/internal/stores/data_style/mesh/cells/{textures.js → textures.ts} +3 -3
  178. package/internal/stores/data_style/mesh/cells/{vertex.js → vertex.ts} +79 -28
  179. package/internal/stores/data_style/mesh/cells/{visibility.js → visibility.ts} +3 -3
  180. package/internal/stores/data_style/mesh/edges/{color.js → color.ts} +2 -2
  181. package/internal/stores/data_style/mesh/edges/{common.js → common.ts} +7 -6
  182. package/internal/stores/data_style/mesh/edges/{edge.js → edge.ts} +81 -29
  183. package/internal/stores/data_style/mesh/edges/{index.js → index.ts} +5 -6
  184. package/internal/stores/data_style/mesh/edges/{vertex.js → vertex.ts} +81 -29
  185. package/internal/stores/data_style/mesh/edges/{visibility.js → visibility.ts} +3 -3
  186. package/internal/stores/data_style/mesh/edges/{width.js → width.ts} +3 -3
  187. package/internal/stores/data_style/mesh/{index.js → index.ts} +9 -8
  188. package/internal/stores/data_style/mesh/points/{color.js → color.ts} +2 -2
  189. package/internal/stores/data_style/mesh/points/{common.js → common.ts} +8 -7
  190. package/internal/stores/data_style/mesh/points/{index.js → index.ts} +5 -5
  191. package/internal/stores/data_style/mesh/points/{size.js → size.ts} +3 -3
  192. package/internal/stores/data_style/mesh/points/{vertex.js → vertex.ts} +79 -28
  193. package/internal/stores/data_style/mesh/points/{visibility.js → visibility.ts} +7 -5
  194. package/internal/stores/data_style/mesh/polygons/{color.js → color.ts} +2 -2
  195. package/internal/stores/data_style/mesh/polygons/{common.js → common.ts} +7 -6
  196. package/internal/stores/data_style/mesh/polygons/{index.js → index.ts} +5 -5
  197. package/internal/stores/data_style/mesh/polygons/{polygon.js → polygon.ts} +81 -29
  198. package/internal/stores/data_style/mesh/polygons/{textures.js → textures.ts} +3 -3
  199. package/internal/stores/data_style/mesh/polygons/{vertex.js → vertex.ts} +81 -29
  200. package/internal/stores/data_style/mesh/polygons/{visibility.js → visibility.ts} +3 -3
  201. package/internal/stores/data_style/mesh/polyhedra/{color.js → color.ts} +2 -2
  202. package/internal/stores/data_style/mesh/polyhedra/{common.js → common.ts} +7 -6
  203. package/internal/stores/data_style/mesh/polyhedra/{index.js → index.ts} +5 -5
  204. package/internal/stores/data_style/mesh/polyhedra/{polyhedron.js → polyhedron.ts} +86 -29
  205. package/internal/stores/data_style/mesh/polyhedra/{vertex.js → vertex.ts} +81 -29
  206. package/internal/stores/data_style/mesh/polyhedra/{visibility.js → visibility.ts} +3 -3
  207. package/internal/stores/data_style/model/blocks/{color.js → color.ts} +18 -6
  208. package/internal/stores/data_style/model/blocks/{common.js → common.ts} +9 -8
  209. package/internal/stores/data_style/model/blocks/{index.js → index.ts} +26 -11
  210. package/internal/stores/data_style/model/blocks/{polyhedron.js → polyhedron.ts} +121 -30
  211. package/internal/stores/data_style/model/blocks/{vertex.js → vertex.ts} +110 -30
  212. package/internal/stores/data_style/model/blocks/{visibility.js → visibility.ts} +6 -2
  213. package/internal/stores/data_style/model/{color.js → color.ts} +70 -28
  214. package/internal/stores/data_style/model/common.ts +216 -0
  215. package/internal/stores/data_style/model/corners/{color.js → color.ts} +18 -6
  216. package/internal/stores/data_style/model/corners/{common.js → common.ts} +9 -8
  217. package/internal/stores/data_style/model/corners/{index.js → index.ts} +24 -10
  218. package/internal/stores/data_style/model/corners/{vertex.js → vertex.ts} +115 -35
  219. package/internal/stores/data_style/model/corners/{visibility.js → visibility.ts} +6 -2
  220. package/internal/stores/data_style/model/edges/{common.js → common.ts} +4 -3
  221. package/internal/stores/data_style/model/edges/{index.js → index.ts} +0 -6
  222. package/internal/stores/data_style/model/edges/{visibility.js → visibility.ts} +4 -4
  223. package/internal/stores/data_style/model/{index.js → index.ts} +4 -4
  224. package/internal/stores/data_style/model/lines/{color.js → color.ts} +18 -6
  225. package/internal/stores/data_style/model/lines/{common.js → common.ts} +9 -8
  226. package/internal/stores/data_style/model/lines/{edge.js → edge.ts} +107 -30
  227. package/internal/stores/data_style/model/lines/{index.js → index.ts} +26 -11
  228. package/internal/stores/data_style/model/lines/{vertex.js → vertex.ts} +107 -30
  229. package/internal/stores/data_style/model/lines/{visibility.js → visibility.ts} +6 -2
  230. package/internal/stores/data_style/model/points/{common.js → common.ts} +4 -3
  231. package/internal/stores/data_style/model/points/{index.js → index.ts} +6 -3
  232. package/internal/stores/data_style/model/points/{size.js → size.ts} +3 -3
  233. package/internal/stores/data_style/model/points/{visibility.js → visibility.ts} +3 -3
  234. package/internal/stores/data_style/model/selection.ts +116 -0
  235. package/internal/stores/data_style/model/surfaces/{color.js → color.ts} +18 -6
  236. package/internal/stores/data_style/model/surfaces/{common.js → common.ts} +9 -8
  237. package/internal/stores/data_style/model/surfaces/{index.js → index.ts} +28 -11
  238. package/internal/stores/data_style/model/surfaces/{polygon.js → polygon.ts} +122 -30
  239. package/internal/stores/data_style/model/surfaces/{vertex.js → vertex.ts} +122 -30
  240. package/internal/stores/data_style/model/surfaces/{visibility.js → visibility.ts} +6 -2
  241. package/internal/stores/data_style/model/{visibility.js → visibility.ts} +38 -20
  242. package/internal/stores/data_style/state.ts +269 -0
  243. package/internal/stores/data_style/types.ts +30 -0
  244. package/internal/stores/hybrid_viewer/{brightness.js → brightness.ts} +35 -11
  245. package/internal/stores/hybrid_viewer/{camera.js → camera.ts} +90 -52
  246. package/internal/stores/hybrid_viewer/{camera_animation.js → camera_animation.ts} +27 -10
  247. package/internal/stores/hybrid_viewer/{constants.js → constants.ts} +2 -2
  248. package/internal/stores/hybrid_viewer/{filters.js → filters.ts} +9 -6
  249. package/internal/stores/hybrid_viewer/{highlight.js → highlight.ts} +81 -29
  250. package/internal/stores/hybrid_viewer/{ruler.js → ruler.ts} +38 -19
  251. package/internal/stores/hybrid_viewer/{scene.js → scene.ts} +39 -29
  252. package/internal/stores/hybrid_viewer/viewport.ts +168 -0
  253. package/internal/stores/hybrid_viewer/vtk_types.ts +74 -0
  254. package/internal/utils/api_fetch.ts +102 -0
  255. package/internal/utils/upload_file.ts +94 -0
  256. package/internal/utils/viewer_call.ts +90 -0
  257. package/internal/utils/ws_client.ts +43 -0
  258. package/{nuxt.config.js → nuxt.config.ts} +6 -1
  259. package/opengeodeweb_front_schemas.js +175 -0
  260. package/package.json +32 -8
  261. package/server/api/cloud/extensions/{run.post.js → run.post.ts} +17 -9
  262. package/server/api/local/app/{project_folder_path.post.js → project_folder_path.post.ts} +7 -3
  263. package/server/api/local/app/{run_back.post.js → run_back.post.ts} +12 -4
  264. package/server/api/local/app/{run_viewer.post.js → run_viewer.post.ts} +12 -4
  265. package/server/api/local/extensions/{kill.post.js → kill.post.ts} +12 -6
  266. package/server/api/local/extensions/{run.post.js → run.post.ts} +17 -9
  267. package/server/api/local/extensions/{upload.put.js → upload.put.ts} +13 -4
  268. package/server/api/microservice/app/{get_is_app_ready.get.js → get_is_app_ready.get.ts} +4 -3
  269. package/server/api/microservice/app/{set_app_base_url.post.js → set_app_base_url.post.ts} +9 -4
  270. package/server/api/microservice/app/{set_back_base_url.post.js → set_back_base_url.post.ts} +9 -4
  271. package/server/api/microservice/app/{set_is_app_ready.post.js → set_is_app_ready.post.ts} +9 -4
  272. package/server/api/microservice/app/{set_viewer_base_url.post.js → set_viewer_base_url.post.ts} +9 -4
  273. package/server/api/microservice/extensions/{download.post.js → download.post.ts} +9 -3
  274. package/server/api/serverless/{run_cloud.post.js → run_cloud.post.ts} +13 -7
  275. package/server/types/vendor.d.ts +64 -0
  276. package/server/utils/app_config.js +34 -64
  277. package/server/utils/app_config.ts +96 -0
  278. package/server/utils/cleanup.js +97 -148
  279. package/server/utils/cleanup.ts +189 -0
  280. package/server/utils/cloud.js +103 -148
  281. package/server/utils/cloud.ts +219 -0
  282. package/server/utils/{extension.js → extension.ts} +17 -4
  283. package/server/utils/microservices.js +126 -159
  284. package/server/utils/microservices.ts +206 -0
  285. package/server/utils/path.js +88 -134
  286. package/server/utils/path.ts +173 -0
  287. package/server/utils/scripts.js +116 -164
  288. package/server/utils/scripts.ts +195 -0
  289. package/server/utils/server.js +34 -50
  290. package/server/utils/server.ts +67 -0
  291. package/server/utils/server_config.js +23 -38
  292. package/server/utils/server_config.ts +60 -0
  293. package/server/utils/ws_client.js +81 -106
  294. package/server/utils/ws_client.ts +134 -0
  295. package/shared/app_mode.js +5 -4
  296. package/shared/app_mode.ts +7 -0
  297. package/shared/scripts.js +37 -32
  298. package/shared/scripts.ts +44 -0
  299. package/shared/utils/call_raw.js +25 -41
  300. package/shared/utils/call_raw.ts +66 -0
  301. package/shared/utils/call_schema.js +24 -41
  302. package/shared/utils/call_schema.ts +57 -0
  303. package/shared/utils/fetch_raw.js +36 -57
  304. package/shared/utils/fetch_raw.ts +85 -0
  305. package/shared/utils/fetch_schema.js +27 -44
  306. package/shared/utils/fetch_schema.ts +61 -0
  307. package/shared/utils/file.js +6 -10
  308. package/shared/utils/file.ts +16 -0
  309. package/shared/utils/parse_boolean.js +20 -13
  310. package/shared/utils/parse_boolean.ts +16 -0
  311. package/shared/utils/response_handlers/load.js +39 -66
  312. package/shared/utils/response_handlers/load.ts +94 -0
  313. package/shared/utils/types.js +1 -0
  314. package/shared/utils/types.ts +27 -0
  315. package/shared/utils/validate_schema.js +13 -9
  316. package/shared/utils/validate_schema.ts +15 -0
  317. package/.github/workflows/config.json +0 -5
  318. package/.github/workflows/deploy.yml +0 -15
  319. package/.github/workflows/manual_release.yml +0 -11
  320. package/.github/workflows/merge_request.yml +0 -9
  321. package/.github/workflows/pr_update.yml +0 -11
  322. package/.github/workflows/prepare_deploy.yml +0 -9
  323. package/.github/workflows/schedule.yml +0 -18
  324. package/.github/workflows/test.yml +0 -14
  325. package/.github/workflows/test_pr.yml +0 -12
  326. package/.oxlintrc.json +0 -150
  327. package/.releaserc +0 -11
  328. package/app/stores/camera_manager.js +0 -57
  329. package/app/stores/data_helpers/collections.js +0 -96
  330. package/app/stores/data_helpers/mesh.js +0 -122
  331. package/app/utils/attributes.js +0 -23
  332. package/app/utils/status.js +0 -10
  333. package/commitlint.config.js +0 -20
  334. package/internal/database/tables/camera_positions.js +0 -4
  335. package/internal/database/tables/data_style.js +0 -4
  336. package/internal/database/tables/model_component_datastyle.js +0 -4
  337. package/internal/database/tables/model_component_type_datastyle.js +0 -4
  338. package/internal/database/tables/model_components.js +0 -4
  339. package/internal/database/tables/model_components_relation.js +0 -4
  340. package/internal/stores/data_style/model/common.js +0 -141
  341. package/internal/stores/data_style/model/selection.js +0 -89
  342. package/internal/stores/data_style/state.js +0 -197
  343. package/internal/stores/hybrid_viewer/viewport.js +0 -140
  344. package/internal/utils/api_fetch.js +0 -52
  345. package/internal/utils/upload_file.js +0 -57
  346. package/internal/utils/viewer_call.js +0 -49
  347. package/internal/utils/ws_client.js +0 -29
  348. package/scripts/generate_geode_objects.js +0 -24
  349. package/tests/integration/data/uploads/test.og_brep +0 -0
  350. package/tests/integration/data/uploads/test.og_edc2d +0 -0
  351. package/tests/integration/data/uploads/test.og_edc3d +0 -0
  352. package/tests/integration/data/uploads/test.og_psf3d +0 -0
  353. package/tests/integration/data/uploads/test.og_rgd2d +0 -0
  354. package/tests/integration/data/uploads/test.og_rgd3d +0 -0
  355. package/tests/integration/data/uploads/test.vtu +0 -22
  356. package/tests/integration/setup.js +0 -92
  357. package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +0 -343
  358. package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +0 -254
  359. package/tests/integration/stores/data_style/mesh/index.nuxt.test.js +0 -62
  360. package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +0 -201
  361. package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +0 -260
  362. package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +0 -267
  363. package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +0 -397
  364. package/tests/integration/stores/data_style/model/corners.nuxt.test.js +0 -264
  365. package/tests/integration/stores/data_style/model/edges.nuxt.test.js +0 -71
  366. package/tests/integration/stores/data_style/model/index.nuxt.test.js +0 -92
  367. package/tests/integration/stores/data_style/model/lines.nuxt.test.js +0 -379
  368. package/tests/integration/stores/data_style/model/points.nuxt.test.js +0 -95
  369. package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +0 -574
  370. package/tests/integration/stores/viewer.nuxt.test.js +0 -69
  371. package/tests/setup_indexeddb.js +0 -4
  372. package/tests/unit/components/CrsSelector.nuxt.test.js +0 -55
  373. package/tests/unit/components/DragAndDrop.nuxt.test.js +0 -89
  374. package/tests/unit/components/ExtensionSelector.nuxt.test.js +0 -65
  375. package/tests/unit/components/FeedBack/ErrorsBanner.nuxt.test.js +0 -41
  376. package/tests/unit/components/FeedBack/Snackers.nuxt.test.js +0 -49
  377. package/tests/unit/components/FileSelector.nuxt.test.js +0 -124
  378. package/tests/unit/components/FileUploader.nuxt.test.js +0 -69
  379. package/tests/unit/components/MissingFilesSelector.nuxt.test.js +0 -77
  380. package/tests/unit/components/ObjectSelector.nuxt.test.js +0 -118
  381. package/tests/unit/components/PackagesVersions.nuxt.test.js +0 -42
  382. package/tests/unit/components/Step.nuxt.test.js +0 -51
  383. package/tests/unit/components/Stepper.nuxt.test.js +0 -41
  384. package/tests/unit/components/ToolPanel.nuxt.test.js +0 -66
  385. package/tests/unit/composables/api_fetch.nuxt.test.js +0 -75
  386. package/tests/unit/composables/project_manager.nuxt.test.js +0 -299
  387. package/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js +0 -57
  388. package/tests/unit/composables/upload_file.nuxt.test.js +0 -45
  389. package/tests/unit/composables/virtual_tree.nuxt.test.js +0 -63
  390. package/tests/unit/plugins/project_load.nuxt.test.js +0 -98
  391. package/tests/unit/stores/app.nuxt.test.js +0 -189
  392. package/tests/unit/stores/back.nuxt.test.js +0 -147
  393. package/tests/unit/stores/cloud.nuxt.test.js +0 -90
  394. package/tests/unit/stores/data.nuxt.test.js +0 -162
  395. package/tests/unit/stores/feedback.nuxt.test.js +0 -90
  396. package/tests/unit/stores/infra.nuxt.test.js +0 -313
  397. package/tests/unit/stores/treeview.nuxt.test.js +0 -63
  398. package/tests/unit/stores/viewer.nuxt.test.js +0 -161
  399. package/tests/unit/utils/validate_schema.nuxt.test.js +0 -38
  400. package/tests/utils.js +0 -20
  401. package/tests/vitest.config.js +0 -67
  402. /package/server/api/local/app/{kill.post.js → kill.post.ts} +0 -0
@@ -1,22 +1,35 @@
1
- <script setup>
2
- import GlassCard from "@ogw_front/components/GlassCard";
1
+ <script setup lang="ts">
2
+ import GlassCard from "@ogw_front/components/GlassCard.vue";
3
3
 
4
- const { isDragging, loading, texts, accept, showExtensions } = defineProps({
5
- isDragging: { type: Boolean, required: true },
6
- loading: { type: Boolean, required: true },
7
- texts: {
8
- type: Object,
9
- default: () => ({
10
- idle: "Click or drag and drop",
11
- drop: "Drop files here",
12
- loading: "Loading...",
13
- }),
4
+ interface DragAndDropTexts {
5
+ idle: string;
6
+ drop: string;
7
+ loading: string;
8
+ }
9
+
10
+ interface Props {
11
+ isDragging: boolean;
12
+ loading: boolean;
13
+ texts?: DragAndDropTexts;
14
+ accept?: string | string[];
15
+ showExtensions: boolean;
16
+ }
17
+
18
+ const {
19
+ isDragging,
20
+ loading,
21
+ texts = {
22
+ idle: "Click or drag and drop",
23
+ drop: "Drop files here",
24
+ loading: "Loading...",
14
25
  },
15
- accept: { type: [String, Array], default: "" },
16
- showExtensions: { type: Boolean, required: true },
17
- });
26
+ accept = "",
27
+ showExtensions,
28
+ } = defineProps<Props>();
18
29
 
19
- const emit = defineEmits(["click"]);
30
+ const emit = defineEmits<{
31
+ click: [];
32
+ }>();
20
33
  </script>
21
34
 
22
35
  <template>
@@ -1,22 +1,35 @@
1
- <script setup>
2
- const { isDragging, showOverlay, fullscreen, loading, texts, multiple, accept, showExtensions } =
3
- defineProps({
4
- isDragging: { type: Boolean, required: true },
5
- showOverlay: { type: Boolean, required: true },
6
- fullscreen: { type: Boolean, required: true },
7
- loading: { type: Boolean, required: true },
8
- texts: {
9
- type: Object,
10
- default: () => ({
11
- idle: "Click or drag and drop",
12
- drop: "Drop files here",
13
- loading: "Loading...",
14
- }),
15
- },
16
- multiple: { type: Boolean, required: true },
17
- accept: { type: [String, Array], default: "" },
18
- showExtensions: { type: Boolean, required: true },
19
- });
1
+ <script setup lang="ts">
2
+ interface DragAndDropTexts {
3
+ idle: string;
4
+ drop: string;
5
+ loading: string;
6
+ }
7
+
8
+ interface Props {
9
+ isDragging: boolean;
10
+ showOverlay: boolean;
11
+ fullscreen: boolean;
12
+ loading: boolean;
13
+ texts?: DragAndDropTexts;
14
+ multiple: boolean;
15
+ accept?: string | string[];
16
+ showExtensions: boolean;
17
+ }
18
+
19
+ const {
20
+ isDragging,
21
+ showOverlay,
22
+ fullscreen,
23
+ loading,
24
+ texts = {
25
+ idle: "Click or drag and drop",
26
+ drop: "Drop files here",
27
+ loading: "Loading...",
28
+ },
29
+ multiple,
30
+ accept = "",
31
+ showExtensions,
32
+ } = defineProps<Props>();
20
33
  </script>
21
34
 
22
35
  <template>
@@ -1,17 +1,25 @@
1
- <script setup>
1
+ <script setup lang="ts">
2
2
  import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json";
3
3
 
4
- import FetchingData from "@ogw_front/components/FetchingData";
4
+ import FetchingData from "@ogw_front/components/FetchingData.vue";
5
5
  import { useBackStore } from "@ogw_front/stores/back";
6
6
 
7
7
  const schema = schemas.opengeodeweb_back.geode_objects_and_output_extensions;
8
- const emit = defineEmits(["update_values", "increment_step", "decrement_step"]);
8
+ const emit = defineEmits<{
9
+ update_values: [values: { output_geode_object: string; output_extension: string }];
10
+ increment_step: [];
11
+ decrement_step: [];
12
+ }>();
9
13
 
10
- const { geodeObjectType, filenames } = defineProps({
11
- geodeObjectType: { type: String, required: true },
12
- filenames: { type: Array, required: true },
13
- });
14
- const geode_objects_and_output_extensions = ref({});
14
+ interface Props {
15
+ geodeObjectType: string;
16
+ filenames: string[];
17
+ }
18
+
19
+ const { geodeObjectType, filenames } = defineProps<Props>();
20
+ type OutputExtensions = Record<string, { is_saveable: boolean }>;
21
+
22
+ const geode_objects_and_output_extensions = ref<Record<string, OutputExtensions>>({});
15
23
  const loading = ref(false);
16
24
 
17
25
  const toggle_loading = useToggle(loading);
@@ -20,22 +28,30 @@ async function get_output_file_extensions() {
20
28
  toggle_loading();
21
29
  geode_objects_and_output_extensions.value = {};
22
30
  const backStore = useBackStore();
23
- const values = await Promise.all(
24
- filenames.map(async (filename) => {
31
+ const values: Record<string, OutputExtensions>[] = await Promise.all(
32
+ filenames.map(async (filename): Promise<Record<string, OutputExtensions>> => {
25
33
  const params = { geode_object_type: geodeObjectType, filename };
26
34
  const response = await backStore.request({ schema, params });
27
- return response.geode_objects_and_output_extensions;
35
+ return (
36
+ response as {
37
+ geode_objects_and_output_extensions: Record<string, OutputExtensions>;
38
+ }
39
+ ).geode_objects_and_output_extensions;
28
40
  }),
29
41
  );
30
42
  const all_keys = [...new Set(values.flatMap((value) => Object.keys(value)))];
31
43
  const common_keys = all_keys.filter((i) => !values.some((j) => !Object.keys(j).includes(i)));
32
- const final_object = {};
44
+ const final_object: Record<string, OutputExtensions> = {};
33
45
  for (const key of common_keys) {
34
46
  final_object[key] = {};
35
47
  for (const value of values) {
36
- for (const extension of Object.keys(value[key])) {
48
+ const extensions = value[key];
49
+ if (!extensions) {
50
+ continue;
51
+ }
52
+ for (const extension of Object.keys(extensions)) {
37
53
  final_object[key][extension] = {
38
- is_saveable: value[key][extension].is_saveable,
54
+ is_saveable: extensions[extension]!.is_saveable,
39
55
  };
40
56
  }
41
57
  }
@@ -44,7 +60,7 @@ async function get_output_file_extensions() {
44
60
  toggle_loading();
45
61
  }
46
62
 
47
- function update_values(output_geode_object, output_extension) {
63
+ function update_values(output_geode_object: string, output_extension: string) {
48
64
  if (output_geode_object !== "" && output_extension !== "") {
49
65
  emit("update_values", {
50
66
  output_geode_object,
@@ -67,7 +83,7 @@ await get_output_file_extensions();
67
83
  class="justify-left"
68
84
  >
69
85
  <v-card class="card ma-2 pa-2" width="100%">
70
- <v-card-title v-tooltip:bottom="`Export as a ${output_geode_object}`" v-bind="props">
86
+ <v-card-title v-tooltip:bottom="`Export as a ${output_geode_object}`">
71
87
  {{ output_geode_object }}
72
88
  </v-card-title>
73
89
  <v-card-text>
@@ -1,4 +1,4 @@
1
- <script setup>
1
+ <script setup lang="ts">
2
2
  import { useFeedbackStore } from "@ogw_front/stores/feedback";
3
3
 
4
4
  const feedbackStore = useFeedbackStore();
@@ -18,7 +18,6 @@ function reload() {
18
18
  <v-row>
19
19
  <v-col cols="auto" class="text-white text-center">
20
20
  <v-icon
21
- v-bind="props"
22
21
  color="white"
23
22
  class="justify-right"
24
23
  v-tooltip:bottom="'We turn off our server automatically after 5 minutes of inactivity'"
@@ -1,4 +1,4 @@
1
- <script setup>
1
+ <script setup lang="ts">
2
2
  import { useFeedbackStore } from "@ogw_front/stores/feedback";
3
3
 
4
4
  const MARGIN_BETWEEN_SNACKERS = 60;
@@ -7,7 +7,7 @@ const FIRST_SNACKER_MARGIN = 8;
7
7
  const feedbackStore = useFeedbackStore();
8
8
  const show = ref(true);
9
9
 
10
- function calc_margin(index) {
10
+ function calc_margin(index: number) {
11
11
  return `${index * MARGIN_BETWEEN_SNACKERS + FIRST_SNACKER_MARGIN}px`;
12
12
  }
13
13
  </script>
@@ -15,7 +15,7 @@ function calc_margin(index) {
15
15
  <template>
16
16
  <v-snackbar
17
17
  v-for="(feedback, index) in feedbackStore.feedbacks"
18
- :key="feedback"
18
+ :key="feedback.id"
19
19
  v-model="show"
20
20
  :style="{ 'margin-bottom': calc_margin(index) }"
21
21
  :color="feedback.type"
@@ -1,22 +1,18 @@
1
- <script setup>
1
+ <script setup lang="ts">
2
2
  const DEFAULT_SIZE = 22;
3
3
  const DEFAULT_WIDTH = 3;
4
4
 
5
+ interface Props {
6
+ text?: string;
7
+ size?: number | string;
8
+ width?: number | string;
9
+ }
10
+
5
11
  const {
6
12
  text = "Fetching data...",
7
13
  size = DEFAULT_SIZE,
8
14
  width = DEFAULT_WIDTH,
9
- } = defineProps({
10
- text: {
11
- type: String,
12
- },
13
- size: {
14
- type: [Number, String],
15
- },
16
- width: {
17
- type: [Number, String],
18
- },
19
- });
15
+ } = defineProps<Props>();
20
16
  </script>
21
17
 
22
18
  <template>
@@ -1,20 +1,26 @@
1
- <script setup>
1
+ <script setup lang="ts">
2
2
  import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json";
3
3
 
4
- import FetchingData from "@ogw_front/components/FetchingData";
5
- import FileUploader from "@ogw_front/components/FileUploader";
4
+ import FetchingData from "@ogw_front/components/FetchingData.vue";
5
+ import FileUploader from "@ogw_front/components/FileUploader.vue";
6
6
  import { useBackStore } from "@ogw_front/stores/back";
7
7
 
8
8
  const schema = schemas.opengeodeweb_back.allowed_files;
9
9
 
10
- const emit = defineEmits(["update_values", "increment_step", "decrement_step"]);
10
+ const emit = defineEmits<{
11
+ update_values: [values: { files: unknown[]; autoUpload: boolean }];
12
+ increment_step: [];
13
+ decrement_step: [];
14
+ }>();
11
15
 
12
- const { multiple, files, autoUpload, showOverlay } = defineProps({
13
- multiple: { type: Boolean, required: true },
14
- files: { type: Array, default: () => [] },
15
- autoUpload: { type: Boolean, default: true },
16
- showOverlay: { type: Boolean, default: true },
17
- });
16
+ interface Props {
17
+ multiple: boolean;
18
+ files?: File[];
19
+ autoUpload?: boolean;
20
+ showOverlay?: boolean;
21
+ }
22
+
23
+ const { multiple, files = [], autoUpload = true, showOverlay = true } = defineProps<Props>();
18
24
 
19
25
  const internal_files = ref(files);
20
26
  const internal_auto_upload = ref(autoUpload);
@@ -37,7 +43,7 @@ watch(
37
43
 
38
44
  const toggle_loading = useToggle(loading);
39
45
 
40
- function files_uploaded_event(value) {
46
+ function files_uploaded_event(value: unknown[]) {
41
47
  if (value.length > 0) {
42
48
  emit("update_values", { files: value, autoUpload: false });
43
49
  emit("increment_step");
@@ -47,7 +53,9 @@ function files_uploaded_event(value) {
47
53
  async function get_allowed_files() {
48
54
  toggle_loading();
49
55
  const backStore = useBackStore();
50
- const response = await backStore.request({ schema });
56
+ const response = (await backStore.request({ schema })) as {
57
+ extensions: string[];
58
+ };
51
59
  accept.value = response.extensions.map((extension) => `.${extension}`).join(",");
52
60
  toggle_loading();
53
61
  }
@@ -1,46 +1,64 @@
1
- <script setup>
1
+ <script setup lang="ts">
2
2
  import { useBackStore } from "@ogw_front/stores/back";
3
3
 
4
- import CsvPreviewer from "@ogw_front/components/csv-preview/CsvPreviewer";
5
- import DragAndDrop from "@ogw_front/components/DragAndDrop";
4
+ import CsvPreviewer from "@ogw_front/components/csv-preview/CsvPreviewer.vue";
5
+ import DragAndDrop from "@ogw_front/components/DragAndDrop.vue";
6
6
 
7
- const emit = defineEmits(["files_uploaded", "decrement_step", "reset_values"]);
7
+ // Files carry extra app-specific bookkeeping fields once picked up here.
8
+ type UploadFile = File & { isConfigured?: boolean; displayName?: string };
8
9
 
9
- const { multiple, accept, files, autoUpload, showOverlay, mini } = defineProps({
10
- multiple: { type: Boolean, default: false },
11
- accept: { type: [String, Array], default: "" },
12
- files: { type: Array, default: () => [] },
13
- autoUpload: { type: Boolean, default: true },
14
- showOverlay: { type: Boolean, default: false },
15
- mini: { type: Boolean, default: false },
16
- });
10
+ const emit = defineEmits<{
11
+ files_uploaded: [files: UploadFile[]];
12
+ decrement_step: [];
13
+ reset_values: [];
14
+ }>();
15
+
16
+ interface Props {
17
+ multiple?: boolean;
18
+ accept?: string | string[];
19
+ files?: UploadFile[];
20
+ autoUpload?: boolean;
21
+ showOverlay?: boolean;
22
+ mini?: boolean;
23
+ }
24
+
25
+ const {
26
+ multiple = false,
27
+ accept = "",
28
+ files = [],
29
+ autoUpload = true,
30
+ showOverlay = false,
31
+ mini = false,
32
+ } = defineProps<Props>();
17
33
 
18
34
  const backStore = useBackStore();
19
35
  const internal_files = ref(files);
20
36
  const dragAndDropRef = useTemplateRef("dragAndDropRef");
21
37
  const csv_dialog = ref(false);
22
- const current_csv_file = ref(undefined);
38
+ const current_csv_file = ref<UploadFile | undefined>(undefined);
23
39
  const current_csv_index = ref(-1);
24
40
  const loading = ref(false);
25
41
  const files_uploaded = ref(false);
26
42
  const toggle_loading = useToggle(loading);
27
43
 
28
- function isCsv(file) {
44
+ function isCsv(file: UploadFile) {
29
45
  return file.name.toLowerCase().endsWith(".csv");
30
46
  }
31
47
 
32
- function openCsvPreviewer(file, index) {
48
+ function openCsvPreviewer(file: UploadFile, index: number) {
33
49
  current_csv_file.value = file;
34
50
  current_csv_index.value = index;
35
51
  csv_dialog.value = true;
36
52
  }
37
53
 
38
- async function onCsvConfirm(result) {
54
+ async function onCsvConfirm(result: unknown) {
55
+ // Only reachable while the CsvPreviewer dialog (gated on current_csv_file) is open.
56
+ const currentFile = current_csv_file.value;
57
+ if (!currentFile) {
58
+ return;
59
+ }
39
60
  const json_content = JSON.stringify(result, undefined, 2);
40
- const base_name = current_csv_file.value.name.slice(
41
- 0,
42
- current_csv_file.value.name.lastIndexOf("."),
43
- );
61
+ const base_name = currentFile.name.slice(0, currentFile.name.lastIndexOf("."));
44
62
  const json_filename = `${base_name}.json`;
45
63
 
46
64
  const blob = new Blob([json_content], { type: "application/json" });
@@ -48,21 +66,24 @@ async function onCsvConfirm(result) {
48
66
  type: "application/json",
49
67
  });
50
68
 
51
- current_csv_file.value.isConfigured = true;
69
+ currentFile.isConfigured = true;
52
70
  await backStore.upload(json_file);
53
71
  internal_files.value = [...internal_files.value];
54
72
  csv_dialog.value = false;
55
73
  }
56
74
 
57
- function processSelectedFiles(selected_files) {
75
+ function processSelectedFiles(selected_files: UploadFile[]) {
58
76
  if (multiple) {
59
77
  internal_files.value = [...internal_files.value, ...selected_files];
60
78
  } else {
61
- internal_files.value = [selected_files[0]];
79
+ const [firstFile] = selected_files;
80
+ if (firstFile) {
81
+ internal_files.value = [firstFile];
82
+ }
62
83
  }
63
84
  }
64
85
 
65
- function removeFile(index) {
86
+ function removeFile(index: number) {
66
87
  internal_files.value.splice(index, 1);
67
88
  if (internal_files.value.length === 0) {
68
89
  files_uploaded.value = false;
@@ -1,18 +1,22 @@
1
- <script setup>
1
+ <script setup lang="ts">
2
2
  import { computed, useAttrs } from "vue";
3
3
  import { onKeyStroke } from "@vueuse/core";
4
4
 
5
- const { variant, rounded, padding, theme, escapeFunction } = defineProps({
6
- variant: {
7
- type: String,
8
- default: "panel",
9
- validator: (valid) => ["panel", "ui"].includes(valid),
10
- },
11
- rounded: { type: String, default: "xl" },
12
- padding: { type: String, default: "pa-6" },
13
- theme: { type: String, default: undefined },
14
- escapeFunction: { type: Function, default: undefined },
15
- });
5
+ interface Props {
6
+ variant?: "panel" | "ui";
7
+ rounded?: string;
8
+ padding?: string;
9
+ theme?: string;
10
+ escapeFunction?: () => void;
11
+ }
12
+
13
+ const {
14
+ variant = "panel",
15
+ rounded = "xl",
16
+ padding = "pa-6",
17
+ theme = undefined,
18
+ escapeFunction = undefined,
19
+ } = defineProps<Props>();
16
20
 
17
21
  const attrs = useAttrs();
18
22
  const isInteractive = computed(() => Boolean(attrs.onClick));
@@ -1,7 +1,7 @@
1
- <script setup>
1
+ <script setup lang="ts">
2
2
  import ColormapQuickPicker from "@ogw_front/components/Viewer/Options/ColormapQuickPicker.vue";
3
- import HybridViewerTooltip from "@ogw_front/components/HybridViewerTooltip";
4
- import ViewToolbar from "@ogw_front/components/ViewToolbar";
3
+ import HybridViewerTooltip from "@ogw_front/components/HybridViewerTooltip.vue";
4
+ import ViewToolbar from "@ogw_front/components/ViewToolbar.vue";
5
5
 
6
6
  import { useDataStore } from "@ogw_front/stores/data";
7
7
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
@@ -11,7 +11,9 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
11
11
 
12
12
  const DEFAULT_ELEMENT_HEIGHT = 100;
13
13
 
14
- const emit = defineEmits(["click"]);
14
+ const emit = defineEmits<{
15
+ click: [event: PointerEvent];
16
+ }>();
15
17
 
16
18
  const container = useTemplateRef("viewer");
17
19
  const hybridViewerStore = useHybridViewerStore();
@@ -22,9 +24,9 @@ const dataStore = useDataStore();
22
24
  const { width: elementWidth, height: elementHeight } = useElementSize(container);
23
25
  const { width: windowWidth, height: windowHeight } = useWindowSize();
24
26
 
25
- function debounce(func, wait) {
26
- let timeout = undefined;
27
- return function executedFunction(...args) {
27
+ function debounce<Callback extends (...args: unknown[]) => void>(func: Callback, wait: number) {
28
+ let timeout: ReturnType<typeof setTimeout> | undefined = undefined;
29
+ return function executedFunction(...args: Parameters<Callback>) {
28
30
  function later() {
29
31
  clearTimeout(timeout);
30
32
  func(...args);
@@ -46,17 +48,26 @@ onMounted(async () => {
46
48
  if (import.meta.client) {
47
49
  await hybridViewerStore.initHybridViewer();
48
50
  await nextTick();
49
- hybridViewerStore.setContainer(container);
51
+ // UseTemplateRef's inferred type is broader than the { $el: HTMLElement } shape
52
+ // SetContainer expects; this element is only ever a component instance with $el
53
+ // (see the `containerEl.$el` usages below).
54
+ hybridViewerStore.setContainer(container as never);
50
55
  debouncedResize();
51
56
  }
52
57
  });
53
58
 
54
59
  const { pickColormap, quickColormap } = useQuickColormap();
55
60
 
56
- async function handleClick(event) {
61
+ async function handleClick(event: PointerEvent) {
57
62
  const { offsetX, offsetY, clientX, clientY } = event;
63
+ // Only ever fired from the pointerup handler bound to this same element.
64
+ const containerEl = container.value;
65
+ if (!containerEl) {
66
+ return;
67
+ }
68
+
58
69
  if (hybridViewerStore.is_ruler_active) {
59
- const rect = container.value.$el.getBoundingClientRect();
70
+ const rect = containerEl.$el.getBoundingClientRect();
60
71
  const x = event.clientX - rect.left;
61
72
  const y = elementHeight.value - (event.clientY - rect.top);
62
73
  await hybridViewerStore.handleRulerClick(x, y);
@@ -64,7 +75,7 @@ async function handleClick(event) {
64
75
  }
65
76
 
66
77
  if (viewerStore.picking_mode) {
67
- const rect = container.value.$el.getBoundingClientRect();
78
+ const rect = containerEl.$el.getBoundingClientRect();
68
79
  const x = event.clientX - rect.left;
69
80
  const y = elementHeight.value - (event.clientY - rect.top);
70
81
  await viewerStore.set_picked_point(x, y);
@@ -1,19 +1,15 @@
1
- <script setup>
2
- import GlassCard from "@ogw_front/components/GlassCard";
1
+ <script setup lang="ts">
2
+ import GlassCard from "@ogw_front/components/GlassCard.vue";
3
3
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
4
4
 
5
5
  const TOOLTIP_SCREEN_MARGIN = 10;
6
6
 
7
- const { containerWidth, containerHeight } = defineProps({
8
- containerWidth: {
9
- type: Number,
10
- required: true,
11
- },
12
- containerHeight: {
13
- type: Number,
14
- required: true,
15
- },
16
- });
7
+ interface Props {
8
+ containerWidth: number;
9
+ containerHeight: number;
10
+ }
11
+
12
+ const { containerWidth, containerHeight } = defineProps<Props>();
17
13
 
18
14
  const hybridViewerStore = useHybridViewerStore();
19
15
 
@@ -86,7 +82,7 @@ const sortedAttributes = computed(() => {
86
82
  );
87
83
  });
88
84
 
89
- function capitalize(val) {
85
+ function capitalize(val: string) {
90
86
  if (!val) {
91
87
  return "";
92
88
  }
@@ -94,7 +90,17 @@ function capitalize(val) {
94
90
  return spaced.charAt(0).toUpperCase() + spaced.slice(1);
95
91
  }
96
92
 
97
- function formatAttributeValue(val) {
93
+ const fieldTypeLabel = computed(() => {
94
+ const fieldType = hybridViewerStore.hoverData?.fieldType;
95
+ return typeof fieldType === "string" ? capitalize(fieldType.toLowerCase()) : "";
96
+ });
97
+
98
+ const coordinates = computed<number[] | undefined>(() => {
99
+ const value = hybridViewerStore.hoverData?.attributes.coordinates;
100
+ return Array.isArray(value) ? (value as number[]) : undefined;
101
+ });
102
+
103
+ function formatAttributeValue(val: unknown) {
98
104
  if (Array.isArray(val)) {
99
105
  const formattedValues = val.map((value) => {
100
106
  if (typeof value === "number") {
@@ -134,7 +140,7 @@ function formatAttributeValue(val) {
134
140
  hybridViewerStore.hoverData.component?.id ||
135
141
  hybridViewerStore.hoverData.blockName ||
136
142
  hybridViewerStore.hoverData.modelName ||
137
- `${capitalize(hybridViewerStore.hoverData.fieldType.toLowerCase())} #${hybridViewerStore.hoverData.pickedId}`
143
+ `${fieldTypeLabel} #${hybridViewerStore.hoverData.pickedId}`
138
144
  }}
139
145
  </span>
140
146
  </v-col>
@@ -160,15 +166,11 @@ function formatAttributeValue(val) {
160
166
  <template v-if="hasOtherAttributes">
161
167
  <v-divider class="my-2" opacity="0.15" />
162
168
  <v-row no-gutters class="flex-column ga-1">
163
- <v-col
164
- v-if="hybridViewerStore.hoverData.attributes.coordinates"
165
- class="d-flex justify-space-between ga-3"
166
- >
169
+ <v-col v-if="coordinates" class="d-flex justify-space-between ga-3">
167
170
  <span class="tooltip-label">Position:</span>
168
171
  <span class="tooltip-value font-mono">
169
- [ {{ Number(hybridViewerStore.hoverData.attributes.coordinates[0]).toFixed(3) }},
170
- {{ Number(hybridViewerStore.hoverData.attributes.coordinates[1]).toFixed(3) }},
171
- {{ Number(hybridViewerStore.hoverData.attributes.coordinates[2]).toFixed(3) }} ]
172
+ [ {{ Number(coordinates[0]).toFixed(3) }}, {{ Number(coordinates[1]).toFixed(3) }},
173
+ {{ Number(coordinates[2]).toFixed(3) }} ]
172
174
  </span>
173
175
  </v-col>
174
176
  <template v-for="[name, val] in sortedAttributes" :key="name">
@@ -1,4 +1,4 @@
1
- <script setup>
1
+ <script setup lang="ts">
2
2
  import { useInfraStore } from "@ogw_front/stores/infra";
3
3
 
4
4
  const infraStore = useInfraStore();
@@ -1,16 +1,18 @@
1
- <script setup>
2
- import Loading from "@ogw_front/components/Loading";
3
- import Recaptcha from "@ogw_front/components/Recaptcha";
1
+ <script setup lang="ts">
2
+ import Loading from "@ogw_front/components/Loading.vue";
3
+ import Recaptcha from "@ogw_front/components/Recaptcha.vue";
4
4
  import { Status } from "@ogw_front/utils/status";
5
5
  import { appMode } from "@ogw_shared/app_mode";
6
6
  import { useInfraStore } from "@ogw_front/stores/infra";
7
7
 
8
- const { appName, email, isUserAuthenticated, logo } = defineProps({
9
- appName: { type: String, required: true },
10
- email: { type: String, default: undefined },
11
- isUserAuthenticated: { type: Boolean, default: false },
12
- logo: { type: String, required: false, default: "" },
13
- });
8
+ interface Props {
9
+ appName: string;
10
+ email?: string;
11
+ isUserAuthenticated?: boolean;
12
+ logo?: string;
13
+ }
14
+
15
+ const { appName, email = undefined, isUserAuthenticated = false, logo = "" } = defineProps<Props>();
14
16
 
15
17
  const infraStore = useInfraStore();
16
18
  if (infraStore.app_mode !== appMode.CLOUD) {