@conboai/storybook.components 0.3.16 → 0.3.17

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.
@@ -1,11 +1,12 @@
1
1
  import { default as React } from 'react';
2
2
  import { CoordinatePoint, GeoType } from '../../types';
3
3
 
4
- declare const Polyline: ({ zoom: zoomFromProps, showDirection, onChange: onChangeFromProps, data, showNumbers }: {
4
+ interface IPolyline {
5
5
  zoom?: number;
6
6
  showDirection?: boolean;
7
7
  onChange?: (polygonPath: CoordinatePoint[]) => void;
8
8
  data?: GeoType | null;
9
9
  showNumbers?: boolean;
10
- }) => React.JSX.Element;
10
+ }
11
+ declare const Polyline: ({ zoom: zoomFromProps, showDirection, onChange: onChangeFromProps, data, showNumbers }: IPolyline) => React.JSX.Element;
11
12
  export default Polyline;
@@ -78215,66 +78215,65 @@ const _ne = ({
78215
78215
  data: r,
78216
78216
  showNumbers: i = !0
78217
78217
  }) => {
78218
- const [o, s] = je((r == null ? void 0 : r.coordinates) || []), l = Vr(null), c = Ys.isNumber(n) ? n : 0, u = (T) => {
78219
- google.maps.event.clearListeners(T.getPath(), "set_at"), google.maps.event.clearListeners(T.getPath(), "insert_at"), T.getPath().addListener("set_at", d), T.getPath().addListener("insert_at", d);
78218
+ const [o, s] = je((r == null ? void 0 : r.coordinates) || []), l = Vr(null), c = Ys.isNumber(n) ? n : 0, u = (b) => {
78219
+ google.maps.event.clearListeners(b.getPath(), "set_at"), google.maps.event.clearListeners(b.getPath(), "insert_at"), b.getPath().addListener("set_at", d), b.getPath().addListener("insert_at", d);
78220
78220
  };
78221
78221
  Le(() => {
78222
78222
  l != null && l.current && u(l == null ? void 0 : l.current);
78223
78223
  }, [o]);
78224
78224
  const d = () => {
78225
78225
  if (l.current) {
78226
- const T = l.current.getPath().getArray().map((C) => new google.maps.LatLng(C.lat(), C.lng())), E = vc(T);
78227
- E.length && (s(E), t == null || t(E));
78226
+ const b = l.current.getPath().getArray().map((E) => new google.maps.LatLng(E.lat(), E.lng())), T = vc(b);
78227
+ T.length && (s(T), t == null || t(T));
78228
78228
  }
78229
- }, h = (T) => {
78230
- const E = o.filter(({ lat: C, lng: w }) => {
78231
- var R;
78232
- return C !== ((R = T.latLng) == null ? void 0 : R.lat()) || w !== T.latLng.lng();
78229
+ }, h = (b) => {
78230
+ const T = o.filter(({ lat: E, lng: C }) => {
78231
+ var w;
78232
+ return E !== ((w = b.latLng) == null ? void 0 : w.lat()) || C !== b.latLng.lng();
78233
78233
  });
78234
- s(E), t == null || t(E);
78235
- }, v = (T) => {
78236
- l.current = T, u(T);
78234
+ s(T), t == null || t(T);
78235
+ }, v = (b) => {
78236
+ l.current = b, u(b);
78237
78237
  };
78238
78238
  Le(() => {
78239
78239
  s((r == null ? void 0 : r.coordinates) || []);
78240
78240
  }, [r]);
78241
- const y = (T, E) => {
78242
- const C = T.lat * Math.PI / 180, w = T.lng * Math.PI / 180, R = E.lat * Math.PI / 180, $ = E.lng * Math.PI / 180 - w, D = Math.sin($) * Math.cos(R), O = Math.cos(C) * Math.sin(R) - Math.sin(C) * Math.cos(R) * Math.cos($);
78243
- return (Math.atan2(D, O) * 180 / Math.PI + 360) % 360;
78241
+ const y = (b, T) => {
78242
+ const E = b.lat * Math.PI / 180, C = b.lng * Math.PI / 180, w = T.lat * Math.PI / 180, F = T.lng * Math.PI / 180 - C, $ = Math.sin(F) * Math.cos(w), D = Math.cos(E) * Math.sin(w) - Math.sin(E) * Math.cos(w) * Math.cos(F);
78243
+ return (Math.atan2($, D) * 180 / Math.PI + 360) % 360;
78244
78244
  }, p = () => {
78245
- const T = o.length - 1, E = Math.min(4, T);
78246
- let C = 0;
78247
- for (let R = T; R > T - E; R--)
78248
- C += y(o[R - 1], o[R]);
78249
- const w = C / E;
78245
+ var w, R;
78246
+ const b = o.length - 1, T = Math.min(4, b);
78247
+ let E = 0;
78248
+ for (let F = b; F > b - T; F--)
78249
+ E += y(o[F - 1], o[F]);
78250
+ const C = E / T;
78250
78251
  return {
78251
- position: o[T],
78252
+ position: o[b],
78252
78253
  icon: {
78253
- path: google.maps.SymbolPath.BACKWARD_CLOSED_ARROW,
78254
+ path: (R = (w = google == null ? void 0 : google.maps) == null ? void 0 : w.SymbolPath) == null ? void 0 : R.BACKWARD_CLOSED_ARROW,
78254
78255
  scale: m - 3,
78255
78256
  strokeColor: "#2196F3",
78256
- rotation: w
78257
+ rotation: C
78257
78258
  }
78258
78259
  };
78259
- }, f = c - 13, m = f < 0 ? 0 : f, x = {
78260
- ...gm
78261
- }, b = (T) => {
78262
- var E;
78260
+ }, f = c - 13 || -1, m = f < 0 ? 0 : f, x = (b) => {
78261
+ var T, E;
78263
78262
  return {
78264
- path: (E = google == null ? void 0 : google.maps) == null ? void 0 : E.SymbolPath.CIRCLE,
78263
+ path: (E = (T = google == null ? void 0 : google.maps) == null ? void 0 : T.SymbolPath) == null ? void 0 : E.CIRCLE,
78265
78264
  fillColor: "#2196F3",
78266
78265
  fillOpacity: 1,
78267
78266
  strokeWeight: 0,
78268
- scale: T + 2
78267
+ scale: b + 2
78269
78268
  };
78270
78269
  };
78271
78270
  return /* @__PURE__ */ ee.jsxs(ee.Fragment, { children: [
78272
- i && (o == null ? void 0 : o.map(({ lat: T, lng: E }, C) => /* @__PURE__ */ ee.jsx(ov, { coordinates: { lat: T, lng: E }, index: C + 1 }, T + E))),
78271
+ i && (o == null ? void 0 : o.map(({ lat: b, lng: T }, E) => /* @__PURE__ */ ee.jsx(ov, { coordinates: { lat: b, lng: T }, index: E + 1 }, b + T))),
78273
78272
  /* @__PURE__ */ ee.jsx(
78274
78273
  pm,
78275
78274
  {
78276
78275
  path: o,
78277
- options: x,
78276
+ options: gm,
78278
78277
  visible: !0,
78279
78278
  editable: !0,
78280
78279
  draggable: !0,
@@ -78286,7 +78285,7 @@ const _ne = ({
78286
78285
  OC,
78287
78286
  {
78288
78287
  position: o[0],
78289
- icon: b(m)
78288
+ icon: x(m)
78290
78289
  }
78291
78290
  ),
78292
78291
  e && o.length > 1 && /* @__PURE__ */ ee.jsx(OC, { ...p() })
@@ -78383,7 +78382,7 @@ const _ne = ({
78383
78382
  _ne,
78384
78383
  {
78385
78384
  zoom: $,
78386
- showDirection: !1,
78385
+ showDirection: n,
78387
78386
  showNumbers: u,
78388
78387
  onChange: r,
78389
78388
  data: A
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conboai/storybook.components",
3
- "version": "0.3.16",
3
+ "version": "0.3.17",
4
4
  "main": "dist/storybook.components.mjs",
5
5
  "types": "dist/build/index.d.ts",
6
6
  "files": [