Skip to content

Commit

Permalink
[fix] fix exported html map (#2918)
Browse files Browse the repository at this point in the history
- import missing css that isn't part of the main bundle anymore.
- replace withState custom state (demo - undefined) with lenses.
- alpha 5 version

Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>
  • Loading branch information
igorDykhta authored Jan 15, 2025
1 parent 43880f1 commit a207ae5
Show file tree
Hide file tree
Showing 28 changed files with 237 additions and 267 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Each version should:
Ref: http://keepachangelog.com/en/0.3.0/
-->

## [3.1.0-alpha.5] - January 15 2025

- b117b08ab [fix] fix for exported html maps

## [3.1.0-alpha.4] - January 15 2025

- 933a91a2f [fix] check for geoarrow extension in geojson layer (#2916)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kepler.gl",
"author": "Shan He <shan@uber.com>",
"version": "3.1.0-alpha.4",
"version": "3.1.0-alpha.5",
"description": "kepler.gl is a webgl based application to visualize large scale location data in the browser",
"license": "MIT",
"main": "dist/index.js",
Expand Down Expand Up @@ -103,7 +103,7 @@
"@deck.gl/mapbox": "^8.9.27",
"@hubble.gl/core": "1.2.0-alpha.6",
"@hubble.gl/react": "1.2.0-alpha.6",
"@kepler.gl/components": "3.1.0-alpha.4",
"@kepler.gl/components": "3.1.0-alpha.5",
"@loaders.gl/polyfills": "^4.3.2",
"@types/mapbox__geo-viewport": "^0.4.1",
"html-webpack-plugin": "^4.3.0",
Expand Down
16 changes: 8 additions & 8 deletions src/actions/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@kepler.gl/actions",
"author": "Shan He <shan@uber.com>",
"version": "3.1.0-alpha.4",
"version": "3.1.0-alpha.5",
"description": "kepler.gl constants used by kepler.gl components, actions and reducers",
"license": "MIT",
"main": "dist/index.js",
Expand Down Expand Up @@ -31,13 +31,13 @@
],
"dependencies": {
"@deck.gl/core": "^8.9.27",
"@kepler.gl/cloud-providers": "3.1.0-alpha.4",
"@kepler.gl/constants": "3.1.0-alpha.4",
"@kepler.gl/layers": "3.1.0-alpha.4",
"@kepler.gl/processors": "3.1.0-alpha.4",
"@kepler.gl/table": "3.1.0-alpha.4",
"@kepler.gl/types": "3.1.0-alpha.4",
"@kepler.gl/utils": "3.1.0-alpha.4",
"@kepler.gl/cloud-providers": "3.1.0-alpha.5",
"@kepler.gl/constants": "3.1.0-alpha.5",
"@kepler.gl/layers": "3.1.0-alpha.5",
"@kepler.gl/processors": "3.1.0-alpha.5",
"@kepler.gl/table": "3.1.0-alpha.5",
"@kepler.gl/types": "3.1.0-alpha.5",
"@kepler.gl/utils": "3.1.0-alpha.5",
"@reduxjs/toolkit": "^1.7.2",
"@types/lodash.curry": "^4.1.7",
"@types/react-redux": "^7.1.23",
Expand Down
14 changes: 7 additions & 7 deletions src/ai-assistant/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@kepler.gl/ai-assistant",
"author": "Xun Li<lixun910@gmail.com>",
"version": "3.1.0-alpha.4",
"version": "3.1.0-alpha.5",
"description": "kepler.gl AI assistant",
"license": "MIT",
"main": "dist/index.js",
Expand Down Expand Up @@ -30,12 +30,12 @@
"umd"
],
"dependencies": {
"@kepler.gl/components": "3.1.0-alpha.4",
"@kepler.gl/constants": "3.1.0-alpha.4",
"@kepler.gl/layers": "3.1.0-alpha.4",
"@kepler.gl/table": "3.1.0-alpha.4",
"@kepler.gl/types": "3.1.0-alpha.4",
"@kepler.gl/utils": "3.1.0-alpha.4",
"@kepler.gl/components": "3.1.0-alpha.5",
"@kepler.gl/constants": "3.1.0-alpha.5",
"@kepler.gl/layers": "3.1.0-alpha.5",
"@kepler.gl/table": "3.1.0-alpha.5",
"@kepler.gl/types": "3.1.0-alpha.5",
"@kepler.gl/utils": "3.1.0-alpha.5",
"color-interpolate": "^1.0.5",
"echarts": "^5.5.1",
"global": "^4.3.0",
Expand Down
4 changes: 2 additions & 2 deletions src/cloud-providers/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@kepler.gl/cloud-providers",
"author": "Shan He <shan@uber.com>",
"version": "3.1.0-alpha.4",
"version": "3.1.0-alpha.5",
"description": "kepler.gl constants used by kepler.gl components, actions and reducers",
"license": "MIT",
"main": "dist/index.js",
Expand Down Expand Up @@ -30,7 +30,7 @@
"umd"
],
"dependencies": {
"@kepler.gl/types": "3.1.0-alpha.4",
"@kepler.gl/types": "3.1.0-alpha.5",
"react": "^18.2.0"
},
"nyc": {
Expand Down
6 changes: 3 additions & 3 deletions src/common-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@kepler.gl/common-utils",
"author": "Shan He <heshan0131@gmail.com>",
"version": "3.1.0-alpha.4",
"version": "3.1.0-alpha.5",
"description": "kepler.gl common utils",
"license": "MIT",
"main": "dist/index.js",
Expand Down Expand Up @@ -30,8 +30,8 @@
"umd"
],
"dependencies": {
"@kepler.gl/constants": "3.1.0-alpha.4",
"@kepler.gl/types": "3.1.0-alpha.4",
"@kepler.gl/constants": "3.1.0-alpha.5",
"@kepler.gl/types": "3.1.0-alpha.5",
"d3-array": "^2.8.0",
"global": "^4.3.0",
"h3-js": "^3.1.0",
Expand Down
30 changes: 15 additions & 15 deletions src/components/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@kepler.gl/components",
"author": "Shan He <shan@uber.com>",
"version": "3.1.0-alpha.4",
"version": "3.1.0-alpha.5",
"description": "kepler.gl constants used by kepler.gl components, actions and reducers",
"license": "MIT",
"main": "dist/index.js",
Expand Down Expand Up @@ -38,20 +38,20 @@
"@dnd-kit/utilities": "^3.2.2",
"@emotion/is-prop-valid": "^1.2.1",
"@floating-ui/react": "0.25.1",
"@kepler.gl/actions": "3.1.0-alpha.4",
"@kepler.gl/cloud-providers": "3.1.0-alpha.4",
"@kepler.gl/common-utils": "3.1.0-alpha.4",
"@kepler.gl/constants": "3.1.0-alpha.4",
"@kepler.gl/effects": "3.1.0-alpha.4",
"@kepler.gl/layers": "3.1.0-alpha.4",
"@kepler.gl/localization": "3.1.0-alpha.4",
"@kepler.gl/processors": "3.1.0-alpha.4",
"@kepler.gl/reducers": "3.1.0-alpha.4",
"@kepler.gl/schemas": "3.1.0-alpha.4",
"@kepler.gl/styles": "3.1.0-alpha.4",
"@kepler.gl/table": "3.1.0-alpha.4",
"@kepler.gl/types": "3.1.0-alpha.4",
"@kepler.gl/utils": "3.1.0-alpha.4",
"@kepler.gl/actions": "3.1.0-alpha.5",
"@kepler.gl/cloud-providers": "3.1.0-alpha.5",
"@kepler.gl/common-utils": "3.1.0-alpha.5",
"@kepler.gl/constants": "3.1.0-alpha.5",
"@kepler.gl/effects": "3.1.0-alpha.5",
"@kepler.gl/layers": "3.1.0-alpha.5",
"@kepler.gl/localization": "3.1.0-alpha.5",
"@kepler.gl/processors": "3.1.0-alpha.5",
"@kepler.gl/reducers": "3.1.0-alpha.5",
"@kepler.gl/schemas": "3.1.0-alpha.5",
"@kepler.gl/styles": "3.1.0-alpha.5",
"@kepler.gl/table": "3.1.0-alpha.5",
"@kepler.gl/types": "3.1.0-alpha.5",
"@kepler.gl/utils": "3.1.0-alpha.5",
"@loaders.gl/mvt": "^4.3.2",
"@loaders.gl/pmtiles": "^4.3.2",
"@mapbox/mapbox-sdk": "^0.15.3",
Expand Down
22 changes: 8 additions & 14 deletions src/components/src/effects/effect-manager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ import {
ActionHandler
} from '@kepler.gl/actions';
import {LIGHT_AND_SHADOW_EFFECT, EFFECT_DESCRIPTIONS} from '@kepler.gl/constants';
import {visStateLens} from '@kepler.gl/reducers';
import {Effect} from '@kepler.gl/types';
import {VisState} from '@kepler.gl/schemas';

import {withState} from '../injector';
import SidePanelTitleFactory from './side-panel-title';
import EffectListFactory from './effect-list';
import EffectTypeSelectorFactory, {EffectTypeSelectorProps} from './effect-type-selector';

export type EffectManagerState = {
visState: VisState;
visStateActions: {
addEffect: ActionHandler<typeof addEffect>;
updateEffect: ActionHandler<typeof updateEffect>;
Expand Down Expand Up @@ -85,7 +88,8 @@ function EffectManagerFactory(
EffectTypeSelector: ReturnType<typeof EffectTypeSelectorFactory>
): React.FC<EffectManagerProps> {
const EffectManager = (props: EffectManagerWithIntlProp & EffectManagerState) => {
const {intl, visStateActions, effects, effectOrder, children} = props;
const {intl, visStateActions, visState, children} = props;
const {effects, effectOrder} = visState;
const {addEffect: visStateAddEffect} = visStateActions;
const [typeSelectorOpened, setTypeSelectorOpened] = useState(false);

Expand Down Expand Up @@ -149,19 +153,9 @@ function EffectManagerFactory(
);
};

return withState(
[],
state => {
const visState = state.demo.keplerGl.map.visState;
return {
effects: visState.effects,
effectOrder: visState.effectOrder
};
},
{
visStateActions: {addEffect, updateEffect, removeEffect, reorderEffect}
}
)(injectIntl(EffectManager)) as React.FC<EffectManagerProps>;
return withState([visStateLens], state => state, {
visStateActions: {addEffect, updateEffect, removeEffect, reorderEffect}
})(injectIntl(EffectManager)) as React.FC<EffectManagerProps>;
}

export default EffectManagerFactory;
29 changes: 11 additions & 18 deletions src/components/src/map/map-legend-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {useMergeRefs} from '@floating-ui/react';

import {ActionHandler, setMapControlSettings, toggleSplitMapViewport} from '@kepler.gl/actions';
import {Layer} from '@kepler.gl/layers';
import {uiStateLens} from '@kepler.gl/reducers';
import {breakPointValues} from '@kepler.gl/styles';
import {LayerVisConfig, MapControlMapLegend, MapControls, MapState} from '@kepler.gl/types';
import {hasPortableWidth} from '@kepler.gl/utils';
Expand Down Expand Up @@ -150,18 +151,11 @@ const DraggableLegendContent = forwardRef((props: DraggableLegendContentProps, r
);
});

const DraggableLegend = withState(
[],
state => {
const {activeSidePanel, mapControls} = state.demo.keplerGl.map.uiState;
return {
isSidePanelShown: activeSidePanel,
settings: mapControls?.mapLegend?.settings
};
},
{setMapControlSettings}
)(
withTheme(({isSidePanelShown, theme, settings, setMapControlSettings, children}) => {
const DraggableLegend = withState([uiStateLens], state => state, {setMapControlSettings})(
withTheme(({uiState, theme, setMapControlSettings, children}) => {
const isSidePanelShown = uiState.activeSidePanel;
const settings = uiState.mapControls?.mapLegend?.settings;

const legendContentRef = useRef<HTMLElement>(null);
const onChangeSettings = useCallback(
newSettings => setMapControlSettings('mapLegend', newSettings),
Expand Down Expand Up @@ -300,18 +294,20 @@ const MapLegendPanelComponent = ({
logoComponent,
actionIcons = defaultActionIcons,
mapState,
uiState,
onLayerVisConfigChange,
onToggleSplitMapViewport,
onClickControlBtn,
isViewportUnsyncAllowed = true,
className,
interactionConfig,
settings,
isSidePanelShown,
MapControlTooltip,
MapControlPanel,
MapLegend
}) => {
const isSidePanelShown = uiState.activeSidePanel;
const settings = uiState.mapControls?.mapLegend?.settings;

const mapLegend = mapControls?.mapLegend || ({} as MapControlMapLegend);
const {active, disableEdit} = mapLegend || {};
const rootContext = useContext(RootContext);
Expand Down Expand Up @@ -390,12 +386,9 @@ function MapLegendPanelFactory(
MapLegend: ReturnType<typeof MapLegendFactory>
): MapLegendPanelComponentType {
const MapLegendPanel = withState(
[],
[uiStateLens],
state => {
const {activeSidePanel, mapControls} = state.demo?.keplerGl.map.uiState ?? {};
return {
isSidePanelShown: activeSidePanel,
settings: mapControls?.mapLegend?.settings,
MapControlTooltip,
MapControlPanel,
MapLegend
Expand Down
4 changes: 2 additions & 2 deletions src/constants/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@kepler.gl/constants",
"author": "Shan He <shan@uber.com>",
"version": "3.1.0-alpha.4",
"version": "3.1.0-alpha.5",
"description": "kepler.gl constants used by kepler.gl components, actions and reducers",
"license": "MIT",
"main": "dist/index.js",
Expand Down Expand Up @@ -32,7 +32,7 @@
"dependencies": {
"@dnd-kit/core": "^6.1.0",
"@dnd-kit/modifiers": "^7.0.0",
"@kepler.gl/types": "3.1.0-alpha.4",
"@kepler.gl/types": "3.1.0-alpha.5",
"@types/d3-scale": "^3.2.2",
"@types/keymirror": "^0.1.1",
"chroma-js": "2.1.2",
Expand Down
2 changes: 1 addition & 1 deletion src/deckgl-arrow-layers/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@kepler.gl/deckgl-arrow-layers",
"author": "Shan He <shan@uber.com>",
"version": "3.1.0-alpha.4",
"version": "3.1.0-alpha.5",
"description": "Deck.gl layers with GeoArrow and GeoParquet support",
"license": "MIT",
"main": "dist/index.js",
Expand Down
8 changes: 4 additions & 4 deletions src/deckgl-layers/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@kepler.gl/deckgl-layers",
"author": "Shan He <shan@uber.com>",
"version": "3.1.0-alpha.4",
"version": "3.1.0-alpha.5",
"description": "kepler.gl constants used by kepler.gl components, actions and reducers",
"license": "MIT",
"main": "dist/index.js",
Expand Down Expand Up @@ -35,9 +35,9 @@
"@deck.gl/core": "^8.9.27",
"@deck.gl/geo-layers": "^8.9.27",
"@deck.gl/layers": "^8.9.27",
"@kepler.gl/constants": "3.1.0-alpha.4",
"@kepler.gl/types": "3.1.0-alpha.4",
"@kepler.gl/utils": "3.1.0-alpha.4",
"@kepler.gl/constants": "3.1.0-alpha.5",
"@kepler.gl/types": "3.1.0-alpha.5",
"@kepler.gl/utils": "3.1.0-alpha.5",
"@luma.gl/constants": "^8.5.20",
"@luma.gl/core": "^8.5.20",
"@mapbox/geo-viewport": "^0.4.1",
Expand Down
10 changes: 5 additions & 5 deletions src/effects/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@kepler.gl/effects",
"author": "Shan He <shan@uber.com>",
"version": "3.1.0-alpha.4",
"version": "3.1.0-alpha.5",
"description": "kepler.gl viaual effects",
"license": "MIT",
"main": "dist/index.js",
Expand Down Expand Up @@ -31,10 +31,10 @@
],
"dependencies": {
"@deck.gl/core": "^8.9.27",
"@kepler.gl/common-utils": "3.1.0-alpha.4",
"@kepler.gl/constants": "3.1.0-alpha.4",
"@kepler.gl/types": "3.1.0-alpha.4",
"@kepler.gl/utils": "3.1.0-alpha.4",
"@kepler.gl/common-utils": "3.1.0-alpha.5",
"@kepler.gl/constants": "3.1.0-alpha.5",
"@kepler.gl/types": "3.1.0-alpha.5",
"@kepler.gl/utils": "3.1.0-alpha.5",
"@luma.gl/core": "^8.5.20",
"@luma.gl/shadertools": "^8.5.20",
"moment-timezone": "^0.5.35",
Expand Down
18 changes: 9 additions & 9 deletions src/layers/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@kepler.gl/layers",
"author": "Shan He <shan@uber.com>",
"version": "3.1.0-alpha.4",
"version": "3.1.0-alpha.5",
"description": "kepler.gl constants used by kepler.gl components, actions and reducers",
"license": "MIT",
"main": "dist/index.js",
Expand Down Expand Up @@ -36,14 +36,14 @@
"@deck.gl/geo-layers": "^8.9.27",
"@deck.gl/layers": "^8.9.27",
"@deck.gl/mesh-layers": "^8.9.27",
"@kepler.gl/common-utils": "3.1.0-alpha.4",
"@kepler.gl/constants": "3.1.0-alpha.4",
"@kepler.gl/deckgl-arrow-layers": "3.1.0-alpha.4",
"@kepler.gl/deckgl-layers": "3.1.0-alpha.4",
"@kepler.gl/localization": "3.1.0-alpha.4",
"@kepler.gl/table": "3.1.0-alpha.4",
"@kepler.gl/types": "3.1.0-alpha.4",
"@kepler.gl/utils": "3.1.0-alpha.4",
"@kepler.gl/common-utils": "3.1.0-alpha.5",
"@kepler.gl/constants": "3.1.0-alpha.5",
"@kepler.gl/deckgl-arrow-layers": "3.1.0-alpha.5",
"@kepler.gl/deckgl-layers": "3.1.0-alpha.5",
"@kepler.gl/localization": "3.1.0-alpha.5",
"@kepler.gl/table": "3.1.0-alpha.5",
"@kepler.gl/types": "3.1.0-alpha.5",
"@kepler.gl/utils": "3.1.0-alpha.5",
"@loaders.gl/arrow": "^4.3.2",
"@loaders.gl/core": "^4.3.2",
"@loaders.gl/gis": "^4.3.2",
Expand Down
Loading

0 comments on commit a207ae5

Please sign in to comment.