@redus/georedus-ui 0.14.1 → 0.16.0

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,23 @@
1
1
  # @orioro/template-react
2
2
 
3
+ ## 0.16.0
4
+
5
+ ### Minor Changes
6
+
7
+ - expose leftPanel props
8
+
9
+ ## 0.15.0
10
+
11
+ ### Minor Changes
12
+
13
+ - expose SyncedMaps mouse event handlers and add svgImages to GeoReDUS
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+ - @orioro/react-maplibre-util@0.7.0
19
+ - @orioro/react-chart-util@0.3.0
20
+
3
21
  ## 0.14.0
4
22
 
5
23
  ### Minor Changes
@@ -1,4 +1,5 @@
1
- export function LeftPanel({ viewConfState, viewConfDispatch, viewSpecs, resolvedViews, open, onSetOpen, syncedMapsRef, mapContainerRef, }: {
1
+ export const LeftPanel: React.MemoExoticComponent<typeof LeftPanelInner>;
2
+ declare function LeftPanelInner({ viewConfState, viewConfDispatch, viewSpecs, resolvedViews, open, onSetOpen, syncedMapsRef, mapContainerRef, header: customHeader, footer: customFooter, }: {
2
3
  viewConfState: any;
3
4
  viewConfDispatch: any;
4
5
  viewSpecs: any;
@@ -7,5 +8,8 @@ export function LeftPanel({ viewConfState, viewConfDispatch, viewSpecs, resolved
7
8
  onSetOpen: any;
8
9
  syncedMapsRef: any;
9
10
  mapContainerRef: any;
11
+ header?: undefined;
12
+ footer?: undefined;
10
13
  }): React.JSX.Element;
11
14
  import React from 'react';
15
+ export {};
package/dist/main.js CHANGED
@@ -15,8 +15,8 @@ import { buffer } from '@turf/turf';
15
15
  import { scaleQuantile } from 'd3-scale';
16
16
  import { csvParse } from 'd3-dsv';
17
17
  import { strAutoCast } from '@orioro/cast';
18
- import { fmtLayerAbsoluteId, waves_1, svgImageGenerator, SVG_PATTERNS, makeSyncedMaps, LayeredMap, useMapRegistry, useTilesLoading, HoverTooltip, layeredMapOnClickHandler, DynamicImages, ControlContainer, InspectControl, MapWindow, TerrainControl, fitGeometry } from '@orioro/react-maplibre-util';
19
- import React$1, { useState, useMemo, useCallback, useContext, createContext, useReducer, useEffect, useRef } from 'react';
18
+ import { fmtLayerAbsoluteId, waves_1, makeSyncedMaps, LayeredMap, svgImageGenerator, SVG_PATTERNS, useMapRegistry, useTilesLoading, HoverTooltip, layeredMapOnClickHandler, DynamicImages, ControlContainer, InspectControl, MapWindow, TerrainControl, fitGeometry } from '@orioro/react-maplibre-util';
19
+ import React$1, { useState, useMemo, useCallback, useContext, createContext, memo, useReducer, useEffect, useRef } from 'react';
20
20
  import styled, { keyframes } from 'styled-components';
21
21
  import { colord } from 'colord';
22
22
  import { Heading, Portal, Badge, Tabs, Tooltip, IconButton, Theme, Text, Popover, Dialog } from '@radix-ui/themes';
@@ -8646,7 +8646,7 @@ var OPEN_WIDTH = {
8646
8646
  var CLOSED_WIDTH = '60px';
8647
8647
  var HEADER_HEIGHT = 60;
8648
8648
  var LogoContainer = styled(Flex)(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n height: 100%;\n\n svg {\n height: 100%;\n width: auto;\n }\n"])));
8649
- function LeftPanel(_ref) {
8649
+ function LeftPanelInner(_ref) {
8650
8650
  var viewConfState = _ref.viewConfState,
8651
8651
  viewConfDispatch = _ref.viewConfDispatch,
8652
8652
  viewSpecs = _ref.viewSpecs,
@@ -8654,8 +8654,52 @@ function LeftPanel(_ref) {
8654
8654
  open = _ref.open,
8655
8655
  onSetOpen = _ref.onSetOpen,
8656
8656
  syncedMapsRef = _ref.syncedMapsRef,
8657
- mapContainerRef = _ref.mapContainerRef;
8657
+ mapContainerRef = _ref.mapContainerRef,
8658
+ _ref$header = _ref.header,
8659
+ customHeader = _ref$header === void 0 ? undefined : _ref$header,
8660
+ _ref$footer = _ref.footer,
8661
+ customFooter = _ref$footer === void 0 ? undefined : _ref$footer;
8658
8662
  var dialogs = useDialogs();
8663
+ var header = typeof customHeader !== 'undefined' ? customHeader : /*#__PURE__*/React$1.createElement(Flex, {
8664
+ px: "12px",
8665
+ py: "10px",
8666
+ height: HEADER_HEIGHT,
8667
+ alignItems: "center",
8668
+ direction: "row",
8669
+ style: {
8670
+ backgroundColor: 'var(--accent-9)',
8671
+ whiteSpace: 'nowrap',
8672
+ flexShrink: 0,
8673
+ flexGrow: 0
8674
+ }
8675
+ }, /*#__PURE__*/React$1.createElement(LogoContainer, {
8676
+ direction: "row",
8677
+ gap: "8px"
8678
+ }, /*#__PURE__*/React$1.createElement(GeoReDUSLogoSymbol, null), /*#__PURE__*/React$1.createElement("div", {
8679
+ style: {
8680
+ transition: open ? 'opacity .7s ease-out' : 'opacity .1s ease-out',
8681
+ opacity: open ? 1 : 0
8682
+ }
8683
+ }, /*#__PURE__*/React$1.createElement(GeoReDUSLogoText, null))));
8684
+ var footer = typeof customFooter !== 'undefined' ? customFooter : /*#__PURE__*/React$1.createElement(Flex, {
8685
+ p: "2",
8686
+ style: {
8687
+ backgroundColor: 'white'
8688
+ },
8689
+ direction: "row",
8690
+ justifyContent: "center"
8691
+ }, /*#__PURE__*/React$1.createElement("img", {
8692
+ style: {
8693
+ transition: 'opacity .1s ease-out',
8694
+ opacity: open ? 1 : 0,
8695
+ height: 48,
8696
+ width: 'auto'
8697
+
8698
+ // height: 'auto',
8699
+ // width: '100%',
8700
+ },
8701
+ src: "/georedus/assets/parcerias.png"
8702
+ }));
8659
8703
  return /*#__PURE__*/React$1.createElement("div", {
8660
8704
  style: {
8661
8705
  position: 'fixed',
@@ -8727,27 +8771,7 @@ function LeftPanel(_ref) {
8727
8771
  onClick: function onClick(e) {
8728
8772
  return onSetOpen(true);
8729
8773
  }
8730
- }, /*#__PURE__*/React$1.createElement(Flex, {
8731
- px: "12px",
8732
- py: "10px",
8733
- height: HEADER_HEIGHT,
8734
- alignItems: "center",
8735
- direction: "row",
8736
- style: {
8737
- backgroundColor: 'var(--accent-9)',
8738
- whiteSpace: 'nowrap',
8739
- flexShrink: 0,
8740
- flexGrow: 0
8741
- }
8742
- }, /*#__PURE__*/React$1.createElement(LogoContainer, {
8743
- direction: "row",
8744
- gap: "8px"
8745
- }, /*#__PURE__*/React$1.createElement(GeoReDUSLogoSymbol, null), /*#__PURE__*/React$1.createElement("div", {
8746
- style: {
8747
- transition: open ? 'opacity .7s ease-out' : 'opacity .1s ease-out',
8748
- opacity: open ? 1 : 0
8749
- }
8750
- }, /*#__PURE__*/React$1.createElement(GeoReDUSLogoText, null)))), Array.isArray(viewSpecs) ? /*#__PURE__*/React$1.createElement(ViewMenu, {
8774
+ }, header, Array.isArray(viewSpecs) ? /*#__PURE__*/React$1.createElement(ViewMenu, {
8751
8775
  style: {
8752
8776
  flexGrow: 1,
8753
8777
  height: '1px'
@@ -8831,26 +8855,9 @@ function LeftPanel(_ref) {
8831
8855
  }
8832
8856
  }, /*#__PURE__*/React$1.createElement(LoadingOverlay, {
8833
8857
  message: null
8834
- })), /*#__PURE__*/React$1.createElement(Flex, {
8835
- p: "2",
8836
- style: {
8837
- backgroundColor: 'white'
8838
- },
8839
- direction: "row",
8840
- justifyContent: "center"
8841
- }, /*#__PURE__*/React$1.createElement("img", {
8842
- style: {
8843
- transition: 'opacity .1s ease-out',
8844
- opacity: open ? 1 : 0,
8845
- height: 48,
8846
- width: 'auto'
8847
-
8848
- // height: 'auto',
8849
- // width: '100%',
8850
- },
8851
- src: "/georedus/assets/parcerias.png"
8852
- }))));
8858
+ })), footer));
8853
8859
  }
8860
+ var LeftPanel = /*#__PURE__*/memo(LeftPanelInner);
8854
8861
 
8855
8862
  var ViewLayoutControlContext = /*#__PURE__*/createContext(null);
8856
8863
  var DRAG_HANDLE_BORDER_RADIUS = 10;
@@ -11100,15 +11107,6 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
11100
11107
  // Sets up vtx:// protocol
11101
11108
  //
11102
11109
  vtxSetup();
11103
- var MAP_SVG_IMAGE_GENERATOR = svgImageGenerator(_objectSpread2({
11104
- mdiTree: mdiTree,
11105
- mdiSprout: mdiSprout,
11106
- mdiCurrencyUsd: mdiCurrencyUsd,
11107
- mdiScaleBalance: mdiScaleBalance,
11108
- mdiAccountMultipleOutline: mdiAccountMultipleOutline,
11109
- mdiSchool: mdiSchool,
11110
- mdiHospital: mdiHospital
11111
- }, SVG_PATTERNS));
11112
11110
  var LegendContainer = styled(Flex)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n box-shadow:\n rgba(0, 0, 0, 0.1) 0px 4px 6px -1px,\n rgba(0, 0, 0, 0.06) 0px 2px 4px -1px;\n background-color: white;\n border-radius: 4px;\n"])));
11113
11111
 
11114
11112
  //
@@ -11293,6 +11291,9 @@ function HoverLegend(_ref) {
11293
11291
  }, []);
11294
11292
  return /*#__PURE__*/React$1.createElement(Legend, _extends({}, legendProps, legendProps.type === 'SequentialColorLegend' ? SEQUENTIAL_COLOR_LEGEND_PROPS : {}));
11295
11293
  }
11294
+ var DEFAULT_MAP_PROPS = {};
11295
+ var DEFAULT_SVG_IMAGES = {};
11296
+ var DEFAULT_LEFT_PANEL_PROPS = {};
11296
11297
  function GeoReDUSInner(_ref2) {
11297
11298
  var globalState = _ref2.state,
11298
11299
  onSetGlobalState = _ref2.onSetState,
@@ -11301,7 +11302,22 @@ function GeoReDUSInner(_ref2) {
11301
11302
  _ref2$children = _ref2.children,
11302
11303
  children = _ref2$children === void 0 ? null : _ref2$children,
11303
11304
  _ref2$mapProps = _ref2.mapProps,
11304
- mapProps = _ref2$mapProps === void 0 ? {} : _ref2$mapProps;
11305
+ mapProps = _ref2$mapProps === void 0 ? DEFAULT_MAP_PROPS : _ref2$mapProps,
11306
+ _ref2$svgImages = _ref2.svgImages,
11307
+ svgImages = _ref2$svgImages === void 0 ? DEFAULT_SVG_IMAGES : _ref2$svgImages,
11308
+ _ref2$leftPanel = _ref2.leftPanel,
11309
+ leftPanelProps = _ref2$leftPanel === void 0 ? DEFAULT_LEFT_PANEL_PROPS : _ref2$leftPanel;
11310
+ var MAP_SVG_IMAGE_GENERATOR = useMemo(function () {
11311
+ return svgImageGenerator(_objectSpread2(_objectSpread2({
11312
+ mdiTree: mdiTree,
11313
+ mdiSprout: mdiSprout,
11314
+ mdiCurrencyUsd: mdiCurrencyUsd,
11315
+ mdiScaleBalance: mdiScaleBalance,
11316
+ mdiAccountMultipleOutline: mdiAccountMultipleOutline,
11317
+ mdiSchool: mdiSchool,
11318
+ mdiHospital: mdiHospital
11319
+ }, SVG_PATTERNS), svgImages));
11320
+ }, [svgImages]);
11305
11321
  var METADATA_API_ENDPOINT = api.METADATA_API_ENDPOINT,
11306
11322
  VECTOR_TILE_SERVER_ENDPOINT = api.VECTOR_TILE_SERVER_ENDPOINT;
11307
11323
 
@@ -11650,7 +11666,7 @@ function GeoReDUSInner(_ref2) {
11650
11666
  }
11651
11667
  });
11652
11668
  }, []);
11653
- return /*#__PURE__*/React$1.createElement(Flex, null, /*#__PURE__*/React$1.createElement(LeftPanel, {
11669
+ return /*#__PURE__*/React$1.createElement(Flex, null, /*#__PURE__*/React$1.createElement(LeftPanel, _extends({
11654
11670
  open: leftPanelOpen,
11655
11671
  onSetOpen: setLeftPanelOpen,
11656
11672
  viewSpecs: resolvedViewSpecs,
@@ -11658,7 +11674,7 @@ function GeoReDUSInner(_ref2) {
11658
11674
  viewConfDispatch: viewConfDispatch,
11659
11675
  resolvedViews: resolvedViews,
11660
11676
  syncedMapsRef: syncedMapsRef
11661
- }), /*#__PURE__*/React$1.createElement(Flex, {
11677
+ }, leftPanelProps)), /*#__PURE__*/React$1.createElement(Flex, {
11662
11678
  style: {
11663
11679
  position: 'fixed',
11664
11680
  zIndex: 2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redus/georedus-ui",
3
- "version": "0.14.1",
3
+ "version": "0.16.0",
4
4
  "packageManager": "yarn@4.0.2",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
@@ -55,7 +55,7 @@
55
55
  "@orioro/react-csv": "^0.0.11",
56
56
  "@orioro/react-dialogs": "^0.0.10",
57
57
  "@orioro/react-dir-nav": "^0.2.0",
58
- "@orioro/react-maplibre-util": "^0.6.0",
58
+ "@orioro/react-maplibre-util": "^0.7.0",
59
59
  "@orioro/react-sortable": "^0.0.10",
60
60
  "@orioro/react-ui-core": "^0.0.14",
61
61
  "@orioro/resolve": "^0.1.9",