@ssplib/react-components 0.0.286 → 0.0.288

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.
@@ -6,6 +6,7 @@ interface DraggableMarkerProps {
6
6
  onChange?: (coord: LatLngExpression) => void;
7
7
  children?: ReactElement;
8
8
  showPopup?: boolean;
9
+ fixedPosition?: boolean;
9
10
  }
10
11
  export default function DraggableMarker({ ...props }: DraggableMarkerProps): JSX.Element;
11
12
  export {};
@@ -33,6 +33,8 @@ function DraggableMarker(_a) {
33
33
  }), []);
34
34
  (0, react_leaflet_1.useMapEvents)({
35
35
  click(e) {
36
+ if (props.fixedPosition)
37
+ return;
36
38
  setPosition({ lat: e.latlng.lat, lng: e.latlng.lng });
37
39
  },
38
40
  });
@@ -12,5 +12,6 @@ export interface MapProps {
12
12
  popupContent?: ReactElement;
13
13
  style?: BoxProps;
14
14
  mapStyle?: React.CSSProperties;
15
+ fixedPosition?: boolean;
15
16
  }
16
17
  export declare function Map(props: MapProps): JSX.Element;
@@ -18,6 +18,6 @@ function Map(props) {
18
18
  react_1.default.createElement(react_leaflet_1.MapContainer, { center: props.firstCoords, zoom: 19, scrollWheelZoom: true, style: props.mapStyle },
19
19
  react_1.default.createElement(react_leaflet_1.TileLayer, { attribution: '\u00A9 <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', url: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png' }),
20
20
  props.pulseMarkerList && props.pulseMarkerList.map((coord, idx) => react_1.default.createElement(AnimatedMarker_1.default, { key: JSON.stringify(coord) + idx, coords: coord })),
21
- react_1.default.createElement(DraggableMarker_1.default, { startCoord: props.firstCoords, onChange: props.onCoordsChange, showPopup: typeof props.popupContent !== 'undefined' }, props.popupContent))));
21
+ react_1.default.createElement(DraggableMarker_1.default, { startCoord: props.firstCoords, onChange: props.onCoordsChange, showPopup: typeof props.popupContent !== 'undefined', fixedPosition: props.fixedPosition }, props.popupContent))));
22
22
  }
23
23
  exports.Map = Map;
@@ -61,7 +61,7 @@ function KeycloakAuthProvider({ url, realm, clientId, children, type = 'ad', res
61
61
  else {
62
62
  const tokenParsed = keycloak.tokenParsed;
63
63
  console.log('TOKEN-> ', tokenParsed);
64
- const userData = Object.assign(Object.assign({}, tokenParsed), { token: keycloak.token, roles: ((_b = ((_a = tokenParsed === null || tokenParsed === void 0 ? void 0 : tokenParsed.resource_access) !== null && _a !== void 0 ? _a : {})[resource_name]) !== null && _b !== void 0 ? _b : []).roles });
64
+ const userData = Object.assign(Object.assign({}, tokenParsed), { refreshToken: keycloak.refreshToken, token: keycloak.token, roles: ((_b = ((_a = tokenParsed === null || tokenParsed === void 0 ? void 0 : tokenParsed.resource_access) !== null && _a !== void 0 ? _a : {})[resource_name]) !== null && _b !== void 0 ? _b : []).roles });
65
65
  setUser(userData);
66
66
  console.info('Authenticated!!!');
67
67
  keycloak.onTokenExpired = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssplib/react-components",
3
- "version": "0.0.286",
3
+ "version": "0.0.288",
4
4
  "description": "SSP React Components",
5
5
  "main": "index.js",
6
6
  "author": "Pedro Henrique <sr.hudrick@gmail.com>",
package/types/auth.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { KeycloakTokenParsed } from "keycloak-js";
1
+ import { KeycloakTokenParsed } from 'keycloak-js';
2
2
  export interface User extends KeycloakTokenParsed {
3
3
  token: string | undefined;
4
4
  roles: any[];
5
5
  image?: string;
6
+ refreshToken?: string;
6
7
  }
7
8
  export interface AuthData {
8
9
  isAuth: boolean;