@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.
- package/lib/commands/BaseCommandIDs.d.ts +5 -0
- package/lib/commands/BaseCommandIDs.js +5 -0
- package/lib/commands/index.js +218 -48
- package/lib/commands/operationCommands.js +2 -2
- package/lib/constants.js +9 -1
- package/lib/{panelview/annotationPanel.js → features/annotations/AnnotationsPanel.js} +1 -1
- package/lib/{annotations → features/annotations}/index.d.ts +1 -0
- package/lib/{annotations → features/annotations}/index.js +1 -0
- package/lib/{console → features/console}/consoleview.js +1 -1
- package/lib/{panelview/filter-panel → features/filter}/Filter.js +4 -4
- package/lib/{panelview/filter-panel → features/filter}/FilterRow.d.ts +3 -2
- package/lib/{panelview/filter-panel → features/filter}/FilterRow.js +2 -1
- package/lib/{panelview/identify-panel → features/identify}/IdentifyPanel.d.ts +2 -0
- package/lib/features/identify/IdentifyPanel.js +102 -0
- package/lib/features/identify/components/FeatureCard.d.ts +17 -0
- package/lib/features/identify/components/FeatureCard.js +26 -0
- package/lib/features/identify/components/FeatureCardHeader.d.ts +11 -0
- package/lib/features/identify/components/FeatureCardHeader.js +30 -0
- package/lib/features/identify/components/FeatureFloater.d.ts +7 -0
- package/lib/features/identify/components/FeatureFloater.js +19 -0
- package/lib/features/identify/components/FeaturePropertyList.d.ts +11 -0
- package/lib/features/identify/components/FeaturePropertyList.js +18 -0
- package/lib/features/identify/components/FeatureRow.d.ts +13 -0
- package/lib/features/identify/components/FeatureRow.js +25 -0
- package/lib/features/identify/components/PropertyEditors.d.ts +44 -0
- package/lib/features/identify/components/PropertyEditors.js +56 -0
- package/lib/features/identify/hooks/useIdentifyPropertyEditor.d.ts +11 -0
- package/lib/features/identify/hooks/useIdentifyPropertyEditor.js +132 -0
- package/lib/features/identify/types/editorTypes.d.ts +21 -0
- package/lib/features/identify/utils/getFeatureIdentifier.d.ts +5 -0
- package/lib/features/identify/utils/getFeatureIdentifier.js +14 -0
- package/lib/features/identify/utils/highlightLayer.d.ts +11 -0
- package/lib/features/identify/utils/highlightLayer.js +57 -0
- package/lib/features/identify/utils/highlightStyle.d.ts +7 -0
- package/lib/features/identify/utils/highlightStyle.js +40 -0
- package/lib/{dialogs/layerBrowserDialog.js → features/layer-browser/index.js} +2 -2
- package/lib/{formbuilder/objectform/layer/heatmapLayerForm.d.ts → features/layers/forms/layer/geoTiffLayerForm.d.ts} +1 -1
- package/lib/{formbuilder/objectform/layer/webGlLayerForm.js → features/layers/forms/layer/geoTiffLayerForm.js} +5 -5
- package/lib/{formbuilder/objectform → features/layers/forms}/layer/hillshadeLayerForm.js +4 -4
- package/lib/{formbuilder/objectform → features/layers/forms}/layer/index.d.ts +1 -2
- package/lib/{formbuilder/objectform → features/layers/forms}/layer/index.js +1 -2
- package/lib/{formbuilder/objectform → features/layers/forms}/layer/layerform.d.ts +1 -1
- package/lib/{formbuilder/objectform → features/layers/forms}/layer/layerform.js +4 -4
- package/lib/features/layers/forms/layer/storySegmentLayerForm.js +150 -0
- package/lib/{formbuilder/objectform → features/layers/forms}/layer/vectorlayerform.js +4 -4
- package/lib/{formbuilder/objectform → features/layers/forms}/source/geojsonsource.js +5 -5
- package/lib/features/layers/forms/source/geopackagesource.d.ts +3 -0
- package/lib/features/layers/forms/source/geopackagesource.js +93 -0
- package/lib/{formbuilder/objectform → features/layers/forms}/source/geotiffsource.js +5 -5
- package/lib/{formbuilder/objectform → features/layers/forms}/source/index.d.ts +1 -0
- package/lib/{formbuilder/objectform → features/layers/forms}/source/index.js +1 -0
- package/lib/{formbuilder/objectform → features/layers/forms}/source/pathbasedsource.js +5 -5
- package/lib/{formbuilder/objectform → features/layers/forms}/source/sourceform.d.ts +1 -1
- package/lib/{formbuilder/objectform → features/layers/forms}/source/sourceform.js +4 -4
- package/lib/{formbuilder/objectform → features/layers/forms}/source/tilesourceform.js +4 -4
- package/lib/{formbuilder/objectform → features/layers/forms}/source/wmsTileSource.d.ts +1 -1
- package/lib/{formbuilder/objectform → features/layers/forms}/source/wmsTileSource.js +6 -6
- package/lib/{dialogs → features/layers}/layerCreationFormDialog.d.ts +1 -1
- package/lib/{dialogs → features/layers}/layerCreationFormDialog.js +1 -1
- package/lib/features/layers/symbology/Grammar.d.ts +11 -0
- package/lib/features/layers/symbology/Grammar.js +316 -0
- package/lib/{dialogs → features/layers}/symbology/classificationModes.d.ts +6 -6
- package/lib/{dialogs → features/layers}/symbology/classificationModes.js +48 -44
- package/lib/{dialogs → features/layers}/symbology/colorRampUtils.d.ts +1 -0
- package/lib/{dialogs → features/layers}/symbology/colorRampUtils.js +12 -1
- package/lib/features/layers/symbology/components/MappingRow.d.ts +40 -0
- package/lib/features/layers/symbology/components/MappingRow.js +520 -0
- package/lib/features/layers/symbology/components/NumericInput.d.ts +20 -0
- package/lib/features/layers/symbology/components/NumericInput.js +44 -0
- package/lib/features/layers/symbology/components/ScaleEditor.d.ts +33 -0
- package/lib/features/layers/symbology/components/ScaleEditor.js +221 -0
- package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ColorRampControls.d.ts +1 -1
- package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ColorRampControls.js +4 -3
- package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ColorRampSelector.d.ts +2 -1
- package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ColorRampSelector.js +6 -1
- package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ModeSelectRow.d.ts +1 -1
- package/lib/{dialogs → features/layers}/symbology/components/color_ramp/RgbaColorPicker.js +39 -9
- package/lib/{dialogs → features/layers}/symbology/components/color_stops/StopContainer.js +1 -1
- package/lib/{dialogs → features/layers}/symbology/components/color_stops/StopRow.d.ts +1 -1
- package/lib/{dialogs → features/layers}/symbology/components/color_stops/StopRow.js +14 -2
- package/lib/features/layers/symbology/grammarToOLLayer.d.ts +27 -0
- package/lib/features/layers/symbology/grammarToOLLayer.js +145 -0
- package/lib/features/layers/symbology/grammarToOLStyle.d.ts +32 -0
- package/lib/features/layers/symbology/grammarToOLStyle.js +487 -0
- package/lib/{dialogs → features/layers}/symbology/hooks/useGetBandInfo.d.ts +1 -1
- package/lib/{dialogs → features/layers}/symbology/hooks/useGetBandInfo.js +1 -1
- package/lib/{dialogs → features/layers}/symbology/hooks/useGetProperties.js +1 -1
- package/lib/{dialogs → features/layers}/symbology/hooks/useGetSymbology.js +4 -2
- package/lib/features/layers/symbology/styleBuilder.d.ts +24 -0
- package/lib/features/layers/symbology/styleBuilder.js +158 -0
- package/lib/{dialogs → features/layers}/symbology/symbologyDialog.d.ts +1 -1
- package/lib/{dialogs → features/layers}/symbology/symbologyDialog.js +11 -13
- package/lib/{dialogs → features/layers}/symbology/symbologyUtils.d.ts +18 -10
- package/lib/{dialogs → features/layers}/symbology/symbologyUtils.js +0 -84
- package/lib/{panelview/objectproperties.d.ts → features/objectproperties/index.d.ts} +1 -1
- package/lib/{panelview/objectproperties.js → features/objectproperties/index.js} +5 -10
- package/lib/{dialogs → features/processing}/ProcessingFormDialog.d.ts +1 -1
- package/lib/{dialogs → features/processing}/ProcessingFormDialog.js +28 -14
- package/lib/features/processing/forms/MapExtentToggle.d.ts +13 -0
- package/lib/features/processing/forms/MapExtentToggle.js +20 -0
- package/lib/features/processing/forms/clipRasterByExtentForm.d.ts +10 -0
- package/lib/features/processing/forms/clipRasterByExtentForm.js +99 -0
- package/lib/{formbuilder/objectform/process → features/processing/forms}/dissolveProcessForm.js +5 -5
- package/lib/{formbuilder/objectform → features/processing/forms}/processingForm.d.ts +1 -1
- package/lib/{formbuilder/objectform → features/processing/forms}/processingForm.js +6 -6
- package/lib/features/processing/forms/rasterizeForm.d.ts +10 -0
- package/lib/features/processing/forms/rasterizeForm.js +75 -0
- package/lib/features/processing/forms/useMapExtent.d.ts +22 -0
- package/lib/features/processing/forms/useMapExtent.js +57 -0
- package/lib/{processing → features/processing}/index.d.ts +19 -2
- package/lib/features/processing/index.js +1246 -0
- package/lib/{processing → features/processing}/processingCommands.d.ts +1 -1
- package/lib/features/processing/processingCommands.js +168 -0
- package/lib/features/processing/serverProcessing.d.ts +51 -0
- package/lib/features/processing/serverProcessing.js +99 -0
- package/lib/{stacBrowser → features/stac-browser}/components/StacPanel.js +2 -2
- package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/QueryableComboBox.js +5 -5
- package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/QueryableRow.js +1 -1
- package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/StacFilterExtensionPanel.js +2 -2
- package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/StacQueryableFilters.js +1 -1
- package/lib/{stacBrowser → features/stac-browser}/components/geodes/StacFilterSection.js +3 -3
- package/lib/{stacBrowser → features/stac-browser}/components/shared/StacPanelResults.js +3 -3
- package/lib/{stacBrowser → features/stac-browser}/components/shared/StacSpatialExtent.js +1 -1
- package/lib/{stacBrowser → features/stac-browser}/components/shared/StacTemporalExtent.js +1 -1
- package/lib/{stacBrowser → features/stac-browser}/context/StacResultsContext.js +2 -2
- package/lib/{stacBrowser → features/stac-browser}/hooks/useGeodesSearch.js +2 -2
- package/lib/{stacBrowser → features/stac-browser}/hooks/useStacFilterExtension.js +3 -3
- package/lib/{stacBrowser → features/stac-browser}/hooks/useStacSearch.js +1 -1
- package/lib/features/stac-browser/types/types.js +1 -0
- package/lib/{panelview/story-maps → features/story}/SpectaPanel.d.ts +4 -1
- package/lib/{panelview/story-maps → features/story}/SpectaPanel.js +3 -4
- package/lib/{panelview/story-maps → features/story}/StoryEditorPanel.js +1 -1
- package/lib/{panelview/story-maps → features/story}/StoryViewerPanel.d.ts +12 -11
- package/lib/features/story/StoryViewerPanel.js +64 -0
- package/lib/features/story/__tests__/fixtures/listStoryTestItems.d.ts +9 -0
- package/lib/features/story/__tests__/fixtures/listStoryTestItems.js +21 -0
- package/lib/features/story/components/ListStoryMapOverlayPanel.d.ts +10 -0
- package/lib/features/story/components/ListStoryMapOverlayPanel.js +11 -0
- package/lib/features/story/components/ListStoryMarkdownMeasurePane.d.ts +11 -0
- package/lib/features/story/components/ListStoryMarkdownMeasurePane.js +55 -0
- package/lib/features/story/components/ListStoryOverlayMarkdown.d.ts +15 -0
- package/lib/features/story/components/ListStoryOverlayMarkdown.js +93 -0
- package/lib/features/story/components/ListStoryStageOverlay.d.ts +11 -0
- package/lib/features/story/components/ListStoryStageOverlay.js +150 -0
- package/lib/features/story/components/ListStoryTitleBar.d.ts +7 -0
- package/lib/features/story/components/ListStoryTitleBar.js +20 -0
- package/lib/features/story/components/ListStoryTitleBarDesktop.d.ts +2 -0
- package/lib/features/story/components/ListStoryTitleBarDesktop.js +55 -0
- package/lib/features/story/components/ListStoryTitleBarMobile.d.ts +2 -0
- package/lib/features/story/components/ListStoryTitleBarMobile.js +41 -0
- package/lib/features/story/components/ListStoryVirtualScrollTrack.d.ts +6 -0
- package/lib/features/story/components/ListStoryVirtualScrollTrack.js +7 -0
- package/lib/{panelview/story-maps → features/story}/components/SpectaDesktopView.d.ts +4 -2
- package/lib/features/story/components/SpectaDesktopView.js +67 -0
- package/lib/features/story/components/SpectaMobileListModeContent.d.ts +13 -0
- package/lib/features/story/components/SpectaMobileListModeContent.js +36 -0
- package/lib/features/story/components/SpectaMobileSingleModeContent.d.ts +14 -0
- package/lib/{panelview/story-maps/components/SpectaMobileView.js → features/story/components/SpectaMobileSingleModeContent.js} +4 -6
- package/lib/{panelview/story-maps → features/story}/components/SpectaMobileView.d.ts +5 -3
- package/lib/features/story/components/SpectaMobileView.js +12 -0
- package/lib/features/story/components/SpectaSingleModeContent.d.ts +18 -0
- package/lib/features/story/components/SpectaSingleModeContent.js +8 -0
- package/lib/features/story/context/ListStoryScrollTrackContext.d.ts +19 -0
- package/lib/features/story/context/ListStoryScrollTrackContext.js +186 -0
- package/lib/features/story/hooks/useCurrentSegmentIndex.d.ts +3 -0
- package/lib/features/story/hooks/useCurrentSegmentIndex.js +17 -0
- package/lib/features/story/hooks/useListStoryScroll.d.ts +15 -0
- package/lib/features/story/hooks/useListStoryScroll.js +107 -0
- package/lib/features/story/hooks/useQueuedMarkdownHeightMeasure.d.ts +19 -0
- package/lib/features/story/hooks/useQueuedMarkdownHeightMeasure.js +56 -0
- package/lib/features/story/hooks/useStoryImagePreload.d.ts +1 -0
- package/lib/features/story/hooks/useStoryImagePreload.js +24 -0
- package/lib/{panelview/story-maps → features/story}/hooks/useStoryMap.d.ts +2 -7
- package/lib/{panelview/story-maps → features/story}/hooks/useStoryMap.js +21 -60
- package/lib/features/story/hooks/useStoryScrollState.d.ts +21 -0
- package/lib/features/story/hooks/useStoryScrollState.js +39 -0
- package/lib/features/story/hooks/useStorySegmentSync.d.ts +8 -0
- package/lib/features/story/hooks/useStorySegmentSync.js +51 -0
- package/lib/features/story/types/types.d.ts +43 -0
- package/lib/features/story/types/types.js +1 -0
- package/lib/features/story/utils/computeListStoryScrollState.d.ts +14 -0
- package/lib/features/story/utils/computeListStoryScrollState.js +79 -0
- package/lib/features/story/utils/listStoryMeasureQueue.d.ts +11 -0
- package/lib/features/story/utils/listStoryMeasureQueue.js +14 -0
- package/lib/features/story/utils/listStoryScrollTrack.d.ts +17 -0
- package/lib/features/story/utils/listStoryScrollTrack.js +72 -0
- package/lib/features/story/utils/spectaPresentation.d.ts +9 -0
- package/lib/features/story/utils/spectaPresentation.js +37 -0
- package/lib/features/story/utils/storySegmentViewItems.d.ts +5 -0
- package/lib/features/story/utils/storySegmentViewItems.js +30 -0
- package/lib/index.d.ts +11 -9
- package/lib/index.js +11 -9
- package/lib/keybindings.json +5 -0
- package/lib/mainview/OpenEOTileLayer.d.ts +49 -0
- package/lib/mainview/OpenEOTileLayer.js +179 -0
- package/lib/mainview/TemporalSlider.js +11 -9
- package/lib/mainview/components/MainViewMapSurface.d.ts +15 -0
- package/lib/mainview/components/MainViewMapSurface.js +13 -0
- package/lib/mainview/components/MainViewOverlayLayer.d.ts +9 -0
- package/lib/mainview/components/MainViewOverlayLayer.js +11 -0
- package/lib/mainview/components/MainViewSidePanels.d.ts +17 -0
- package/lib/mainview/components/MainViewSidePanels.js +10 -0
- package/lib/mainview/components/MainViewSpectaPanel.d.ts +17 -0
- package/lib/mainview/components/MainViewSpectaPanel.js +8 -0
- package/lib/mainview/components/MainViewStoryStage.d.ts +13 -0
- package/lib/mainview/components/MainViewStoryStage.js +17 -0
- package/lib/mainview/components/PositionedFloater.d.ts +10 -0
- package/lib/mainview/components/PositionedFloater.js +7 -0
- package/lib/mainview/geoJsonFeaturePatch.d.ts +9 -0
- package/lib/mainview/geoJsonFeaturePatch.js +43 -0
- package/lib/mainview/mainView.d.ts +93 -14
- package/lib/mainview/mainView.js +1216 -686
- package/lib/mainview/mainviewwidget.d.ts +5 -1
- package/lib/mainview/mainviewwidget.js +4 -2
- package/lib/shared/components/Button.d.ts +1 -1
- package/lib/shared/components/DropdownMenu.d.ts +1 -0
- package/lib/shared/components/DropdownMenu.js +3 -2
- package/lib/shared/components/NativeSelect.d.ts +8 -0
- package/lib/shared/components/NativeSelect.js +29 -0
- package/lib/shared/components/Tabs.d.ts +3 -3
- package/lib/shared/components/Tabs.js +5 -5
- package/lib/{formbuilder → shared/formbuilder}/creationform.js +71 -4
- package/lib/{formbuilder → shared/formbuilder}/editform.js +1 -1
- package/lib/{formbuilder → shared/formbuilder}/formselectors.d.ts +2 -2
- package/lib/{formbuilder → shared/formbuilder}/formselectors.js +10 -7
- package/lib/shared/formbuilder/index.d.ts +4 -0
- package/lib/shared/formbuilder/index.js +4 -0
- package/lib/{formbuilder → shared/formbuilder}/objectform/SchemaForm.d.ts +1 -1
- package/lib/{formbuilder → shared/formbuilder}/objectform/StoryEditorForm.d.ts +1 -1
- package/lib/{formbuilder → shared/formbuilder}/objectform/StoryEditorForm.js +1 -1
- package/lib/{formbuilder → shared/formbuilder}/objectform/components/LayerSelect.js +1 -1
- package/lib/{formbuilder → shared/formbuilder}/objectform/components/SegmentFormSymbology.js +4 -4
- package/lib/{formbuilder → shared/formbuilder}/objectform/components/SourcePropertiesField.js +1 -1
- package/lib/{formbuilder → shared/formbuilder}/objectform/components/StorySegmentReset.js +1 -1
- package/lib/{formbuilder → shared/formbuilder}/objectform/components/WmsTileSourceUrlInput.js +4 -4
- package/lib/{formbuilder → shared/formbuilder}/objectform/fileselectorwidget.js +8 -1
- package/lib/{formbuilder → shared/formbuilder}/objectform/schemaUtils.d.ts +3 -1
- package/lib/{formbuilder → shared/formbuilder}/objectform/schemaUtils.js +11 -0
- package/lib/{formbuilder → shared/formbuilder}/objectform/useSchemaFormState.d.ts +1 -1
- package/lib/{formbuilder → shared/formbuilder}/objectform/useSchemaFormState.js +1 -1
- package/lib/{icons.d.ts → shared/icons.d.ts} +2 -0
- package/lib/{icons.js → shared/icons.js} +28 -18
- package/lib/tools.d.ts +2 -0
- package/lib/tools.js +138 -4
- package/lib/types.d.ts +6 -1
- package/lib/types.js +6 -2
- package/lib/{menus.js → workspace/menus.js} +10 -2
- package/lib/workspace/panels/components/TabbedPanel.d.ts +17 -0
- package/lib/workspace/panels/components/TabbedPanel.js +19 -0
- package/lib/{panelview → workspace/panels}/components/layers.js +63 -18
- package/lib/workspace/panels/components/legendItem.js +680 -0
- package/lib/workspace/panels/hooks/useLayerTree.d.ts +19 -0
- package/lib/workspace/panels/hooks/useLayerTree.js +103 -0
- package/lib/workspace/panels/hooks/useRightPanelOptions.d.ts +27 -0
- package/lib/workspace/panels/hooks/useRightPanelOptions.js +72 -0
- package/lib/workspace/panels/hooks/useUIState.d.ts +2 -0
- package/lib/workspace/panels/hooks/useUIState.js +25 -0
- package/lib/{panelview → workspace/panels}/index.d.ts +1 -1
- package/lib/{panelview → workspace/panels}/index.js +1 -1
- package/lib/{panelview → workspace/panels}/leftpanel.d.ts +1 -1
- package/lib/workspace/panels/leftpanel.js +70 -0
- package/lib/{panelview/rightpanel.d.ts → workspace/panels/mergedpanel.d.ts} +6 -5
- package/lib/workspace/panels/mergedpanel.js +166 -0
- package/lib/workspace/panels/rightpanel.d.ts +25 -0
- package/lib/{panelview → workspace/panels}/rightpanel.js +53 -63
- package/lib/{statusbar → workspace/statusbar}/StatusBar.js +5 -4
- package/lib/{toolbar → workspace/toolbar}/widget.d.ts +2 -0
- package/lib/{toolbar → workspace/toolbar}/widget.js +33 -5
- package/lib/{widget.d.ts → workspace/widget.d.ts} +7 -5
- package/lib/{widget.js → workspace/widget.js} +16 -7
- package/package.json +16 -4
- package/style/base.css +124 -2
- package/style/icons/geopackage.svg +95 -0
- package/style/icons/pencil_solid.svg +7 -0
- package/style/identify.css +95 -0
- package/style/layerBrowser.css +29 -1
- package/style/leftPanel.css +25 -0
- package/style/shared/button.css +12 -0
- package/style/shared/dropdownMenu.css +9 -0
- package/style/shared/nativeSelect.css +75 -0
- package/style/shared/tabs.css +1 -1
- package/style/spectaProgressBar.css +0 -1
- package/style/storyPanel.css +330 -9
- package/style/storySpectaArticleOverlay.css +129 -0
- package/style/symbologyDialog.css +522 -27
- package/lib/dialogs/symbology/tiff_layer/TiffRendering.d.ts +0 -4
- package/lib/dialogs/symbology/tiff_layer/TiffRendering.js +0 -42
- package/lib/dialogs/symbology/tiff_layer/components/BandRow.d.ts +0 -23
- package/lib/dialogs/symbology/tiff_layer/components/BandRow.js +0 -59
- package/lib/dialogs/symbology/tiff_layer/types/MultibandColor.d.ts +0 -4
- package/lib/dialogs/symbology/tiff_layer/types/MultibandColor.js +0 -92
- package/lib/dialogs/symbology/tiff_layer/types/SingleBandPseudoColor.d.ts +0 -5
- package/lib/dialogs/symbology/tiff_layer/types/SingleBandPseudoColor.js +0 -313
- package/lib/dialogs/symbology/vector_layer/VectorRendering.d.ts +0 -4
- package/lib/dialogs/symbology/vector_layer/VectorRendering.js +0 -112
- package/lib/dialogs/symbology/vector_layer/components/ValueSelect.d.ts +0 -8
- package/lib/dialogs/symbology/vector_layer/components/ValueSelect.js +0 -9
- package/lib/dialogs/symbology/vector_layer/types/Canonical.d.ts +0 -4
- package/lib/dialogs/symbology/vector_layer/types/Canonical.js +0 -130
- package/lib/dialogs/symbology/vector_layer/types/Categorized.d.ts +0 -4
- package/lib/dialogs/symbology/vector_layer/types/Categorized.js +0 -243
- package/lib/dialogs/symbology/vector_layer/types/Graduated.d.ts +0 -4
- package/lib/dialogs/symbology/vector_layer/types/Graduated.js +0 -362
- package/lib/dialogs/symbology/vector_layer/types/Heatmap.d.ts +0 -4
- package/lib/dialogs/symbology/vector_layer/types/Heatmap.js +0 -89
- package/lib/dialogs/symbology/vector_layer/types/SimpleSymbol.d.ts +0 -4
- package/lib/dialogs/symbology/vector_layer/types/SimpleSymbol.js +0 -120
- package/lib/formbuilder/index.d.ts +0 -4
- package/lib/formbuilder/index.js +0 -4
- package/lib/formbuilder/objectform/layer/heatmapLayerForm.js +0 -96
- package/lib/formbuilder/objectform/layer/storySegmentLayerForm.js +0 -95
- package/lib/formbuilder/objectform/layer/webGlLayerForm.d.ts +0 -3
- package/lib/formbuilder/objectform/process/index.d.ts +0 -1
- package/lib/formbuilder/objectform/process/index.js +0 -1
- package/lib/panelview/components/legendItem.js +0 -210
- package/lib/panelview/identify-panel/IdentifyPanel.js +0 -102
- package/lib/panelview/leftpanel.js +0 -139
- package/lib/panelview/story-maps/StoryViewerPanel.js +0 -116
- package/lib/panelview/story-maps/components/SpectaDesktopView.js +0 -49
- package/lib/processing/index.js +0 -200
- package/lib/processing/processingCommands.js +0 -67
- /package/lib/{panelview/annotationPanel.d.ts → features/annotations/AnnotationsPanel.d.ts} +0 -0
- /package/lib/{annotations → features/annotations}/components/Annotation.d.ts +0 -0
- /package/lib/{annotations → features/annotations}/components/Annotation.js +0 -0
- /package/lib/{annotations → features/annotations}/components/AnnotationFloater.d.ts +0 -0
- /package/lib/{annotations → features/annotations}/components/AnnotationFloater.js +0 -0
- /package/lib/{annotations → features/annotations}/components/Message.d.ts +0 -0
- /package/lib/{annotations → features/annotations}/components/Message.js +0 -0
- /package/lib/{annotations → features/annotations}/model.d.ts +0 -0
- /package/lib/{annotations → features/annotations}/model.js +0 -0
- /package/lib/{console → features/console}/consoleview.d.ts +0 -0
- /package/lib/{console → features/console}/index.d.ts +0 -0
- /package/lib/{console → features/console}/index.js +0 -0
- /package/lib/{panelview/filter-panel → features/filter}/Filter.d.ts +0 -0
- /package/lib/{stacBrowser/types/types.js → features/identify/types/editorTypes.js} +0 -0
- /package/lib/{dialogs/layerBrowserDialog.d.ts → features/layer-browser/index.d.ts} +0 -0
- /package/lib/{formbuilder/objectform → features/layers/forms}/layer/hillshadeLayerForm.d.ts +0 -0
- /package/lib/{formbuilder/objectform → features/layers/forms}/layer/storySegmentLayerForm.d.ts +0 -0
- /package/lib/{formbuilder/objectform → features/layers/forms}/layer/vectorlayerform.d.ts +0 -0
- /package/lib/{formbuilder/objectform → features/layers/forms}/source/geojsonsource.d.ts +0 -0
- /package/lib/{formbuilder/objectform → features/layers/forms}/source/geotiffsource.d.ts +0 -0
- /package/lib/{formbuilder/objectform → features/layers/forms}/source/pathbasedsource.d.ts +0 -0
- /package/lib/{formbuilder/objectform → features/layers/forms}/source/tilesourceform.d.ts +0 -0
- /package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ColorRampSelectorEntry.d.ts +0 -0
- /package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ColorRampSelectorEntry.js +0 -0
- /package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ModeSelectRow.js +0 -0
- /package/lib/{dialogs → features/layers}/symbology/components/color_ramp/RgbaColorPicker.d.ts +0 -0
- /package/lib/{dialogs → features/layers}/symbology/components/color_ramp/cmocean.json +0 -0
- /package/lib/{dialogs → features/layers}/symbology/components/color_stops/StopContainer.d.ts +0 -0
- /package/lib/{dialogs → features/layers}/symbology/hooks/useEffectiveSymbologyParams.d.ts +0 -0
- /package/lib/{dialogs → features/layers}/symbology/hooks/useEffectiveSymbologyParams.js +0 -0
- /package/lib/{dialogs → features/layers}/symbology/hooks/useGetProperties.d.ts +0 -0
- /package/lib/{dialogs → features/layers}/symbology/hooks/useGetSymbology.d.ts +0 -0
- /package/lib/{dialogs → features/layers}/symbology/hooks/useOkSignal.d.ts +0 -0
- /package/lib/{dialogs → features/layers}/symbology/hooks/useOkSignal.js +0 -0
- /package/lib/{formbuilder/objectform/process → features/processing/forms}/dissolveProcessForm.d.ts +0 -0
- /package/lib/{processing → features/processing}/processingFormToParam.d.ts +0 -0
- /package/lib/{processing → features/processing}/processingFormToParam.js +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/components/StacPanel.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/QueryableComboBox.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/QueryableRow.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/StacFilterExtensionPanel.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/StacQueryableFilters.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/components/geodes/StacFilterSection.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/components/geodes/StacGeodesFilterPanel.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/components/geodes/StacGeodesFilterPanel.js +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/components/shared/StacPanelResults.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/components/shared/StacSpatialExtent.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/components/shared/StacTemporalExtent.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/constants.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/constants.js +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/context/StacResultsContext.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/hooks/useGeodesSearch.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/hooks/useStacFilterExtension.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/hooks/useStacSearch.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/index.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/index.js +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/types/types.d.ts +0 -0
- /package/lib/{panelview/story-maps → features/story}/StoryEditorPanel.d.ts +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/PreviewModeSwitch.d.ts +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/PreviewModeSwitch.js +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/StoryContentSection.d.ts +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/StoryContentSection.js +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/StoryImageSection.d.ts +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/StoryImageSection.js +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/StoryNavBar.d.ts +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/StoryNavBar.js +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/StorySubtitleSection.d.ts +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/StorySubtitleSection.js +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/StoryTitleSection.d.ts +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/StoryTitleSection.js +0 -0
- /package/lib/{formbuilder → shared/formbuilder}/creationform.d.ts +0 -0
- /package/lib/{formbuilder → shared/formbuilder}/editform.d.ts +0 -0
- /package/lib/{formbuilder → shared/formbuilder}/objectform/SchemaForm.js +0 -0
- /package/lib/{formbuilder → shared/formbuilder}/objectform/components/LayerSelect.d.ts +0 -0
- /package/lib/{formbuilder → shared/formbuilder}/objectform/components/OpacitySlider.d.ts +0 -0
- /package/lib/{formbuilder → shared/formbuilder}/objectform/components/OpacitySlider.js +0 -0
- /package/lib/{formbuilder → shared/formbuilder}/objectform/components/SegmentFormSymbology.d.ts +0 -0
- /package/lib/{formbuilder → shared/formbuilder}/objectform/components/SourcePropertiesField.d.ts +0 -0
- /package/lib/{formbuilder → shared/formbuilder}/objectform/components/StorySegmentReset.d.ts +0 -0
- /package/lib/{formbuilder → shared/formbuilder}/objectform/components/WmsTileSourceUrlInput.d.ts +0 -0
- /package/lib/{formbuilder → shared/formbuilder}/objectform/fileselectorwidget.d.ts +0 -0
- /package/lib/{store.d.ts → shared/store.d.ts} +0 -0
- /package/lib/{store.js → shared/store.js} +0 -0
- /package/lib/{menus.d.ts → workspace/menus.d.ts} +0 -0
- /package/lib/{panelview → workspace/panels}/components/layers.d.ts +0 -0
- /package/lib/{panelview → workspace/panels}/components/legendItem.d.ts +0 -0
- /package/lib/{panelview → workspace/panels}/header.d.ts +0 -0
- /package/lib/{panelview → workspace/panels}/header.js +0 -0
- /package/lib/{statusbar → workspace/statusbar}/SpectaPresentationProgressBar.d.ts +0 -0
- /package/lib/{statusbar → workspace/statusbar}/SpectaPresentationProgressBar.js +0 -0
- /package/lib/{statusbar → workspace/statusbar}/StatusBar.d.ts +0 -0
- /package/lib/{toolbar → workspace/toolbar}/index.d.ts +0 -0
- /package/lib/{toolbar → workspace/toolbar}/index.js +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { STORY_TYPE } from "../../../types";
|
|
2
|
+
/** CSS variables (+ optional text color) for specta theming */
|
|
3
|
+
export function getSpectaPresentationCssVars(story) {
|
|
4
|
+
const isListMode = (story === null || story === void 0 ? void 0 : story.storyType) === STORY_TYPE.verticalScroll;
|
|
5
|
+
const bgColor = story === null || story === void 0 ? void 0 : story.presentationBgColor;
|
|
6
|
+
const textColor = story === null || story === void 0 ? void 0 : story.presentationTextColor;
|
|
7
|
+
const style = {};
|
|
8
|
+
if (textColor) {
|
|
9
|
+
style['--jgis-specta-text-color'] = textColor;
|
|
10
|
+
style.color = textColor;
|
|
11
|
+
}
|
|
12
|
+
if (isListMode) {
|
|
13
|
+
style['--jgis-specta-panel-color'] =
|
|
14
|
+
'transparent';
|
|
15
|
+
if (bgColor) {
|
|
16
|
+
style['--jgis-specta-bg-color'] = bgColor;
|
|
17
|
+
}
|
|
18
|
+
return style;
|
|
19
|
+
}
|
|
20
|
+
if (bgColor) {
|
|
21
|
+
style['--jgis-specta-panel-color'] = bgColor;
|
|
22
|
+
}
|
|
23
|
+
return style;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Full inline style for solid surfaces (e.g. mobile drawer).
|
|
27
|
+
* Do not use on `.jgis-specta-story-panel-container` — it overrides the gradient.
|
|
28
|
+
*/
|
|
29
|
+
export function getSpectaPresentationStyle(story) {
|
|
30
|
+
const style = getSpectaPresentationCssVars(story);
|
|
31
|
+
const isListMode = (story === null || story === void 0 ? void 0 : story.storyType) === STORY_TYPE.verticalScroll;
|
|
32
|
+
const bgColor = story === null || story === void 0 ? void 0 : story.presentationBgColor;
|
|
33
|
+
if (!isListMode && bgColor) {
|
|
34
|
+
style.backgroundColor = bgColor;
|
|
35
|
+
}
|
|
36
|
+
return style;
|
|
37
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IJGISStoryMap, IJupyterGISModel } from '@jupytergis/schema';
|
|
2
|
+
import type { IListStoryMarkdownSegment, IStorySegmentViewItem } from "../types/types";
|
|
3
|
+
export declare function buildStorySegmentViewItems(model: IJupyterGISModel, storyData: IJGISStoryMap | null): IStorySegmentViewItem[];
|
|
4
|
+
export declare function getStoryMarkdownFromSlide(activeSlide: IStorySegmentViewItem['activeSlide']): string;
|
|
5
|
+
export declare function getListStoryMarkdownSegmentsFromItems(items: IStorySegmentViewItem[]): IListStoryMarkdownSegment[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { getSegmentDisplayMode } from './listStoryScrollTrack';
|
|
2
|
+
export function buildStorySegmentViewItems(model, storyData) {
|
|
3
|
+
var _a;
|
|
4
|
+
const segments = (_a = storyData === null || storyData === void 0 ? void 0 : storyData.storySegments) !== null && _a !== void 0 ? _a : [];
|
|
5
|
+
const items = segments.map((segmentId, index) => {
|
|
6
|
+
var _a;
|
|
7
|
+
const layer = model.getLayer(segmentId);
|
|
8
|
+
return {
|
|
9
|
+
id: segmentId,
|
|
10
|
+
index,
|
|
11
|
+
layerName: (_a = layer === null || layer === void 0 ? void 0 : layer.name) !== null && _a !== void 0 ? _a : `Segment ${index + 1}`,
|
|
12
|
+
activeSlide: layer === null || layer === void 0 ? void 0 : layer.parameters,
|
|
13
|
+
};
|
|
14
|
+
});
|
|
15
|
+
return items;
|
|
16
|
+
}
|
|
17
|
+
export function getStoryMarkdownFromSlide(activeSlide) {
|
|
18
|
+
var _a;
|
|
19
|
+
const markdown = (_a = activeSlide === null || activeSlide === void 0 ? void 0 : activeSlide.content) === null || _a === void 0 ? void 0 : _a.markdown;
|
|
20
|
+
return typeof markdown === 'string' ? markdown : '';
|
|
21
|
+
}
|
|
22
|
+
export function getListStoryMarkdownSegmentsFromItems(items) {
|
|
23
|
+
return items
|
|
24
|
+
.filter(item => getSegmentDisplayMode(item.activeSlide) === 'markdown')
|
|
25
|
+
.map(item => ({
|
|
26
|
+
id: item.id,
|
|
27
|
+
index: item.index,
|
|
28
|
+
markdown: getStoryMarkdownFromSlide(item.activeSlide),
|
|
29
|
+
}));
|
|
30
|
+
}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
export * from './annotations';
|
|
1
|
+
export * from './features/annotations';
|
|
2
|
+
export * from './features/processing/serverProcessing';
|
|
2
3
|
export * from './commands/index';
|
|
3
4
|
export * from './constants';
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './icons';
|
|
5
|
+
export * from './features/layers/layerCreationFormDialog';
|
|
6
|
+
export * from './shared/icons';
|
|
6
7
|
export * from './mainview';
|
|
7
|
-
export * from './menus';
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './store';
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './
|
|
8
|
+
export * from './workspace/menus';
|
|
9
|
+
export * from './workspace/panels';
|
|
10
|
+
export * from './shared/store';
|
|
11
|
+
export * from './features/stac-browser';
|
|
12
|
+
export * from './features/objectproperties';
|
|
13
|
+
export * from './workspace/toolbar';
|
|
12
14
|
export * from './tools';
|
|
13
15
|
export * from './types';
|
|
14
|
-
export * from './widget';
|
|
16
|
+
export * from './workspace/widget';
|
package/lib/index.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
export * from './annotations';
|
|
1
|
+
export * from './features/annotations';
|
|
2
|
+
export * from './features/processing/serverProcessing';
|
|
2
3
|
export * from './commands/index';
|
|
3
4
|
export * from './constants';
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './icons';
|
|
5
|
+
export * from './features/layers/layerCreationFormDialog';
|
|
6
|
+
export * from './shared/icons';
|
|
6
7
|
export * from './mainview';
|
|
7
|
-
export * from './menus';
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './store';
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './
|
|
8
|
+
export * from './workspace/menus';
|
|
9
|
+
export * from './workspace/panels';
|
|
10
|
+
export * from './shared/store';
|
|
11
|
+
export * from './features/stac-browser';
|
|
12
|
+
export * from './features/objectproperties';
|
|
13
|
+
export * from './workspace/toolbar';
|
|
12
14
|
export * from './tools';
|
|
13
15
|
export * from './types';
|
|
14
|
-
export * from './widget';
|
|
16
|
+
export * from './workspace/widget';
|
package/lib/keybindings.json
CHANGED
|
@@ -39,6 +39,11 @@
|
|
|
39
39
|
"keys": ["F2"],
|
|
40
40
|
"selector": ".data-jgis-keybinding"
|
|
41
41
|
},
|
|
42
|
+
{
|
|
43
|
+
"command": "jupytergis:toggleDrawFeatures",
|
|
44
|
+
"keys": ["Accel Shift D"],
|
|
45
|
+
"selector": ".data-jgis-keybinding"
|
|
46
|
+
},
|
|
42
47
|
{
|
|
43
48
|
"command": "jupytergis:executeConsole",
|
|
44
49
|
"keys": ["Shift Enter"],
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Connection, Process } from '@openeo/js-client';
|
|
2
|
+
import TileLayer from 'ol/layer/Tile';
|
|
3
|
+
import { ProjectionLike } from 'ol/proj';
|
|
4
|
+
import { XYZ as XYZSource } from 'ol/source';
|
|
5
|
+
import { Options as XYZOptions } from 'ol/source/XYZ';
|
|
6
|
+
export interface ISigninValues {
|
|
7
|
+
serverUrl: string;
|
|
8
|
+
username: string;
|
|
9
|
+
password: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function connect(connectionInfo: IOpenEOConnectionInfo): Promise<Connection>;
|
|
12
|
+
export interface IOpenEOConnectionInfo {
|
|
13
|
+
/**
|
|
14
|
+
* The url to the open-eo server.
|
|
15
|
+
*/
|
|
16
|
+
url?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The session bearer.
|
|
19
|
+
*/
|
|
20
|
+
authBearer?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface IOpenEOTileLayerOptions {
|
|
23
|
+
/**
|
|
24
|
+
* The tile size
|
|
25
|
+
*/
|
|
26
|
+
projection?: ProjectionLike;
|
|
27
|
+
}
|
|
28
|
+
export declare class OpenEOTileLayer extends TileLayer {
|
|
29
|
+
}
|
|
30
|
+
export interface IOpenEOTileSourceOptions extends XYZOptions {
|
|
31
|
+
/**
|
|
32
|
+
* The process graph value.
|
|
33
|
+
*/
|
|
34
|
+
processGraph: Process;
|
|
35
|
+
/**
|
|
36
|
+
* The connection info.
|
|
37
|
+
*/
|
|
38
|
+
connectionInfo: IOpenEOConnectionInfo;
|
|
39
|
+
}
|
|
40
|
+
export declare class OpenEOTileSource extends XYZSource {
|
|
41
|
+
constructor(options: IOpenEOTileSourceOptions);
|
|
42
|
+
private _connect;
|
|
43
|
+
private _updateUrl;
|
|
44
|
+
private _url;
|
|
45
|
+
private _connection;
|
|
46
|
+
private _connected;
|
|
47
|
+
processGraph: Process;
|
|
48
|
+
connectionInfo: IOpenEOConnectionInfo;
|
|
49
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { showErrorMessage, Dialog, ReactWidget, showDialog, } from '@jupyterlab/apputils';
|
|
2
|
+
import { PromiseDelegate } from '@lumino/coreutils';
|
|
3
|
+
import { OpenEO } from '@openeo/js-client';
|
|
4
|
+
import TileLayer from 'ol/layer/Tile';
|
|
5
|
+
import { XYZ as XYZSource } from 'ol/source';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
const CONNECTIONS = {};
|
|
8
|
+
class SigninWidget extends ReactWidget {
|
|
9
|
+
constructor(initialServerUrl = '') {
|
|
10
|
+
super();
|
|
11
|
+
this._username = '';
|
|
12
|
+
this._password = '';
|
|
13
|
+
this._serverUrl = initialServerUrl;
|
|
14
|
+
}
|
|
15
|
+
getValue() {
|
|
16
|
+
return {
|
|
17
|
+
serverUrl: this._serverUrl,
|
|
18
|
+
username: this._username,
|
|
19
|
+
password: this._password,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
return (React.createElement("div", { style: {
|
|
24
|
+
display: 'flex',
|
|
25
|
+
flexDirection: 'column',
|
|
26
|
+
gap: '12px',
|
|
27
|
+
minWidth: '320px',
|
|
28
|
+
} },
|
|
29
|
+
React.createElement("label", null,
|
|
30
|
+
React.createElement("div", { style: { marginBottom: '4px' } }, "Server URL"),
|
|
31
|
+
React.createElement("input", { className: "jp-mod-styled", type: "text", defaultValue: this._serverUrl, onChange: e => {
|
|
32
|
+
this._serverUrl = e.target.value;
|
|
33
|
+
}, style: { width: '100%' } })),
|
|
34
|
+
React.createElement("label", null,
|
|
35
|
+
React.createElement("div", { style: { marginBottom: '4px' } }, "Username"),
|
|
36
|
+
React.createElement("input", { className: "jp-mod-styled", type: "text", onChange: e => {
|
|
37
|
+
this._username = e.target.value;
|
|
38
|
+
}, style: { width: '100%' } })),
|
|
39
|
+
React.createElement("label", null,
|
|
40
|
+
React.createElement("div", { style: { marginBottom: '4px' } }, "Password"),
|
|
41
|
+
React.createElement("input", { className: "jp-mod-styled", type: "password", onChange: e => {
|
|
42
|
+
this._password = e.target.value;
|
|
43
|
+
}, style: { width: '100%' } }))));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
async function showSigninDialog(serverUrl) {
|
|
47
|
+
const body = new SigninWidget(serverUrl);
|
|
48
|
+
const result = await showDialog({
|
|
49
|
+
title: 'Signin to OpenEO tile server',
|
|
50
|
+
body,
|
|
51
|
+
buttons: [Dialog.cancelButton(), Dialog.okButton({ label: 'Sign In' })],
|
|
52
|
+
});
|
|
53
|
+
if (!result.button.accept) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
return body.getValue();
|
|
57
|
+
}
|
|
58
|
+
export async function connect(connectionInfo) {
|
|
59
|
+
let { url } = connectionInfo;
|
|
60
|
+
const { authBearer } = connectionInfo;
|
|
61
|
+
let signIn = null;
|
|
62
|
+
if (!url) {
|
|
63
|
+
signIn = await showSigninDialog(url);
|
|
64
|
+
if (!signIn) {
|
|
65
|
+
throw new Error('Needs credentials to connect to OpenEO server.');
|
|
66
|
+
}
|
|
67
|
+
url = signIn.serverUrl;
|
|
68
|
+
}
|
|
69
|
+
if (!url.match(/^https?:\/\//i)) {
|
|
70
|
+
url = `https://${url}`;
|
|
71
|
+
}
|
|
72
|
+
// Already connected to that server url
|
|
73
|
+
if (CONNECTIONS[url]) {
|
|
74
|
+
return CONNECTIONS[url];
|
|
75
|
+
}
|
|
76
|
+
const errorTitle = 'Failed to connect to the OpenEO server';
|
|
77
|
+
const parsedUrl = new URL(url);
|
|
78
|
+
if (window.location.protocol === 'https:' &&
|
|
79
|
+
parsedUrl.protocol !== 'https:') {
|
|
80
|
+
showErrorMessage(errorTitle, 'You are trying to connect to a server with HTTP instead of HTTPS, which is insecure and prohibited by web browsers. Please use HTTPS instead.');
|
|
81
|
+
throw new Error(errorTitle);
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
const connection = await OpenEO.connect(url, {
|
|
85
|
+
addNamespaceToProcess: true,
|
|
86
|
+
});
|
|
87
|
+
const providers = await connection.listAuthProviders();
|
|
88
|
+
let providerType = 'basic';
|
|
89
|
+
let token = null;
|
|
90
|
+
if (authBearer) {
|
|
91
|
+
providerType = authBearer.split('/')[0];
|
|
92
|
+
token = authBearer.split('/')[2];
|
|
93
|
+
}
|
|
94
|
+
const authProvider = providers.find(provider => provider.type === providerType);
|
|
95
|
+
if (!authProvider) {
|
|
96
|
+
throw new Error(`Failed to get "${providerType}" OpenEO provider.`);
|
|
97
|
+
}
|
|
98
|
+
if (token) {
|
|
99
|
+
authProvider.setToken(token);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
if (!signIn) {
|
|
103
|
+
// TODO Add support for signin dialogs for OIDC?
|
|
104
|
+
signIn = await showSigninDialog(url);
|
|
105
|
+
if (!signIn) {
|
|
106
|
+
throw new Error('Needs credentials to connect to OpenEO server.');
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
await authProvider.login(signIn.username, signIn.password);
|
|
110
|
+
const token = authProvider.getToken();
|
|
111
|
+
if (token) {
|
|
112
|
+
connectionInfo.authBearer = token;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const serviceTypes = await connection.listServiceTypes();
|
|
116
|
+
// TODO Support other services?
|
|
117
|
+
if (!serviceTypes['XYZ']) {
|
|
118
|
+
throw new Error('We need the OpenEO service to support XYZ tiling.');
|
|
119
|
+
}
|
|
120
|
+
CONNECTIONS[url] = connection;
|
|
121
|
+
return connection;
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
showErrorMessage(errorTitle, `${error}`);
|
|
125
|
+
throw error;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
export class OpenEOTileLayer extends TileLayer {
|
|
129
|
+
}
|
|
130
|
+
export class OpenEOTileSource extends XYZSource {
|
|
131
|
+
constructor(options) {
|
|
132
|
+
super(Object.assign(Object.assign({}, options), { url: '{z},{x},{y}', tileLoadFunction: async (tile, src) => {
|
|
133
|
+
await this._connected.promise;
|
|
134
|
+
let url = this._url;
|
|
135
|
+
if (!url) {
|
|
136
|
+
throw new Error('XYZ URL undefined');
|
|
137
|
+
}
|
|
138
|
+
const [z, x, y] = tile.tileCoord;
|
|
139
|
+
url = url.replace('%7Bz%7D', z);
|
|
140
|
+
url = url.replace('%7By%7D', y);
|
|
141
|
+
url = url.replace('%7Bx%7D', x);
|
|
142
|
+
const res = await fetch(url, {
|
|
143
|
+
method: 'GET',
|
|
144
|
+
});
|
|
145
|
+
const blob = await res.blob();
|
|
146
|
+
tile.getImage().src = URL.createObjectURL(blob);
|
|
147
|
+
} }));
|
|
148
|
+
this._url = null;
|
|
149
|
+
this._connection = null;
|
|
150
|
+
this._connected = new PromiseDelegate();
|
|
151
|
+
this._connect(options.connectionInfo, options.processGraph);
|
|
152
|
+
}
|
|
153
|
+
async _connect(connectionInfo, graph) {
|
|
154
|
+
this._connection = await connect(connectionInfo);
|
|
155
|
+
if (!this._connection) {
|
|
156
|
+
throw new Error('Failed to get OpenEO connection');
|
|
157
|
+
}
|
|
158
|
+
this._connected.resolve();
|
|
159
|
+
this._updateUrl(graph);
|
|
160
|
+
}
|
|
161
|
+
async _updateUrl(processGraph) {
|
|
162
|
+
await this._connected.promise;
|
|
163
|
+
if (!this._connection) {
|
|
164
|
+
throw new Error('Failed to get OpenEO service connection');
|
|
165
|
+
}
|
|
166
|
+
let service = null;
|
|
167
|
+
try {
|
|
168
|
+
service = await this._connection.createService(processGraph, 'XYZ');
|
|
169
|
+
}
|
|
170
|
+
catch (e) {
|
|
171
|
+
throw new Error(`Failed to connect to XYZ service ${e}`);
|
|
172
|
+
}
|
|
173
|
+
if (!service.url) {
|
|
174
|
+
throw new Error('Failed to connect to XYZ service');
|
|
175
|
+
}
|
|
176
|
+
this._url = service.url;
|
|
177
|
+
this.refresh();
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -4,7 +4,7 @@ import { Button, Slider } from '@jupyter/react-components';
|
|
|
4
4
|
import { format, isValid, parse } from 'date-fns';
|
|
5
5
|
import { daysInYear, millisecondsInDay, millisecondsInHour, millisecondsInMinute, millisecondsInSecond, millisecondsInWeek, minutesInMonth, } from 'date-fns/constants';
|
|
6
6
|
import React, { useEffect, useRef, useState } from 'react';
|
|
7
|
-
import { useGetProperties } from "../
|
|
7
|
+
import { useGetProperties } from "../features/layers/symbology/hooks/useGetProperties";
|
|
8
8
|
// List of common date formats to try
|
|
9
9
|
// TODO: Not even close to every valid format
|
|
10
10
|
const commonDateFormats = [
|
|
@@ -45,7 +45,7 @@ const TemporalSlider = ({ model, filterStates, }) => {
|
|
|
45
45
|
const { featureProperties } = useGetProperties({ layerId, model });
|
|
46
46
|
useEffect(() => {
|
|
47
47
|
// This is for when the selected layer changes
|
|
48
|
-
const
|
|
48
|
+
const handleSelectedChanged = () => {
|
|
49
49
|
var _a, _b;
|
|
50
50
|
if (!((_b = (_a = model.localState) === null || _a === void 0 ? void 0 : _a.selected) === null || _b === void 0 ? void 0 : _b.value)) {
|
|
51
51
|
return;
|
|
@@ -59,7 +59,7 @@ const TemporalSlider = ({ model, filterStates, }) => {
|
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
// this is for when the layer itself changes
|
|
62
|
-
const
|
|
62
|
+
const handleSharedLayersChanged = (_, change) => {
|
|
63
63
|
var _a;
|
|
64
64
|
// Get the changes for the selected layer
|
|
65
65
|
const selectedLayer = (_a = change.layerChange) === null || _a === void 0 ? void 0 : _a.find(layer => layer.id === layerIdRef.current);
|
|
@@ -71,16 +71,18 @@ const TemporalSlider = ({ model, filterStates, }) => {
|
|
|
71
71
|
// If layer was deleted (empty object) or the layer type changed, close the temporal controller
|
|
72
72
|
if (Object.keys(newValue).length === 0 ||
|
|
73
73
|
newValue.type !== oldValue.type) {
|
|
74
|
-
model.
|
|
74
|
+
if (model.isTemporalControllerActive) {
|
|
75
|
+
model.toggleTemporalController();
|
|
76
|
+
}
|
|
75
77
|
}
|
|
76
78
|
};
|
|
77
79
|
// Initial state
|
|
78
|
-
|
|
79
|
-
model.
|
|
80
|
-
model.sharedLayersChanged.connect(
|
|
80
|
+
handleSelectedChanged();
|
|
81
|
+
model.selectedChanged.connect(handleSelectedChanged);
|
|
82
|
+
model.sharedLayersChanged.connect(handleSharedLayersChanged);
|
|
81
83
|
return () => {
|
|
82
|
-
model.
|
|
83
|
-
model.sharedLayersChanged.disconnect(
|
|
84
|
+
model.selectedChanged.disconnect(handleSelectedChanged);
|
|
85
|
+
model.sharedLayersChanged.disconnect(handleSharedLayersChanged);
|
|
84
86
|
removeFilter();
|
|
85
87
|
if (intervalRef.current) {
|
|
86
88
|
clearInterval(intervalRef.current);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IDict } from '@jupytergis/schema';
|
|
2
|
+
import { User } from '@jupyterlab/services';
|
|
3
|
+
import React, { RefObject } from 'react';
|
|
4
|
+
import { ClientPointer } from "../CollaboratorPointers";
|
|
5
|
+
export interface IMainViewMapSurfaceProps {
|
|
6
|
+
mainViewRef: RefObject<HTMLDivElement>;
|
|
7
|
+
loading: boolean;
|
|
8
|
+
remoteUser?: User.IIdentity | null;
|
|
9
|
+
clientPointers: IDict<ClientPointer>;
|
|
10
|
+
spectaMobileTouch: boolean;
|
|
11
|
+
onTouchStart?: (event: React.TouchEvent) => void;
|
|
12
|
+
onTouchEnd?: (event: React.TouchEvent) => void;
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare function MainViewMapSurface({ mainViewRef, loading, remoteUser, clientPointers, spectaMobileTouch, onTouchStart, onTouchEnd, children, }: IMainViewMapSurfaceProps): JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import CollaboratorPointers from "../CollaboratorPointers";
|
|
3
|
+
import { FollowIndicator } from "../FollowIndicator";
|
|
4
|
+
import { LoadingOverlay } from "../../shared/components/loading";
|
|
5
|
+
export function MainViewMapSurface({ mainViewRef, loading, remoteUser, clientPointers, spectaMobileTouch, onTouchStart, onTouchEnd, children, }) {
|
|
6
|
+
return (React.createElement("div", { ref: mainViewRef, className: "jGIS-Mainview data-jgis-keybinding", tabIndex: 0, style: {
|
|
7
|
+
border: remoteUser ? `solid 3px ${remoteUser.color}` : 'unset',
|
|
8
|
+
}, onTouchStart: spectaMobileTouch ? onTouchStart : undefined, onTouchEnd: spectaMobileTouch ? onTouchEnd : undefined },
|
|
9
|
+
React.createElement(LoadingOverlay, { loading: loading }),
|
|
10
|
+
React.createElement(FollowIndicator, { remoteUser: remoteUser }),
|
|
11
|
+
React.createElement(CollaboratorPointers, { clients: clientPointers }),
|
|
12
|
+
children));
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface IMainViewOverlayLayerProps {
|
|
3
|
+
annotationFloaters: React.ReactNode;
|
|
4
|
+
featureFloaters: React.ReactNode;
|
|
5
|
+
editingVectorLayer: boolean;
|
|
6
|
+
drawGeometryLabel: string | undefined;
|
|
7
|
+
onDrawGeometryTypeChange: (event: React.ChangeEvent<HTMLSelectElement>) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function MainViewOverlayLayer({ annotationFloaters, featureFloaters, editingVectorLayer, drawGeometryLabel, onDrawGeometryTypeChange, }: IMainViewOverlayLayerProps): JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
const DRAW_GEOMETRIES = ['Point', 'LineString', 'Polygon'];
|
|
3
|
+
export function MainViewOverlayLayer({ annotationFloaters, featureFloaters, editingVectorLayer, drawGeometryLabel, onDrawGeometryTypeChange, }) {
|
|
4
|
+
return (React.createElement(React.Fragment, null,
|
|
5
|
+
annotationFloaters,
|
|
6
|
+
featureFloaters,
|
|
7
|
+
editingVectorLayer ? (React.createElement("div", { className: "jgis-geometry-type-selector-overlay" },
|
|
8
|
+
React.createElement("select", { className: "geometry-type-selector", id: "geometry-type-selector", value: drawGeometryLabel !== null && drawGeometryLabel !== void 0 ? drawGeometryLabel : '', onChange: onDrawGeometryTypeChange },
|
|
9
|
+
React.createElement("option", { value: "", disabled: true, hidden: true }, "Geometry type"),
|
|
10
|
+
DRAW_GEOMETRIES.map(geometryType => (React.createElement("option", { key: geometryType, value: geometryType }, geometryType)))))) : null));
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IAnnotationModel, IJGISFormSchemaRegistry, IJGISLayer, IJupyterGISModel, IJupyterGISSettings } from '@jupytergis/schema';
|
|
2
|
+
import { IStateDB } from '@jupyterlab/statedb';
|
|
3
|
+
import { CommandRegistry } from '@lumino/commands';
|
|
4
|
+
import type { PatchGeoJSONFeatureProperties } from "../geoJsonFeaturePatch";
|
|
5
|
+
export interface IMainViewSidePanelsProps {
|
|
6
|
+
model: IJupyterGISModel;
|
|
7
|
+
commands: CommandRegistry;
|
|
8
|
+
settings: IJupyterGISSettings;
|
|
9
|
+
showMergedMobilePanel: boolean;
|
|
10
|
+
state?: IStateDB;
|
|
11
|
+
formSchemaRegistry?: IJGISFormSchemaRegistry;
|
|
12
|
+
annotationModel?: IAnnotationModel;
|
|
13
|
+
addLayer: (id: string, layer: IJGISLayer, index: number) => Promise<void>;
|
|
14
|
+
removeLayer: (id: string) => void;
|
|
15
|
+
patchGeoJSONFeatureProperties: PatchGeoJSONFeatureProperties;
|
|
16
|
+
}
|
|
17
|
+
export declare function MainViewSidePanels({ model, commands, settings, showMergedMobilePanel, state, formSchemaRegistry, annotationModel, addLayer, removeLayer, patchGeoJSONFeatureProperties, }: IMainViewSidePanelsProps): JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LeftPanel, MergedPanel, RightPanel } from "../../workspace/panels";
|
|
3
|
+
export function MainViewSidePanels({ model, commands, settings, showMergedMobilePanel, state, formSchemaRegistry, annotationModel, addLayer, removeLayer, patchGeoJSONFeatureProperties, }) {
|
|
4
|
+
if (showMergedMobilePanel) {
|
|
5
|
+
return (React.createElement(MergedPanel, { model: model, commands: commands, state: state, settings: settings, formSchemaRegistry: formSchemaRegistry, annotationModel: annotationModel, addLayer: addLayer, removeLayer: removeLayer }));
|
|
6
|
+
}
|
|
7
|
+
return (React.createElement(React.Fragment, null,
|
|
8
|
+
state ? (React.createElement(LeftPanel, { model: model, commands: commands, state: state, settings: settings })) : null,
|
|
9
|
+
formSchemaRegistry && annotationModel ? (React.createElement(RightPanel, { model: model, commands: commands, formSchemaRegistry: formSchemaRegistry, annotationModel: annotationModel, addLayer: addLayer, removeLayer: removeLayer, settings: settings, patchGeoJSONFeatureProperties: patchGeoJSONFeatureProperties })) : null));
|
|
10
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IJGISLayer, IJupyterGISModel } from '@jupytergis/schema';
|
|
2
|
+
import { RefObject } from 'react';
|
|
3
|
+
import type { IStoryViewerPanelHandle } from "../../features/story/StoryViewerPanel";
|
|
4
|
+
import type { IListStorySegmentTransition } from "../../features/story/types/types";
|
|
5
|
+
export interface IMainViewSpectaPanelProps {
|
|
6
|
+
model: IJupyterGISModel;
|
|
7
|
+
isSpecta: boolean;
|
|
8
|
+
isMobile: boolean;
|
|
9
|
+
initialLayersReady: boolean;
|
|
10
|
+
containerRef: RefObject<HTMLDivElement>;
|
|
11
|
+
storyViewerPanelRef: RefObject<IStoryViewerPanelHandle>;
|
|
12
|
+
addLayer: (id: string, layer: IJGISLayer, index: number) => Promise<void>;
|
|
13
|
+
removeLayer: (id: string) => void;
|
|
14
|
+
onSegmentTransitionEnd: () => void;
|
|
15
|
+
onSegmentTransitionChange: (payload: IListStorySegmentTransition | null) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function MainViewSpectaPanel({ model, isSpecta, isMobile, initialLayersReady, containerRef, storyViewerPanelRef, addLayer, removeLayer, onSegmentTransitionEnd, onSegmentTransitionChange, }: IMainViewSpectaPanelProps): JSX.Element | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SpectaPanel } from "../../features/story/SpectaPanel";
|
|
3
|
+
export function MainViewSpectaPanel({ model, isSpecta, isMobile, initialLayersReady, containerRef, storyViewerPanelRef, addLayer, removeLayer, onSegmentTransitionEnd, onSegmentTransitionChange, }) {
|
|
4
|
+
if (!initialLayersReady) {
|
|
5
|
+
return null;
|
|
6
|
+
}
|
|
7
|
+
return (React.createElement(SpectaPanel, { model: model, isSpecta: isSpecta, isMobile: isMobile, onSegmentTransitionEnd: onSegmentTransitionEnd, containerRef: containerRef, storyViewerPanelRef: storyViewerPanelRef, addLayer: addLayer, removeLayer: removeLayer, onSegmentTransitionChange: onSegmentTransitionChange }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IJupyterGISModel } from '@jupytergis/schema';
|
|
2
|
+
import React, { RefObject } from 'react';
|
|
3
|
+
import type { IListStorySegmentTransition } from "../../features/story/types/types";
|
|
4
|
+
export interface IMainViewStoryStageProps {
|
|
5
|
+
model: IJupyterGISModel;
|
|
6
|
+
isListStory: boolean;
|
|
7
|
+
isMobile: boolean;
|
|
8
|
+
segmentTransition: IListStorySegmentTransition | null;
|
|
9
|
+
stageRef: RefObject<HTMLDivElement>;
|
|
10
|
+
controlsToolbarRef: RefObject<HTMLDivElement>;
|
|
11
|
+
panels: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare function MainViewStoryStage({ model, isListStory, isMobile, segmentTransition, stageRef, controlsToolbarRef, panels, }: IMainViewStoryStageProps): JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ListStoryStageOverlay } from "../../features/story/components/ListStoryStageOverlay";
|
|
3
|
+
import { ListStoryTitleBar } from "../../features/story/components/ListStoryTitleBar";
|
|
4
|
+
import { ListStoryScrollTrackProvider } from "../../features/story/context/ListStoryScrollTrackContext";
|
|
5
|
+
export function MainViewStoryStage({ model, isListStory, isMobile, segmentTransition, stageRef, controlsToolbarRef, panels, }) {
|
|
6
|
+
return (React.createElement("div", { ref: stageRef, className: "jgis-mainview-stage", style: {
|
|
7
|
+
width: '100%',
|
|
8
|
+
height: '100%',
|
|
9
|
+
position: 'relative',
|
|
10
|
+
} },
|
|
11
|
+
React.createElement(ListStoryScrollTrackProvider, { model: model, enabled: isListStory },
|
|
12
|
+
isListStory ? (React.createElement(React.Fragment, null,
|
|
13
|
+
React.createElement(ListStoryTitleBar, { model: model, isMobile: isMobile }),
|
|
14
|
+
React.createElement(ListStoryStageOverlay, { model: model, segmentTransition: segmentTransition }))) : null,
|
|
15
|
+
React.createElement("div", { className: "jgis-panels-wrapper" }, panels),
|
|
16
|
+
React.createElement("div", { ref: controlsToolbarRef, className: "jgis-controls-toolbar" }))));
|
|
17
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface IPositionedFloaterProps {
|
|
3
|
+
id: string;
|
|
4
|
+
className: string;
|
|
5
|
+
left: number;
|
|
6
|
+
top: number;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare function PositionedFloater({ id, className, left, top, children, }: IPositionedFloaterProps): JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IDict, IJGISSource, IJupyterGISModel } from '@jupytergis/schema';
|
|
2
|
+
export interface IPatchGeoJSONFeatureContext {
|
|
3
|
+
model: IJupyterGISModel;
|
|
4
|
+
persistAndRefreshSource: (sourceId: string, source: IJGISSource) => Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
export type PatchGeoJSONFeatureProperties = (sourceId: string, target: {
|
|
7
|
+
featureId: string;
|
|
8
|
+
}, propertyUpdates: IDict<any>) => Promise<boolean>;
|
|
9
|
+
export declare function createGeoJSONFeaturePatcher(context: IPatchGeoJSONFeatureContext): PatchGeoJSONFeatureProperties;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { deepCopy } from "../tools";
|
|
2
|
+
/**
|
|
3
|
+
* Only concerned with features added via draw tool for now
|
|
4
|
+
*/
|
|
5
|
+
async function patchGeoJSONFeatureProperties(context, sourceId, target, propertyUpdates) {
|
|
6
|
+
var _a;
|
|
7
|
+
if (!context.model.sharedModel.editable) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
const source = context.model.getSource(sourceId);
|
|
11
|
+
if (!source || source.type !== 'GeoJSONSource') {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
const parameters = source.parameters;
|
|
15
|
+
const data = parameters.data;
|
|
16
|
+
if (!data || data.type !== 'FeatureCollection') {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
const features = data.features;
|
|
20
|
+
const featureId = target.featureId;
|
|
21
|
+
const index = features.findIndex(feature => { var _a; return ((_a = feature.properties) === null || _a === void 0 ? void 0 : _a._id) === featureId; });
|
|
22
|
+
if (index < 0 || index >= features.length) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
const updatedSource = deepCopy(source);
|
|
26
|
+
const updatedParameters = updatedSource.parameters;
|
|
27
|
+
const updatedData = updatedParameters.data;
|
|
28
|
+
const updatedFeature = updatedData.features[index];
|
|
29
|
+
const nextProperties = Object.assign({}, ((_a = updatedFeature.properties) !== null && _a !== void 0 ? _a : {}));
|
|
30
|
+
Object.entries(propertyUpdates).forEach(([key, value]) => {
|
|
31
|
+
if (value === undefined) {
|
|
32
|
+
delete nextProperties[key];
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
nextProperties[key] = value;
|
|
36
|
+
});
|
|
37
|
+
updatedFeature.properties = nextProperties;
|
|
38
|
+
await context.persistAndRefreshSource(sourceId, updatedSource);
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
export function createGeoJSONFeaturePatcher(context) {
|
|
42
|
+
return (sourceId, target, propertyUpdates) => patchGeoJSONFeatureProperties(context, sourceId, target, propertyUpdates);
|
|
43
|
+
}
|