@dynatrace/strato-geo 2.11.2 → 2.12.2

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.
@@ -20,7 +20,9 @@ const MapToolbar = () => {
20
20
  const isZoomEnabled = toolbarConfig?.zoom?.enabled ?? interactionsConfig?.zoom?.enabled ?? false;
21
21
  const isZoomToFitEnabled = toolbarConfig?.zoom?.enabled ?? interactionsConfig?.zoomToFit?.enabled ?? false;
22
22
  const isDownloadDataEnabled = toolbarConfig?.downloadCSV?.enabled ?? false;
23
- const hasControls = isZoomEnabled || isZoomToFitEnabled || isDownloadDataEnabled;
23
+ const hasZoomControls = isZoomEnabled || isZoomToFitEnabled;
24
+ const hasControls = hasZoomControls || isDownloadDataEnabled;
25
+ const hasOnlyDownloadCSV = isDownloadDataEnabled && !hasZoomControls;
24
26
  const handleMouseEnter = () => {
25
27
  setTooltipState({
26
28
  enabled: false
@@ -42,7 +44,7 @@ const MapToolbar = () => {
42
44
  draggable: toolbarConfig?.draggable,
43
45
  placement: toolbarConfig?.placement ?? defaultToolbarPlacement,
44
46
  handleDownloadDataToolbar,
45
- isDownloadEnabled: isDownloadDataEnabled,
47
+ isDownloadEnabled: !hasOnlyDownloadCSV && isDownloadDataEnabled,
46
48
  initialA11yState: initialA11yToolbarTabIndexContext,
47
49
  onMouseEnter: handleMouseEnter,
48
50
  onMouseLeave: handleMouseLeave,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/map/components/toolbar/MapToolbar.tsx"],
4
- "sourcesContent": ["import { _ChartToolbarRenderer as ChartToolbarRenderer } from '@dynatrace/strato-components-preview/charts';\n\nimport { MapDownloadDataButton } from './buttons/MapDownloadDataButton.js';\nimport { MapResetButton } from './buttons/MapResetButton.js';\nimport { MapZoomInOutButtons } from './buttons/MapZoomInOutButtons.js';\nimport { MapZoomToFitButton } from './buttons/MapZoomToFitButton.js';\nimport { initialA11yToolbarTabIndexContext } from './constants.js';\nimport { useMapConfig } from '../../hooks/use-map-config.js';\nimport { useMapRawData } from '../../hooks/use-map-raw-data.js';\nimport { MapInitialViewProvider } from '../../providers/map-initial-view.provider.js';\nimport { useMapOverlayState } from '../../store/selectors.js';\nimport { useSetStateTooltip } from '../../store/store.js';\nimport { buildAndDownloadCsv } from '../../utils/build-and-download-csv.js';\n\nconst defaultToolbarPlacement = 'top-right';\n\nexport const MapToolbar = () => {\n const { toolbar: toolbarConfig, interactions: interactionsConfig } =\n useMapConfig();\n const data = useMapRawData();\n\n const { mouseInBounds } = useMapOverlayState();\n const setTooltipState = useSetStateTooltip();\n const isZoomEnabled =\n toolbarConfig?.zoom?.enabled ?? interactionsConfig?.zoom?.enabled ?? false;\n const isZoomToFitEnabled =\n toolbarConfig?.zoom?.enabled ??\n interactionsConfig?.zoomToFit?.enabled ??\n false;\n const isDownloadDataEnabled = toolbarConfig?.downloadCSV?.enabled ?? false;\n\n const hasControls =\n isZoomEnabled || isZoomToFitEnabled || isDownloadDataEnabled;\n\n const handleMouseEnter = () => {\n setTooltipState({\n enabled: false,\n });\n };\n\n const handleMouseLeave = () => {\n setTooltipState({\n enabled: true,\n });\n };\n\n const handleDownloadDataToolbar = () => {\n buildAndDownloadCsv(data);\n };\n\n return hasControls ? (\n <MapInitialViewProvider>\n <ChartToolbarRenderer\n visible={mouseInBounds}\n collapsed={toolbarConfig?.collapsed}\n draggable={toolbarConfig?.draggable}\n placement={toolbarConfig?.placement ?? defaultToolbarPlacement}\n handleDownloadDataToolbar={handleDownloadDataToolbar}\n isDownloadEnabled={isDownloadDataEnabled}\n initialA11yState={initialA11yToolbarTabIndexContext}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n menuDisplayMode=\"never\"\n >\n {isZoomEnabled && <MapZoomInOutButtons />}\n {isZoomEnabled && <MapResetButton />}\n {isZoomToFitEnabled && <MapZoomToFitButton />}\n {isDownloadDataEnabled && <MapDownloadDataButton />}\n </ChartToolbarRender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;AAAA,MAEf;AAAA,yBAAiB,oBAAC,uBAAoB;AAAA,QACtC,iBAAiB,oBAAC,kBAAe;AAAA,QACjC,sBAAsB,oBAAC,sBAAmB;AAAA,QAC1C,yBAAyB,oBAAC,yBAAsB;AAAA;AAAA;AAAA,EACnD,GACF,IACE;AACN;AAEA,WAAW,aAAa,IAAI;",
4
+ "sourcesContent": ["import { _ChartToolbarRenderer as ChartToolbarRenderer } from '@dynatrace/strato-components-preview/charts';\n\nimport { MapDownloadDataButton } from './buttons/MapDownloadDataButton.js';\nimport { MapResetButton } from './buttons/MapResetButton.js';\nimport { MapZoomInOutButtons } from './buttons/MapZoomInOutButtons.js';\nimport { MapZoomToFitButton } from './buttons/MapZoomToFitButton.js';\nimport { initialA11yToolbarTabIndexContext } from './constants.js';\nimport { useMapConfig } from '../../hooks/use-map-config.js';\nimport { useMapRawData } from '../../hooks/use-map-raw-data.js';\nimport { MapInitialViewProvider } from '../../providers/map-initial-view.provider.js';\nimport { useMapOverlayState } from '../../store/selectors.js';\nimport { useSetStateTooltip } from '../../store/store.js';\nimport { buildAndDownloadCsv } from '../../utils/build-and-download-csv.js';\n\nconst defaultToolbarPlacement = 'top-right';\n\nexport const MapToolbar = () => {\n const { toolbar: toolbarConfig, interactions: interactionsConfig } =\n useMapConfig();\n const data = useMapRawData();\n\n const { mouseInBounds } = useMapOverlayState();\n const setTooltipState = useSetStateTooltip();\n const isZoomEnabled =\n toolbarConfig?.zoom?.enabled ?? interactionsConfig?.zoom?.enabled ?? false;\n const isZoomToFitEnabled =\n toolbarConfig?.zoom?.enabled ??\n interactionsConfig?.zoomToFit?.enabled ??\n false;\n const isDownloadDataEnabled = toolbarConfig?.downloadCSV?.enabled ?? false;\n\n const hasZoomControls = isZoomEnabled || isZoomToFitEnabled;\n const hasControls = hasZoomControls || isDownloadDataEnabled;\n const hasOnlyDownloadCSV = isDownloadDataEnabled && !hasZoomControls;\n\n const handleMouseEnter = () => {\n setTooltipState({\n enabled: false,\n });\n };\n\n const handleMouseLeave = () => {\n setTooltipState({\n enabled: true,\n });\n };\n\n const handleDownloadDataToolbar = () => {\n buildAndDownloadCsv(data);\n };\n\n return hasControls ? (\n <MapInitialViewProvider>\n <ChartToolbarRenderer\n visible={mouseInBounds}\n collapsed={toolbarConfig?.collapsed}\n draggable={toolbarConfig?.draggable}\n placement={toolbarConfig?.placement ?? defaultToolbarPlacement}\n handleDownloadDataToolbar={handleDownloadDataToolbar}\n isDownloadEnabled={!hasOnlyDownloadCSV && isDownloadDataEnabled}\n initialA11yState={initialA11yToolbarTabIndexContext}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n menuDisplayMode=\"never\"\n >\n {isZoomEnabled && <MapZoomInOutButtons />}\n {isZoomEnabled && <MapResetButton />}\n {isZoomToFitEnabled && <MapZoomToFitButton />}\n {isDownloadDataEnabled && <MapDownloadDataButton />}\n </ChartToolbarRenderer>\n </MapInitialViewProvider>\n ) : null;\n};\n\nMapToolbar['displayName'] = 'MapToolbar';\n"],
5
+ "mappings": "AAqDM,SAYoB,KAZpB;AArDN,SAAS,yBAAyB,4BAA4B;AAE9D,SAAS,6BAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,2BAA2B;AACpC,SAAS,0BAA0B;AACnC,SAAS,yCAAyC;AAClD,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,8BAA8B;AACvC,SAAS,0BAA0B;AACnC,SAAS,0BAA0B;AACnC,SAAS,2BAA2B;AAEpC,MAAM,0BAA0B;AAEzB,MAAM,aAAa,MAAM;AAC9B,QAAM,EAAE,SAAS,eAAe,cAAc,mBAAmB,IAC/D,aAAa;AACf,QAAM,OAAO,cAAc;AAE3B,QAAM,EAAE,cAAc,IAAI,mBAAmB;AAC7C,QAAM,kBAAkB,mBAAmB;AAC3C,QAAM,gBACJ,eAAe,MAAM,WAAW,oBAAoB,MAAM,WAAW;AACvE,QAAM,qBACJ,eAAe,MAAM,WACrB,oBAAoB,WAAW,WAC/B;AACF,QAAM,wBAAwB,eAAe,aAAa,WAAW;AAErE,QAAM,kBAAkB,iBAAiB;AACzC,QAAM,cAAc,mBAAmB;AACvC,QAAM,qBAAqB,yBAAyB,CAAC;AAErD,QAAM,mBAAmB,MAAM;AAC7B,oBAAgB;AAAA,MACd,SAAS;AAAA,IACX,CAAC;AAAA,EACH;AAEA,QAAM,mBAAmB,MAAM;AAC7B,oBAAgB;AAAA,MACd,SAAS;AAAA,IACX,CAAC;AAAA,EACH;AAEA,QAAM,4BAA4B,MAAM;AACtC,wBAAoB,IAAI;AAAA,EAC1B;AAEA,SAAO,cACL,oBAAC,0BACC;AAAA,IAAC;AAAA;AAAA,MACC,SAAS;AAAA,MACT,WAAW,eAAe;AAAA,MAC1B,WAAW,eAAe;AAAA,MAC1B,WAAW,eAAe,aAAa;AAAA,MACvC;AAAA,MACA,mBAAmB,CAAC,sBAAsB;AAAA,MAC1C,kBAAkB;AAAA,MAClB,cAAc;AAAA,MACd,cAAc;AAAA,MACd,iBAAgB;AAAA,MAEf;AAAA,yBAAiB,oBAAC,uBAAoB;AAAA,QACtC,iBAAiB,oBAAC,kBAAe;AAAA,QACjC,sBAAsB,oBAAC,sBAAmB;AAAA,QAC1C,yBAAyB,oBAAC,yBAAsB;AAAA;AAAA;AAAA,EACnD,GACF,IACE;AACN;AAEA,WAAW,aAAa,IAAI;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/map/contexts/formatter.context.ts"],
4
- "sourcesContent": ["import { createContext } from 'react';\n\nimport { Formatter } from '@dynatrace/strato-components-preview/charts';\nimport { ConvertibleUnit, FormatOptions, Unit } from '@dynatrace-sdk/units';\n\nexport const FormatterContext = createContext<\n Formatter | FormatOptions<Unit, ConvertibleUnit> | undefined\n>(undefined);\n"],
5
- "mappings": "AAAA,SAAS,qBAAqB;AAKvB,MAAM,mBAAmB,cAE9B,MAAS;",
4
+ "sourcesContent": ["import { createContext } from 'react';\n\nimport type { Formatter } from '@dynatrace/strato-components-preview/charts';\nimport type {\n ConvertibleUnit,\n FormatOptions,\n Unit,\n} from '@dynatrace-sdk/units';\n\nexport const FormatterContext = createContext<\n Formatter | FormatOptions<Unit, ConvertibleUnit> | undefined\n>(undefined);\n"],
5
+ "mappings": "AAAA,SAAS,qBAAqB;AASvB,MAAM,mBAAmB,cAE9B,MAAS;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/map/hooks/use-formatter-context.ts"],
4
- "sourcesContent": ["import { useContext } from 'react';\n\nimport { FormatterContext } from '../contexts/formatter.context.js';\n\nexport const useFormatterContext = () => useContext(FormatterContext);\n"],
5
- "mappings": "AAAA,SAAS,kBAAkB;AAE3B,SAAS,wBAAwB;AAE1B,MAAM,sBAAsB,MAAM,WAAW,gBAAgB;",
4
+ "sourcesContent": ["import { useContext } from 'react';\n\nimport type { Formatter } from '@dynatrace/strato-components-preview/charts';\nimport type {\n ConvertibleUnit,\n FormatOptions,\n Unit,\n} from '@dynatrace-sdk/units';\n\nimport { FormatterContext } from '../contexts/formatter.context.js';\n\nexport const useFormatterContext: () =>\n | Formatter\n | FormatOptions<Unit, ConvertibleUnit>\n | undefined = () => useContext(FormatterContext);\n"],
5
+ "mappings": "AAAA,SAAS,kBAAkB;AAS3B,SAAS,wBAAwB;AAE1B,MAAM,sBAGG,MAAM,WAAW,gBAAgB;",
6
6
  "names": []
7
7
  }
@@ -43,7 +43,9 @@ const MapToolbar = () => {
43
43
  const isZoomEnabled = toolbarConfig?.zoom?.enabled ?? interactionsConfig?.zoom?.enabled ?? false;
44
44
  const isZoomToFitEnabled = toolbarConfig?.zoom?.enabled ?? interactionsConfig?.zoomToFit?.enabled ?? false;
45
45
  const isDownloadDataEnabled = toolbarConfig?.downloadCSV?.enabled ?? false;
46
- const hasControls = isZoomEnabled || isZoomToFitEnabled || isDownloadDataEnabled;
46
+ const hasZoomControls = isZoomEnabled || isZoomToFitEnabled;
47
+ const hasControls = hasZoomControls || isDownloadDataEnabled;
48
+ const hasOnlyDownloadCSV = isDownloadDataEnabled && !hasZoomControls;
47
49
  const handleMouseEnter = () => {
48
50
  setTooltipState({
49
51
  enabled: false
@@ -65,7 +67,7 @@ const MapToolbar = () => {
65
67
  draggable: toolbarConfig?.draggable,
66
68
  placement: toolbarConfig?.placement ?? defaultToolbarPlacement,
67
69
  handleDownloadDataToolbar,
68
- isDownloadEnabled: isDownloadDataEnabled,
70
+ isDownloadEnabled: !hasOnlyDownloadCSV && isDownloadDataEnabled,
69
71
  initialA11yState: import_constants.initialA11yToolbarTabIndexContext,
70
72
  onMouseEnter: handleMouseEnter,
71
73
  onMouseLeave: handleMouseLeave,
@@ -1,3 +1,3 @@
1
- import { Formatter } from '@dynatrace/strato-components-preview/charts';
2
- import { ConvertibleUnit, FormatOptions, Unit } from '@dynatrace-sdk/units';
1
+ import type { Formatter } from '@dynatrace/strato-components-preview/charts';
2
+ import type { ConvertibleUnit, FormatOptions, Unit } from '@dynatrace-sdk/units';
3
3
  export declare const FormatterContext: import("react").Context<Formatter | FormatOptions<Unit, ConvertibleUnit> | undefined>;
@@ -1 +1,3 @@
1
- export declare const useFormatterContext: () => import("@dynatrace/strato-components-preview").Formatter | import("@dynatrace-sdk/units").FormatOptions<import("@dynatrace-sdk/units").Unit, import("@dynatrace-sdk/units").ConvertibleUnit> | undefined;
1
+ import type { Formatter } from '@dynatrace/strato-components-preview/charts';
2
+ import type { ConvertibleUnit, FormatOptions, Unit } from '@dynatrace-sdk/units';
3
+ export declare const useFormatterContext: () => Formatter | FormatOptions<Unit, ConvertibleUnit> | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynatrace/strato-geo",
3
- "version": "2.11.2",
3
+ "version": "2.12.2",
4
4
  "private": false,
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
@@ -48,7 +48,7 @@
48
48
  "d3-array": "^3.2.4",
49
49
  "d3-interpolate": "^3.0.1",
50
50
  "d3-scale": "^4.0.2",
51
- "maplibre-gl": "^5.0.0"
51
+ "maplibre-gl": ">=5.0.0 <5.12.0"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@dynatrace-sdk/client-classic-environment-v2": "^3.7.3",
@@ -59,8 +59,8 @@
59
59
  "react-intl": "^6.0.8 || ^7.0.0",
60
60
  "react-is": "^18.0.0",
61
61
  "@dynatrace/strato-components": "^1.14.0",
62
+ "@dynatrace/strato-components-preview": "^2.12.2",
62
63
  "@dynatrace/strato-design-tokens": "^1.2.0",
63
- "@dynatrace/strato-components-preview": "^2.11.2",
64
64
  "@dynatrace/strato-icons": "^1.11.0"
65
65
  },
66
66
  "sideEffects": [