@jupytergis/base 0.14.1 → 0.16.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commands/BaseCommandIDs.d.ts +6 -0
- package/lib/commands/BaseCommandIDs.js +6 -0
- package/lib/commands/index.js +245 -55
- package/lib/commands/operationCommands.js +2 -2
- package/lib/constants.js +6 -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/features/layers/forms/layer/geoTiffLayerForm.d.ts +3 -0
- package/lib/{formbuilder/objectform/layer/webGlLayerForm.js → features/layers/forms/layer/geoTiffLayerForm.js} +5 -5
- package/lib/{formbuilder/objectform → features/layers/forms}/layer/heatmapLayerForm.js +4 -4
- package/lib/{formbuilder/objectform → features/layers/forms}/layer/hillshadeLayerForm.js +4 -4
- package/lib/{formbuilder/objectform → features/layers/forms}/layer/index.d.ts +1 -1
- package/lib/{formbuilder/objectform → features/layers/forms}/layer/index.js +1 -1
- 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 +2 -0
- package/lib/{formbuilder/objectform → features/layers/forms}/source/index.js +2 -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/features/layers/forms/source/wmsTileSource.d.ts +4 -0
- package/lib/features/layers/forms/source/wmsTileSource.js +78 -0
- 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 +235 -0
- package/lib/{dialogs/symbology/vector_layer/types → features/layers/symbology}/Heatmap.d.ts +1 -1
- package/lib/{dialogs/symbology/vector_layer/types → features/layers/symbology}/Heatmap.js +30 -10
- package/lib/{dialogs → features/layers}/symbology/classificationModes.d.ts +6 -6
- package/lib/{dialogs → features/layers}/symbology/classificationModes.js +57 -57
- package/lib/features/layers/symbology/colorRampUtils.d.ts +65 -0
- package/lib/features/layers/symbology/colorRampUtils.js +242 -0
- package/lib/features/layers/symbology/components/MappingRow.d.ts +40 -0
- package/lib/features/layers/symbology/components/MappingRow.js +516 -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 +3 -2
- 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 +12 -15
- package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ColorRampSelectorEntry.d.ts +2 -2
- package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ColorRampSelectorEntry.js +3 -11
- package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ModeSelectRow.d.ts +1 -1
- package/lib/features/layers/symbology/components/color_ramp/RgbaColorPicker.d.ts +13 -0
- package/lib/features/layers/symbology/components/color_ramp/RgbaColorPicker.js +128 -0
- package/lib/{dialogs → features/layers}/symbology/components/color_stops/StopContainer.js +3 -1
- package/lib/{dialogs → features/layers}/symbology/components/color_stops/StopRow.d.ts +2 -2
- package/lib/{dialogs → features/layers}/symbology/components/color_stops/StopRow.js +12 -7
- 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 +467 -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 +21 -0
- package/lib/features/layers/symbology/styleBuilder.js +145 -0
- package/lib/{dialogs → features/layers}/symbology/symbologyDialog.d.ts +3 -2
- package/lib/{dialogs → features/layers}/symbology/symbologyDialog.js +12 -12
- package/lib/features/layers/symbology/symbologyUtils.d.ts +41 -0
- package/lib/features/layers/symbology/symbologyUtils.js +114 -0
- 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 +64 -21
- 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.d.ts +1 -1
- package/lib/{stacBrowser → features/stac-browser}/hooks/useStacFilterExtension.js +198 -114
- package/lib/{stacBrowser → features/stac-browser}/hooks/useStacSearch.d.ts +1 -0
- package/lib/{stacBrowser → features/stac-browser}/hooks/useStacSearch.js +19 -11
- 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 +12 -0
- package/lib/features/story/components/ListStoryStageOverlay.js +132 -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/{panelview/story-maps → features/story}/components/SpectaMobileView.d.ts +2 -4
- package/lib/{panelview/story-maps → features/story}/components/SpectaMobileView.js +3 -3
- 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 +15 -0
- package/lib/features/story/context/ListStoryScrollTrackContext.js +142 -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 +20 -44
- 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 +38 -0
- package/lib/features/story/types/types.js +1 -0
- package/lib/features/story/utils/computeListStoryScrollState.d.ts +12 -0
- package/lib/features/story/utils/computeListStoryScrollState.js +70 -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/geoJsonFeaturePatch.d.ts +9 -0
- package/lib/mainview/geoJsonFeaturePatch.js +43 -0
- package/lib/mainview/mainView.d.ts +93 -8
- package/lib/mainview/mainView.js +1286 -529
- 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 +13 -4
- 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/shared/formbuilder/objectform/components/WmsTileSourceUrlInput.d.ts +3 -0
- package/lib/shared/formbuilder/objectform/components/WmsTileSourceUrlInput.js +84 -0
- 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 +2 -2
- 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 +3 -1
- package/lib/tools.js +140 -6
- package/lib/types.d.ts +12 -1
- package/lib/types.js +6 -1
- package/lib/{menus.js → workspace/menus.js} +14 -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 +82 -20
- 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 +19 -4
- package/style/base.css +109 -1
- 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 +28 -0
- 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 +3 -3
- package/style/spectaProgressBar.css +0 -1
- package/style/storyPanel.css +142 -9
- package/style/storySpectaArticleOverlay.css +129 -0
- package/style/symbologyDialog.css +330 -28
- package/lib/dialogs/symbology/colorRampUtils.d.ts +0 -20
- package/lib/dialogs/symbology/colorRampUtils.js +0 -132
- package/lib/dialogs/symbology/symbologyUtils.d.ts +0 -33
- package/lib/dialogs/symbology/symbologyUtils.js +0 -180
- 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 -301
- 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 -65
- package/lib/dialogs/symbology/vector_layer/types/Categorized.d.ts +0 -4
- package/lib/dialogs/symbology/vector_layer/types/Categorized.js +0 -196
- package/lib/dialogs/symbology/vector_layer/types/Graduated.d.ts +0 -4
- package/lib/dialogs/symbology/vector_layer/types/Graduated.js +0 -250
- package/lib/dialogs/symbology/vector_layer/types/SimpleSymbol.d.ts +0 -4
- package/lib/dialogs/symbology/vector_layer/types/SimpleSymbol.js +0 -105
- package/lib/formbuilder/index.d.ts +0 -4
- package/lib/formbuilder/index.js +0 -4
- 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 -200
- 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/heatmapLayerForm.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/ModeSelectRow.js +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}/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/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,19 @@
|
|
|
1
|
+
import { IJGISLayerTree, IJupyterGISModel } from '@jupytergis/schema';
|
|
2
|
+
import { CommandRegistry } from '@lumino/commands';
|
|
3
|
+
/**
|
|
4
|
+
* Subscribes to the model's layer tree and splits it into two derived trees:
|
|
5
|
+
* - `layerTree`: regular map layers (excludes StorySegmentLayers)
|
|
6
|
+
* - `segmentTree`: story segment layers only
|
|
7
|
+
*
|
|
8
|
+
* Also pre-selects the last item on first load, and syncs segment order back
|
|
9
|
+
* to the story map whenever the segment tree changes.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useLayerTree(model: IJupyterGISModel, commands: CommandRegistry, opts?: {
|
|
12
|
+
onSegmentAdded?: (payload: {
|
|
13
|
+
storySegmentId: string;
|
|
14
|
+
storyId: string;
|
|
15
|
+
}) => void;
|
|
16
|
+
}): {
|
|
17
|
+
layerTree: IJGISLayerTree;
|
|
18
|
+
segmentTree: IJGISLayerTree;
|
|
19
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CommandIDs } from '../../../constants';
|
|
3
|
+
/**
|
|
4
|
+
* Subscribes to the model's layer tree and splits it into two derived trees:
|
|
5
|
+
* - `layerTree`: regular map layers (excludes StorySegmentLayers)
|
|
6
|
+
* - `segmentTree`: story segment layers only
|
|
7
|
+
*
|
|
8
|
+
* Also pre-selects the last item on first load, and syncs segment order back
|
|
9
|
+
* to the story map whenever the segment tree changes.
|
|
10
|
+
*/
|
|
11
|
+
export function useLayerTree(model, commands, opts) {
|
|
12
|
+
const [rawLayerTree, setRawLayerTree] = React.useState(model.getLayerTree());
|
|
13
|
+
const hasSyncedInitialSelectionRef = React.useRef(false);
|
|
14
|
+
// Ref keeps the callback fresh without re-registering the signal handler on every render
|
|
15
|
+
const onSegmentAddedRef = React.useRef(opts === null || opts === void 0 ? void 0 : opts.onSegmentAdded);
|
|
16
|
+
React.useEffect(() => {
|
|
17
|
+
onSegmentAddedRef.current = opts === null || opts === void 0 ? void 0 : opts.onSegmentAdded;
|
|
18
|
+
});
|
|
19
|
+
React.useEffect(() => {
|
|
20
|
+
const syncInitialSelection = (tree) => {
|
|
21
|
+
if (hasSyncedInitialSelectionRef.current || tree.length === 0) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
hasSyncedInitialSelectionRef.current = true;
|
|
25
|
+
const lastItem = tree[tree.length - 1];
|
|
26
|
+
const lastId = typeof lastItem === 'string' ? lastItem : lastItem === null || lastItem === void 0 ? void 0 : lastItem.name;
|
|
27
|
+
const lastType = typeof lastItem === 'string' ? 'layer' : 'group';
|
|
28
|
+
if (lastId) {
|
|
29
|
+
model.syncSelected({ [lastId]: { type: lastType } }, model.getClientId().toString());
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const updateLayerTree = () => {
|
|
33
|
+
const freshTree = model.getLayerTree() || [];
|
|
34
|
+
setRawLayerTree(freshTree);
|
|
35
|
+
syncInitialSelection(freshTree);
|
|
36
|
+
commands.notifyCommandChanged(CommandIDs.toggleStoryPresentationMode);
|
|
37
|
+
};
|
|
38
|
+
const handleSegmentAdded = (_sender, payload) => {
|
|
39
|
+
var _a;
|
|
40
|
+
model.syncSelected({ [payload.storySegmentId]: { type: 'layer' } }, model.getClientId().toString());
|
|
41
|
+
(_a = onSegmentAddedRef.current) === null || _a === void 0 ? void 0 : _a.call(onSegmentAddedRef, payload);
|
|
42
|
+
};
|
|
43
|
+
model.sharedModel.layersChanged.connect(updateLayerTree);
|
|
44
|
+
model.sharedModel.layerTreeChanged.connect(updateLayerTree);
|
|
45
|
+
model.segmentAdded.connect(handleSegmentAdded);
|
|
46
|
+
updateLayerTree();
|
|
47
|
+
return () => {
|
|
48
|
+
model.sharedModel.layersChanged.disconnect(updateLayerTree);
|
|
49
|
+
model.sharedModel.layerTreeChanged.disconnect(updateLayerTree);
|
|
50
|
+
model.segmentAdded.disconnect(handleSegmentAdded);
|
|
51
|
+
};
|
|
52
|
+
}, [model]);
|
|
53
|
+
// Split the raw tree into regular layers and story segment layers
|
|
54
|
+
const { layerTree, segmentTree } = React.useMemo(() => {
|
|
55
|
+
const layers = [];
|
|
56
|
+
const segments = [];
|
|
57
|
+
const processLayer = (layer) => {
|
|
58
|
+
if (typeof layer === 'string') {
|
|
59
|
+
const layerData = model.getLayer(layer);
|
|
60
|
+
const isStorySegment = (layerData === null || layerData === void 0 ? void 0 : layerData.type) === 'StorySegmentLayer';
|
|
61
|
+
return {
|
|
62
|
+
layer: isStorySegment ? null : layer,
|
|
63
|
+
segment: isStorySegment ? layer : null,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const groupLayers = [];
|
|
67
|
+
const groupSegments = [];
|
|
68
|
+
for (const groupLayer of layer.layers) {
|
|
69
|
+
const result = processLayer(groupLayer);
|
|
70
|
+
if (result.layer !== null) {
|
|
71
|
+
groupLayers.push(result.layer);
|
|
72
|
+
}
|
|
73
|
+
if (result.segment !== null) {
|
|
74
|
+
groupSegments.push(result.segment);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
layer: groupLayers.length > 0 ? Object.assign(Object.assign({}, layer), { layers: groupLayers }) : null,
|
|
79
|
+
segment: groupSegments.length > 0 ? Object.assign(Object.assign({}, layer), { layers: groupSegments }) : null,
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
for (const item of rawLayerTree) {
|
|
83
|
+
const result = processLayer(item);
|
|
84
|
+
if (result.layer !== null) {
|
|
85
|
+
layers.push(result.layer);
|
|
86
|
+
}
|
|
87
|
+
if (result.segment !== null) {
|
|
88
|
+
segments.push(result.segment);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
layers.reverse();
|
|
92
|
+
return { layerTree: layers, segmentTree: segments };
|
|
93
|
+
}, [rawLayerTree]);
|
|
94
|
+
// Sync segment order back to the story map when it changes
|
|
95
|
+
React.useEffect(() => {
|
|
96
|
+
const { storyId, story } = model.getSelectedStory();
|
|
97
|
+
if (!story) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
model.sharedModel.updateStoryMap(storyId, Object.assign(Object.assign({}, story), { storySegments: segmentTree }));
|
|
101
|
+
}, [segmentTree]);
|
|
102
|
+
return { layerTree, segmentTree };
|
|
103
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IJupyterGISModel } from '@jupytergis/schema';
|
|
2
|
+
interface IUseRightPanelOptionsResult {
|
|
3
|
+
storyMapPresentationMode: boolean;
|
|
4
|
+
editorMode: boolean;
|
|
5
|
+
showEditor: boolean;
|
|
6
|
+
storyPanelTitle: string;
|
|
7
|
+
toggleEditor: () => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Tracks story map presentation mode and editor mode, and fires optional
|
|
11
|
+
* callbacks when the active tab should change. This keeps tab state in the
|
|
12
|
+
* caller (RightPanel, MergedPanel, …) rather than inside this hook, so the
|
|
13
|
+
* same hook can drive any panel layout.
|
|
14
|
+
*
|
|
15
|
+
* @param model - The JupyterGIS model to subscribe to.
|
|
16
|
+
* @param opts.onPresentationModeEnabled - Called when story presentation mode
|
|
17
|
+
* is activated; the caller should switch to the story tab.
|
|
18
|
+
* @param opts.onIdentifyFeatures - Called when new features are identified on
|
|
19
|
+
* the map; the caller should switch to the identify tab.
|
|
20
|
+
* @returns storyMapPresentationMode, editorMode, showEditor, storyPanelTitle,
|
|
21
|
+
* toggleEditor.
|
|
22
|
+
*/
|
|
23
|
+
export declare function useRightPanelOptions(model: IJupyterGISModel, opts?: {
|
|
24
|
+
onPresentationModeEnabled?: () => void;
|
|
25
|
+
onIdentifyFeatures?: () => void;
|
|
26
|
+
}): IUseRightPanelOptionsResult;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Tracks story map presentation mode and editor mode, and fires optional
|
|
4
|
+
* callbacks when the active tab should change. This keeps tab state in the
|
|
5
|
+
* caller (RightPanel, MergedPanel, …) rather than inside this hook, so the
|
|
6
|
+
* same hook can drive any panel layout.
|
|
7
|
+
*
|
|
8
|
+
* @param model - The JupyterGIS model to subscribe to.
|
|
9
|
+
* @param opts.onPresentationModeEnabled - Called when story presentation mode
|
|
10
|
+
* is activated; the caller should switch to the story tab.
|
|
11
|
+
* @param opts.onIdentifyFeatures - Called when new features are identified on
|
|
12
|
+
* the map; the caller should switch to the identify tab.
|
|
13
|
+
* @returns storyMapPresentationMode, editorMode, showEditor, storyPanelTitle,
|
|
14
|
+
* toggleEditor.
|
|
15
|
+
*/
|
|
16
|
+
export function useRightPanelOptions(model, opts) {
|
|
17
|
+
var _a;
|
|
18
|
+
const [editorMode, setEditorMode] = React.useState(true);
|
|
19
|
+
const [storyMapPresentationMode, setStoryMapPresentationMode] = React.useState((_a = model.getOptions().storyMapPresentationMode) !== null && _a !== void 0 ? _a : false);
|
|
20
|
+
// Keep refs fresh to avoid stale closures in the effect below
|
|
21
|
+
const onPresentationModeEnabledRef = React.useRef(opts === null || opts === void 0 ? void 0 : opts.onPresentationModeEnabled);
|
|
22
|
+
const onIdentifyFeaturesRef = React.useRef(opts === null || opts === void 0 ? void 0 : opts.onIdentifyFeatures);
|
|
23
|
+
React.useEffect(() => {
|
|
24
|
+
onPresentationModeEnabledRef.current = opts === null || opts === void 0 ? void 0 : opts.onPresentationModeEnabled;
|
|
25
|
+
onIdentifyFeaturesRef.current = opts === null || opts === void 0 ? void 0 : opts.onIdentifyFeatures;
|
|
26
|
+
});
|
|
27
|
+
React.useEffect(() => {
|
|
28
|
+
const onOptionsChanged = () => {
|
|
29
|
+
var _a;
|
|
30
|
+
const { storyMapPresentationMode } = model.getOptions();
|
|
31
|
+
setStoryMapPresentationMode(storyMapPresentationMode !== null && storyMapPresentationMode !== void 0 ? storyMapPresentationMode : false);
|
|
32
|
+
if (storyMapPresentationMode) {
|
|
33
|
+
(_a = onPresentationModeEnabledRef.current) === null || _a === void 0 ? void 0 : _a.call(onPresentationModeEnabledRef);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
let currentlyIdentifiedFeatures = undefined;
|
|
37
|
+
const handleIdentifiedFeaturesChanged = () => {
|
|
38
|
+
var _a, _b, _c;
|
|
39
|
+
const identifiedFeatures = (_b = (_a = model.localState) === null || _a === void 0 ? void 0 : _a.identifiedFeatures) === null || _b === void 0 ? void 0 : _b.value;
|
|
40
|
+
if (!identifiedFeatures) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (identifiedFeatures !== currentlyIdentifiedFeatures) {
|
|
44
|
+
currentlyIdentifiedFeatures = identifiedFeatures;
|
|
45
|
+
(_c = onIdentifyFeaturesRef.current) === null || _c === void 0 ? void 0 : _c.call(onIdentifyFeaturesRef);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
model.sharedOptionsChanged.connect(onOptionsChanged);
|
|
49
|
+
model.identifiedFeaturesChanged.connect(handleIdentifiedFeaturesChanged);
|
|
50
|
+
handleIdentifiedFeaturesChanged();
|
|
51
|
+
return () => {
|
|
52
|
+
model.sharedOptionsChanged.disconnect(onOptionsChanged);
|
|
53
|
+
model.identifiedFeaturesChanged.disconnect(handleIdentifiedFeaturesChanged);
|
|
54
|
+
};
|
|
55
|
+
}, [model]);
|
|
56
|
+
const showEditor = !storyMapPresentationMode && editorMode;
|
|
57
|
+
const storyPanelTitle = storyMapPresentationMode
|
|
58
|
+
? 'Story Map'
|
|
59
|
+
: editorMode
|
|
60
|
+
? 'Story Editor'
|
|
61
|
+
: 'Story Map';
|
|
62
|
+
const toggleEditor = () => {
|
|
63
|
+
setEditorMode(prev => !prev);
|
|
64
|
+
};
|
|
65
|
+
return {
|
|
66
|
+
storyMapPresentationMode,
|
|
67
|
+
editorMode,
|
|
68
|
+
showEditor,
|
|
69
|
+
storyPanelTitle,
|
|
70
|
+
toggleEditor,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GlobalStateDbManager } from "../../../shared/store";
|
|
3
|
+
const STATE_DB_KEY_PREFIX = 'jupytergis:localUIState:';
|
|
4
|
+
export function useUIState(key, model) {
|
|
5
|
+
const [value, setValue] = React.useState(() => model.getUIState()[key]);
|
|
6
|
+
// Listen for model uiState changes and persist to StateDB
|
|
7
|
+
React.useEffect(() => {
|
|
8
|
+
const handler = (_, state) => {
|
|
9
|
+
setValue(state[key]);
|
|
10
|
+
const stateDb = GlobalStateDbManager.getInstance().getStateDb();
|
|
11
|
+
if (stateDb) {
|
|
12
|
+
stateDb.save(`${STATE_DB_KEY_PREFIX}${model.filePath}`, state);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
model.uiStateChanged.connect(handler);
|
|
16
|
+
return () => {
|
|
17
|
+
model.uiStateChanged.disconnect(handler);
|
|
18
|
+
};
|
|
19
|
+
}, [model, key]);
|
|
20
|
+
const setUIStateValue = React.useCallback((newValue) => {
|
|
21
|
+
setValue(newValue);
|
|
22
|
+
model.setUIState({ [key]: newValue });
|
|
23
|
+
}, [model, key]);
|
|
24
|
+
return [value, setUIStateValue];
|
|
25
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IJupyterGISModel,
|
|
1
|
+
import { IJupyterGISModel, IJupyterGISSettings, SelectionType } from '@jupytergis/schema';
|
|
2
2
|
import { IStateDB } from '@jupyterlab/statedb';
|
|
3
3
|
import { CommandRegistry } from '@lumino/commands';
|
|
4
4
|
import { MouseEvent as ReactMouseEvent } from 'react';
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Draggable from 'react-draggable';
|
|
3
|
+
import { TabbedPanel } from './components/TabbedPanel';
|
|
4
|
+
import { LayersBodyComponent } from './components/layers';
|
|
5
|
+
import { useLayerTree } from './hooks/useLayerTree';
|
|
6
|
+
import { useUIState } from './hooks/useUIState';
|
|
7
|
+
import StacPanel from '../../features/stac-browser/components/StacPanel';
|
|
8
|
+
export const LeftPanel = props => {
|
|
9
|
+
var _a;
|
|
10
|
+
const nodeRef = React.useRef(null);
|
|
11
|
+
const [options, setOptions] = React.useState(props.model.getOptions());
|
|
12
|
+
const storyMapPresentationMode = (_a = options.storyMapPresentationMode) !== null && _a !== void 0 ? _a : false;
|
|
13
|
+
const [leftPanelOpen] = useUIState('leftPanelOpen', props.model);
|
|
14
|
+
const [curTab, setCurTab] = React.useState(() => {
|
|
15
|
+
if (!props.settings.layersDisabled) {
|
|
16
|
+
return 'layers';
|
|
17
|
+
}
|
|
18
|
+
if (!props.settings.stacBrowserDisabled && !storyMapPresentationMode) {
|
|
19
|
+
return 'stac';
|
|
20
|
+
}
|
|
21
|
+
if (!props.settings.storyMapsDisabled) {
|
|
22
|
+
return 'segments';
|
|
23
|
+
}
|
|
24
|
+
return '';
|
|
25
|
+
});
|
|
26
|
+
React.useEffect(() => {
|
|
27
|
+
const onOptionsChanged = () => setOptions(Object.assign({}, props.model.getOptions()));
|
|
28
|
+
props.model.sharedOptionsChanged.connect(onOptionsChanged);
|
|
29
|
+
return () => {
|
|
30
|
+
props.model.sharedOptionsChanged.disconnect(onOptionsChanged);
|
|
31
|
+
};
|
|
32
|
+
}, [props.model]);
|
|
33
|
+
const { layerTree, segmentTree } = useLayerTree(props.model, props.commands, {
|
|
34
|
+
onSegmentAdded: () => setCurTab('segments'),
|
|
35
|
+
});
|
|
36
|
+
const allLeftTabsDisabled = props.settings.layersDisabled &&
|
|
37
|
+
props.settings.stacBrowserDisabled &&
|
|
38
|
+
props.settings.storyMapsDisabled;
|
|
39
|
+
const tabs = [
|
|
40
|
+
{
|
|
41
|
+
name: 'layers',
|
|
42
|
+
title: 'Layers',
|
|
43
|
+
enabled: !props.settings.layersDisabled,
|
|
44
|
+
contentClassName: 'jp-gis-layerPanel',
|
|
45
|
+
content: (React.createElement(LayersBodyComponent, { model: props.model, commands: props.commands, state: props.state, layerTree: layerTree })),
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'stac',
|
|
49
|
+
title: 'Stac Browser',
|
|
50
|
+
enabled: !props.settings.stacBrowserDisabled && !storyMapPresentationMode,
|
|
51
|
+
contentClassName: 'jgis-panel-tab-content-stac-panel',
|
|
52
|
+
content: React.createElement(StacPanel, { model: props.model }),
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'segments',
|
|
56
|
+
title: 'Segments',
|
|
57
|
+
enabled: !props.settings.storyMapsDisabled,
|
|
58
|
+
content: (React.createElement(LayersBodyComponent, { model: props.model, commands: props.commands, state: props.state, layerTree: segmentTree })),
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
return (React.createElement(Draggable, { nodeRef: nodeRef, handle: ".jgis-tabs-list", cancel: ".jgis-tabs-trigger", bounds: ".jGIS-Mainview-Container" },
|
|
62
|
+
React.createElement("div", { ref: nodeRef, className: "jgis-left-panel-container", style: {
|
|
63
|
+
display: props.settings.leftPanelDisabled ||
|
|
64
|
+
allLeftTabsDisabled ||
|
|
65
|
+
leftPanelOpen === false
|
|
66
|
+
? 'none'
|
|
67
|
+
: 'block',
|
|
68
|
+
} },
|
|
69
|
+
React.createElement(TabbedPanel, { tabs: tabs, curTab: curTab, onTabClick: name => setCurTab(prev => (prev === name ? '' : name)) }))));
|
|
70
|
+
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { IAnnotationModel, IJGISFormSchemaRegistry, IJGISLayer, IJupyterGISModel, IJupyterGISSettings } from '@jupytergis/schema';
|
|
2
|
+
import { IStateDB } from '@jupyterlab/statedb';
|
|
2
3
|
import { CommandRegistry } from '@lumino/commands';
|
|
3
4
|
import * as React from 'react';
|
|
4
|
-
interface
|
|
5
|
-
formSchemaRegistry: IJGISFormSchemaRegistry;
|
|
6
|
-
annotationModel: IAnnotationModel;
|
|
5
|
+
export interface IMergedPanelProps {
|
|
7
6
|
model: IJupyterGISModel;
|
|
7
|
+
state: IStateDB;
|
|
8
8
|
commands: CommandRegistry;
|
|
9
9
|
settings: IJupyterGISSettings;
|
|
10
|
+
formSchemaRegistry: IJGISFormSchemaRegistry;
|
|
11
|
+
annotationModel: IAnnotationModel;
|
|
10
12
|
addLayer?: (id: string, layer: IJGISLayer, index: number) => Promise<void>;
|
|
11
13
|
removeLayer?: (id: string) => void;
|
|
12
14
|
}
|
|
13
|
-
export declare const
|
|
14
|
-
export {};
|
|
15
|
+
export declare const MergedPanel: React.FC<IMergedPanelProps>;
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { STORY_TYPE } from "../../types";
|
|
3
|
+
import { TabbedPanel } from './components/TabbedPanel';
|
|
4
|
+
import { LayersBodyComponent } from './components/layers';
|
|
5
|
+
import { useLayerTree } from './hooks/useLayerTree';
|
|
6
|
+
import { useRightPanelOptions } from './hooks/useRightPanelOptions';
|
|
7
|
+
import { useUIState } from './hooks/useUIState';
|
|
8
|
+
import { RightPanelStoryViewer } from './rightpanel';
|
|
9
|
+
import { AnnotationsPanel } from '../../features/annotations';
|
|
10
|
+
import { IdentifyPanelComponent } from '../../features/identify/IdentifyPanel';
|
|
11
|
+
import { ObjectPropertiesReact } from '../../features/objectproperties';
|
|
12
|
+
import StacPanel from '../../features/stac-browser/components/StacPanel';
|
|
13
|
+
import StoryEditorPanel from '../../features/story/StoryEditorPanel';
|
|
14
|
+
import { PreviewModeSwitch } from '../../features/story/components/PreviewModeSwitch';
|
|
15
|
+
export const MergedPanel = props => {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
const [leftPanelOpen] = useUIState('leftPanelOpen', props.model);
|
|
18
|
+
const [rightPanelOpen] = useUIState('rightPanelOpen', props.model);
|
|
19
|
+
const [panelHeight, setPanelHeight] = React.useState(null);
|
|
20
|
+
const panelHeightRef = React.useRef(null);
|
|
21
|
+
const isDraggingRef = React.useRef(false);
|
|
22
|
+
const startTabListInteract = (startX, startY) => {
|
|
23
|
+
var _a;
|
|
24
|
+
const startHeight = (_a = panelHeightRef.current) !== null && _a !== void 0 ? _a : window.innerHeight * 0.3;
|
|
25
|
+
let gesture = 'undecided';
|
|
26
|
+
const classify = (dx, dy) => {
|
|
27
|
+
if (Math.hypot(dx, dy) > 6) {
|
|
28
|
+
gesture = Math.abs(dy) >= Math.abs(dx) ? 'vertical' : 'horizontal';
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const applyResize = (clientY) => {
|
|
32
|
+
const clamped = Math.max(24, Math.min(startHeight + (startY - clientY), window.innerHeight * 0.9));
|
|
33
|
+
panelHeightRef.current = clamped;
|
|
34
|
+
setPanelHeight(clamped);
|
|
35
|
+
};
|
|
36
|
+
const onMouseMove = (ev) => {
|
|
37
|
+
if (gesture === 'undecided') {
|
|
38
|
+
classify(ev.clientX - startX, ev.clientY - startY);
|
|
39
|
+
}
|
|
40
|
+
if (gesture === 'vertical') {
|
|
41
|
+
isDraggingRef.current = true;
|
|
42
|
+
applyResize(ev.clientY);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const onTouchMove = (ev) => {
|
|
46
|
+
const t = ev.touches[0];
|
|
47
|
+
if (gesture === 'undecided') {
|
|
48
|
+
classify(t.clientX - startX, t.clientY - startY);
|
|
49
|
+
}
|
|
50
|
+
if (gesture === 'vertical') {
|
|
51
|
+
ev.preventDefault();
|
|
52
|
+
isDraggingRef.current = true;
|
|
53
|
+
applyResize(t.clientY);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const cleanup = () => {
|
|
57
|
+
document.removeEventListener('mousemove', onMouseMove);
|
|
58
|
+
document.removeEventListener('mouseup', cleanup);
|
|
59
|
+
document.removeEventListener('touchmove', onTouchMove);
|
|
60
|
+
document.removeEventListener('touchend', cleanup);
|
|
61
|
+
// Reset after click fires (click follows mouseup synchronously)
|
|
62
|
+
setTimeout(() => {
|
|
63
|
+
isDraggingRef.current = false;
|
|
64
|
+
}, 0);
|
|
65
|
+
};
|
|
66
|
+
document.addEventListener('mousemove', onMouseMove);
|
|
67
|
+
document.addEventListener('mouseup', cleanup);
|
|
68
|
+
document.addEventListener('touchmove', onTouchMove, { passive: false });
|
|
69
|
+
document.addEventListener('touchend', cleanup);
|
|
70
|
+
};
|
|
71
|
+
const onTabListMouseDown = (e) => {
|
|
72
|
+
startTabListInteract(e.clientX, e.clientY);
|
|
73
|
+
};
|
|
74
|
+
const onTabListTouchStart = (e) => {
|
|
75
|
+
const t = e.touches[0];
|
|
76
|
+
startTabListInteract(t.clientX, t.clientY);
|
|
77
|
+
};
|
|
78
|
+
const [curTab, setCurTab] = React.useState(() => {
|
|
79
|
+
const { leftPanelDisabled, rightPanelDisabled } = props.settings;
|
|
80
|
+
if (!leftPanelDisabled && !props.settings.layersDisabled) {
|
|
81
|
+
return 'layers';
|
|
82
|
+
}
|
|
83
|
+
if (!rightPanelDisabled && !props.settings.objectPropertiesDisabled) {
|
|
84
|
+
return 'objectProperties';
|
|
85
|
+
}
|
|
86
|
+
return '';
|
|
87
|
+
});
|
|
88
|
+
const [selectedObjectProperties, setSelectedObjectProperties] = React.useState(undefined);
|
|
89
|
+
const { layerTree, segmentTree } = useLayerTree(props.model, props.commands, {
|
|
90
|
+
onSegmentAdded: () => setCurTab('segments'),
|
|
91
|
+
});
|
|
92
|
+
const { storyMapPresentationMode, editorMode, showEditor, storyPanelTitle, toggleEditor, } = useRightPanelOptions(props.model, {
|
|
93
|
+
onPresentationModeEnabled: () => setCurTab('storyPanel'),
|
|
94
|
+
onIdentifyFeatures: () => setCurTab('identifyPanel'),
|
|
95
|
+
});
|
|
96
|
+
const isListStory = ((_a = props.model.getSelectedStory().story) === null || _a === void 0 ? void 0 : _a.storyType) ===
|
|
97
|
+
STORY_TYPE.verticalScroll;
|
|
98
|
+
const { leftPanelDisabled, rightPanelDisabled } = props.settings;
|
|
99
|
+
const tabs = [
|
|
100
|
+
{
|
|
101
|
+
name: 'layers',
|
|
102
|
+
title: 'Layers',
|
|
103
|
+
enabled: !leftPanelDisabled &&
|
|
104
|
+
!props.settings.layersDisabled &&
|
|
105
|
+
!storyMapPresentationMode,
|
|
106
|
+
content: (React.createElement(LayersBodyComponent, { model: props.model, commands: props.commands, state: props.state, layerTree: layerTree })),
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: 'stac',
|
|
110
|
+
title: 'Stac Browser',
|
|
111
|
+
enabled: !leftPanelDisabled &&
|
|
112
|
+
!props.settings.stacBrowserDisabled &&
|
|
113
|
+
!storyMapPresentationMode,
|
|
114
|
+
content: React.createElement(StacPanel, { model: props.model }),
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: 'segments',
|
|
118
|
+
title: 'Segments',
|
|
119
|
+
enabled: !leftPanelDisabled && !props.settings.storyMapsDisabled,
|
|
120
|
+
content: (React.createElement(LayersBodyComponent, { model: props.model, commands: props.commands, state: props.state, layerTree: segmentTree })),
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'objectProperties',
|
|
124
|
+
title: 'Object Properties',
|
|
125
|
+
enabled: !rightPanelDisabled &&
|
|
126
|
+
!props.settings.objectPropertiesDisabled &&
|
|
127
|
+
!storyMapPresentationMode,
|
|
128
|
+
content: (React.createElement(ObjectPropertiesReact, { setSelectedObject: setSelectedObjectProperties, selectedObject: selectedObjectProperties, formSchemaRegistry: props.formSchemaRegistry, model: props.model })),
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: 'storyPanel',
|
|
132
|
+
title: storyPanelTitle,
|
|
133
|
+
enabled: !rightPanelDisabled && !props.settings.storyMapsDisabled,
|
|
134
|
+
content: (React.createElement(React.Fragment, null,
|
|
135
|
+
!storyMapPresentationMode && !isListStory && (React.createElement(PreviewModeSwitch, { checked: !editorMode, onCheckedChange: toggleEditor })),
|
|
136
|
+
showEditor ? (React.createElement(StoryEditorPanel, { model: props.model, commands: props.commands })) : curTab === 'storyPanel' ? (React.createElement(RightPanelStoryViewer, { model: props.model, addLayer: props.addLayer, removeLayer: props.removeLayer })) : null)),
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: 'annotations',
|
|
140
|
+
title: 'Annotations',
|
|
141
|
+
enabled: !rightPanelDisabled && !props.settings.annotationsDisabled,
|
|
142
|
+
content: (React.createElement(AnnotationsPanel, { annotationModel: props.annotationModel, jgisModel: props.model })),
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'identifyPanel',
|
|
146
|
+
title: 'Identified Features',
|
|
147
|
+
enabled: !rightPanelDisabled && !props.settings.identifyDisabled,
|
|
148
|
+
content: React.createElement(IdentifyPanelComponent, { model: props.model }),
|
|
149
|
+
},
|
|
150
|
+
];
|
|
151
|
+
const enabledTabNames = tabs.filter(t => t.enabled).map(t => t.name);
|
|
152
|
+
const effectiveCurTab = enabledTabNames.includes(curTab)
|
|
153
|
+
? curTab
|
|
154
|
+
: ((_b = enabledTabNames[0]) !== null && _b !== void 0 ? _b : '');
|
|
155
|
+
return (React.createElement("div", { className: "jgis-merged-panel-container", style: Object.assign({ display: (leftPanelDisabled || leftPanelOpen === false) &&
|
|
156
|
+
(rightPanelDisabled || rightPanelOpen === false)
|
|
157
|
+
? 'none'
|
|
158
|
+
: undefined }, (panelHeight !== null ? { height: `${panelHeight}px` } : {})) },
|
|
159
|
+
React.createElement("div", { className: "jgis-resize-handle", onMouseDown: onTabListMouseDown, onTouchStart: onTabListTouchStart }),
|
|
160
|
+
React.createElement(TabbedPanel, { tabs: tabs, curTab: effectiveCurTab, onTabClick: name => {
|
|
161
|
+
if (isDraggingRef.current) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
setCurTab(prev => (prev === name ? '' : name));
|
|
165
|
+
}, onTabListMouseDown: onTabListMouseDown, onTabListTouchStart: onTabListTouchStart })));
|
|
166
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IAnnotationModel, IDict, IJGISFormSchemaRegistry, IJGISLayer, IJupyterGISModel, IJupyterGISSettings } from '@jupytergis/schema';
|
|
2
|
+
import { CommandRegistry } from '@lumino/commands';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
/** Story viewer + useStoryMap hook
|
|
5
|
+
* only mounted when story tab is active to avoid the hook causing re-renders when tab is hidden.
|
|
6
|
+
**/
|
|
7
|
+
export declare function RightPanelStoryViewer({ model, addLayer, removeLayer, }: {
|
|
8
|
+
model: IJupyterGISModel;
|
|
9
|
+
addLayer?: (id: string, layer: IJGISLayer, index: number) => Promise<void>;
|
|
10
|
+
removeLayer?: (id: string) => void;
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
interface IRightPanelProps {
|
|
13
|
+
formSchemaRegistry: IJGISFormSchemaRegistry;
|
|
14
|
+
annotationModel: IAnnotationModel;
|
|
15
|
+
model: IJupyterGISModel;
|
|
16
|
+
commands: CommandRegistry;
|
|
17
|
+
settings: IJupyterGISSettings;
|
|
18
|
+
addLayer?: (id: string, layer: IJGISLayer, index: number) => Promise<void>;
|
|
19
|
+
removeLayer?: (id: string) => void;
|
|
20
|
+
patchGeoJSONFeatureProperties?: (sourceId: string, target: {
|
|
21
|
+
featureId: string;
|
|
22
|
+
}, propertyUpdates: IDict<any>) => Promise<boolean>;
|
|
23
|
+
}
|
|
24
|
+
export declare const RightPanel: React.NamedExoticComponent<IRightPanelProps>;
|
|
25
|
+
export {};
|