@carto/ps-react-ui 4.0.0 → 4.0.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.
@@ -22,4 +22,5 @@ export {
22
22
  LassoToolsModes,
23
23
  LassoToolOptionsMode,
24
24
  LassoToolsModesMapping,
25
+ CustomLassoToolsMode,
25
26
  } from './lasso-tools'
@@ -1,6 +1,4 @@
1
- import type { ReactNode } from 'react'
2
1
  import type { Class } from 'type-fest'
3
- import type { GeoJsonEditMode } from '@deck.gl-community/editable-layers'
4
2
  import type { EditableModesMapping } from './common'
5
3
 
6
4
  export type LassoToolsMode =
@@ -10,15 +8,18 @@ export type LassoToolsMode =
10
8
  | 'lasso'
11
9
  | 'edit'
12
10
 
13
- export interface LassoToolsModeOption<M extends string = LassoToolsMode> {
11
+ export interface LassoToolsModeOption<
12
+ M extends string = LassoToolsMode,
13
+ T = GeoJSONEditMode,
14
+ > {
14
15
  value: M
15
- mode: Class<GeoJsonEditMode>
16
+ mode: Class<T>
16
17
  }
17
18
 
18
- export type LassoToolsModes<M extends string = LassoToolsMode> = Record<
19
- M,
20
- LassoToolsModeOption<M>
21
- >
19
+ export type LassoToolsModes<
20
+ M extends string = LassoToolsMode,
21
+ T = GeoJSONEditMode,
22
+ > = Record<M, LassoToolsModeOption<M, T>>
22
23
 
23
24
  export type LassoToolOptionsMode<M extends string = LassoToolsMode> = Record<
24
25
  M,
@@ -31,3 +32,5 @@ export type LassoToolsModesMapping<M extends string> = Record<
31
32
  disabled?: boolean
32
33
  }
33
34
  >
35
+
36
+ export type CustomLassoToolsMode<T> = InstanceType<Class<T>>
@@ -1,6 +1,5 @@
1
1
  import type { Class } from 'type-fest'
2
2
  import type { EditableModesMapping } from './common'
3
- import type { GeoJsonEditMode } from '@deck.gl-community/editable-layers'
4
3
 
5
4
  export type MeasurementSystem = 'metric' | 'imperial'
6
5
 
@@ -58,7 +57,7 @@ export type MeasurementModesMapping<T extends string> = Record<
58
57
  EditableModesMapping
59
58
  >
60
59
 
61
- export type MeasureUnitMapping = {
60
+ export interface MeasureUnitMapping {
62
61
  short: string
63
62
  }
64
63
 
@@ -5,7 +5,7 @@ export { LassoToolsInlineUI } from './lasso-tool/lasso-tool-inline';
5
5
  export { DEFAULT_LASSO_TOOLS_MODES_MAPPING, LASSO_TOOLS_LABELS, } from './lasso-tool/const';
6
6
  export { DrawCircleIcon, DrawLassoIcon, DrawPolygonIcon, DrawSquareIcon, SelectToolIcon, } from './lasso-tool/icons';
7
7
  export type { MeasurementToolsComponentProps } from './measurement-tools/types';
8
- export { DEFAULT_MEASUREMENT_TOOLS_LABELS, DEFAULT_MEASUREMENT_TOOLS_UNITS_MAPPING, } from './measurement-tools/const';
8
+ export { DEFAULT_MEASUREMENT_TOOLS_LABELS, DEFAULT_MEASUREMENT_TOOLS_UNITS_MAPPING, DEFAULT_MEASUREMENT_TOOLS_MODES_MAPPING, } from './measurement-tools/const';
9
9
  export { AreaIcon, BufferIcon, RulerIcon } from './measurement-tools/icons';
10
10
  export { MeasurementToolsUI } from './measurement-tools/measurement-tools';
11
11
  export type { GeolocationControlProps } from './geolocation-controls/types';
@@ -1,5 +1,6 @@
1
1
  import { RequiredDeep } from 'type-fest';
2
- import { MeasurementUnitsMapping } from '../types';
2
+ import { MeasurementMode, MeasurementModesMapping, MeasurementUnitsMapping } from '../types';
3
3
  import { MeasurementToolsComponentProps } from './types';
4
4
  export declare const DEFAULT_MEASUREMENT_TOOLS_LABELS: RequiredDeep<MeasurementToolsComponentProps['labels']>;
5
5
  export declare const DEFAULT_MEASUREMENT_TOOLS_UNITS_MAPPING: MeasurementUnitsMapping;
6
+ export declare const DEFAULT_MEASUREMENT_TOOLS_MODES_MAPPING: MeasurementModesMapping<MeasurementMode>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carto/ps-react-ui",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "CARTO's Professional Service React Material library",
5
5
  "type": "module",
6
6
  "devDependencies": {