react-bkoi-gl 1.0.1 → 1.0.3

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.
Files changed (45) hide show
  1. package/dist/components/attribution-control.d.ts +1 -1
  2. package/dist/components/fullscreen-control.d.ts +1 -1
  3. package/dist/components/geolocate-control.d.ts +1 -1
  4. package/dist/components/geolocate-control.js +5 -5
  5. package/dist/components/geolocate-control.js.map +1 -1
  6. package/dist/components/layer.d.ts +3 -3
  7. package/dist/components/layer.js +5 -3
  8. package/dist/components/layer.js.map +1 -1
  9. package/dist/components/map.d.ts +4 -4
  10. package/dist/components/map.js +8 -6
  11. package/dist/components/map.js.map +1 -1
  12. package/dist/components/marker.d.ts +1 -1
  13. package/dist/components/marker.js +9 -7
  14. package/dist/components/marker.js.map +1 -1
  15. package/dist/components/navigation-control.d.ts +1 -1
  16. package/dist/components/popup.d.ts +1 -1
  17. package/dist/components/popup.js +6 -5
  18. package/dist/components/popup.js.map +1 -1
  19. package/dist/components/scale-control.d.ts +1 -1
  20. package/dist/components/source.d.ts +1 -1
  21. package/dist/components/source.js +4 -3
  22. package/dist/components/source.js.map +1 -1
  23. package/dist/components/use-control.d.ts +1 -1
  24. package/dist/components/use-map.d.ts +2 -2
  25. package/dist/components/use-map.js +8 -9
  26. package/dist/components/use-map.js.map +1 -1
  27. package/dist/exports-bkoi-gl.d.ts +22 -22
  28. package/dist/exports-mapbox.d.ts +23 -23
  29. package/dist/mapbox/create-ref.d.ts +1 -1
  30. package/dist/mapbox/mapbox.d.ts +1 -1
  31. package/dist/mapbox/mapbox.js +70 -67
  32. package/dist/mapbox/mapbox.js.map +1 -1
  33. package/dist/styles/react-bkoi-gl.css +1 -1
  34. package/dist/types/common.d.ts +7 -7
  35. package/dist/types/events-bkoi-gl.d.ts +3 -3
  36. package/dist/types/events-mapbox.d.ts +3 -3
  37. package/dist/types/events.d.ts +9 -9
  38. package/dist/types/index.d.ts +1 -1
  39. package/dist/types/lib.d.ts +3 -3
  40. package/dist/types/style-spec-bkoi-gl.d.ts +4 -4
  41. package/dist/types/style-spec-mapbox.d.ts +2 -2
  42. package/dist/utils/set-globals.d.ts +1 -1
  43. package/dist/utils/style-utils.js +5 -3
  44. package/dist/utils/style-utils.js.map +1 -1
  45. package/package.json +2 -2
@@ -1,7 +1,7 @@
1
1
  import type { BackgroundLayer, SkyLayer, CircleLayer, FillLayer, FillExtrusionLayer, HeatmapLayer, HillshadeLayer, LineLayer, RasterLayer, SymbolLayer } from 'mapbox-gl';
2
- export declare type AnyLayer = BackgroundLayer | CircleLayer | FillExtrusionLayer | FillLayer | HeatmapLayer | HillshadeLayer | LineLayer | RasterLayer | SymbolLayer | SkyLayer;
2
+ export type AnyLayer = BackgroundLayer | CircleLayer | FillExtrusionLayer | FillLayer | HeatmapLayer | HillshadeLayer | LineLayer | RasterLayer | SymbolLayer | SkyLayer;
3
3
  export type { BackgroundLayer, SkyLayer, CircleLayer, FillLayer, FillExtrusionLayer, HeatmapLayer, HillshadeLayer, LineLayer, RasterLayer, SymbolLayer };
4
4
  import type { GeoJSONSourceRaw, VideoSourceRaw, ImageSourceRaw, VectorSource as VectorSourceRaw, RasterSource, CanvasSourceRaw, RasterDemSource } from 'mapbox-gl';
5
- export declare type AnySource = GeoJSONSourceRaw | VideoSourceRaw | ImageSourceRaw | CanvasSourceRaw | VectorSourceRaw | RasterSource | RasterDemSource;
5
+ export type AnySource = GeoJSONSourceRaw | VideoSourceRaw | ImageSourceRaw | CanvasSourceRaw | VectorSourceRaw | RasterSource | RasterDemSource;
6
6
  export type { GeoJSONSourceRaw, VideoSourceRaw, ImageSourceRaw, CanvasSourceRaw, VectorSourceRaw, RasterSource, RasterDemSource };
7
7
  export type { Style as MapStyle, Light, Fog, TerrainSpecification as Terrain, Projection } from 'mapbox-gl';
@@ -1,4 +1,4 @@
1
- export declare type GlobalSettings = {
1
+ export type GlobalSettings = {
2
2
  /** The map's default API URL for requesting tiles, styles, sprites, and glyphs. */
3
3
  baseApiUrl?: string;
4
4
  /** The maximum number of images (raster tiles, sprites, icons) to load in parallel.
@@ -1,3 +1,6 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1
4
  const refProps = ['type', 'source', 'source-layer', 'minzoom', 'maxzoom', 'filter', 'layout'];
2
5
  export function normalizeStyle(style) {
3
6
  if (!style) {
@@ -34,9 +37,8 @@ export function normalizeStyle(style) {
34
37
  }
35
38
  return normalizedLayer || layer;
36
39
  });
37
- return {
38
- ...style,
40
+ return _objectSpread(_objectSpread({}, style), {}, {
39
41
  layers
40
- };
42
+ });
41
43
  }
42
44
  //# sourceMappingURL=style-utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"style-utils.js","names":["refProps","normalizeStyle","style","toJS","layers","layerIndex","layer","id","map","normalizedLayer","Object","assign","interactive","layerRef","ref","propName"],"sources":["../../src/utils/style-utils.ts"],"sourcesContent":["import {ImmutableLike, MapStyle} from '../types';\n\nconst refProps = ['type', 'source', 'source-layer', 'minzoom', 'maxzoom', 'filter', 'layout'];\n\n// Prepare a map style object for diffing\n// If immutable - convert to plain object\n// Work around some issues in older styles that would fail Mapbox's diffing\nexport function normalizeStyle(\n style: string | MapStyle | ImmutableLike<MapStyle>\n): string | MapStyle {\n if (!style) {\n return null;\n }\n if (typeof style === 'string') {\n return style;\n }\n if ('toJS' in style) {\n style = style.toJS();\n }\n if (!style.layers) {\n return style;\n }\n const layerIndex = {};\n\n for (const layer of style.layers) {\n layerIndex[layer.id] = layer;\n }\n\n const layers = style.layers.map(layer => {\n let normalizedLayer: typeof layer = null;\n\n if ('interactive' in layer) {\n normalizedLayer = Object.assign({}, layer);\n // Breaks style diffing :(\n // @ts-ignore legacy field not typed\n delete normalizedLayer.interactive;\n }\n\n // Style diffing doesn't work with refs so expand them out manually before diffing.\n // @ts-ignore legacy field not typed\n const layerRef = layerIndex[layer.ref];\n if (layerRef) {\n normalizedLayer = normalizedLayer || Object.assign({}, layer);\n // @ts-ignore\n delete normalizedLayer.ref;\n // https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/deref.js\n for (const propName of refProps) {\n if (propName in layerRef) {\n normalizedLayer[propName] = layerRef[propName];\n }\n }\n }\n\n return normalizedLayer || layer;\n });\n\n // Do not mutate the style object provided by the user\n return {...style, layers};\n}\n"],"mappings":"AAEA,MAAMA,QAAQ,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC;AAK7F,OAAO,SAASC,cAAcA,CAC5BC,KAAkD,EAC/B;EACnB,IAAI,CAACA,KAAK,EAAE;IACV,OAAO,IAAI;EACb;EACA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOA,KAAK;EACd;EACA,IAAI,MAAM,IAAIA,KAAK,EAAE;IACnBA,KAAK,GAAGA,KAAK,CAACC,IAAI,CAAC,CAAC;EACtB;EACA,IAAI,CAACD,KAAK,CAACE,MAAM,EAAE;IACjB,OAAOF,KAAK;EACd;EACA,MAAMG,UAAU,GAAG,CAAC,CAAC;EAErB,KAAK,MAAMC,KAAK,IAAIJ,KAAK,CAACE,MAAM,EAAE;IAChCC,UAAU,CAACC,KAAK,CAACC,EAAE,CAAC,GAAGD,KAAK;EAC9B;EAEA,MAAMF,MAAM,GAAGF,KAAK,CAACE,MAAM,CAACI,GAAG,CAACF,KAAK,IAAI;IACvC,IAAIG,eAA6B,GAAG,IAAI;IAExC,IAAI,aAAa,IAAIH,KAAK,EAAE;MAC1BG,eAAe,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEL,KAAK,CAAC;MAG1C,OAAOG,eAAe,CAACG,WAAW;IACpC;IAIA,MAAMC,QAAQ,GAAGR,UAAU,CAACC,KAAK,CAACQ,GAAG,CAAC;IACtC,IAAID,QAAQ,EAAE;MACZJ,eAAe,GAAGA,eAAe,IAAIC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEL,KAAK,CAAC;MAE7D,OAAOG,eAAe,CAACK,GAAG;MAE1B,KAAK,MAAMC,QAAQ,IAAIf,QAAQ,EAAE;QAC/B,IAAIe,QAAQ,IAAIF,QAAQ,EAAE;UACxBJ,eAAe,CAACM,QAAQ,CAAC,GAAGF,QAAQ,CAACE,QAAQ,CAAC;QAChD;MACF;IACF;IAEA,OAAON,eAAe,IAAIH,KAAK;EACjC,CAAC,CAAC;EAGF,OAAO;IAAC,GAAGJ,KAAK;IAAEE;EAAM,CAAC;AAC3B","ignoreList":[]}
1
+ {"version":3,"file":"style-utils.js","names":["refProps","normalizeStyle","style","toJS","layers","layerIndex","layer","id","map","normalizedLayer","Object","assign","interactive","layerRef","ref","propName","_objectSpread"],"sources":["../../src/utils/style-utils.ts"],"sourcesContent":["import {ImmutableLike, MapStyle} from '../types';\n\nconst refProps = ['type', 'source', 'source-layer', 'minzoom', 'maxzoom', 'filter', 'layout'];\n\n// Prepare a map style object for diffing\n// If immutable - convert to plain object\n// Work around some issues in older styles that would fail Mapbox's diffing\nexport function normalizeStyle(\n style: string | MapStyle | ImmutableLike<MapStyle>\n): string | MapStyle {\n if (!style) {\n return null;\n }\n if (typeof style === 'string') {\n return style;\n }\n if ('toJS' in style) {\n style = style.toJS();\n }\n if (!style.layers) {\n return style;\n }\n const layerIndex = {};\n\n for (const layer of style.layers) {\n layerIndex[layer.id] = layer;\n }\n\n const layers = style.layers.map(layer => {\n let normalizedLayer: typeof layer = null;\n\n if ('interactive' in layer) {\n normalizedLayer = Object.assign({}, layer);\n // Breaks style diffing :(\n // @ts-ignore legacy field not typed\n delete normalizedLayer.interactive;\n }\n\n // Style diffing doesn't work with refs so expand them out manually before diffing.\n // @ts-ignore legacy field not typed\n const layerRef = layerIndex[layer.ref];\n if (layerRef) {\n normalizedLayer = normalizedLayer || Object.assign({}, layer);\n // @ts-ignore\n delete normalizedLayer.ref;\n // https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/deref.js\n for (const propName of refProps) {\n if (propName in layerRef) {\n normalizedLayer[propName] = layerRef[propName];\n }\n }\n }\n\n return normalizedLayer || layer;\n });\n\n // Do not mutate the style object provided by the user\n return {...style, layers};\n}\n"],"mappings":";;;AAEA,MAAMA,QAAQ,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC;AAK7F,OAAO,SAASC,cAAcA,CAC5BC,KAAkD,EAC/B;EACnB,IAAI,CAACA,KAAK,EAAE;IACV,OAAO,IAAI;EACb;EACA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOA,KAAK;EACd;EACA,IAAI,MAAM,IAAIA,KAAK,EAAE;IACnBA,KAAK,GAAGA,KAAK,CAACC,IAAI,CAAC,CAAC;EACtB;EACA,IAAI,CAACD,KAAK,CAACE,MAAM,EAAE;IACjB,OAAOF,KAAK;EACd;EACA,MAAMG,UAAU,GAAG,CAAC,CAAC;EAErB,KAAK,MAAMC,KAAK,IAAIJ,KAAK,CAACE,MAAM,EAAE;IAChCC,UAAU,CAACC,KAAK,CAACC,EAAE,CAAC,GAAGD,KAAK;EAC9B;EAEA,MAAMF,MAAM,GAAGF,KAAK,CAACE,MAAM,CAACI,GAAG,CAACF,KAAK,IAAI;IACvC,IAAIG,eAA6B,GAAG,IAAI;IAExC,IAAI,aAAa,IAAIH,KAAK,EAAE;MAC1BG,eAAe,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEL,KAAK,CAAC;MAG1C,OAAOG,eAAe,CAACG,WAAW;IACpC;IAIA,MAAMC,QAAQ,GAAGR,UAAU,CAACC,KAAK,CAACQ,GAAG,CAAC;IACtC,IAAID,QAAQ,EAAE;MACZJ,eAAe,GAAGA,eAAe,IAAIC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEL,KAAK,CAAC;MAE7D,OAAOG,eAAe,CAACK,GAAG;MAE1B,KAAK,MAAMC,QAAQ,IAAIf,QAAQ,EAAE;QAC/B,IAAIe,QAAQ,IAAIF,QAAQ,EAAE;UACxBJ,eAAe,CAACM,QAAQ,CAAC,GAAGF,QAAQ,CAACE,QAAQ,CAAC;QAChD;MACF;IACF;IAEA,OAAON,eAAe,IAAIH,KAAK;EACjC,CAAC,CAAC;EAGF,OAAAU,aAAA,CAAAA,aAAA,KAAWd,KAAK;IAAEE;EAAM;AAC1B","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-bkoi-gl",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "React components for Barikoi GL JS",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",
@@ -34,7 +34,7 @@
34
34
  ],
35
35
  "scripts": {
36
36
  "typecheck": "tsc -p tsconfig.build.json --noEmit",
37
- "build": "ocular-clean && ocular-build && node scripts/copy-css.js",
37
+ "build": "ocular-clean && ocular-build && node scripts/modify-css.js",
38
38
  "lint": "ocular-lint",
39
39
  "cover": "ocular-test cover",
40
40
  "test": "yarn typecheck && ocular-test",