@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,56 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { buildPendingMeasureIds } from "../utils/listStoryMeasureQueue";
|
|
3
|
+
/**
|
|
4
|
+
* Queues markdown segments near the active index and measures them one at a time
|
|
5
|
+
* in a shared off-screen pane (see ListStoryMarkdownMeasurePane).
|
|
6
|
+
*/
|
|
7
|
+
export function useQueuedMarkdownHeightMeasure({ enabled, markdownSegments, currentSegmentIndex, heightsById, onHeight, }) {
|
|
8
|
+
const [segmentBeingMeasured, setSegmentBeingMeasured] = useState(null);
|
|
9
|
+
const queueRef = useRef([]);
|
|
10
|
+
const refillQueue = useCallback(() => {
|
|
11
|
+
queueRef.current = buildPendingMeasureIds({
|
|
12
|
+
markdownSegments,
|
|
13
|
+
currentSegmentIndex,
|
|
14
|
+
heightsById,
|
|
15
|
+
measuringSegmentId: segmentBeingMeasured === null || segmentBeingMeasured === void 0 ? void 0 : segmentBeingMeasured.id,
|
|
16
|
+
});
|
|
17
|
+
}, [
|
|
18
|
+
markdownSegments,
|
|
19
|
+
currentSegmentIndex,
|
|
20
|
+
heightsById,
|
|
21
|
+
segmentBeingMeasured === null || segmentBeingMeasured === void 0 ? void 0 : segmentBeingMeasured.id,
|
|
22
|
+
]);
|
|
23
|
+
const reportHeight = useCallback((segmentId, height) => {
|
|
24
|
+
onHeight(segmentId, height);
|
|
25
|
+
}, [onHeight]);
|
|
26
|
+
const completeMeasure = useCallback(() => {
|
|
27
|
+
setSegmentBeingMeasured(null);
|
|
28
|
+
}, []);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (!enabled) {
|
|
31
|
+
setSegmentBeingMeasured(null);
|
|
32
|
+
queueRef.current = [];
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
refillQueue();
|
|
36
|
+
if (segmentBeingMeasured) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const nextId = queueRef.current.shift();
|
|
40
|
+
if (!nextId) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const segment = markdownSegments.find(item => item.id === nextId);
|
|
44
|
+
if (segment) {
|
|
45
|
+
setSegmentBeingMeasured(segment);
|
|
46
|
+
}
|
|
47
|
+
}, [
|
|
48
|
+
enabled,
|
|
49
|
+
currentSegmentIndex,
|
|
50
|
+
markdownSegments,
|
|
51
|
+
heightsById,
|
|
52
|
+
segmentBeingMeasured,
|
|
53
|
+
refillQueue,
|
|
54
|
+
]);
|
|
55
|
+
return { segmentBeingMeasured, reportHeight, completeMeasure };
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useStoryImagePreload(imageUrl?: string): boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
export function useStoryImagePreload(imageUrl) {
|
|
3
|
+
const [imageLoaded, setImageLoaded] = useState(false);
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
if (!imageUrl) {
|
|
6
|
+
setImageLoaded(false);
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
setImageLoaded(false);
|
|
10
|
+
const img = new Image();
|
|
11
|
+
img.onload = () => {
|
|
12
|
+
setImageLoaded(true);
|
|
13
|
+
};
|
|
14
|
+
img.onerror = () => {
|
|
15
|
+
setImageLoaded(false);
|
|
16
|
+
};
|
|
17
|
+
img.src = imageUrl;
|
|
18
|
+
return () => {
|
|
19
|
+
img.onload = null;
|
|
20
|
+
img.onerror = null;
|
|
21
|
+
};
|
|
22
|
+
}, [imageUrl]);
|
|
23
|
+
return imageLoaded;
|
|
24
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IJGISLayer, IJGISStoryMap, IJupyterGISModel } from '@jupytergis/schema';
|
|
2
|
-
import {
|
|
2
|
+
import { RefObject } from 'react';
|
|
3
3
|
/** Entry for a layer affected by layer override
|
|
4
4
|
* remove if we added a layer or restore if we modified an existing layer.
|
|
5
5
|
**/
|
|
@@ -13,12 +13,8 @@ export interface IUseStoryMapParams {
|
|
|
13
13
|
removeLayer?: (id: string) => void;
|
|
14
14
|
addLayer?: (id: string, layer: IJGISLayer, index: number) => Promise<void>;
|
|
15
15
|
isSpecta: boolean;
|
|
16
|
-
/** Panel root element for applying specta presentation CSS variables. */
|
|
17
|
-
panelRef?: RefObject<HTMLDivElement | null>;
|
|
18
16
|
}
|
|
19
|
-
|
|
20
|
-
export declare function getSpectaPresentationStyle(story: IJGISStoryMap | null): CSSProperties;
|
|
21
|
-
export declare function useStoryMap({ model, overrideLayerEntriesRef, removeLayer, addLayer, panelRef, isSpecta, }: IUseStoryMapParams): {
|
|
17
|
+
export declare function useStoryMap({ model, overrideLayerEntriesRef, removeLayer, addLayer, isSpecta, }: IUseStoryMapParams): {
|
|
22
18
|
storyData: IJGISStoryMap | null;
|
|
23
19
|
storySegments: IJGISLayer[];
|
|
24
20
|
currentIndex: number;
|
|
@@ -36,5 +32,4 @@ export declare function useStoryMap({ model, overrideLayerEntriesRef, removeLaye
|
|
|
36
32
|
} | undefined;
|
|
37
33
|
layerName: string;
|
|
38
34
|
currentStorySegmentId: string | undefined;
|
|
39
|
-
zoomToCurrentLayer: () => void;
|
|
40
35
|
};
|
|
@@ -1,22 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
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 (bgColor) {
|
|
9
|
-
style['--jgis-specta-bg-color'] = bgColor;
|
|
10
|
-
style.backgroundColor = bgColor;
|
|
11
|
-
}
|
|
12
|
-
if (textColor) {
|
|
13
|
-
style['--jgis-specta-text-color'] = textColor;
|
|
14
|
-
style.color = textColor;
|
|
15
|
-
}
|
|
16
|
-
return style;
|
|
17
|
-
}
|
|
18
|
-
export function useStoryMap({ model, overrideLayerEntriesRef, removeLayer, addLayer, panelRef, isSpecta, }) {
|
|
19
|
-
var _a;
|
|
1
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import { STORY_TYPE } from "../../../types";
|
|
3
|
+
export function useStoryMap({ model, overrideLayerEntriesRef, removeLayer, addLayer, isSpecta, }) {
|
|
4
|
+
var _a, _b;
|
|
20
5
|
const [currentIndex, setCurrentIndex] = useState(() => { var _a; return (_a = model.getCurrentSegmentIndex()) !== null && _a !== void 0 ? _a : 0; });
|
|
21
6
|
const [storyData, setStoryData] = useState(() => { var _a; return (_a = model.getSelectedStory().story) !== null && _a !== void 0 ? _a : null; });
|
|
22
7
|
const storySegments = useMemo(() => {
|
|
@@ -33,7 +18,9 @@ export function useStoryMap({ model, overrideLayerEntriesRef, removeLayer, addLa
|
|
|
33
18
|
const activeSlide = useMemo(() => currentStorySegment === null || currentStorySegment === void 0 ? void 0 : currentStorySegment.parameters, [currentStorySegment]);
|
|
34
19
|
const layerName = useMemo(() => { var _a; return (_a = currentStorySegment === null || currentStorySegment === void 0 ? void 0 : currentStorySegment.name) !== null && _a !== void 0 ? _a : ''; }, [currentStorySegment]);
|
|
35
20
|
const currentStorySegmentId = useMemo(() => storySegmentIds === null || storySegmentIds === void 0 ? void 0 : storySegmentIds[currentIndex], [storySegmentIds, currentIndex]);
|
|
36
|
-
const
|
|
21
|
+
const currentSegmentContentMode = (_a = activeSlide === null || activeSlide === void 0 ? void 0 : activeSlide.content) === null || _a === void 0 ? void 0 : _a.contentMode;
|
|
22
|
+
const showGradient = (_b = storyData === null || storyData === void 0 ? void 0 : storyData.showGradient) !== null && _b !== void 0 ? _b : true;
|
|
23
|
+
const isGuidedStory = (storyData === null || storyData === void 0 ? void 0 : storyData.storyType) === STORY_TYPE.guided;
|
|
37
24
|
const hasPrev = currentIndex > 0;
|
|
38
25
|
const hasNext = currentIndex < segmentCount - 1;
|
|
39
26
|
const clearOverrideLayers = useCallback(() => {
|
|
@@ -54,11 +41,6 @@ export function useStoryMap({ model, overrideLayerEntriesRef, removeLayer, addLa
|
|
|
54
41
|
});
|
|
55
42
|
entries.length = 0;
|
|
56
43
|
}, [model, overrideLayerEntriesRef, removeLayer]);
|
|
57
|
-
const zoomToCurrentLayer = useCallback(() => {
|
|
58
|
-
if (currentStorySegmentId) {
|
|
59
|
-
model.centerOnPosition(currentStorySegmentId);
|
|
60
|
-
}
|
|
61
|
-
}, [model, currentStorySegmentId]);
|
|
62
44
|
const setIndex = useCallback((index) => {
|
|
63
45
|
model.setCurrentSegmentIndex(index);
|
|
64
46
|
}, [model]);
|
|
@@ -94,7 +76,7 @@ export function useStoryMap({ model, overrideLayerEntriesRef, removeLayer, addLa
|
|
|
94
76
|
return;
|
|
95
77
|
}
|
|
96
78
|
layerOverrides.forEach(override => {
|
|
97
|
-
var _a, _b, _c
|
|
79
|
+
var _a, _b, _c;
|
|
98
80
|
const { color, opacity, sourceProperties, symbologyState, targetLayer: targetLayerId, visible, } = override;
|
|
99
81
|
if (!targetLayerId) {
|
|
100
82
|
return;
|
|
@@ -135,20 +117,6 @@ export function useStoryMap({ model, overrideLayerEntriesRef, removeLayer, addLa
|
|
|
135
117
|
model.triggerLayerUpdate(sourceId, source);
|
|
136
118
|
}
|
|
137
119
|
}
|
|
138
|
-
if ((symbologyState === null || symbologyState === void 0 ? void 0 : symbologyState.renderType) === 'Heatmap') {
|
|
139
|
-
targetLayer.type = 'HeatmapLayer';
|
|
140
|
-
if (addLayer) {
|
|
141
|
-
const newId = UUID.uuid4();
|
|
142
|
-
addLayer(newId, targetLayer, 100);
|
|
143
|
-
(_d = overrideLayerEntriesRef.current) === null || _d === void 0 ? void 0 : _d.push({
|
|
144
|
-
layerId: newId,
|
|
145
|
-
action: 'remove',
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
model.triggerLayerUpdate(targetLayerId, targetLayer);
|
|
151
|
-
}
|
|
152
120
|
}
|
|
153
121
|
});
|
|
154
122
|
}, [addLayer, model, storySegments, overrideLayerEntriesRef]);
|
|
@@ -196,44 +164,38 @@ export function useStoryMap({ model, overrideLayerEntriesRef, removeLayer, addLa
|
|
|
196
164
|
};
|
|
197
165
|
}, []);
|
|
198
166
|
useEffect(() => {
|
|
199
|
-
if (currentStorySegmentId) {
|
|
200
|
-
|
|
167
|
+
if (!currentStorySegmentId) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (currentSegmentContentMode === 'markdown') {
|
|
171
|
+
return;
|
|
201
172
|
}
|
|
202
|
-
|
|
173
|
+
model.centerOnPosition(currentStorySegmentId);
|
|
174
|
+
}, [model, currentStorySegmentId, currentSegmentContentMode]);
|
|
203
175
|
// Set selected layer and apply symbology when segment changes; remove previous segment's override layers first.
|
|
204
176
|
useEffect(() => {
|
|
205
177
|
if (!(storyData === null || storyData === void 0 ? void 0 : storyData.storySegments) || currentIndex < 0) {
|
|
206
178
|
return;
|
|
207
179
|
}
|
|
208
180
|
clearOverrideLayers();
|
|
209
|
-
|
|
181
|
+
if (isGuidedStory) {
|
|
182
|
+
setSelectedLayerByIndex(currentIndex);
|
|
183
|
+
}
|
|
210
184
|
overrideSymbology(currentIndex);
|
|
211
185
|
}, [
|
|
212
186
|
storyData,
|
|
213
187
|
currentIndex,
|
|
188
|
+
isGuidedStory,
|
|
214
189
|
setSelectedLayerByIndex,
|
|
215
190
|
clearOverrideLayers,
|
|
216
191
|
overrideSymbology,
|
|
217
192
|
]);
|
|
218
193
|
// Set selected layer on initial render and when story data changes
|
|
219
194
|
useEffect(() => {
|
|
220
|
-
if ((storyData === null || storyData === void 0 ? void 0 : storyData.storySegments) && currentIndex >= 0) {
|
|
195
|
+
if (isGuidedStory && (storyData === null || storyData === void 0 ? void 0 : storyData.storySegments) && currentIndex >= 0) {
|
|
221
196
|
setSelectedLayerByIndex(currentIndex);
|
|
222
197
|
}
|
|
223
|
-
}, [storyData, currentIndex, setSelectedLayerByIndex]);
|
|
224
|
-
// Apply story presentation colors (specta) to panel root
|
|
225
|
-
useEffect(() => {
|
|
226
|
-
if (!isSpecta || !(panelRef === null || panelRef === void 0 ? void 0 : panelRef.current)) {
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
const container = panelRef.current;
|
|
230
|
-
const style = getSpectaPresentationStyle(storyData);
|
|
231
|
-
Object.entries(style).forEach(([key, value]) => {
|
|
232
|
-
if (value !== null) {
|
|
233
|
-
container.style.setProperty(key, String(value));
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
}, [storyData, isSpecta, panelRef]);
|
|
198
|
+
}, [storyData, currentIndex, isGuidedStory, setSelectedLayerByIndex]);
|
|
237
199
|
return {
|
|
238
200
|
storyData,
|
|
239
201
|
storySegments,
|
|
@@ -250,6 +212,5 @@ export function useStoryMap({ model, overrideLayerEntriesRef, removeLayer, addLa
|
|
|
250
212
|
activeSlide,
|
|
251
213
|
layerName,
|
|
252
214
|
currentStorySegmentId,
|
|
253
|
-
zoomToCurrentLayer,
|
|
254
215
|
};
|
|
255
216
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Specta story column scroll container + optional sentinel tracking.
|
|
4
|
+
* - `scrollContainerRef`: list + single attach here (`#jgis-story-segment-panel`).
|
|
5
|
+
* - With `sentinelsEnabled: false` (list mode), only the ref is used.
|
|
6
|
+
* - `getAtTop` / `getAtBottom`: guided/unguided wheel edges (single mode).
|
|
7
|
+
*/
|
|
8
|
+
interface IUseStoryScrollStateParams {
|
|
9
|
+
currentIndex: number;
|
|
10
|
+
/** When false, only exposes scrollContainerRef (list story virtual track). */
|
|
11
|
+
sentinelsEnabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface IUseStoryScrollStateResult {
|
|
14
|
+
scrollContainerRef: RefObject<HTMLDivElement>;
|
|
15
|
+
topSentinelRef: RefObject<HTMLDivElement>;
|
|
16
|
+
bottomSentinelRef: RefObject<HTMLDivElement>;
|
|
17
|
+
getAtTop: () => boolean;
|
|
18
|
+
getAtBottom: () => boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare function useStoryScrollState({ currentIndex, sentinelsEnabled, }: IUseStoryScrollStateParams): IUseStoryScrollStateResult;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
export function useStoryScrollState({ currentIndex, sentinelsEnabled = true, }) {
|
|
3
|
+
const scrollContainerRef = useRef(null);
|
|
4
|
+
const topSentinelRef = useRef(null);
|
|
5
|
+
const bottomSentinelRef = useRef(null);
|
|
6
|
+
const atTopRef = useRef(false);
|
|
7
|
+
const atBottomRef = useRef(false);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (!sentinelsEnabled) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const root = scrollContainerRef.current;
|
|
13
|
+
const topEl = topSentinelRef.current;
|
|
14
|
+
const bottomEl = bottomSentinelRef.current;
|
|
15
|
+
if (!root || !topEl || !bottomEl) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const observer = new IntersectionObserver((entries) => {
|
|
19
|
+
for (const entry of entries) {
|
|
20
|
+
if (entry.target === topEl) {
|
|
21
|
+
atTopRef.current = entry.isIntersecting;
|
|
22
|
+
}
|
|
23
|
+
else if (entry.target === bottomEl) {
|
|
24
|
+
atBottomRef.current = entry.isIntersecting;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}, { root, threshold: 0, rootMargin: '0px' });
|
|
28
|
+
observer.observe(topEl);
|
|
29
|
+
observer.observe(bottomEl);
|
|
30
|
+
return () => observer.disconnect();
|
|
31
|
+
}, [currentIndex, sentinelsEnabled]);
|
|
32
|
+
return {
|
|
33
|
+
scrollContainerRef,
|
|
34
|
+
topSentinelRef,
|
|
35
|
+
bottomSentinelRef,
|
|
36
|
+
getAtTop: () => atTopRef.current,
|
|
37
|
+
getAtBottom: () => atBottomRef.current,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IJGISStoryMap, IJupyterGISModel } from '@jupytergis/schema';
|
|
2
|
+
interface IUseStorySegmentSyncParams {
|
|
3
|
+
model: IJupyterGISModel;
|
|
4
|
+
storyData: IJGISStoryMap | null;
|
|
5
|
+
setIndex: (index: number) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function useStorySegmentSync({ model, storyData, setIndex, }: IUseStorySegmentSyncParams): void;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { STORY_TYPE } from "../../../types";
|
|
3
|
+
function getSingleSelectedLayerId(selected) {
|
|
4
|
+
if (!selected) {
|
|
5
|
+
return null;
|
|
6
|
+
}
|
|
7
|
+
const selectedLayerIds = Object.keys(selected);
|
|
8
|
+
if (selectedLayerIds.length !== 1) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return selectedLayerIds[0];
|
|
12
|
+
}
|
|
13
|
+
function getStorySegmentIndexFromLayerId(storyData, selectedLayerId) {
|
|
14
|
+
var _a;
|
|
15
|
+
const index = (_a = storyData.storySegments) === null || _a === void 0 ? void 0 : _a.indexOf(selectedLayerId);
|
|
16
|
+
if (index === undefined || index === -1) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return index;
|
|
20
|
+
}
|
|
21
|
+
// This hook just syncs the active segment with the currently selected segment
|
|
22
|
+
// Only for unguided mode
|
|
23
|
+
export function useStorySegmentSync({ model, storyData, setIndex, }) {
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const handleSelectedStorySegmentChanged = () => {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
if (!storyData || storyData.storyType !== STORY_TYPE.unguided) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const selected = (_b = (_a = model.localState) === null || _a === void 0 ? void 0 : _a.selected) === null || _b === void 0 ? void 0 : _b.value;
|
|
31
|
+
const selectedLayerId = getSingleSelectedLayerId(selected);
|
|
32
|
+
if (!selectedLayerId) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const selectedLayer = model.getLayer(selectedLayerId);
|
|
36
|
+
if (!selectedLayer || selectedLayer.type !== 'StorySegmentLayer') {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const index = getStorySegmentIndexFromLayerId(storyData, selectedLayerId);
|
|
40
|
+
if (index === null) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
setIndex(index);
|
|
44
|
+
};
|
|
45
|
+
model.selectedChanged.connect(handleSelectedStorySegmentChanged);
|
|
46
|
+
handleSelectedStorySegmentChanged();
|
|
47
|
+
return () => {
|
|
48
|
+
model.selectedChanged.disconnect(handleSelectedStorySegmentChanged);
|
|
49
|
+
};
|
|
50
|
+
}, [model, storyData, setIndex]);
|
|
51
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { IStorySegmentLayer } from '@jupytergis/schema';
|
|
2
|
+
export type StorySegmentDisplayMode = 'map' | 'markdown';
|
|
3
|
+
/** Active handoff between two segments while scrolling the virtual track. */
|
|
4
|
+
export interface IListStorySegmentTransition {
|
|
5
|
+
/** 0–1 across the handoff span (outgoing segment + gap + incoming segment). */
|
|
6
|
+
progress: number;
|
|
7
|
+
fromIndex: number;
|
|
8
|
+
toIndex: number;
|
|
9
|
+
fromMode: StorySegmentDisplayMode;
|
|
10
|
+
toMode: StorySegmentDisplayMode;
|
|
11
|
+
}
|
|
12
|
+
export interface IStorySegmentViewItem {
|
|
13
|
+
id: string;
|
|
14
|
+
index: number;
|
|
15
|
+
layerName: string;
|
|
16
|
+
activeSlide: IStorySegmentLayer['parameters'] | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface IListStoryTitleBarContentProps {
|
|
19
|
+
segmentItems: IStorySegmentViewItem[];
|
|
20
|
+
currentIndex: number;
|
|
21
|
+
onSegmentClick: (index: number) => void;
|
|
22
|
+
}
|
|
23
|
+
export interface IListStoryMarkdownSegment {
|
|
24
|
+
id: string;
|
|
25
|
+
index: number;
|
|
26
|
+
markdown: string;
|
|
27
|
+
}
|
|
28
|
+
export interface IListStoryScrollTrackSegment {
|
|
29
|
+
id: string;
|
|
30
|
+
index: number;
|
|
31
|
+
contentMode: StorySegmentDisplayMode;
|
|
32
|
+
height: number;
|
|
33
|
+
measured: boolean;
|
|
34
|
+
/** Inclusive start in scroller content coordinates. */
|
|
35
|
+
start: number;
|
|
36
|
+
/** Exclusive end in scroller content coordinates. */
|
|
37
|
+
end: number;
|
|
38
|
+
}
|
|
39
|
+
export interface IListStoryScrollTrackLayout {
|
|
40
|
+
segments: IListStoryScrollTrackSegment[];
|
|
41
|
+
/** Sum of segment heights and handoff gaps (virtual track height). */
|
|
42
|
+
scrollTrackHeight: number;
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IListStorySegmentTransition, IListStoryScrollTrackSegment } from "../types/types";
|
|
2
|
+
export interface IListStoryScrollState {
|
|
3
|
+
activeIndex: number;
|
|
4
|
+
segmentTransition: IListStorySegmentTransition | null;
|
|
5
|
+
}
|
|
6
|
+
interface IComputeListStoryScrollInput {
|
|
7
|
+
scrollTop: number;
|
|
8
|
+
viewportHeight: number;
|
|
9
|
+
segments: IListStoryScrollTrackSegment[];
|
|
10
|
+
}
|
|
11
|
+
/** Same-segment scroll (from and to pane share content; to pane is the stack tail). */
|
|
12
|
+
export declare function isIntraSegmentScroll(transition: IListStorySegmentTransition | null): boolean;
|
|
13
|
+
export declare function computeListStoryScrollState({ scrollTop, viewportHeight, segments, }: IComputeListStoryScrollInput): IListStoryScrollState | null;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
function clamp01(value) {
|
|
2
|
+
return Math.min(1, Math.max(0, value));
|
|
3
|
+
}
|
|
4
|
+
/** Same-segment scroll (from and to pane share content; to pane is the stack tail). */
|
|
5
|
+
export function isIntraSegmentScroll(transition) {
|
|
6
|
+
return transition !== null && transition.fromIndex === transition.toIndex;
|
|
7
|
+
}
|
|
8
|
+
function findSegmentAtScrollTop(scrollTop, segments) {
|
|
9
|
+
if (scrollTop < segments[0].start) {
|
|
10
|
+
return segments[0];
|
|
11
|
+
}
|
|
12
|
+
for (const segment of segments) {
|
|
13
|
+
if (scrollTop >= segment.start && scrollTop < segment.end) {
|
|
14
|
+
return segment;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return segments[segments.length - 1];
|
|
18
|
+
}
|
|
19
|
+
function buildIntraSegmentScrollState(segment, scrollTop) {
|
|
20
|
+
const span = segment.end - segment.start;
|
|
21
|
+
const progress = span > 0 ? clamp01((scrollTop - segment.start) / span) : 0;
|
|
22
|
+
return {
|
|
23
|
+
activeIndex: segment.index,
|
|
24
|
+
segmentTransition: {
|
|
25
|
+
progress,
|
|
26
|
+
fromIndex: segment.index,
|
|
27
|
+
toIndex: segment.index,
|
|
28
|
+
fromMode: segment.contentMode,
|
|
29
|
+
toMode: segment.contentMode,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function computePairTransition(scrollTop, fromSegment, toSegment) {
|
|
34
|
+
if (scrollTop < fromSegment.start || scrollTop >= toSegment.end) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
const handoffEndScrollTop = toSegment.start;
|
|
38
|
+
const handoffSpan = handoffEndScrollTop - fromSegment.start;
|
|
39
|
+
if (handoffSpan <= 0) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
if (scrollTop >= handoffEndScrollTop) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
const progress = clamp01((scrollTop - fromSegment.start) / handoffSpan);
|
|
46
|
+
return {
|
|
47
|
+
progress,
|
|
48
|
+
activeIndex: progress >= 0.5 ? toSegment.index : fromSegment.index,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function buildSegmentTransitionPayload(fromSegment, toSegment, progress) {
|
|
52
|
+
return {
|
|
53
|
+
progress,
|
|
54
|
+
fromIndex: fromSegment.index,
|
|
55
|
+
toIndex: toSegment.index,
|
|
56
|
+
fromMode: fromSegment.contentMode,
|
|
57
|
+
toMode: toSegment.contentMode,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export function computeListStoryScrollState({ scrollTop, viewportHeight, segments, }) {
|
|
61
|
+
if (!segments.length) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
if (segments.length > 1) {
|
|
65
|
+
for (let i = 0; i < segments.length - 1; i++) {
|
|
66
|
+
const fromSegment = segments[i];
|
|
67
|
+
const toSegment = segments[i + 1];
|
|
68
|
+
const pairTransition = computePairTransition(scrollTop, fromSegment, toSegment);
|
|
69
|
+
if (!pairTransition) {
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
activeIndex: pairTransition.activeIndex,
|
|
74
|
+
segmentTransition: buildSegmentTransitionPayload(fromSegment, toSegment, pairTransition.progress),
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return buildIntraSegmentScrollState(findSegmentAtScrollTop(scrollTop, segments), scrollTop);
|
|
79
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IListStoryMarkdownSegment } from "../types/types";
|
|
2
|
+
export declare const LIST_STORY_MEASURE_LOOKAHEAD = 2;
|
|
3
|
+
interface IBuildPendingMeasureIdsParams {
|
|
4
|
+
markdownSegments: IListStoryMarkdownSegment[];
|
|
5
|
+
currentSegmentIndex: number;
|
|
6
|
+
heightsById: Readonly<Record<string, number>>;
|
|
7
|
+
measuringSegmentId: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
/** Markdown segment ids near the active index that still need measurement. */
|
|
10
|
+
export declare function buildPendingMeasureIds({ markdownSegments, currentSegmentIndex, heightsById, measuringSegmentId, }: IBuildPendingMeasureIdsParams): string[];
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const LIST_STORY_MEASURE_LOOKAHEAD = 2;
|
|
2
|
+
/** Markdown segment ids near the active index that still need measurement. */
|
|
3
|
+
export function buildPendingMeasureIds({ markdownSegments, currentSegmentIndex, heightsById, measuringSegmentId, }) {
|
|
4
|
+
const pending = markdownSegments
|
|
5
|
+
.filter(segment => Math.abs(segment.index - currentSegmentIndex) <=
|
|
6
|
+
LIST_STORY_MEASURE_LOOKAHEAD && heightsById[segment.id] === undefined)
|
|
7
|
+
.sort((a, b) => Math.abs(a.index - currentSegmentIndex) -
|
|
8
|
+
Math.abs(b.index - currentSegmentIndex))
|
|
9
|
+
.map(segment => segment.id);
|
|
10
|
+
if (!measuringSegmentId) {
|
|
11
|
+
return pending;
|
|
12
|
+
}
|
|
13
|
+
return pending.filter(id => id !== measuringSegmentId);
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IStorySegmentLayer } from '@jupytergis/schema';
|
|
2
|
+
import type { IListStoryScrollTrackLayout, StorySegmentDisplayMode, IStorySegmentViewItem } from "../types/types";
|
|
3
|
+
interface IBuildListStoryScrollTrackInput {
|
|
4
|
+
items: IStorySegmentViewItem[];
|
|
5
|
+
/** Story column scroller height (markdown estimates, scroll padding). */
|
|
6
|
+
viewportHeight: number;
|
|
7
|
+
/** Map stage height (`.jGIS-Mainview-Container`); defaults to viewportHeight. */
|
|
8
|
+
mapViewportHeight?: number;
|
|
9
|
+
heightsById?: Readonly<Record<string, number>>;
|
|
10
|
+
}
|
|
11
|
+
export declare function estimateMarkdownHeight(markdown: string, viewportHeight: number): number;
|
|
12
|
+
export declare function estimateMapSegmentHeight(viewportHeight: number): number;
|
|
13
|
+
export declare function getScrollTrackSegmentHeight(layout: IListStoryScrollTrackLayout | null, index: number): number | undefined;
|
|
14
|
+
/** Builds cumulative segment ranges for the virtual list story scroll track. */
|
|
15
|
+
export declare function buildListStoryScrollTrack({ items, viewportHeight, mapViewportHeight, heightsById, }: IBuildListStoryScrollTrackInput): IListStoryScrollTrackLayout | null;
|
|
16
|
+
export declare function getSegmentDisplayMode(activeSlide: IStorySegmentLayer['parameters'] | undefined): StorySegmentDisplayMode;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
const MARKDOWN_LINE_HEIGHT_PX = 28;
|
|
2
|
+
const MARKDOWN_CONTENT_PADDING_PX = 32;
|
|
3
|
+
const MIN_MARKDOWN_VIEWPORT_RATIO = 0.5;
|
|
4
|
+
export function estimateMarkdownHeight(markdown, viewportHeight) {
|
|
5
|
+
const lineCount = Math.max(1, markdown.split('\n').length);
|
|
6
|
+
const estimatedFromLines = lineCount * MARKDOWN_LINE_HEIGHT_PX + MARKDOWN_CONTENT_PADDING_PX;
|
|
7
|
+
const minHeight = viewportHeight * MIN_MARKDOWN_VIEWPORT_RATIO;
|
|
8
|
+
return Math.max(minHeight, estimatedFromLines);
|
|
9
|
+
}
|
|
10
|
+
export function estimateMapSegmentHeight(viewportHeight) {
|
|
11
|
+
return viewportHeight;
|
|
12
|
+
}
|
|
13
|
+
export function getScrollTrackSegmentHeight(layout, index) {
|
|
14
|
+
var _a;
|
|
15
|
+
return (_a = layout === null || layout === void 0 ? void 0 : layout.segments.find(segment => segment.index === index)) === null || _a === void 0 ? void 0 : _a.height;
|
|
16
|
+
}
|
|
17
|
+
function segmentHeightForItem(item, viewportHeight, mapViewportHeight, heightsById) {
|
|
18
|
+
var _a, _b, _c;
|
|
19
|
+
const mode = getSegmentDisplayMode(item.activeSlide);
|
|
20
|
+
if (mode === 'map') {
|
|
21
|
+
return {
|
|
22
|
+
height: estimateMapSegmentHeight(mapViewportHeight),
|
|
23
|
+
measured: mapViewportHeight > 0,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const measured = heightsById[item.id];
|
|
27
|
+
if (measured !== undefined && measured > 0) {
|
|
28
|
+
return { height: measured, measured: true };
|
|
29
|
+
}
|
|
30
|
+
const markdown = (_c = (_b = (_a = item.activeSlide) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.markdown) !== null && _c !== void 0 ? _c : '';
|
|
31
|
+
return {
|
|
32
|
+
height: estimateMarkdownHeight(typeof markdown === 'string' ? markdown : '', viewportHeight),
|
|
33
|
+
measured: false,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/** Builds cumulative segment ranges for the virtual list story scroll track. */
|
|
37
|
+
export function buildListStoryScrollTrack({ items, viewportHeight, mapViewportHeight, heightsById = {}, }) {
|
|
38
|
+
if (!items.length || viewportHeight <= 0) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const mapHeight = mapViewportHeight !== null && mapViewportHeight !== void 0 ? mapViewportHeight : viewportHeight;
|
|
42
|
+
const heights = items.map(item => segmentHeightForItem(item, viewportHeight, mapHeight, heightsById));
|
|
43
|
+
const handoffGap = mapHeight;
|
|
44
|
+
let offset = 0;
|
|
45
|
+
const segments = items.map((item, i) => {
|
|
46
|
+
const start = offset;
|
|
47
|
+
const height = heights[i].height;
|
|
48
|
+
const gapAfter = i < items.length - 1 ? handoffGap : 0;
|
|
49
|
+
const end = start + height + gapAfter;
|
|
50
|
+
offset = end;
|
|
51
|
+
return {
|
|
52
|
+
id: item.id,
|
|
53
|
+
index: item.index,
|
|
54
|
+
contentMode: getSegmentDisplayMode(item.activeSlide),
|
|
55
|
+
height,
|
|
56
|
+
measured: heights[i].measured,
|
|
57
|
+
start,
|
|
58
|
+
end,
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
return {
|
|
62
|
+
segments,
|
|
63
|
+
scrollTrackHeight: offset,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export function getSegmentDisplayMode(activeSlide) {
|
|
67
|
+
var _a;
|
|
68
|
+
if (((_a = activeSlide === null || activeSlide === void 0 ? void 0 : activeSlide.content) === null || _a === void 0 ? void 0 : _a.contentMode) === 'markdown') {
|
|
69
|
+
return 'markdown';
|
|
70
|
+
}
|
|
71
|
+
return 'map';
|
|
72
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IJGISStoryMap } from '@jupytergis/schema';
|
|
2
|
+
import type { CSSProperties } from 'react';
|
|
3
|
+
/** CSS variables (+ optional text color) for specta theming */
|
|
4
|
+
export declare function getSpectaPresentationCssVars(story: IJGISStoryMap | null): CSSProperties;
|
|
5
|
+
/**
|
|
6
|
+
* Full inline style for solid surfaces (e.g. mobile drawer).
|
|
7
|
+
* Do not use on `.jgis-specta-story-panel-container` — it overrides the gradient.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getSpectaPresentationStyle(story: IJGISStoryMap | null): CSSProperties;
|