@mapcomponents/react-maplibre 1.3.3 → 1.5.0-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.
- package/CHANGELOG.md +163 -38
- package/CODE_OF_CONDUCT.md +70 -70
- package/CONTRIBUTING.md +157 -149
- package/README.md +1 -1
- package/docs_md/anatomy_of_a_mapcomponent.md +34 -37
- package/eslint.config.cjs +3 -0
- package/package.json +193 -224
- package/project.json +21 -0
- package/tsconfig.lib.json +29 -0
- package/vite.config.ts +61 -0
- package/.eslintrc.cjs +0 -33
- package/dist/assets/index.cjs-Iqz0mZaU.css +0 -98
- package/dist/assets/index.esm-Iqz0mZaU.css +0 -98
- package/dist/index.cjs.js +0 -22120
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.esm.js +0 -22000
- package/dist/index.esm.js.map +0 -1
- package/dist/src/components/MapLibreMap/MapLibreMap.d.ts +0 -34
- package/dist/src/components/MapLibreMap/lib/MapLibreGlWrapper.d.ts +0 -120
- package/dist/src/components/MlCenterPosition/MlCenterPosition.d.ts +0 -36
- package/dist/src/components/MlClientSearch/MlClientSearch.d.ts +0 -30
- package/dist/src/components/MlClientSearch/lib/SearchContext.d.ts +0 -13
- package/dist/src/components/MlClientSearch/lib/SearchForm.d.ts +0 -2
- package/dist/src/components/MlClientSearch/lib/createGeojsonFeature.d.ts +0 -4
- package/dist/src/components/MlComponentTemplate/MlComponentTemplate.d.ts +0 -18
- package/dist/src/components/MlComponentTemplate/MlComponentTemplate.stories_.d.ts +0 -14
- package/dist/src/components/MlCreatePdfButton/MlCreatePdfButton.d.ts +0 -22
- package/dist/src/components/MlCreatePdfForm/MlCreatePdfForm.d.ts +0 -13
- package/dist/src/components/MlCreatePdfForm/lib/PdfContext.d.ts +0 -8
- package/dist/src/components/MlCreatePdfForm/lib/PdfForm.d.ts +0 -25
- package/dist/src/components/MlCreatePdfForm/lib/PdfPreview.d.ts +0 -26
- package/dist/src/components/MlCreatePdfForm/lib/pdf.templates.d.ts +0 -11
- package/dist/src/components/MlCreatePngButton/MlCreatePngButton.d.ts +0 -22
- package/dist/src/components/MlFeatureEditor/MlFeatureEditor.d.ts +0 -5
- package/dist/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.d.ts +0 -62
- package/dist/src/components/MlFollowGps/MlFollowGps.d.ts +0 -81
- package/dist/src/components/MlGeoJsonLayer/MlGeoJsonLayer.d.ts +0 -98
- package/dist/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.lineStyler.d.ts +0 -9
- package/dist/src/components/MlGeoJsonLayer/story_utils/MlGeoJsonLayer.polygonStyler.d.ts +0 -9
- package/dist/src/components/MlGeoJsonLayer/util/getDefaultLayerTypeByGeometry.d.ts +0 -4
- package/dist/src/components/MlGeoJsonLayer/util/getDefaultPaintPropsByType.d.ts +0 -5
- package/dist/src/components/MlGeojsonLayerWithSource/MlGeojsonLayerWithSource.d.ts +0 -23
- package/dist/src/components/MlGlobeButton/MlGlobeButton.d.ts +0 -28
- package/dist/src/components/MlGpxViewer/MlGpxViewer.d.ts +0 -31
- package/dist/src/components/MlGpxViewer/util/GeoJsonContext.d.ts +0 -10
- package/dist/src/components/MlGpxViewer/util/GeoJsonProvider.d.ts +0 -5
- package/dist/src/components/MlGpxViewer/util/Metadata.d.ts +0 -7
- package/dist/src/components/MlGpxViewer/util/MlGpxDemoLoader.d.ts +0 -11
- package/dist/src/components/MlGpxViewer/util/MlGpxViewerInstructions.d.ts +0 -4
- package/dist/src/components/MlImageMarkerLayer/MlImageMarkerLayer.d.ts +0 -39
- package/dist/src/components/MlLayer/MlLayer.d.ts +0 -33
- package/dist/src/components/MlLayerMagnify/MlLayerMagnify.d.ts +0 -33
- package/dist/src/components/MlLayerSwipe/MlLayerSwipe.d.ts +0 -26
- package/dist/src/components/MlLayerSwipe/assets/SwipeIcon.d.ts +0 -10
- package/dist/src/components/MlLayerSwitcher/MlLayerSwitcher.d.ts +0 -29
- package/dist/src/components/MlLayerSwitcher/components/LayerBox.d.ts +0 -10
- package/dist/src/components/MlMarker/MlMarker.d.ts +0 -29
- package/dist/src/components/MlMeasureTool/MlMeasureTool.d.ts +0 -37
- package/dist/src/components/MlMultiMeasureTool/MlMultiMeasureTool.d.ts +0 -55
- package/dist/src/components/MlNavigationCompass/MlNavigationCompass.d.ts +0 -33
- package/dist/src/components/MlNavigationCompass/assets/CompassBackground.d.ts +0 -9
- package/dist/src/components/MlNavigationCompass/assets/CompassNeedle.d.ts +0 -9
- package/dist/src/components/MlNavigationTools/MlNavigationTools.d.ts +0 -60
- package/dist/src/components/MlOgcApiFeatures/MlOgcApiFeatures.d.ts +0 -45
- package/dist/src/components/MlOrderLayers/MlOrderLayers.d.ts +0 -21
- package/dist/src/components/MlScaleReference/MlScaleReference.d.ts +0 -9
- package/dist/src/components/MlShareMapState/MlShareMapState.d.ts +0 -35
- package/dist/src/components/MlSketchTool/MlSketchTool.d.ts +0 -50
- package/dist/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.d.ts +0 -40
- package/dist/src/components/MlSpatialElevationProfile/util/getElevationData.d.ts +0 -13
- package/dist/src/components/MlTemporalController/MlTemporalController.d.ts +0 -181
- package/dist/src/components/MlTemporalController/utils/MlTemporalControllerLabels.d.ts +0 -20
- package/dist/src/components/MlTemporalController/utils/TemporalControllerPlayer.d.ts +0 -22
- package/dist/src/components/MlTemporalController/utils/paintPicker.d.ts +0 -59
- package/dist/src/components/MlTemporalController/utils/useFilterData.d.ts +0 -14
- package/dist/src/components/MlTerrainLayer/MlTerrainLayer.d.ts +0 -28
- package/dist/src/components/MlThreeJsLayer/MlThreeJsLayer.d.ts +0 -13
- package/dist/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.d.ts +0 -12
- package/dist/src/components/MlUseMapDebugger/MlUseMapDebugger.d.ts +0 -21
- package/dist/src/components/MlVectorTileLayer/MlVectorTileLayer.d.ts +0 -22
- package/dist/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.d.ts +0 -22
- package/dist/src/components/MlWmsLayer/MlWmsLayer.d.ts +0 -58
- package/dist/src/components/MlWmsLoader/MlWmsLoader.d.ts +0 -125
- package/dist/src/components/MlWmsLoader/utils/MlWmsLoaderInstructions.d.ts +0 -4
- package/dist/src/components/MlWmsLoader/utils/WMSLinks.d.ts +0 -8
- package/dist/src/contexts/LayerContext.d.ts +0 -59
- package/dist/src/contexts/MapContext.d.ts +0 -26
- package/dist/src/contexts/SimpleDataContext.d.ts +0 -4
- package/dist/src/contexts/SimpleDataProvider.d.ts +0 -12
- package/dist/src/decorators/EmptyMapDecorator.d.ts +0 -4
- package/dist/src/decorators/GeoJsonMapDecorator.d.ts +0 -4
- package/dist/src/decorators/LowZoomDecorator.d.ts +0 -4
- package/dist/src/decorators/MapContextDecorator.d.ts +0 -7
- package/dist/src/decorators/MapContextDecoratorHooks.d.ts +0 -4
- package/dist/src/decorators/MapContextReduxStoreDecorator.d.ts +0 -7
- package/dist/src/decorators/MultiMapContextDecorator.d.ts +0 -4
- package/dist/src/decorators/NoNavToolsDecorator.d.ts +0 -4
- package/dist/src/decorators/ThemeDecorator.d.ts +0 -5
- package/dist/src/hooks/useAddImage/useAddImage.d.ts +0 -20
- package/dist/src/hooks/useAddProtocol/useAddProtocol.d.ts +0 -23
- package/dist/src/hooks/useCameraFollowPath/useCameraFollowPath.d.ts +0 -35
- package/dist/src/hooks/useExportMap/index.d.ts +0 -11
- package/dist/src/hooks/useExportMap/lib.d.ts +0 -52
- package/dist/src/hooks/useFeatureEditor/useFeatureEditor.d.ts +0 -46
- package/dist/src/hooks/useFeatureEditor/utils/FeatureEditorStyle.d.ts +0 -116
- package/dist/src/hooks/useFitLayerBounds.d.ts +0 -8
- package/dist/src/hooks/useGpx/useGpx.d.ts +0 -26
- package/dist/src/hooks/useLayer.d.ts +0 -36
- package/dist/src/hooks/useLayerContext.d.ts +0 -2
- package/dist/src/hooks/useLayerFilter/useLayerFilter.d.ts +0 -8
- package/dist/src/hooks/useLayerHoverPopup/LayerHoverPopup.d.ts +0 -24
- package/dist/src/hooks/useMap.d.ts +0 -14
- package/dist/src/hooks/useMapState.d.ts +0 -37
- package/dist/src/hooks/useSource.d.ts +0 -17
- package/dist/src/hooks/useWms.d.ts +0 -26
- package/dist/src/index.d.ts +0 -126
- package/dist/src/omt_styles/bright.d.ts +0 -2495
- package/dist/src/omt_styles/config.d.ts +0 -7
- package/dist/src/omt_styles/gruvbox.d.ts +0 -2420
- package/dist/src/omt_styles/medieval_kingdom.d.ts +0 -2420
- package/dist/src/omt_styles/monokai.d.ts +0 -2420
- package/dist/src/omt_styles/oceanic_next.d.ts +0 -2420
- package/dist/src/omt_styles/solarized.d.ts +0 -2420
- package/dist/src/protocol_handlers/csv.d.ts +0 -8
- package/dist/src/protocol_handlers/mbtiles.d.ts +0 -74
- package/dist/src/protocol_handlers/osm.d.ts +0 -10
- package/dist/src/protocol_handlers/topojson.d.ts +0 -9
- package/dist/src/protocol_handlers/utils/getProtocolData.d.ts +0 -1
- package/dist/src/protocol_handlers/utils/protocolPathParser.d.ts +0 -7
- package/dist/src/protocol_handlers/xml.d.ts +0 -10
- package/dist/src/stores/map.store.d.ts +0 -105
- package/dist/src/ui_components/AddLayerButton/AddLayerButton.d.ts +0 -17
- package/dist/src/ui_components/AddLayerButton/AddLayerPopup.d.ts +0 -15
- package/dist/src/ui_components/AddLayerButton/LayerConfigForms/GeoJsonLayerForm.d.ts +0 -8
- package/dist/src/ui_components/AddLayerButton/LayerConfigForms/LayerTypeForm.d.ts +0 -10
- package/dist/src/ui_components/AddLayerButton/LayerConfigForms/MbtilesLayerForm.d.ts +0 -13
- package/dist/src/ui_components/AddLayerButton/LayerConfigForms/ProtocolHandlerLayerForm.d.ts +0 -10
- package/dist/src/ui_components/AddLayerButton/LayerConfigForms/WmsLayerForm.d.ts +0 -10
- package/dist/src/ui_components/AddLayerButton/LayerConfigForms/utils/CSVOptionsFomular.d.ts +0 -6
- package/dist/src/ui_components/AddLayerButton/LayerConfigForms/utils/MbtilesLayerPropFormular.d.ts +0 -7
- package/dist/src/ui_components/AddLayerButton/LayerConfigForms/utils/OsmOptionsFomular.d.ts +0 -6
- package/dist/src/ui_components/ColorPicker/ColorPicker.d.ts +0 -15
- package/dist/src/ui_components/ColorPicker/transformers.d.ts +0 -10
- package/dist/src/ui_components/ConfirmDialog.d.ts +0 -16
- package/dist/src/ui_components/DemoDescriptions.d.ts +0 -12
- package/dist/src/ui_components/Dropzone.d.ts +0 -6
- package/dist/src/ui_components/ImageLoader.d.ts +0 -10
- package/dist/src/ui_components/LayerList/LayerList.d.ts +0 -7
- package/dist/src/ui_components/LayerList/LayerListFolder.d.ts +0 -9
- package/dist/src/ui_components/LayerList/LayerListItem.d.ts +0 -26
- package/dist/src/ui_components/LayerList/LayerListItemFactory.d.ts +0 -18
- package/dist/src/ui_components/LayerList/util/LayerListItemVectorLayer.d.ts +0 -19
- package/dist/src/ui_components/LayerList/util/LayerPropertyForm.d.ts +0 -10
- package/dist/src/ui_components/LayerList/util/SortableContainer.d.ts +0 -7
- package/dist/src/ui_components/LayerList/util/input/ColorPicker.d.ts +0 -10
- package/dist/src/ui_components/LayerTree/LayerOnMap.d.ts +0 -7
- package/dist/src/ui_components/LayerTree/LayerTree.d.ts +0 -6
- package/dist/src/ui_components/LayerTree/LayerTreeListItem.d.ts +0 -18
- package/dist/src/ui_components/LayerTree/util/LayerPropertyForm.d.ts +0 -9
- package/dist/src/ui_components/LayerTree/util/input/ColorPicker.d.ts +0 -7
- package/dist/src/ui_components/LoadingOverlayContext.d.ts +0 -4
- package/dist/src/ui_components/MapcomponentsTheme.d.ts +0 -36
- package/dist/src/ui_components/SelectStyleButton/SelectStyleButton.d.ts +0 -20
- package/dist/src/ui_components/SelectStyleButton/SelectStylePopup.d.ts +0 -18
- package/dist/src/ui_components/Sidebar.d.ts +0 -13
- package/dist/src/ui_components/SpeedDial/SpeedDial.d.ts +0 -14
- package/dist/src/ui_components/TopToolbar.d.ts +0 -9
- package/dist/src/ui_components/UploadButton.d.ts +0 -8
- package/dist/src/util/BubbleForInstructions.d.ts +0 -16
- package/dist/src/util/Instructions.d.ts +0 -14
- package/eslint.config.mjs +0 -73
- package/rollup.config.mjs +0 -62
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { SxProps } from '@mui/material';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { StyleSpecification } from 'maplibre-gl';
|
|
4
|
-
export interface SelectStyleButtonProps {
|
|
5
|
-
sx?: SxProps;
|
|
6
|
-
onComplete?: (config: StyleSpecification[]) => void;
|
|
7
|
-
styles?: StyleSpecification[];
|
|
8
|
-
defaultStyles?: boolean;
|
|
9
|
-
styleThumbnailPaths?: {
|
|
10
|
-
[key: string]: string;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
declare const SelectStyleButton: {
|
|
14
|
-
(props: SelectStyleButtonProps): React.JSX.Element;
|
|
15
|
-
defaultProps: {
|
|
16
|
-
style: never[];
|
|
17
|
-
defaultStyles: boolean;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export default SelectStyleButton;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { StyleSpecification } from 'maplibre-gl';
|
|
3
|
-
export interface SelectStylePopupProps {
|
|
4
|
-
open: boolean;
|
|
5
|
-
setOpen: (open: boolean) => void;
|
|
6
|
-
styles?: StyleSpecification[];
|
|
7
|
-
onSelect?: (style: StyleSpecification) => void;
|
|
8
|
-
styleThumbnailPaths?: {
|
|
9
|
-
[key: string]: string;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
declare const SelectStylePopup: {
|
|
13
|
-
(props: SelectStylePopupProps): React.JSX.Element;
|
|
14
|
-
defaultProps: {
|
|
15
|
-
styleThumbnailPaths: {};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export default SelectStylePopup;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PaperProps, DrawerProps } from '@mui/material';
|
|
3
|
-
interface SidebarProps {
|
|
4
|
-
drawerPaperProps?: PaperProps;
|
|
5
|
-
drawerHeaderProps?: Headers;
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
open?: boolean;
|
|
8
|
-
setOpen?: (val: boolean) => void;
|
|
9
|
-
name?: string;
|
|
10
|
-
drawerBleeding?: number;
|
|
11
|
-
}
|
|
12
|
-
export default function Sidebar({ drawerPaperProps, drawerHeaderProps, setOpen, ...props }: SidebarProps & DrawerProps): React.JSX.Element;
|
|
13
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface SpeedDialProps {
|
|
3
|
-
/**
|
|
4
|
-
* Id of the target MapLibre instance in mapContext
|
|
5
|
-
*/
|
|
6
|
-
mapId?: string;
|
|
7
|
-
}
|
|
8
|
-
declare const SpeedDial: {
|
|
9
|
-
(): React.JSX.Element;
|
|
10
|
-
defaultProps: {
|
|
11
|
-
mapId: undefined;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export default SpeedDial;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export interface TopToolbarProps {
|
|
3
|
-
children?: React.ReactNode;
|
|
4
|
-
unmovableButtons?: React.ReactNode;
|
|
5
|
-
buttons?: React.ReactNode;
|
|
6
|
-
logo?: React.ReactNode;
|
|
7
|
-
}
|
|
8
|
-
declare function TopToolbar(props: TopToolbarProps): React.JSX.Element;
|
|
9
|
-
export default TopToolbar;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface BubbleForInstructionProps {
|
|
3
|
-
bubbleRight?: string;
|
|
4
|
-
bubbleLeft?: string;
|
|
5
|
-
bubbleTop?: string;
|
|
6
|
-
bubbleBottom?: string;
|
|
7
|
-
zIndex: string;
|
|
8
|
-
textMarginTop: string;
|
|
9
|
-
textMarginLeft: string;
|
|
10
|
-
iconTransform: string;
|
|
11
|
-
iconMarginTop: string;
|
|
12
|
-
iconMarginLeft: string;
|
|
13
|
-
children?: React.ReactNode;
|
|
14
|
-
}
|
|
15
|
-
declare function BubbleForInstruction(props: BubbleForInstructionProps): React.JSX.Element;
|
|
16
|
-
export default BubbleForInstruction;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { BubbleForInstructionProps } from './BubbleForInstructions';
|
|
3
|
-
export interface StepObject {
|
|
4
|
-
duration: number;
|
|
5
|
-
props: BubbleForInstructionProps;
|
|
6
|
-
content: React.JSX.Element;
|
|
7
|
-
}
|
|
8
|
-
export interface InstructionProps {
|
|
9
|
-
steps: StepObject[];
|
|
10
|
-
open: boolean;
|
|
11
|
-
callback?: () => void;
|
|
12
|
-
}
|
|
13
|
-
declare const Instructions: (props: InstructionProps) => React.JSX.Element;
|
|
14
|
-
export default Instructions;
|
package/eslint.config.mjs
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import react from 'eslint-plugin-react';
|
|
2
|
-
import typescriptEslint from '@typescript-eslint/eslint-plugin';
|
|
3
|
-
import globals from 'globals';
|
|
4
|
-
import tsParser from '@typescript-eslint/parser';
|
|
5
|
-
import path from 'node:path';
|
|
6
|
-
import { fileURLToPath } from 'node:url';
|
|
7
|
-
import js from '@eslint/js';
|
|
8
|
-
import { FlatCompat } from '@eslint/eslintrc';
|
|
9
|
-
|
|
10
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
-
const __dirname = path.dirname(__filename);
|
|
12
|
-
const compat = new FlatCompat({
|
|
13
|
-
baseDirectory: __dirname,
|
|
14
|
-
recommendedConfig: js.configs.recommended,
|
|
15
|
-
allConfig: js.configs.all,
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export default [
|
|
19
|
-
{
|
|
20
|
-
ignores: [
|
|
21
|
-
'**/.cache',
|
|
22
|
-
'**/.github',
|
|
23
|
-
'**/.storybook',
|
|
24
|
-
'**/.vscode',
|
|
25
|
-
'**/coverage',
|
|
26
|
-
'**/dist',
|
|
27
|
-
'**/docs',
|
|
28
|
-
'**/docs-build',
|
|
29
|
-
'**/js-docs',
|
|
30
|
-
'**/node_modules',
|
|
31
|
-
'**/storybook-static',
|
|
32
|
-
'**/scripts',
|
|
33
|
-
],
|
|
34
|
-
},
|
|
35
|
-
...compat.extends(
|
|
36
|
-
'eslint:recommended',
|
|
37
|
-
'plugin:react/recommended',
|
|
38
|
-
'plugin:@typescript-eslint/recommended',
|
|
39
|
-
'prettier',
|
|
40
|
-
'plugin:storybook/recommended'
|
|
41
|
-
),
|
|
42
|
-
{
|
|
43
|
-
plugins: {
|
|
44
|
-
react,
|
|
45
|
-
'@typescript-eslint': typescriptEslint,
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
languageOptions: {
|
|
49
|
-
globals: {
|
|
50
|
-
...globals.browser,
|
|
51
|
-
...globals.node,
|
|
52
|
-
...globals.jest,
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
parser: tsParser,
|
|
56
|
-
ecmaVersion: 'latest',
|
|
57
|
-
sourceType: 'module',
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
settings: {
|
|
61
|
-
react: {
|
|
62
|
-
version: 'detect',
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
rules: {
|
|
67
|
-
'react/prop-types': 'off',
|
|
68
|
-
'@typescript-eslint/no-empty-function': 'off',
|
|
69
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
70
|
-
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
];
|
package/rollup.config.mjs
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import commonjs from '@rollup/plugin-commonjs';
|
|
2
|
-
import typescript from 'rollup-plugin-typescript2';
|
|
3
|
-
import { defineConfig } from 'rollup';
|
|
4
|
-
|
|
5
|
-
import babel from '@rollup/plugin-babel';
|
|
6
|
-
import url from '@rollup/plugin-url';
|
|
7
|
-
import externals from 'rollup-plugin-node-externals';
|
|
8
|
-
|
|
9
|
-
import css from 'rollup-plugin-import-css';
|
|
10
|
-
import del from 'rollup-plugin-delete';
|
|
11
|
-
import * as fs from 'node:fs';
|
|
12
|
-
|
|
13
|
-
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
|
14
|
-
|
|
15
|
-
const externalsConfig = {
|
|
16
|
-
deps: true,
|
|
17
|
-
devDeps: true,
|
|
18
|
-
exclude: ['react', 'react-dom'],
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const config = defineConfig([
|
|
22
|
-
{
|
|
23
|
-
input: ['src/index.ts'],
|
|
24
|
-
output: [
|
|
25
|
-
{
|
|
26
|
-
file: 'dist/index.cjs.js',
|
|
27
|
-
format: 'cjs',
|
|
28
|
-
sourcemap: true,
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
file: 'dist/index.esm.js',
|
|
32
|
-
format: 'es',
|
|
33
|
-
sourcemap: true,
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
plugins: [
|
|
37
|
-
url(),
|
|
38
|
-
babel({
|
|
39
|
-
presets: ['@babel/preset-react'],
|
|
40
|
-
babelHelpers: 'bundled',
|
|
41
|
-
}),
|
|
42
|
-
externals(externalsConfig),
|
|
43
|
-
commonjs(),
|
|
44
|
-
typescript({
|
|
45
|
-
declarationDir: 'dist/types',
|
|
46
|
-
sourceMap: true,
|
|
47
|
-
exclude: ['**/*.cy.tsx', '**/*.stories.tsx', '**/*.test.tsx'],
|
|
48
|
-
}),
|
|
49
|
-
css(),
|
|
50
|
-
del({ targets: ['dist/*'] }),
|
|
51
|
-
],
|
|
52
|
-
external: [
|
|
53
|
-
'react',
|
|
54
|
-
'react-dom',
|
|
55
|
-
'd3',
|
|
56
|
-
'sql.js',
|
|
57
|
-
...Object.keys(pkg.dependencies),
|
|
58
|
-
...Object.keys(pkg.devDependencies),
|
|
59
|
-
],
|
|
60
|
-
},
|
|
61
|
-
]);
|
|
62
|
-
export default config;
|