@jupytergis/base 0.15.0 → 0.16.0-alpha.1

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 (414) hide show
  1. package/lib/commands/BaseCommandIDs.d.ts +5 -0
  2. package/lib/commands/BaseCommandIDs.js +5 -0
  3. package/lib/commands/index.js +218 -48
  4. package/lib/commands/operationCommands.js +2 -2
  5. package/lib/constants.js +9 -1
  6. package/lib/{panelview/annotationPanel.js → features/annotations/AnnotationsPanel.js} +1 -1
  7. package/lib/{annotations → features/annotations}/index.d.ts +1 -0
  8. package/lib/{annotations → features/annotations}/index.js +1 -0
  9. package/lib/{console → features/console}/consoleview.js +1 -1
  10. package/lib/{panelview/filter-panel → features/filter}/Filter.js +4 -4
  11. package/lib/{panelview/filter-panel → features/filter}/FilterRow.d.ts +3 -2
  12. package/lib/{panelview/filter-panel → features/filter}/FilterRow.js +2 -1
  13. package/lib/{panelview/identify-panel → features/identify}/IdentifyPanel.d.ts +2 -0
  14. package/lib/features/identify/IdentifyPanel.js +102 -0
  15. package/lib/features/identify/components/FeatureCard.d.ts +17 -0
  16. package/lib/features/identify/components/FeatureCard.js +26 -0
  17. package/lib/features/identify/components/FeatureCardHeader.d.ts +11 -0
  18. package/lib/features/identify/components/FeatureCardHeader.js +30 -0
  19. package/lib/features/identify/components/FeatureFloater.d.ts +7 -0
  20. package/lib/features/identify/components/FeatureFloater.js +19 -0
  21. package/lib/features/identify/components/FeaturePropertyList.d.ts +11 -0
  22. package/lib/features/identify/components/FeaturePropertyList.js +18 -0
  23. package/lib/features/identify/components/FeatureRow.d.ts +13 -0
  24. package/lib/features/identify/components/FeatureRow.js +25 -0
  25. package/lib/features/identify/components/PropertyEditors.d.ts +44 -0
  26. package/lib/features/identify/components/PropertyEditors.js +56 -0
  27. package/lib/features/identify/hooks/useIdentifyPropertyEditor.d.ts +11 -0
  28. package/lib/features/identify/hooks/useIdentifyPropertyEditor.js +132 -0
  29. package/lib/features/identify/types/editorTypes.d.ts +21 -0
  30. package/lib/features/identify/utils/getFeatureIdentifier.d.ts +5 -0
  31. package/lib/features/identify/utils/getFeatureIdentifier.js +14 -0
  32. package/lib/features/identify/utils/highlightLayer.d.ts +11 -0
  33. package/lib/features/identify/utils/highlightLayer.js +57 -0
  34. package/lib/features/identify/utils/highlightStyle.d.ts +7 -0
  35. package/lib/features/identify/utils/highlightStyle.js +40 -0
  36. package/lib/{dialogs/layerBrowserDialog.js → features/layer-browser/index.js} +2 -2
  37. package/lib/{formbuilder/objectform/layer/heatmapLayerForm.d.ts → features/layers/forms/layer/geoTiffLayerForm.d.ts} +1 -1
  38. package/lib/{formbuilder/objectform/layer/webGlLayerForm.js → features/layers/forms/layer/geoTiffLayerForm.js} +5 -5
  39. package/lib/{formbuilder/objectform → features/layers/forms}/layer/hillshadeLayerForm.js +4 -4
  40. package/lib/{formbuilder/objectform → features/layers/forms}/layer/index.d.ts +1 -2
  41. package/lib/{formbuilder/objectform → features/layers/forms}/layer/index.js +1 -2
  42. package/lib/{formbuilder/objectform → features/layers/forms}/layer/layerform.d.ts +1 -1
  43. package/lib/{formbuilder/objectform → features/layers/forms}/layer/layerform.js +4 -4
  44. package/lib/features/layers/forms/layer/storySegmentLayerForm.js +150 -0
  45. package/lib/{formbuilder/objectform → features/layers/forms}/layer/vectorlayerform.js +4 -4
  46. package/lib/{formbuilder/objectform → features/layers/forms}/source/geojsonsource.js +5 -5
  47. package/lib/features/layers/forms/source/geopackagesource.d.ts +3 -0
  48. package/lib/features/layers/forms/source/geopackagesource.js +93 -0
  49. package/lib/{formbuilder/objectform → features/layers/forms}/source/geotiffsource.js +5 -5
  50. package/lib/{formbuilder/objectform → features/layers/forms}/source/index.d.ts +1 -0
  51. package/lib/{formbuilder/objectform → features/layers/forms}/source/index.js +1 -0
  52. package/lib/{formbuilder/objectform → features/layers/forms}/source/pathbasedsource.js +5 -5
  53. package/lib/{formbuilder/objectform → features/layers/forms}/source/sourceform.d.ts +1 -1
  54. package/lib/{formbuilder/objectform → features/layers/forms}/source/sourceform.js +4 -4
  55. package/lib/{formbuilder/objectform → features/layers/forms}/source/tilesourceform.js +4 -4
  56. package/lib/{formbuilder/objectform → features/layers/forms}/source/wmsTileSource.d.ts +1 -1
  57. package/lib/{formbuilder/objectform → features/layers/forms}/source/wmsTileSource.js +6 -6
  58. package/lib/{dialogs → features/layers}/layerCreationFormDialog.d.ts +1 -1
  59. package/lib/{dialogs → features/layers}/layerCreationFormDialog.js +1 -1
  60. package/lib/features/layers/symbology/Grammar.d.ts +11 -0
  61. package/lib/features/layers/symbology/Grammar.js +316 -0
  62. package/lib/{dialogs → features/layers}/symbology/classificationModes.d.ts +6 -6
  63. package/lib/{dialogs → features/layers}/symbology/classificationModes.js +48 -44
  64. package/lib/{dialogs → features/layers}/symbology/colorRampUtils.d.ts +1 -0
  65. package/lib/{dialogs → features/layers}/symbology/colorRampUtils.js +12 -1
  66. package/lib/features/layers/symbology/components/MappingRow.d.ts +40 -0
  67. package/lib/features/layers/symbology/components/MappingRow.js +520 -0
  68. package/lib/features/layers/symbology/components/NumericInput.d.ts +20 -0
  69. package/lib/features/layers/symbology/components/NumericInput.js +44 -0
  70. package/lib/features/layers/symbology/components/ScaleEditor.d.ts +33 -0
  71. package/lib/features/layers/symbology/components/ScaleEditor.js +221 -0
  72. package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ColorRampControls.d.ts +1 -1
  73. package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ColorRampControls.js +4 -3
  74. package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ColorRampSelector.d.ts +2 -1
  75. package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ColorRampSelector.js +6 -1
  76. package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ModeSelectRow.d.ts +1 -1
  77. package/lib/{dialogs → features/layers}/symbology/components/color_ramp/RgbaColorPicker.js +39 -9
  78. package/lib/{dialogs → features/layers}/symbology/components/color_stops/StopContainer.js +1 -1
  79. package/lib/{dialogs → features/layers}/symbology/components/color_stops/StopRow.d.ts +1 -1
  80. package/lib/{dialogs → features/layers}/symbology/components/color_stops/StopRow.js +14 -2
  81. package/lib/features/layers/symbology/grammarToOLLayer.d.ts +27 -0
  82. package/lib/features/layers/symbology/grammarToOLLayer.js +145 -0
  83. package/lib/features/layers/symbology/grammarToOLStyle.d.ts +32 -0
  84. package/lib/features/layers/symbology/grammarToOLStyle.js +487 -0
  85. package/lib/{dialogs → features/layers}/symbology/hooks/useGetBandInfo.d.ts +1 -1
  86. package/lib/{dialogs → features/layers}/symbology/hooks/useGetBandInfo.js +1 -1
  87. package/lib/{dialogs → features/layers}/symbology/hooks/useGetProperties.js +1 -1
  88. package/lib/{dialogs → features/layers}/symbology/hooks/useGetSymbology.js +4 -2
  89. package/lib/features/layers/symbology/styleBuilder.d.ts +24 -0
  90. package/lib/features/layers/symbology/styleBuilder.js +158 -0
  91. package/lib/{dialogs → features/layers}/symbology/symbologyDialog.d.ts +1 -1
  92. package/lib/{dialogs → features/layers}/symbology/symbologyDialog.js +11 -13
  93. package/lib/{dialogs → features/layers}/symbology/symbologyUtils.d.ts +18 -10
  94. package/lib/{dialogs → features/layers}/symbology/symbologyUtils.js +0 -84
  95. package/lib/{panelview/objectproperties.d.ts → features/objectproperties/index.d.ts} +1 -1
  96. package/lib/{panelview/objectproperties.js → features/objectproperties/index.js} +5 -10
  97. package/lib/{dialogs → features/processing}/ProcessingFormDialog.d.ts +1 -1
  98. package/lib/{dialogs → features/processing}/ProcessingFormDialog.js +28 -14
  99. package/lib/features/processing/forms/MapExtentToggle.d.ts +13 -0
  100. package/lib/features/processing/forms/MapExtentToggle.js +20 -0
  101. package/lib/features/processing/forms/clipRasterByExtentForm.d.ts +10 -0
  102. package/lib/features/processing/forms/clipRasterByExtentForm.js +99 -0
  103. package/lib/{formbuilder/objectform/process → features/processing/forms}/dissolveProcessForm.js +5 -5
  104. package/lib/{formbuilder/objectform → features/processing/forms}/processingForm.d.ts +1 -1
  105. package/lib/{formbuilder/objectform → features/processing/forms}/processingForm.js +6 -6
  106. package/lib/features/processing/forms/rasterizeForm.d.ts +10 -0
  107. package/lib/features/processing/forms/rasterizeForm.js +75 -0
  108. package/lib/features/processing/forms/useMapExtent.d.ts +22 -0
  109. package/lib/features/processing/forms/useMapExtent.js +57 -0
  110. package/lib/{processing → features/processing}/index.d.ts +19 -2
  111. package/lib/features/processing/index.js +1246 -0
  112. package/lib/{processing → features/processing}/processingCommands.d.ts +1 -1
  113. package/lib/features/processing/processingCommands.js +168 -0
  114. package/lib/features/processing/serverProcessing.d.ts +51 -0
  115. package/lib/features/processing/serverProcessing.js +99 -0
  116. package/lib/{stacBrowser → features/stac-browser}/components/StacPanel.js +2 -2
  117. package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/QueryableComboBox.js +5 -5
  118. package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/QueryableRow.js +1 -1
  119. package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/StacFilterExtensionPanel.js +2 -2
  120. package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/StacQueryableFilters.js +1 -1
  121. package/lib/{stacBrowser → features/stac-browser}/components/geodes/StacFilterSection.js +3 -3
  122. package/lib/{stacBrowser → features/stac-browser}/components/shared/StacPanelResults.js +3 -3
  123. package/lib/{stacBrowser → features/stac-browser}/components/shared/StacSpatialExtent.js +1 -1
  124. package/lib/{stacBrowser → features/stac-browser}/components/shared/StacTemporalExtent.js +1 -1
  125. package/lib/{stacBrowser → features/stac-browser}/context/StacResultsContext.js +2 -2
  126. package/lib/{stacBrowser → features/stac-browser}/hooks/useGeodesSearch.js +2 -2
  127. package/lib/{stacBrowser → features/stac-browser}/hooks/useStacFilterExtension.js +3 -3
  128. package/lib/{stacBrowser → features/stac-browser}/hooks/useStacSearch.js +1 -1
  129. package/lib/features/stac-browser/types/types.js +1 -0
  130. package/lib/{panelview/story-maps → features/story}/SpectaPanel.d.ts +4 -1
  131. package/lib/{panelview/story-maps → features/story}/SpectaPanel.js +3 -4
  132. package/lib/{panelview/story-maps → features/story}/StoryEditorPanel.js +1 -1
  133. package/lib/{panelview/story-maps → features/story}/StoryViewerPanel.d.ts +12 -11
  134. package/lib/features/story/StoryViewerPanel.js +64 -0
  135. package/lib/features/story/__tests__/fixtures/listStoryTestItems.d.ts +9 -0
  136. package/lib/features/story/__tests__/fixtures/listStoryTestItems.js +21 -0
  137. package/lib/features/story/components/ListStoryMapOverlayPanel.d.ts +10 -0
  138. package/lib/features/story/components/ListStoryMapOverlayPanel.js +11 -0
  139. package/lib/features/story/components/ListStoryMarkdownMeasurePane.d.ts +11 -0
  140. package/lib/features/story/components/ListStoryMarkdownMeasurePane.js +55 -0
  141. package/lib/features/story/components/ListStoryOverlayMarkdown.d.ts +15 -0
  142. package/lib/features/story/components/ListStoryOverlayMarkdown.js +93 -0
  143. package/lib/features/story/components/ListStoryStageOverlay.d.ts +11 -0
  144. package/lib/features/story/components/ListStoryStageOverlay.js +150 -0
  145. package/lib/features/story/components/ListStoryTitleBar.d.ts +7 -0
  146. package/lib/features/story/components/ListStoryTitleBar.js +20 -0
  147. package/lib/features/story/components/ListStoryTitleBarDesktop.d.ts +2 -0
  148. package/lib/features/story/components/ListStoryTitleBarDesktop.js +55 -0
  149. package/lib/features/story/components/ListStoryTitleBarMobile.d.ts +2 -0
  150. package/lib/features/story/components/ListStoryTitleBarMobile.js +41 -0
  151. package/lib/features/story/components/ListStoryVirtualScrollTrack.d.ts +6 -0
  152. package/lib/features/story/components/ListStoryVirtualScrollTrack.js +7 -0
  153. package/lib/{panelview/story-maps → features/story}/components/SpectaDesktopView.d.ts +4 -2
  154. package/lib/features/story/components/SpectaDesktopView.js +67 -0
  155. package/lib/features/story/components/SpectaMobileListModeContent.d.ts +13 -0
  156. package/lib/features/story/components/SpectaMobileListModeContent.js +36 -0
  157. package/lib/features/story/components/SpectaMobileSingleModeContent.d.ts +14 -0
  158. package/lib/{panelview/story-maps/components/SpectaMobileView.js → features/story/components/SpectaMobileSingleModeContent.js} +4 -6
  159. package/lib/{panelview/story-maps → features/story}/components/SpectaMobileView.d.ts +5 -3
  160. package/lib/features/story/components/SpectaMobileView.js +12 -0
  161. package/lib/features/story/components/SpectaSingleModeContent.d.ts +18 -0
  162. package/lib/features/story/components/SpectaSingleModeContent.js +8 -0
  163. package/lib/features/story/context/ListStoryScrollTrackContext.d.ts +19 -0
  164. package/lib/features/story/context/ListStoryScrollTrackContext.js +186 -0
  165. package/lib/features/story/hooks/useCurrentSegmentIndex.d.ts +3 -0
  166. package/lib/features/story/hooks/useCurrentSegmentIndex.js +17 -0
  167. package/lib/features/story/hooks/useListStoryScroll.d.ts +15 -0
  168. package/lib/features/story/hooks/useListStoryScroll.js +107 -0
  169. package/lib/features/story/hooks/useQueuedMarkdownHeightMeasure.d.ts +19 -0
  170. package/lib/features/story/hooks/useQueuedMarkdownHeightMeasure.js +56 -0
  171. package/lib/features/story/hooks/useStoryImagePreload.d.ts +1 -0
  172. package/lib/features/story/hooks/useStoryImagePreload.js +24 -0
  173. package/lib/{panelview/story-maps → features/story}/hooks/useStoryMap.d.ts +2 -7
  174. package/lib/{panelview/story-maps → features/story}/hooks/useStoryMap.js +21 -60
  175. package/lib/features/story/hooks/useStoryScrollState.d.ts +21 -0
  176. package/lib/features/story/hooks/useStoryScrollState.js +39 -0
  177. package/lib/features/story/hooks/useStorySegmentSync.d.ts +8 -0
  178. package/lib/features/story/hooks/useStorySegmentSync.js +51 -0
  179. package/lib/features/story/types/types.d.ts +43 -0
  180. package/lib/features/story/types/types.js +1 -0
  181. package/lib/features/story/utils/computeListStoryScrollState.d.ts +14 -0
  182. package/lib/features/story/utils/computeListStoryScrollState.js +79 -0
  183. package/lib/features/story/utils/listStoryMeasureQueue.d.ts +11 -0
  184. package/lib/features/story/utils/listStoryMeasureQueue.js +14 -0
  185. package/lib/features/story/utils/listStoryScrollTrack.d.ts +17 -0
  186. package/lib/features/story/utils/listStoryScrollTrack.js +72 -0
  187. package/lib/features/story/utils/spectaPresentation.d.ts +9 -0
  188. package/lib/features/story/utils/spectaPresentation.js +37 -0
  189. package/lib/features/story/utils/storySegmentViewItems.d.ts +5 -0
  190. package/lib/features/story/utils/storySegmentViewItems.js +30 -0
  191. package/lib/index.d.ts +11 -9
  192. package/lib/index.js +11 -9
  193. package/lib/keybindings.json +5 -0
  194. package/lib/mainview/OpenEOTileLayer.d.ts +49 -0
  195. package/lib/mainview/OpenEOTileLayer.js +179 -0
  196. package/lib/mainview/TemporalSlider.js +11 -9
  197. package/lib/mainview/components/MainViewMapSurface.d.ts +15 -0
  198. package/lib/mainview/components/MainViewMapSurface.js +13 -0
  199. package/lib/mainview/components/MainViewOverlayLayer.d.ts +9 -0
  200. package/lib/mainview/components/MainViewOverlayLayer.js +11 -0
  201. package/lib/mainview/components/MainViewSidePanels.d.ts +17 -0
  202. package/lib/mainview/components/MainViewSidePanels.js +10 -0
  203. package/lib/mainview/components/MainViewSpectaPanel.d.ts +17 -0
  204. package/lib/mainview/components/MainViewSpectaPanel.js +8 -0
  205. package/lib/mainview/components/MainViewStoryStage.d.ts +13 -0
  206. package/lib/mainview/components/MainViewStoryStage.js +17 -0
  207. package/lib/mainview/components/PositionedFloater.d.ts +10 -0
  208. package/lib/mainview/components/PositionedFloater.js +7 -0
  209. package/lib/mainview/geoJsonFeaturePatch.d.ts +9 -0
  210. package/lib/mainview/geoJsonFeaturePatch.js +43 -0
  211. package/lib/mainview/mainView.d.ts +93 -14
  212. package/lib/mainview/mainView.js +1216 -686
  213. package/lib/mainview/mainviewwidget.d.ts +5 -1
  214. package/lib/mainview/mainviewwidget.js +4 -2
  215. package/lib/shared/components/Button.d.ts +1 -1
  216. package/lib/shared/components/DropdownMenu.d.ts +1 -0
  217. package/lib/shared/components/DropdownMenu.js +3 -2
  218. package/lib/shared/components/NativeSelect.d.ts +8 -0
  219. package/lib/shared/components/NativeSelect.js +29 -0
  220. package/lib/shared/components/Tabs.d.ts +3 -3
  221. package/lib/shared/components/Tabs.js +5 -5
  222. package/lib/{formbuilder → shared/formbuilder}/creationform.js +71 -4
  223. package/lib/{formbuilder → shared/formbuilder}/editform.js +1 -1
  224. package/lib/{formbuilder → shared/formbuilder}/formselectors.d.ts +2 -2
  225. package/lib/{formbuilder → shared/formbuilder}/formselectors.js +10 -7
  226. package/lib/shared/formbuilder/index.d.ts +4 -0
  227. package/lib/shared/formbuilder/index.js +4 -0
  228. package/lib/{formbuilder → shared/formbuilder}/objectform/SchemaForm.d.ts +1 -1
  229. package/lib/{formbuilder → shared/formbuilder}/objectform/StoryEditorForm.d.ts +1 -1
  230. package/lib/{formbuilder → shared/formbuilder}/objectform/StoryEditorForm.js +1 -1
  231. package/lib/{formbuilder → shared/formbuilder}/objectform/components/LayerSelect.js +1 -1
  232. package/lib/{formbuilder → shared/formbuilder}/objectform/components/SegmentFormSymbology.js +4 -4
  233. package/lib/{formbuilder → shared/formbuilder}/objectform/components/SourcePropertiesField.js +1 -1
  234. package/lib/{formbuilder → shared/formbuilder}/objectform/components/StorySegmentReset.js +1 -1
  235. package/lib/{formbuilder → shared/formbuilder}/objectform/components/WmsTileSourceUrlInput.js +4 -4
  236. package/lib/{formbuilder → shared/formbuilder}/objectform/fileselectorwidget.js +8 -1
  237. package/lib/{formbuilder → shared/formbuilder}/objectform/schemaUtils.d.ts +3 -1
  238. package/lib/{formbuilder → shared/formbuilder}/objectform/schemaUtils.js +11 -0
  239. package/lib/{formbuilder → shared/formbuilder}/objectform/useSchemaFormState.d.ts +1 -1
  240. package/lib/{formbuilder → shared/formbuilder}/objectform/useSchemaFormState.js +1 -1
  241. package/lib/{icons.d.ts → shared/icons.d.ts} +2 -0
  242. package/lib/{icons.js → shared/icons.js} +28 -18
  243. package/lib/tools.d.ts +2 -0
  244. package/lib/tools.js +138 -4
  245. package/lib/types.d.ts +6 -1
  246. package/lib/types.js +6 -2
  247. package/lib/{menus.js → workspace/menus.js} +10 -2
  248. package/lib/workspace/panels/components/TabbedPanel.d.ts +17 -0
  249. package/lib/workspace/panels/components/TabbedPanel.js +19 -0
  250. package/lib/{panelview → workspace/panels}/components/layers.js +63 -18
  251. package/lib/workspace/panels/components/legendItem.js +680 -0
  252. package/lib/workspace/panels/hooks/useLayerTree.d.ts +19 -0
  253. package/lib/workspace/panels/hooks/useLayerTree.js +103 -0
  254. package/lib/workspace/panels/hooks/useRightPanelOptions.d.ts +27 -0
  255. package/lib/workspace/panels/hooks/useRightPanelOptions.js +72 -0
  256. package/lib/workspace/panels/hooks/useUIState.d.ts +2 -0
  257. package/lib/workspace/panels/hooks/useUIState.js +25 -0
  258. package/lib/{panelview → workspace/panels}/index.d.ts +1 -1
  259. package/lib/{panelview → workspace/panels}/index.js +1 -1
  260. package/lib/{panelview → workspace/panels}/leftpanel.d.ts +1 -1
  261. package/lib/workspace/panels/leftpanel.js +70 -0
  262. package/lib/{panelview/rightpanel.d.ts → workspace/panels/mergedpanel.d.ts} +6 -5
  263. package/lib/workspace/panels/mergedpanel.js +166 -0
  264. package/lib/workspace/panels/rightpanel.d.ts +25 -0
  265. package/lib/{panelview → workspace/panels}/rightpanel.js +53 -63
  266. package/lib/{statusbar → workspace/statusbar}/StatusBar.js +5 -4
  267. package/lib/{toolbar → workspace/toolbar}/widget.d.ts +2 -0
  268. package/lib/{toolbar → workspace/toolbar}/widget.js +33 -5
  269. package/lib/{widget.d.ts → workspace/widget.d.ts} +7 -5
  270. package/lib/{widget.js → workspace/widget.js} +16 -7
  271. package/package.json +16 -4
  272. package/style/base.css +124 -2
  273. package/style/icons/geopackage.svg +95 -0
  274. package/style/icons/pencil_solid.svg +7 -0
  275. package/style/identify.css +95 -0
  276. package/style/layerBrowser.css +29 -1
  277. package/style/leftPanel.css +25 -0
  278. package/style/shared/button.css +12 -0
  279. package/style/shared/dropdownMenu.css +9 -0
  280. package/style/shared/nativeSelect.css +75 -0
  281. package/style/shared/tabs.css +1 -1
  282. package/style/spectaProgressBar.css +0 -1
  283. package/style/storyPanel.css +330 -9
  284. package/style/storySpectaArticleOverlay.css +129 -0
  285. package/style/symbologyDialog.css +522 -27
  286. package/lib/dialogs/symbology/tiff_layer/TiffRendering.d.ts +0 -4
  287. package/lib/dialogs/symbology/tiff_layer/TiffRendering.js +0 -42
  288. package/lib/dialogs/symbology/tiff_layer/components/BandRow.d.ts +0 -23
  289. package/lib/dialogs/symbology/tiff_layer/components/BandRow.js +0 -59
  290. package/lib/dialogs/symbology/tiff_layer/types/MultibandColor.d.ts +0 -4
  291. package/lib/dialogs/symbology/tiff_layer/types/MultibandColor.js +0 -92
  292. package/lib/dialogs/symbology/tiff_layer/types/SingleBandPseudoColor.d.ts +0 -5
  293. package/lib/dialogs/symbology/tiff_layer/types/SingleBandPseudoColor.js +0 -313
  294. package/lib/dialogs/symbology/vector_layer/VectorRendering.d.ts +0 -4
  295. package/lib/dialogs/symbology/vector_layer/VectorRendering.js +0 -112
  296. package/lib/dialogs/symbology/vector_layer/components/ValueSelect.d.ts +0 -8
  297. package/lib/dialogs/symbology/vector_layer/components/ValueSelect.js +0 -9
  298. package/lib/dialogs/symbology/vector_layer/types/Canonical.d.ts +0 -4
  299. package/lib/dialogs/symbology/vector_layer/types/Canonical.js +0 -130
  300. package/lib/dialogs/symbology/vector_layer/types/Categorized.d.ts +0 -4
  301. package/lib/dialogs/symbology/vector_layer/types/Categorized.js +0 -243
  302. package/lib/dialogs/symbology/vector_layer/types/Graduated.d.ts +0 -4
  303. package/lib/dialogs/symbology/vector_layer/types/Graduated.js +0 -362
  304. package/lib/dialogs/symbology/vector_layer/types/Heatmap.d.ts +0 -4
  305. package/lib/dialogs/symbology/vector_layer/types/Heatmap.js +0 -89
  306. package/lib/dialogs/symbology/vector_layer/types/SimpleSymbol.d.ts +0 -4
  307. package/lib/dialogs/symbology/vector_layer/types/SimpleSymbol.js +0 -120
  308. package/lib/formbuilder/index.d.ts +0 -4
  309. package/lib/formbuilder/index.js +0 -4
  310. package/lib/formbuilder/objectform/layer/heatmapLayerForm.js +0 -96
  311. package/lib/formbuilder/objectform/layer/storySegmentLayerForm.js +0 -95
  312. package/lib/formbuilder/objectform/layer/webGlLayerForm.d.ts +0 -3
  313. package/lib/formbuilder/objectform/process/index.d.ts +0 -1
  314. package/lib/formbuilder/objectform/process/index.js +0 -1
  315. package/lib/panelview/components/legendItem.js +0 -210
  316. package/lib/panelview/identify-panel/IdentifyPanel.js +0 -102
  317. package/lib/panelview/leftpanel.js +0 -139
  318. package/lib/panelview/story-maps/StoryViewerPanel.js +0 -116
  319. package/lib/panelview/story-maps/components/SpectaDesktopView.js +0 -49
  320. package/lib/processing/index.js +0 -200
  321. package/lib/processing/processingCommands.js +0 -67
  322. /package/lib/{panelview/annotationPanel.d.ts → features/annotations/AnnotationsPanel.d.ts} +0 -0
  323. /package/lib/{annotations → features/annotations}/components/Annotation.d.ts +0 -0
  324. /package/lib/{annotations → features/annotations}/components/Annotation.js +0 -0
  325. /package/lib/{annotations → features/annotations}/components/AnnotationFloater.d.ts +0 -0
  326. /package/lib/{annotations → features/annotations}/components/AnnotationFloater.js +0 -0
  327. /package/lib/{annotations → features/annotations}/components/Message.d.ts +0 -0
  328. /package/lib/{annotations → features/annotations}/components/Message.js +0 -0
  329. /package/lib/{annotations → features/annotations}/model.d.ts +0 -0
  330. /package/lib/{annotations → features/annotations}/model.js +0 -0
  331. /package/lib/{console → features/console}/consoleview.d.ts +0 -0
  332. /package/lib/{console → features/console}/index.d.ts +0 -0
  333. /package/lib/{console → features/console}/index.js +0 -0
  334. /package/lib/{panelview/filter-panel → features/filter}/Filter.d.ts +0 -0
  335. /package/lib/{stacBrowser/types/types.js → features/identify/types/editorTypes.js} +0 -0
  336. /package/lib/{dialogs/layerBrowserDialog.d.ts → features/layer-browser/index.d.ts} +0 -0
  337. /package/lib/{formbuilder/objectform → features/layers/forms}/layer/hillshadeLayerForm.d.ts +0 -0
  338. /package/lib/{formbuilder/objectform → features/layers/forms}/layer/storySegmentLayerForm.d.ts +0 -0
  339. /package/lib/{formbuilder/objectform → features/layers/forms}/layer/vectorlayerform.d.ts +0 -0
  340. /package/lib/{formbuilder/objectform → features/layers/forms}/source/geojsonsource.d.ts +0 -0
  341. /package/lib/{formbuilder/objectform → features/layers/forms}/source/geotiffsource.d.ts +0 -0
  342. /package/lib/{formbuilder/objectform → features/layers/forms}/source/pathbasedsource.d.ts +0 -0
  343. /package/lib/{formbuilder/objectform → features/layers/forms}/source/tilesourceform.d.ts +0 -0
  344. /package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ColorRampSelectorEntry.d.ts +0 -0
  345. /package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ColorRampSelectorEntry.js +0 -0
  346. /package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ModeSelectRow.js +0 -0
  347. /package/lib/{dialogs → features/layers}/symbology/components/color_ramp/RgbaColorPicker.d.ts +0 -0
  348. /package/lib/{dialogs → features/layers}/symbology/components/color_ramp/cmocean.json +0 -0
  349. /package/lib/{dialogs → features/layers}/symbology/components/color_stops/StopContainer.d.ts +0 -0
  350. /package/lib/{dialogs → features/layers}/symbology/hooks/useEffectiveSymbologyParams.d.ts +0 -0
  351. /package/lib/{dialogs → features/layers}/symbology/hooks/useEffectiveSymbologyParams.js +0 -0
  352. /package/lib/{dialogs → features/layers}/symbology/hooks/useGetProperties.d.ts +0 -0
  353. /package/lib/{dialogs → features/layers}/symbology/hooks/useGetSymbology.d.ts +0 -0
  354. /package/lib/{dialogs → features/layers}/symbology/hooks/useOkSignal.d.ts +0 -0
  355. /package/lib/{dialogs → features/layers}/symbology/hooks/useOkSignal.js +0 -0
  356. /package/lib/{formbuilder/objectform/process → features/processing/forms}/dissolveProcessForm.d.ts +0 -0
  357. /package/lib/{processing → features/processing}/processingFormToParam.d.ts +0 -0
  358. /package/lib/{processing → features/processing}/processingFormToParam.js +0 -0
  359. /package/lib/{stacBrowser → features/stac-browser}/components/StacPanel.d.ts +0 -0
  360. /package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/QueryableComboBox.d.ts +0 -0
  361. /package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/QueryableRow.d.ts +0 -0
  362. /package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/StacFilterExtensionPanel.d.ts +0 -0
  363. /package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/StacQueryableFilters.d.ts +0 -0
  364. /package/lib/{stacBrowser → features/stac-browser}/components/geodes/StacFilterSection.d.ts +0 -0
  365. /package/lib/{stacBrowser → features/stac-browser}/components/geodes/StacGeodesFilterPanel.d.ts +0 -0
  366. /package/lib/{stacBrowser → features/stac-browser}/components/geodes/StacGeodesFilterPanel.js +0 -0
  367. /package/lib/{stacBrowser → features/stac-browser}/components/shared/StacPanelResults.d.ts +0 -0
  368. /package/lib/{stacBrowser → features/stac-browser}/components/shared/StacSpatialExtent.d.ts +0 -0
  369. /package/lib/{stacBrowser → features/stac-browser}/components/shared/StacTemporalExtent.d.ts +0 -0
  370. /package/lib/{stacBrowser → features/stac-browser}/constants.d.ts +0 -0
  371. /package/lib/{stacBrowser → features/stac-browser}/constants.js +0 -0
  372. /package/lib/{stacBrowser → features/stac-browser}/context/StacResultsContext.d.ts +0 -0
  373. /package/lib/{stacBrowser → features/stac-browser}/hooks/useGeodesSearch.d.ts +0 -0
  374. /package/lib/{stacBrowser → features/stac-browser}/hooks/useStacFilterExtension.d.ts +0 -0
  375. /package/lib/{stacBrowser → features/stac-browser}/hooks/useStacSearch.d.ts +0 -0
  376. /package/lib/{stacBrowser → features/stac-browser}/index.d.ts +0 -0
  377. /package/lib/{stacBrowser → features/stac-browser}/index.js +0 -0
  378. /package/lib/{stacBrowser → features/stac-browser}/types/types.d.ts +0 -0
  379. /package/lib/{panelview/story-maps → features/story}/StoryEditorPanel.d.ts +0 -0
  380. /package/lib/{panelview/story-maps → features/story}/components/PreviewModeSwitch.d.ts +0 -0
  381. /package/lib/{panelview/story-maps → features/story}/components/PreviewModeSwitch.js +0 -0
  382. /package/lib/{panelview/story-maps → features/story}/components/StoryContentSection.d.ts +0 -0
  383. /package/lib/{panelview/story-maps → features/story}/components/StoryContentSection.js +0 -0
  384. /package/lib/{panelview/story-maps → features/story}/components/StoryImageSection.d.ts +0 -0
  385. /package/lib/{panelview/story-maps → features/story}/components/StoryImageSection.js +0 -0
  386. /package/lib/{panelview/story-maps → features/story}/components/StoryNavBar.d.ts +0 -0
  387. /package/lib/{panelview/story-maps → features/story}/components/StoryNavBar.js +0 -0
  388. /package/lib/{panelview/story-maps → features/story}/components/StorySubtitleSection.d.ts +0 -0
  389. /package/lib/{panelview/story-maps → features/story}/components/StorySubtitleSection.js +0 -0
  390. /package/lib/{panelview/story-maps → features/story}/components/StoryTitleSection.d.ts +0 -0
  391. /package/lib/{panelview/story-maps → features/story}/components/StoryTitleSection.js +0 -0
  392. /package/lib/{formbuilder → shared/formbuilder}/creationform.d.ts +0 -0
  393. /package/lib/{formbuilder → shared/formbuilder}/editform.d.ts +0 -0
  394. /package/lib/{formbuilder → shared/formbuilder}/objectform/SchemaForm.js +0 -0
  395. /package/lib/{formbuilder → shared/formbuilder}/objectform/components/LayerSelect.d.ts +0 -0
  396. /package/lib/{formbuilder → shared/formbuilder}/objectform/components/OpacitySlider.d.ts +0 -0
  397. /package/lib/{formbuilder → shared/formbuilder}/objectform/components/OpacitySlider.js +0 -0
  398. /package/lib/{formbuilder → shared/formbuilder}/objectform/components/SegmentFormSymbology.d.ts +0 -0
  399. /package/lib/{formbuilder → shared/formbuilder}/objectform/components/SourcePropertiesField.d.ts +0 -0
  400. /package/lib/{formbuilder → shared/formbuilder}/objectform/components/StorySegmentReset.d.ts +0 -0
  401. /package/lib/{formbuilder → shared/formbuilder}/objectform/components/WmsTileSourceUrlInput.d.ts +0 -0
  402. /package/lib/{formbuilder → shared/formbuilder}/objectform/fileselectorwidget.d.ts +0 -0
  403. /package/lib/{store.d.ts → shared/store.d.ts} +0 -0
  404. /package/lib/{store.js → shared/store.js} +0 -0
  405. /package/lib/{menus.d.ts → workspace/menus.d.ts} +0 -0
  406. /package/lib/{panelview → workspace/panels}/components/layers.d.ts +0 -0
  407. /package/lib/{panelview → workspace/panels}/components/legendItem.d.ts +0 -0
  408. /package/lib/{panelview → workspace/panels}/header.d.ts +0 -0
  409. /package/lib/{panelview → workspace/panels}/header.js +0 -0
  410. /package/lib/{statusbar → workspace/statusbar}/SpectaPresentationProgressBar.d.ts +0 -0
  411. /package/lib/{statusbar → workspace/statusbar}/SpectaPresentationProgressBar.js +0 -0
  412. /package/lib/{statusbar → workspace/statusbar}/StatusBar.d.ts +0 -0
  413. /package/lib/{toolbar → workspace/toolbar}/index.d.ts +0 -0
  414. /package/lib/{toolbar → workspace/toolbar}/index.js +0 -0
@@ -0,0 +1,487 @@
1
+ /**
2
+ * Grammar → OL FlatStyle compiler.
3
+ *
4
+ * grammarToOLStyle(state) compiles an IGrammarSymbologyState into an OL
5
+ * FlatStyle object ready to be applied to a VectorLayer or VectorTileLayer.
6
+ *
7
+ * Compilation steps:
8
+ * 1. Expand rules into per-channel entries (guard + expression).
9
+ * 2. Build a case expression per channel (conditional entries first,
10
+ * last unconditional entry as the else branch).
11
+ * 3. Assemble sub-channels (fill-red/green/blue/alpha) into a composite
12
+ * fill-color ['array', r, g, b, a] expression.
13
+ */
14
+ import { computeCategorizedColorStops, computeGraduatedColorStops, STOP_NULL, STOP_UNDEFINED, } from './styleBuilder';
15
+ // '$density' is the pseudo-field produced by a kde transform (KDE density raster).
16
+ // Encoding rules referencing it are compiled only when a kde transform is present;
17
+ // the actual OL HeatmapLayer instantiation happens outside this compiler.
18
+ export const DENSITY_FIELD = '$density';
19
+ // ---------------------------------------------------------------------------
20
+ // Field expression helpers
21
+ // ---------------------------------------------------------------------------
22
+ /**
23
+ * Convert a field name to an OL expression.
24
+ * $band-N (raster pseudo-fields) → ['band', N]
25
+ * everything else → ['get', field]
26
+ */
27
+ function fieldExpr(field) {
28
+ const m = field.match(/^\$band-(\d+)$/);
29
+ if (m) {
30
+ return ['band', parseInt(m[1], 10)];
31
+ }
32
+ return ['get', field];
33
+ }
34
+ /** Band pseudo-fields always exist; vector feature properties may not. */
35
+ function fieldAlwaysPresent(field) {
36
+ return /^\$band-\d+$/.test(field) || field === DENSITY_FIELD;
37
+ }
38
+ // ---------------------------------------------------------------------------
39
+ // Public API
40
+ // ---------------------------------------------------------------------------
41
+ /**
42
+ * Compile a Grammar symbology state to an OL FlatStyle object.
43
+ * Sub-channels (fill-red/green/blue/alpha) are assembled into fill-color.
44
+ *
45
+ * @param featureValues Feature attribute values for the rule field(s).
46
+ * Required for categorical and colorRamp scales so the compiler can
47
+ * enumerate unique values / compute classification breaks at render time,
48
+ * mirroring how buildVectorFlatStyle works.
49
+ */
50
+ export function grammarToOLStyle(state, featureValues = []) {
51
+ var _a, _b, _c, _d, _e, _f, _g;
52
+ // Accumulate per-channel entries from all layers and their rules.
53
+ // Layers with a kde/cluster preprocess are handled at the renderer level;
54
+ // this compiler only produces the flat-style for the vector portion.
55
+ const accumulator = new Map();
56
+ // Guard: state.layers may be absent on legacy Grammar states that predate
57
+ // the layers nesting (e.g. stored as { rules: [...] } without a layers wrapper).
58
+ for (const layer of (_a = state.layers) !== null && _a !== void 0 ? _a : []) {
59
+ if ((_b = layer.preprocess) === null || _b === void 0 ? void 0 : _b.some(t => t.type === 'kde')) {
60
+ // KDE layers are compiled separately by the renderer (HeatmapLayer).
61
+ // Skip flat-style compilation for this layer.
62
+ continue;
63
+ }
64
+ // Layer-level guard: compiled separately then AND-ed with the rule guard.
65
+ const layerGuard = layer.when && layer.when.length > 0
66
+ ? compileGuard(layer.when, (_c = layer.whenOp) !== null && _c !== void 0 ? _c : 'all')
67
+ : undefined;
68
+ for (const rule of layer.rules) {
69
+ // For now use the first field; multi-field assembly is handled via
70
+ // sub-channel mappings (pixel-red/green/blue) or expression scales.
71
+ const field = (_d = rule.fields) === null || _d === void 0 ? void 0 : _d[0];
72
+ const ruleGuard = rule.when && rule.when.length > 0
73
+ ? compileGuard(rule.when, (_e = rule.whenOp) !== null && _e !== void 0 ? _e : 'all')
74
+ : undefined;
75
+ const guard = layerGuard && ruleGuard
76
+ ? ['all', layerGuard, ruleGuard]
77
+ : (layerGuard !== null && layerGuard !== void 0 ? layerGuard : ruleGuard);
78
+ for (const mapping of rule.mappings) {
79
+ for (const channel of mapping.channels) {
80
+ if (channel === 'pixel-rgb') {
81
+ // Virtual channel: fan out to pixel-red/green/blue so assembleStyle
82
+ // can compose them into ['color', r, g, b, a] with a separate alpha.
83
+ for (const sub of [
84
+ 'pixel-red',
85
+ 'pixel-green',
86
+ 'pixel-blue',
87
+ ]) {
88
+ const expr = compileMapping(field, mapping, featureValues, sub);
89
+ const entries = (_f = accumulator.get(sub)) !== null && _f !== void 0 ? _f : [];
90
+ entries.push({ guard, expr });
91
+ accumulator.set(sub, entries);
92
+ }
93
+ }
94
+ else {
95
+ // Compile per-channel so sub-channels (pixel-red/green/blue) can each
96
+ // extract the correct component from a colorRamp or other color scale.
97
+ const expr = compileMapping(field, mapping, featureValues, channel);
98
+ const entries = (_g = accumulator.get(channel)) !== null && _g !== void 0 ? _g : [];
99
+ entries.push({ guard, expr });
100
+ accumulator.set(channel, entries);
101
+ }
102
+ }
103
+ }
104
+ }
105
+ }
106
+ // Build per-channel OL expressions.
107
+ const channelExprs = new Map();
108
+ for (const [channel, entries] of accumulator) {
109
+ channelExprs.set(channel, buildChannelExpr(entries, channel));
110
+ }
111
+ // Assemble into the final style object, handling sub-channel composition.
112
+ return assembleStyle(channelExprs);
113
+ }
114
+ // ---------------------------------------------------------------------------
115
+ // Feature-value extraction helper
116
+ // ---------------------------------------------------------------------------
117
+ /**
118
+ * Extract the encoding field column from feature property rows.
119
+ * colorRamp and categorical scales take a single input field; this returns
120
+ * all values for that field so the compiler can compute classification breaks.
121
+ */
122
+ export function extractEncodingFieldValues(state, rows) {
123
+ var _a, _b, _c;
124
+ let field;
125
+ for (const gl of (_a = state.layers) !== null && _a !== void 0 ? _a : []) {
126
+ for (const rule of (_b = gl.rules) !== null && _b !== void 0 ? _b : []) {
127
+ const f = (_c = rule.fields) === null || _c === void 0 ? void 0 : _c[0];
128
+ if (f && !f.startsWith('$')) {
129
+ field = f;
130
+ break;
131
+ }
132
+ }
133
+ if (field) {
134
+ break;
135
+ }
136
+ }
137
+ if (!field) {
138
+ console.debug('extractEncodingFieldValues: no encoding field found in Grammar state');
139
+ return [];
140
+ }
141
+ return rows.map(r => r[field]).filter(v => v !== null && v !== undefined);
142
+ }
143
+ // ---------------------------------------------------------------------------
144
+ // Channel expression builder
145
+ // ---------------------------------------------------------------------------
146
+ /**
147
+ * Merge a list of ChannelEntries into a single OL expression.
148
+ * Conditional entries form case branches; the last unconditional entry wins
149
+ * as the else branch (transparent/zero if none).
150
+ */
151
+ function buildChannelExpr(entries, channel) {
152
+ const conditional = entries.filter(e => e.guard !== undefined);
153
+ const unconditional = entries.filter(e => e.guard === undefined);
154
+ const elseExpr = unconditional.length > 0
155
+ ? unconditional[unconditional.length - 1].expr
156
+ : channelZero(channel);
157
+ if (conditional.length === 0) {
158
+ return elseExpr;
159
+ }
160
+ const caseExpr = ['case'];
161
+ for (const { guard, expr } of conditional) {
162
+ caseExpr.push(guard, expr);
163
+ }
164
+ caseExpr.push(elseExpr);
165
+ return caseExpr;
166
+ }
167
+ /** Typed zero for channels with no unconditional rule. */
168
+ function channelZero(channel) {
169
+ const rgbaChannels = new Set([
170
+ 'fill-color',
171
+ 'stroke-color',
172
+ 'circle-fill-color',
173
+ 'circle-stroke-color',
174
+ 'pixel-color',
175
+ ]);
176
+ return rgbaChannels.has(channel) ? 'rgba(0,0,0,0)' : 0;
177
+ }
178
+ // ---------------------------------------------------------------------------
179
+ // Sub-channel assembly
180
+ // ---------------------------------------------------------------------------
181
+ const FILL_SUB = ['fill-red', 'fill-green', 'fill-blue'];
182
+ const FILL_ALPHA_SUB = ['fill-alpha'];
183
+ const PIXEL_SUB = ['pixel-red', 'pixel-green', 'pixel-blue'];
184
+ const PIXEL_ALPHA_SUB = ['pixel-alpha'];
185
+ /**
186
+ * Assemble the final style object.
187
+ * Sub-channels (fill-red/green/blue/alpha, pixel-red/green/blue/alpha) are
188
+ * combined into a ['color', r, g, b, a] expression on the parent channel.
189
+ * Virtual channels (pixel-rgb) are already fanned out before this runs.
190
+ */
191
+ function assembleStyle(channelExprs) {
192
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
193
+ const style = {};
194
+ // Collect named channels directly.
195
+ const skip = new Set([
196
+ ...FILL_SUB,
197
+ ...FILL_ALPHA_SUB,
198
+ ...PIXEL_SUB,
199
+ ...PIXEL_ALPHA_SUB,
200
+ ]);
201
+ for (const [channel, expr] of channelExprs) {
202
+ if (!skip.has(channel)) {
203
+ style[channel] = expr;
204
+ }
205
+ }
206
+ // Assemble fill-color from sub-channels if any fill-* sub-channel is present.
207
+ // ['color', r, g, b, a] is the OL operator that produces ColorType (r/g/b 0-255, a 0-1).
208
+ if (FILL_SUB.some(c => channelExprs.has(c)) ||
209
+ FILL_ALPHA_SUB.some(c => channelExprs.has(c))) {
210
+ const r = (_a = channelExprs.get('fill-red')) !== null && _a !== void 0 ? _a : 0;
211
+ const g = (_b = channelExprs.get('fill-green')) !== null && _b !== void 0 ? _b : 0;
212
+ const b = (_c = channelExprs.get('fill-blue')) !== null && _c !== void 0 ? _c : 0;
213
+ const a = (_d = channelExprs.get('fill-alpha')) !== null && _d !== void 0 ? _d : 1;
214
+ style['fill-color'] = ['color', r, g, b, a];
215
+ }
216
+ // Assemble pixel-color from sub-channels when pixel-R/G/B are present.
217
+ // pixel-alpha alone does NOT overwrite a direct pixel-color mapping.
218
+ if (PIXEL_SUB.some(c => channelExprs.has(c))) {
219
+ const r = (_e = channelExprs.get('pixel-red')) !== null && _e !== void 0 ? _e : 0;
220
+ const g = (_f = channelExprs.get('pixel-green')) !== null && _f !== void 0 ? _f : 0;
221
+ const b = (_g = channelExprs.get('pixel-blue')) !== null && _g !== void 0 ? _g : 0;
222
+ const a = (_h = channelExprs.get('pixel-alpha')) !== null && _h !== void 0 ? _h : 1;
223
+ style['pixel-color'] = ['color', r, g, b, a];
224
+ }
225
+ else if (PIXEL_ALPHA_SUB.some(c => channelExprs.has(c)) &&
226
+ !channelExprs.has('pixel-color')) {
227
+ // Alpha-only with no direct pixel-color: compose with black.
228
+ const a = (_j = channelExprs.get('pixel-alpha')) !== null && _j !== void 0 ? _j : 1;
229
+ style['pixel-color'] = ['color', 0, 0, 0, a];
230
+ }
231
+ return style;
232
+ }
233
+ // ---------------------------------------------------------------------------
234
+ // Guard compilation
235
+ // ---------------------------------------------------------------------------
236
+ function compileGuard(predicates, op = 'all') {
237
+ const conditions = predicates.map(compilePredicate);
238
+ return conditions.length === 1 ? conditions[0] : [op, ...conditions];
239
+ }
240
+ function compilePredicate(predicate) {
241
+ switch (predicate.type) {
242
+ case 'geometryType':
243
+ return ['==', ['geometry-type'], predicate.value];
244
+ case 'hasField':
245
+ // Band pseudo-fields always exist; for vector features use ['has'].
246
+ return fieldAlwaysPresent(predicate.field)
247
+ ? true
248
+ : ['has', predicate.field];
249
+ case 'fieldEquals':
250
+ return ['==', fieldExpr(predicate.field), predicate.value];
251
+ case 'fieldCompare':
252
+ return [predicate.op, fieldExpr(predicate.field), predicate.value];
253
+ case 'between':
254
+ return [
255
+ 'all',
256
+ ['>=', fieldExpr(predicate.field), predicate.min],
257
+ ['<=', fieldExpr(predicate.field), predicate.max],
258
+ ];
259
+ }
260
+ }
261
+ // ---------------------------------------------------------------------------
262
+ // Mapping compilation — dispatches by scale scheme
263
+ // ---------------------------------------------------------------------------
264
+ /**
265
+ * Return the RGBA array index for a sub-channel, or undefined for full-color
266
+ * channels. Used to decompose a colorRamp into a single numeric component.
267
+ */
268
+ function colorComponentIndex(channel) {
269
+ switch (channel) {
270
+ case 'fill-red':
271
+ case 'pixel-red':
272
+ return 0;
273
+ case 'fill-green':
274
+ case 'pixel-green':
275
+ return 1;
276
+ case 'fill-blue':
277
+ case 'pixel-blue':
278
+ return 2;
279
+ case 'fill-alpha':
280
+ case 'pixel-alpha':
281
+ return 3;
282
+ default:
283
+ return undefined;
284
+ }
285
+ }
286
+ function compileMapping(field, mapping, featureValues, channel) {
287
+ const { scale } = mapping;
288
+ switch (scale.scheme) {
289
+ case 'colorRamp':
290
+ return field
291
+ ? compileColorRamp(field, scale, featureValues, channel)
292
+ : scale.params.fallback;
293
+ case 'categorical':
294
+ return field
295
+ ? compileCategorical(field, scale, featureValues)
296
+ : scale.params.fallback;
297
+ case 'expression':
298
+ // Expression scale is not yet implemented; fall back to channel zero.
299
+ console.warn('[grammarToOLStyle] expression scale is not yet implemented');
300
+ return channelZero(mapping.channels[0]);
301
+ case 'constant_rgba':
302
+ case 'constant_num':
303
+ return scale.params.value;
304
+ case 'scalar':
305
+ return field ? compileScalar(field, scale) : scale.params.fallback;
306
+ case 'identity': {
307
+ if (!field) {
308
+ return channelZero(mapping.channels[0]);
309
+ }
310
+ // Wrap with coalesce so OL's expression type system infers the correct
311
+ // output type (color vs number). Bare ['get', field] has type 'any'
312
+ // which OL rejects for typed channels like fill-color.
313
+ const isColorChannel = mapping.channels.some(ch => [
314
+ 'fill-color',
315
+ 'stroke-color',
316
+ 'circle-fill-color',
317
+ 'circle-stroke-color',
318
+ 'pixel-color',
319
+ ].includes(ch));
320
+ const typedFallback = isColorChannel
321
+ ? [0, 0, 0, 0]
322
+ : 0;
323
+ if (fieldAlwaysPresent(field)) {
324
+ return fieldExpr(field);
325
+ }
326
+ return ['coalesce', fieldExpr(field), typedFallback];
327
+ }
328
+ }
329
+ }
330
+ // ---------------------------------------------------------------------------
331
+ // Scale compilers
332
+ // ---------------------------------------------------------------------------
333
+ /**
334
+ * colorRamp: numeric field → RGBA color via a named palette + classification.
335
+ *
336
+ * Output:
337
+ * ['case', ['has', field],
338
+ * ['interpolate', ['linear'], ['get', field], stop0, color0, ...],
339
+ * fallback]
340
+ */
341
+ function compileColorRamp(field, scale, featureValues, channel) {
342
+ const stops = resolveColorStops(scale, featureValues);
343
+ // Guard: interpolate requires at least 2 stop pairs. Return fallback when
344
+ // the source is not yet loaded and no explicit domain/colorStops are set.
345
+ if (stops.length < 2) {
346
+ const componentIdx = channel !== undefined ? colorComponentIndex(channel) : undefined;
347
+ return componentIdx !== undefined ? 0 : scale.params.fallback;
348
+ }
349
+ const componentIdx = channel !== undefined ? colorComponentIndex(channel) : undefined;
350
+ const interpolateExpr = [
351
+ 'interpolate',
352
+ ['linear'],
353
+ fieldExpr(field),
354
+ ];
355
+ if (componentIdx !== undefined) {
356
+ // Sub-channel scalar interpolation for one color component (R=0,G=1,B=2,A=3).
357
+ // colormap stops carry [r, g, b, a] with r/g/b in 0-255 and a in 0-1.
358
+ // Values are passed as-is since assembleStyle uses ['color', r, g, b, a]
359
+ // which takes r/g/b in 0-255.
360
+ for (const { stop, color } of stops) {
361
+ interpolateExpr.push(stop, color[componentIdx]);
362
+ }
363
+ if (fieldAlwaysPresent(field)) {
364
+ return interpolateExpr;
365
+ }
366
+ return ['case', ['has', field], interpolateExpr, 0];
367
+ }
368
+ // Full color channel: emit the usual RGBA interpolation.
369
+ for (const { stop, color } of stops) {
370
+ interpolateExpr.push(stop, color);
371
+ }
372
+ if (fieldAlwaysPresent(field)) {
373
+ return interpolateExpr;
374
+ }
375
+ return ['case', ['has', field], interpolateExpr, scale.params.fallback];
376
+ }
377
+ /**
378
+ * Resolve color stops for a colorRamp scale.
379
+ * Explicit colorStops (user overrides) take precedence; otherwise classification
380
+ * breaks are computed from featureValues using computeGraduatedColorStops.
381
+ */
382
+ function resolveColorStops(scale, featureValues) {
383
+ var _a, _b;
384
+ if (scale.params.colorStops && scale.params.colorStops.length >= 2) {
385
+ return scale.params.colorStops;
386
+ }
387
+ const numericValues = featureValues.filter(Number.isFinite);
388
+ const syntheticState = {
389
+ nClasses: scale.params.nShades,
390
+ mode: scale.params.mode,
391
+ colorRamp: scale.params.name,
392
+ reverseRamp: scale.params.reverse,
393
+ vmin: (_a = scale.params.domain) === null || _a === void 0 ? void 0 : _a[0],
394
+ vmax: (_b = scale.params.domain) === null || _b === void 0 ? void 0 : _b[1],
395
+ };
396
+ const computed = computeGraduatedColorStops(syntheticState, numericValues);
397
+ return computed.map(s => ({
398
+ stop: s.value,
399
+ color: s.color,
400
+ }));
401
+ }
402
+ /**
403
+ * categorical: nominal field → RGBA color via a named palette.
404
+ * Unique field values are enumerated from featureValues at render time,
405
+ * mirroring buildCategorized.
406
+ *
407
+ * Output:
408
+ * ['case',
409
+ * ['==', ['get', field], val0], color0,
410
+ * ...,
411
+ * fallback]
412
+ */
413
+ function compileCategorical(field, scale, featureValues) {
414
+ var _a;
415
+ let stops;
416
+ if (scale.params.colorStops && scale.params.colorStops.length > 0) {
417
+ stops = scale.params.colorStops.map(s => ({
418
+ value: s.stop,
419
+ color: s.color,
420
+ }));
421
+ }
422
+ else {
423
+ const syntheticState = {
424
+ colorRamp: scale.params.colorRamp,
425
+ reverseRamp: (_a = scale.params.reverse) !== null && _a !== void 0 ? _a : false,
426
+ };
427
+ stops = computeCategorizedColorStops(syntheticState, featureValues);
428
+ }
429
+ // Guard: a OL case expression requires at least one condition+value pair
430
+ // before the else branch. Return fallback directly when stops is empty.
431
+ if (stops.length === 0) {
432
+ return scale.params.fallback;
433
+ }
434
+ const caseExpr = ['case'];
435
+ for (const stop of stops) {
436
+ let condition;
437
+ if (stop.value === STOP_UNDEFINED) {
438
+ // Property missing entirely
439
+ condition = ['!', ['has', field]];
440
+ }
441
+ else if (stop.value === STOP_NULL) {
442
+ // Property exists but value is null
443
+ condition = [
444
+ 'all',
445
+ ['has', field],
446
+ ['==', ['coalesce', fieldExpr(field), '__jgis_ns__'], '__jgis_ns__'],
447
+ ];
448
+ }
449
+ else {
450
+ condition = [
451
+ '==',
452
+ fieldExpr(field),
453
+ stop.value,
454
+ ];
455
+ }
456
+ caseExpr.push(condition, stop.color);
457
+ }
458
+ caseExpr.push(scale.params.fallback);
459
+ return caseExpr;
460
+ }
461
+ /**
462
+ * scalar: numeric field → numeric output (radius, width, sub-channel value).
463
+ *
464
+ * Output:
465
+ * ['case', ['has', field],
466
+ * ['interpolate', ['linear'], ['get', field], stop0, out0, ...],
467
+ * fallback]
468
+ */
469
+ function compileScalar(field, scale) {
470
+ const interpolateExpr = [
471
+ 'interpolate',
472
+ ['linear'],
473
+ fieldExpr(field),
474
+ ];
475
+ if (scale.params.scalarStops && scale.params.scalarStops.length >= 2) {
476
+ for (const { stop, output } of scale.params.scalarStops) {
477
+ interpolateExpr.push(stop, output);
478
+ }
479
+ }
480
+ else {
481
+ interpolateExpr.push(scale.params.domain[0], scale.params.range[0], scale.params.domain[1], scale.params.range[1]);
482
+ }
483
+ if (fieldAlwaysPresent(field)) {
484
+ return interpolateExpr;
485
+ }
486
+ return ['case', ['has', field], interpolateExpr, scale.params.fallback];
487
+ }
@@ -7,7 +7,7 @@ export interface IBandRow {
7
7
  maximum: number;
8
8
  };
9
9
  }
10
- declare const useGetBandInfo: (model: IJupyterGISModel, layer: IJGISLayer) => {
10
+ declare const useGetBandInfo: (model: IJupyterGISModel, layer: IJGISLayer | null | undefined) => {
11
11
  bandRows: IBandRow[];
12
12
  setBandRows: import("react").Dispatch<import("react").SetStateAction<IBandRow[]>>;
13
13
  loading: boolean;
@@ -1,6 +1,6 @@
1
1
  import { fromUrl, fromBlob } from 'geotiff';
2
2
  import { useEffect, useState } from 'react';
3
- import { loadFile } from "../../../tools";
3
+ import { loadFile } from "../../../../tools";
4
4
  const useGetBandInfo = (model, layer) => {
5
5
  const [bandRows, setBandRows] = useState([]);
6
6
  const [loading, setLoading] = useState(false);
@@ -1,6 +1,6 @@
1
1
  // import { GeoJSONFeature } from 'geojson';
2
2
  import { useEffect, useState } from 'react';
3
- import { loadFile } from "../../../tools";
3
+ import { loadFile } from "../../../../tools";
4
4
  async function getGeoJsonProperties({ source, model, }) {
5
5
  const result = {};
6
6
  const data = await (async () => {
@@ -54,11 +54,13 @@ export const useGetSymbology = ({ layerId, model, }) => {
54
54
  };
55
55
  // initial load
56
56
  fetchSymbology();
57
- model.sharedModel.awareness.on('change', () => {
57
+ const handleLayersChanged = () => {
58
58
  fetchSymbology();
59
- });
59
+ };
60
+ model.sharedLayersChanged.connect(handleLayersChanged);
60
61
  return () => {
61
62
  disposed = true;
63
+ model.sharedLayersChanged.disconnect(handleLayersChanged);
62
64
  };
63
65
  }, [layerId, model]);
64
66
  return { symbology, isLoading, error };
@@ -0,0 +1,24 @@
1
+ import { IVectorLayer } from '@jupytergis/schema';
2
+ import { FlatStyle } from 'ol/style/flat';
3
+ import { DEFAULT_STROKE_WIDTH, RgbaColor } from './colorRampUtils';
4
+ export { DEFAULT_STROKE_WIDTH };
5
+ export type SymbologyState = NonNullable<IVectorLayer['symbologyState']>;
6
+ export type GeometryType = 'fill' | 'circle' | 'line';
7
+ /** Default OL flat style used when no Grammar rules produce output. */
8
+ export declare const DEFAULT_FLAT_STYLE: FlatStyle;
9
+ /** Sentinel stop values for missing data. */
10
+ export declare const STOP_NULL = "__null__";
11
+ export declare const STOP_UNDEFINED = "__undefined__";
12
+ /** A computed stop: value → RGBA color. */
13
+ export interface IComputedStop {
14
+ value: number | string | boolean;
15
+ color: RgbaColor;
16
+ }
17
+ /**
18
+ * Compute color stops for Graduated symbology from the config + feature values.
19
+ */
20
+ export declare function computeGraduatedColorStops(state: SymbologyState, numericValues: number[]): IComputedStop[];
21
+ /**
22
+ * Compute color stops for Categorized symbology from the config + feature values.
23
+ */
24
+ export declare function computeCategorizedColorStops(state: SymbologyState, featureValues: unknown[]): IComputedStop[];