@orioro/react-maplibre-util 0.7.1 → 0.8.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @orioro/react-maplibre-util
2
2
 
3
+ ## 0.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: upgrade build dependency react babel preset runtime: automatic
8
+
9
+ ## 0.8.0
10
+
11
+ ### Minor Changes
12
+
13
+ - release vector_polygon presets
14
+
3
15
  ## 0.7.1
4
16
 
5
17
  ### Patch Changes
@@ -6,3 +6,4 @@ export declare const mosaic_1: (data: Record<string, any>) => string;
6
6
  export declare const waves_1: (data: Record<string, any>) => string;
7
7
  export declare const circles_1: (data: Record<string, any>) => string;
8
8
  export declare const lines_1: (data: Record<string, any>) => string;
9
+ export declare const mosaic_2: (data: Record<string, any>) => string;
package/dist/index.mjs CHANGED
@@ -6,6 +6,7 @@ import { Flex, useRefByKey, useLocalState, DropdownMenu } from '@orioro/react-ui
6
6
  import styled from 'styled-components';
7
7
  import { usePrevious } from 'react-use';
8
8
  import { mergeRefs } from 'react-merge-refs';
9
+ import { jsxs } from 'react/jsx-runtime';
9
10
  import { mdiCloseCircleOutline, mdiCheck, mdiTerrain, mdiVideo3d } from '@mdi/js';
10
11
  import { interpolate, strExpr } from '@orioro/util';
11
12
  import { ckmeans } from 'simple-statistics';
@@ -774,14 +775,13 @@ function _arrayLikeToArray(r, a) {
774
775
  function _arrayWithHoles(r) {
775
776
  if (Array.isArray(r)) return r;
776
777
  }
777
- function _extends() {
778
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
779
- for (var e = 1; e < arguments.length; e++) {
780
- var t = arguments[e];
781
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
782
- }
783
- return n;
784
- }, _extends.apply(null, arguments);
778
+ function _defineProperty(e, r, t) {
779
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
780
+ value: t,
781
+ enumerable: true,
782
+ configurable: true,
783
+ writable: true
784
+ }) : e[r] = t, e;
785
785
  }
786
786
  function _iterableToArrayLimit(r, l) {
787
787
  var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
@@ -810,6 +810,27 @@ function _iterableToArrayLimit(r, l) {
810
810
  function _nonIterableRest() {
811
811
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
812
812
  }
813
+ function ownKeys(e, r) {
814
+ var t = Object.keys(e);
815
+ if (Object.getOwnPropertySymbols) {
816
+ var o = Object.getOwnPropertySymbols(e);
817
+ r && (o = o.filter(function (r) {
818
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
819
+ })), t.push.apply(t, o);
820
+ }
821
+ return t;
822
+ }
823
+ function _objectSpread2(e) {
824
+ for (var r = 1; r < arguments.length; r++) {
825
+ var t = null != arguments[r] ? arguments[r] : {};
826
+ r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
827
+ _defineProperty(e, r, t[r]);
828
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
829
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
830
+ });
831
+ }
832
+ return e;
833
+ }
813
834
  function _objectWithoutProperties(e, t) {
814
835
  if (null == e) return {};
815
836
  var o,
@@ -833,6 +854,20 @@ function _objectWithoutPropertiesLoose(r, e) {
833
854
  function _slicedToArray(r, e) {
834
855
  return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
835
856
  }
857
+ function _toPrimitive(t, r) {
858
+ if ("object" != typeof t || !t) return t;
859
+ var e = t[Symbol.toPrimitive];
860
+ if (void 0 !== e) {
861
+ var i = e.call(t, r);
862
+ if ("object" != typeof i) return i;
863
+ throw new TypeError("@@toPrimitive must return a primitive value.");
864
+ }
865
+ return ("string" === r ? String : Number)(t);
866
+ }
867
+ function _toPropertyKey(t) {
868
+ var i = _toPrimitive(t, "string");
869
+ return "symbol" == typeof i ? i : i + "";
870
+ }
836
871
  function _typeof(o) {
837
872
  "@babel/helpers - typeof";
838
873
 
@@ -875,13 +910,14 @@ function withHover(Component, withHoverProps) {
875
910
  var _useHover = useHover(withHoverProps, []),
876
911
  _useHover2 = _slicedToArray(_useHover, 1),
877
912
  hoverProps = _useHover2[0];
878
- return /*#__PURE__*/React.createElement(Component, _extends({}, restProps, {
913
+ return /*#__PURE__*/jsxs(Component, _objectSpread2(_objectSpread2({}, restProps), {}, {
879
914
  ref: ref,
880
915
  cursor: cursor || hoverProps.cursor,
881
916
  onMouseMove: useMergedCallback(onMouseMove, hoverProps.onMouseMove),
882
917
  onDragStart: useMergedCallback(onDragStart, hoverProps.onDragStart),
883
- onDragEnd: useMergedCallback(onDragEnd, hoverProps.onDragEnd)
884
- }), hoverProps.children, children);
918
+ onDragEnd: useMergedCallback(onDragEnd, hoverProps.onDragEnd),
919
+ children: [hoverProps.children, children]
920
+ }));
885
921
  });
886
922
  }
887
923
 
@@ -1372,27 +1408,42 @@ var diamonds_1 = _pattern("<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n ".con
1372
1408
  height: 50,
1373
1409
  width: 50
1374
1410
  }), ">\n <defs>\n <pattern\n patternTransform=\"scale(${ scale = 1 })\"\n id=\"a\"\n width=\"50\"\n height=\"50\"\n patternUnits=\"userSpaceOnUse\"\n >\n ").concat(_bgRect(), "\n <path\n fill=\"transparent\"\n stroke=\"${ stroke = #000000 }\"\n stroke-width=\"${ strokeWidth = 2 }\"\n d=\"M50 25 37.5 50 25 25 37.5 0zm-25 0L12.5 50 0 25 12.5 0z\"\n />\n </pattern>\n </defs>\n <rect width=\"800%\" height=\"800%\" fill=\"url(#a)\" />\n</svg>"));
1411
+ // Source:
1412
+ // https://pattern.monster/plus-1
1375
1413
  var cross_1 = _pattern("<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n ".concat(_svgViewBox({
1376
1414
  height: 20,
1377
1415
  width: 20
1378
1416
  }), ">\n <defs>\n <pattern\n patternTransform=\"scale(${ scale = 1 })\"\n id=\"a\"\n width=\"20\"\n height=\"20\"\n patternUnits=\"userSpaceOnUse\"\n >\n ").concat(_bgRect(), "\n <path\n fill=\"transparent\"\n stroke=\"${ stroke = #000000 }\"\n stroke-width=\"${ strokeWidth = 2 }\"\n stroke-linecap=\"square\"\n d=\"M3.25 10h13.5M10 3.25v13.5\"\n />\n </pattern>\n </defs>\n <rect width=\"800%\" height=\"800%\" fill=\"url(#a)\" />\n</svg>"));
1417
+ // Source:
1379
1418
  // https://pattern.monster/cubes-1
1380
1419
  var mosaic_1 = _pattern("<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n ".concat(_svgViewBox({
1381
1420
  width: 60,
1382
1421
  height: 60
1383
1422
  }), ">\n <defs>\n <pattern\n patternTransform=\"scale(${ scale = 1 })\"\n id=\"a\"\n width=\"60\"\n height=\"60\"\n patternUnits=\"userSpaceOnUse\">\n ").concat(_bgRect(), "\n <path\n fill=\"transparent\"\n stroke=\"${ stroke = #000000 }\"\n stroke-width=\"${ strokeWidth = 2 }\"\n d=\"M15 30v30m-7.5 0V30h15v30m7.5 0H0V30h30M45 0v30m7.5-30v30m-15 0V0M30 0h30v30M30 45h30m-30-7.5h30m0 15H30M30 30h30v30H30zM0 15h30M0 7.5h30m0 15H0M0 0h30v30H0z\"\n />\n </pattern>\n </defs>\n <rect width=\"800%\" height=\"800%\" fill=\"url(#a)\" />\n</svg>"));
1423
+ // Source:
1424
+ // https://pattern.monster/waves-1
1384
1425
  var waves_1 = _pattern("<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n ".concat(_svgViewBox({
1385
1426
  width: 120,
1386
1427
  height: 80
1387
1428
  }), ">\n <defs>\n <pattern\n patternTransform=\"scale(${ scale = 1 })\"\n id=\"a\"\n width=\"120\"\n height=\"80\"\n patternUnits=\"userSpaceOnUse\">\n ").concat(_bgRect(), "\n <path\n fill=\"transparent\"\n stroke=\"${ stroke = #000000 }\"\n stroke-width=\"${ strokeWidth = 2 }\"\n d=\"M-50.129 12.685C-33.346 12.358-16.786 4.918 0 5c16.787.082 43.213 10 60 10s43.213-9.918 60-10 33.346 7.358 50.129 7.685\"\n />\n <path\n fill=\"transparent\"\n stroke=\"${ stroke = #000000 }\"\n stroke-width=\"${ strokeWidth = 2 }\"\n d=\"M-50.129 32.685C-33.346 32.358-16.786 24.918 0 25c16.787.082 43.213 10 60 10s43.213-9.918 60-10 33.346 7.358 50.129 7.685\"\n />\n <path\n fill=\"transparent\"\n stroke=\"${ stroke = #000000 }\"\n stroke-width=\"${ strokeWidth = 2 }\"\n d=\"M-50.129 52.685C-33.346 52.358-16.786 44.918 0 45c16.787.082 43.213 10 60 10s43.213-9.918 60-10 33.346 7.358 50.129 7.685\"\n />\n <path\n fill=\"transparent\"\n stroke=\"${ stroke = #000000 }\"\n stroke-width=\"${ strokeWidth = 2 }\"\n d=\"M-50.129 72.685C-33.346 72.358-16.786 64.918 0 65c16.787.082 43.213 10 60 10s43.213-9.918 60-10 33.346 7.358 50.129 7.685\"\n />\n </pattern>\n </defs>\n <rect width=\"800%\" height=\"800%\" fill=\"url(#a)\" />\n</svg>"));
1429
+ // Source:
1430
+ // https://pattern.monster/circles-1
1388
1431
  var circles_1 = _pattern("<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n ".concat(_svgViewBox({
1389
1432
  width: 20,
1390
1433
  height: 20
1391
1434
  }), ">\n <defs>\n <pattern\n patternTransform=\"scale(${ scale = 1 })\"\n id=\"a\"\n width=\"20\"\n height=\"20\"\n patternUnits=\"userSpaceOnUse\">\n ").concat(_bgRect(), "\n <path\n fill=\"transparent\"\n stroke=\"${ stroke = #000000 }\"\n stroke-width=\"${ strokeWidth = 2 }\"\n d=\"M10 15a5 5 0 1 1 0-10 5 5 0 0 1 0 10z\"\n />\n </pattern>\n </defs>\n <rect width=\"800%\" height=\"800%\" fill=\"url(#a)\" />\n</svg>"));
1435
+ // Source:
1436
+ // https://pattern.monster/straight-lines
1392
1437
  var lines_1 = _pattern("<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n ".concat(_svgViewBox({
1393
1438
  width: 20,
1394
1439
  height: 80
1395
1440
  }), ">\n <defs>\n <pattern\n patternTransform=\"scale(${ scale = 1 })\"\n id=\"a\"\n width=\"20\"\n height=\"80\"\n patternUnits=\"userSpaceOnUse\">\n ").concat(_bgRect(), "\n <path\n fill=\"transparent\"\n stroke=\"${ stroke = #000000 }\"\n stroke-width=\"${ strokeWidth = 2 }\"\n d=\"M0 10h20z\"\n />\n <path\n fill=\"transparent\"\n stroke=\"${ stroke = #000000 }\"\n stroke-width=\"${ strokeWidth = 2 }\"\n d=\"M0 30h20z\"\n />\n <path\n fill=\"transparent\"\n stroke=\"${ stroke = #000000 }\"\n stroke-width=\"${ strokeWidth = 2 }\"\n d=\"M0 50h20z\"\n />\n <path\n fill=\"transparent\"\n stroke=\"${ stroke = #000000 }\"\n stroke-width=\"${ strokeWidth = 2 }\"\n d=\"M0 70h20z\"\n />\n </pattern>\n </defs>\n <rect width=\"800%\" height=\"800%\" fill=\"url(#a)\" />\n</svg>"));
1441
+ // Source:
1442
+ // https://pattern.monster/herringbone-8
1443
+ var mosaic_2 = _pattern("<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n ".concat(_svgViewBox({
1444
+ width: 40,
1445
+ height: 40
1446
+ }), ">\n <defs>\n <pattern\n id=\"a\"\n width=\"40\"\n height=\"40\"\n patternTransform=\"scale(${ scale = 2 })\"\n patternUnits=\"userSpaceOnUse\">\n ").concat(_bgRect(), "\n <path\n fill=\"transparent\"\n stroke=\"${ stroke = #000000 }\"\n d=\"M15 5h10v30H15zM35-5V5H5V-5zm0 40v10H5V35zm0-50h10v30H35zm20 30v10H25V15zm-40 0v10h-30V15zm20 10h10v30H35zm-40 0H5v30H-5zm0-40H5v30H-5z\"\n />\n </pattern>\n </defs>\n <rect width=\"800%\" height=\"800%\" fill=\"url(#a)\" />\n</svg>"));
1396
1447
 
1397
1448
  var index = /*#__PURE__*/Object.freeze({
1398
1449
  __proto__: null,
@@ -1401,6 +1452,7 @@ var index = /*#__PURE__*/Object.freeze({
1401
1452
  diamonds_1: diamonds_1,
1402
1453
  lines_1: lines_1,
1403
1454
  mosaic_1: mosaic_1,
1455
+ mosaic_2: mosaic_2,
1404
1456
  squares_1: squares_1,
1405
1457
  triangles_1: triangles_1,
1406
1458
  waves_1: waves_1
@@ -1926,4 +1978,4 @@ function InspectControl(props) {
1926
1978
  return null;
1927
1979
  }
1928
1980
 
1929
- export { $naturalBreaks, ControlContainer, DynamicImages, HoverTooltip, InspectControl, LayeredMap, MapWindow, index as SVG_PATTERNS, SyncedMaps, TerrainControl, applyReactStyle, augmentFeature, circles_1, cross_1, diamonds_1, ensureAddLayer, ensureAddSource, ensureRemoveLayer, ensureRemoveSource, fitGeometry, fmtLayerAbsoluteId, getSrcLayer, getSrcViewByLayerId, hoverParseEvent, layeredMapOnClickHandler, lines_1, makeSyncedMaps, mapSetFeaturesState, mosaic_1, naturalBreakBounds, parseMapViews, scaleNaturalBreaks, sortLayers, squares_1, svgIconGenerator, svgImageGenerator, svgImageId, triangles_1, useClientRect, useHover, useLayeredMap, useMapRegistry, useTilesLoading, waves_1, withHover };
1981
+ export { $naturalBreaks, ControlContainer, DynamicImages, HoverTooltip, InspectControl, LayeredMap, MapWindow, index as SVG_PATTERNS, SyncedMaps, TerrainControl, applyReactStyle, augmentFeature, circles_1, cross_1, diamonds_1, ensureAddLayer, ensureAddSource, ensureRemoveLayer, ensureRemoveSource, fitGeometry, fmtLayerAbsoluteId, getSrcLayer, getSrcViewByLayerId, hoverParseEvent, layeredMapOnClickHandler, lines_1, makeSyncedMaps, mapSetFeaturesState, mosaic_1, mosaic_2, naturalBreakBounds, parseMapViews, scaleNaturalBreaks, sortLayers, squares_1, svgIconGenerator, svgImageGenerator, svgImageId, triangles_1, useClientRect, useHover, useLayeredMap, useMapRegistry, useTilesLoading, waves_1, withHover };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orioro/react-maplibre-util",
3
- "version": "0.7.1",
3
+ "version": "0.8.1",
4
4
  "packageManager": "yarn@4.0.2",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",
@@ -23,7 +23,7 @@
23
23
  "build-storybook": "storybook build"
24
24
  },
25
25
  "devDependencies": {
26
- "@orioro/dev": "^0.0.6",
26
+ "@orioro/dev": "^0.0.7",
27
27
  "@radix-ui/themes": "^3.0.1",
28
28
  "@tanstack/react-query": "^5.66.0",
29
29
  "maplibre-gl": "^5.1.0",