@redus/georedus-ui 0.15.0 → 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,11 @@
1
1
  # @orioro/template-react
2
2
 
3
+ ## 0.16.0
4
+
5
+ ### Minor Changes
6
+
7
+ - expose leftPanel props
8
+
3
9
  ## 0.15.0
4
10
 
5
11
  ### 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
@@ -16,7 +16,7 @@ import { scaleQuantile } from 'd3-scale';
16
16
  import { csvParse } from 'd3-dsv';
17
17
  import { strAutoCast } from '@orioro/cast';
18
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, useReducer, useEffect, useRef } from 'react';
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;
@@ -11286,6 +11293,7 @@ function HoverLegend(_ref) {
11286
11293
  }
11287
11294
  var DEFAULT_MAP_PROPS = {};
11288
11295
  var DEFAULT_SVG_IMAGES = {};
11296
+ var DEFAULT_LEFT_PANEL_PROPS = {};
11289
11297
  function GeoReDUSInner(_ref2) {
11290
11298
  var globalState = _ref2.state,
11291
11299
  onSetGlobalState = _ref2.onSetState,
@@ -11296,7 +11304,9 @@ function GeoReDUSInner(_ref2) {
11296
11304
  _ref2$mapProps = _ref2.mapProps,
11297
11305
  mapProps = _ref2$mapProps === void 0 ? DEFAULT_MAP_PROPS : _ref2$mapProps,
11298
11306
  _ref2$svgImages = _ref2.svgImages,
11299
- svgImages = _ref2$svgImages === void 0 ? DEFAULT_SVG_IMAGES : _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;
11300
11310
  var MAP_SVG_IMAGE_GENERATOR = useMemo(function () {
11301
11311
  return svgImageGenerator(_objectSpread2(_objectSpread2({
11302
11312
  mdiTree: mdiTree,
@@ -11656,7 +11666,7 @@ function GeoReDUSInner(_ref2) {
11656
11666
  }
11657
11667
  });
11658
11668
  }, []);
11659
- 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({
11660
11670
  open: leftPanelOpen,
11661
11671
  onSetOpen: setLeftPanelOpen,
11662
11672
  viewSpecs: resolvedViewSpecs,
@@ -11664,7 +11674,7 @@ function GeoReDUSInner(_ref2) {
11664
11674
  viewConfDispatch: viewConfDispatch,
11665
11675
  resolvedViews: resolvedViews,
11666
11676
  syncedMapsRef: syncedMapsRef
11667
- }), /*#__PURE__*/React$1.createElement(Flex, {
11677
+ }, leftPanelProps)), /*#__PURE__*/React$1.createElement(Flex, {
11668
11678
  style: {
11669
11679
  position: 'fixed',
11670
11680
  zIndex: 2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redus/georedus-ui",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "packageManager": "yarn@4.0.2",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",