@redus/georedus-ui 0.8.6 → 0.8.8
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
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function CopyToClipboardButton({ text, label, ...props }: {
|
|
2
|
+
[x: string]: any;
|
|
3
|
+
text: any;
|
|
4
|
+
label: any;
|
|
5
|
+
}): React.JSX.Element;
|
|
6
|
+
export function CopyToClipboardIconButton({ text, label, children, copiedMessage, ...props }: {
|
|
7
|
+
[x: string]: any;
|
|
8
|
+
text: any;
|
|
9
|
+
label?: string | undefined;
|
|
10
|
+
children?: React.JSX.Element | undefined;
|
|
11
|
+
copiedMessage?: string | undefined;
|
|
12
|
+
}): React.JSX.Element;
|
|
13
|
+
import React from 'react';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ShareButtonBar";
|
package/dist/main.js
CHANGED
|
@@ -3,8 +3,8 @@ import { MARKDOWN_DEFAULT_REMARK_PLUGINS, MARKDOWN_DEFAULT_REHYPE_PLUGINS, Markd
|
|
|
3
3
|
import { nodeIdFromPath } from '@orioro/tree-model';
|
|
4
4
|
import { makeDirNav } from '@orioro/react-dir-nav';
|
|
5
5
|
import { Icon } from '@mdi/react';
|
|
6
|
-
import { mdiHelpCircleOutline, mdiDownload, mdiDotsVertical, mdiOpacity, mdiFilterVariant, mdiHospitalBox, mdiHomeCity, mdiSchool, mdiAccountGroup, mdiChevronLeft, mdiShareVariantOutline, mdiDragVertical, mdiLayers, mdiClose } from '@mdi/js';
|
|
7
|
-
import { Tabs, Tooltip, IconButton, Theme, Heading, Text, Dialog, Portal
|
|
6
|
+
import { mdiHelpCircleOutline, mdiDownload, mdiDotsVertical, mdiOpacity, mdiFilterVariant, mdiHospitalBox, mdiHomeCity, mdiSchool, mdiAccountGroup, mdiContentCopy, mdiLinkVariant, mdiChevronLeft, mdiShareVariantOutline, mdiForumOutline, mdiDragVertical, mdiLayers, mdiClose } from '@mdi/js';
|
|
7
|
+
import { Tabs, Tooltip, IconButton, Theme, Heading, Text, Popover, Dialog, Portal } from '@radix-ui/themes';
|
|
8
8
|
import styled, { keyframes } from 'styled-components';
|
|
9
9
|
import * as Collapsible from '@radix-ui/react-collapsible';
|
|
10
10
|
import { __makeTemplateObject, __assign, __spreadArray, __awaiter, __generator } from 'tslib';
|
|
@@ -12,10 +12,12 @@ import remarkMath from 'remark-math';
|
|
|
12
12
|
import rehypeKatex from 'rehype-katex';
|
|
13
13
|
import 'katex/dist/katex.min.css';
|
|
14
14
|
import { isPlainObject, get, pick, omit, set, uniqBy, groupBy, uniq } from 'lodash';
|
|
15
|
-
import { useDebounce } from 'react-use';
|
|
15
|
+
import { useDebounce, useLocation } from 'react-use';
|
|
16
16
|
import { createDialogSystem, DIALOGS } from '@orioro/react-dialogs';
|
|
17
17
|
import { CsvImportDialog } from '@orioro/react-csv';
|
|
18
18
|
import Highlighter from 'react-highlight-words';
|
|
19
|
+
import { LinkedinShareButton, LinkedinIcon, EmailShareButton, EmailIcon, FacebookShareButton, FacebookIcon, TwitterShareButton, TwitterIcon, WhatsappShareButton, WhatsappIcon } from 'react-share';
|
|
20
|
+
import CopyToClipboard from 'react-copy-to-clipboard';
|
|
19
21
|
import { makeSortableMultiList } from '@orioro/react-sortable';
|
|
20
22
|
import { fmtLayerAbsoluteId, makeSyncedMaps, LayeredMap, HoverTooltip, ControlContainer, InspectControl, MapWindow, TerrainControl, fitGeometry } from '@orioro/react-maplibre-util';
|
|
21
23
|
import '@maplibre/maplibre-gl-inspect/dist/maplibre-gl-inspect.css';
|
|
@@ -800,9 +802,9 @@ function ViewConfTabs(_ref) {
|
|
|
800
802
|
}, "Visualiza\xE7\xE3o habilitada"));
|
|
801
803
|
}
|
|
802
804
|
|
|
803
|
-
var _excluded$
|
|
804
|
-
var _templateObject$
|
|
805
|
-
var Container = styled(Box)(_templateObject$
|
|
805
|
+
var _excluded$5 = ["textSearch", "content", "maxLines"];
|
|
806
|
+
var _templateObject$4, _templateObject2$2;
|
|
807
|
+
var Container$1 = styled(Box)(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteral(["\n --view-control-base-padding: 12px;\n box-shadow:\n rgba(0, 0, 0, 0.12) 0px 1px 3px,\n rgba(0, 0, 0, 0.24) 0px 1px 2px;\n\n border-radius: 2px;\n background-color: var(--redus-bege, white);\n // background-color: var(--accent-4, white);\n"])));
|
|
806
808
|
var Summary = styled.div(_templateObject2$2 || (_templateObject2$2 = _taggedTemplateLiteral(["\n // background-color: var(--redus-bege, white);\n background-color: ", ";\n padding: 0;\n\n transition: background-color 0.1s ease-out;\n\n display: flex;\n border: none;\n text-align: left;\n width: 100%;\n\n cursor: pointer;\n\n &:hover {\n // background-color: color-mix(in srgb, var(--redus-bege) 80%, white);\n background-color: ", ";\n }\n\n &:active {\n filter: brightness(96%);\n }\n"])), function (_ref) {
|
|
807
809
|
var $active = _ref.$active;
|
|
808
810
|
return $active ? 'var(--redus-bege, white)' : 'var(--accent-2)';
|
|
@@ -828,7 +830,7 @@ function HeadingWithTooltipAndEllipsis(_ref7) {
|
|
|
828
830
|
content = _ref7.content,
|
|
829
831
|
_ref7$maxLines = _ref7.maxLines,
|
|
830
832
|
maxLines = _ref7$maxLines === void 0 ? 2 : _ref7$maxLines,
|
|
831
|
-
props = _objectWithoutProperties(_ref7, _excluded$
|
|
833
|
+
props = _objectWithoutProperties(_ref7, _excluded$5);
|
|
832
834
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
833
835
|
content: content
|
|
834
836
|
}, /*#__PURE__*/React.createElement(Heading, _extends({
|
|
@@ -869,7 +871,7 @@ function ViewControl(_ref8) {
|
|
|
869
871
|
}, [active, deactivateView, setView]);
|
|
870
872
|
return viewSpec && /*#__PURE__*/React.createElement(Collapsible.Root, {
|
|
871
873
|
open: configurable === true && active
|
|
872
|
-
}, /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Summary, {
|
|
874
|
+
}, /*#__PURE__*/React.createElement(Container$1, null, /*#__PURE__*/React.createElement(Summary, {
|
|
873
875
|
type: "button",
|
|
874
876
|
role: "button",
|
|
875
877
|
style: style,
|
|
@@ -937,8 +939,8 @@ function ViewControl(_ref8) {
|
|
|
937
939
|
|
|
938
940
|
var VIEW_TYPE_SURFACE_CHOROPLETH = 'surface_choropleth';
|
|
939
941
|
|
|
940
|
-
var _excluded$
|
|
941
|
-
var _templateObject$
|
|
942
|
+
var _excluded$4 = ["viewSpecs", "viewConfState", "resolvedViews", "onSetView", "onDeactivateView", "style"];
|
|
943
|
+
var _templateObject$3, _templateObject2$1;
|
|
942
944
|
var STATIC_NODE_ICONS = {
|
|
943
945
|
'populacao-e-domicilios': /*#__PURE__*/React.createElement(Icon, {
|
|
944
946
|
path: mdiAccountGroup
|
|
@@ -961,7 +963,7 @@ var ViewMenuContext = /*#__PURE__*/createContext({
|
|
|
961
963
|
onSetView: errNoViewMenuContext,
|
|
962
964
|
onDeactivateView: errNoViewMenuContext
|
|
963
965
|
});
|
|
964
|
-
var ActiveCounter = styled.div(_templateObject$
|
|
966
|
+
var ActiveCounter = styled.div(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n left: 0;\n transform: translate(-30%, -30%);\n border-radius: 50%;\n border: 1px solid white;\n height: 20px;\n width: 20px;\n font-size: 12px;\n background-color: var(--accent-9);\n color: white;\n font-weight: bold;\n\n display: flex;\n align-items: center;\n justify-content: center;\n"])));
|
|
965
967
|
function Item(_ref) {
|
|
966
968
|
var node = _ref.node;
|
|
967
969
|
_ref.depth;
|
|
@@ -1079,7 +1081,7 @@ function ViewMenu(_ref4) {
|
|
|
1079
1081
|
onSetView = _ref4.onSetView,
|
|
1080
1082
|
onDeactivateView = _ref4.onDeactivateView,
|
|
1081
1083
|
style = _ref4.style,
|
|
1082
|
-
props = _objectWithoutProperties(_ref4, _excluded$
|
|
1084
|
+
props = _objectWithoutProperties(_ref4, _excluded$4);
|
|
1083
1085
|
var viewSpecsById = useMemo(function () {
|
|
1084
1086
|
return Object.fromEntries(viewSpecs.map(function (spec) {
|
|
1085
1087
|
return [spec.id, spec];
|
|
@@ -1230,6 +1232,101 @@ function GeoReDUSLogoText() {
|
|
|
1230
1232
|
}))));
|
|
1231
1233
|
}
|
|
1232
1234
|
|
|
1235
|
+
var _excluded2 = ["text", "label", "children", "copiedMessage"];
|
|
1236
|
+
var DEFAULT_ICON = /*#__PURE__*/React.createElement(Icon, {
|
|
1237
|
+
path: mdiContentCopy,
|
|
1238
|
+
size: "18px"
|
|
1239
|
+
});
|
|
1240
|
+
function CopyToClipboardIconButton(_ref2) {
|
|
1241
|
+
var text = _ref2.text,
|
|
1242
|
+
_ref2$label = _ref2.label,
|
|
1243
|
+
label = _ref2$label === void 0 ? 'Copiar' : _ref2$label,
|
|
1244
|
+
_ref2$children = _ref2.children,
|
|
1245
|
+
children = _ref2$children === void 0 ? DEFAULT_ICON : _ref2$children,
|
|
1246
|
+
_ref2$copiedMessage = _ref2.copiedMessage,
|
|
1247
|
+
copiedMessage = _ref2$copiedMessage === void 0 ? 'Copiado!' : _ref2$copiedMessage,
|
|
1248
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
1249
|
+
var _useState3 = useState(false),
|
|
1250
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
1251
|
+
copied = _useState4[0],
|
|
1252
|
+
setCopied = _useState4[1];
|
|
1253
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Popover.Root, {
|
|
1254
|
+
open: copied
|
|
1255
|
+
}, /*#__PURE__*/React.createElement(CopyToClipboard, {
|
|
1256
|
+
text: text
|
|
1257
|
+
}, /*#__PURE__*/React.createElement(Popover.Trigger, null, /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
1258
|
+
asChild: true,
|
|
1259
|
+
radius: "full"
|
|
1260
|
+
}, props), /*#__PURE__*/React.createElement("button", {
|
|
1261
|
+
onClick: function onClick() {
|
|
1262
|
+
setCopied(true);
|
|
1263
|
+
setTimeout(function () {
|
|
1264
|
+
setCopied(function () {
|
|
1265
|
+
return false;
|
|
1266
|
+
});
|
|
1267
|
+
}, 2500);
|
|
1268
|
+
}
|
|
1269
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
1270
|
+
content: label,
|
|
1271
|
+
sideOffset: 10
|
|
1272
|
+
}, children))))), /*#__PURE__*/React.createElement(Popover.Content, {
|
|
1273
|
+
align: "center",
|
|
1274
|
+
size: "1",
|
|
1275
|
+
style: {
|
|
1276
|
+
fontSize: '.8rem',
|
|
1277
|
+
padding: 8
|
|
1278
|
+
},
|
|
1279
|
+
maxWidth: 60
|
|
1280
|
+
}, copiedMessage)));
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
var _excluded$3 = ["url"];
|
|
1284
|
+
var _templateObject$2;
|
|
1285
|
+
var Container = styled(Flex)(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n > * {\n height: 32px;\n }\n"])));
|
|
1286
|
+
var ShareButtonBar = function ShareButtonBar(_ref) {
|
|
1287
|
+
var url = _ref.url,
|
|
1288
|
+
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
1289
|
+
var _useLocation = useLocation(),
|
|
1290
|
+
href = _useLocation.href;
|
|
1291
|
+
var shareUrl = url ? url : href;
|
|
1292
|
+
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
1293
|
+
direction: "row",
|
|
1294
|
+
gap: "3"
|
|
1295
|
+
}, props), /*#__PURE__*/React.createElement(CopyToClipboardIconButton, {
|
|
1296
|
+
label: "Copiar link de compartilhamento",
|
|
1297
|
+
copiedMessage: "Link copiado para \xE1rea de transfer\xEAncia",
|
|
1298
|
+
text: shareUrl
|
|
1299
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
1300
|
+
path: mdiLinkVariant,
|
|
1301
|
+
size: "18px"
|
|
1302
|
+
})), /*#__PURE__*/React.createElement(LinkedinShareButton, {
|
|
1303
|
+
url: shareUrl
|
|
1304
|
+
}, /*#__PURE__*/React.createElement(LinkedinIcon, {
|
|
1305
|
+
size: 32,
|
|
1306
|
+
round: true
|
|
1307
|
+
})), /*#__PURE__*/React.createElement(EmailShareButton, {
|
|
1308
|
+
url: shareUrl
|
|
1309
|
+
}, /*#__PURE__*/React.createElement(EmailIcon, {
|
|
1310
|
+
size: 32,
|
|
1311
|
+
round: true
|
|
1312
|
+
})), /*#__PURE__*/React.createElement(FacebookShareButton, {
|
|
1313
|
+
url: shareUrl
|
|
1314
|
+
}, /*#__PURE__*/React.createElement(FacebookIcon, {
|
|
1315
|
+
size: 32,
|
|
1316
|
+
round: true
|
|
1317
|
+
})), /*#__PURE__*/React.createElement(TwitterShareButton, {
|
|
1318
|
+
url: shareUrl
|
|
1319
|
+
}, /*#__PURE__*/React.createElement(TwitterIcon, {
|
|
1320
|
+
size: 32,
|
|
1321
|
+
round: true
|
|
1322
|
+
})), /*#__PURE__*/React.createElement(WhatsappShareButton, {
|
|
1323
|
+
url: shareUrl
|
|
1324
|
+
}, /*#__PURE__*/React.createElement(WhatsappIcon, {
|
|
1325
|
+
size: 32,
|
|
1326
|
+
round: true
|
|
1327
|
+
})));
|
|
1328
|
+
};
|
|
1329
|
+
|
|
1233
1330
|
//
|
|
1234
1331
|
// html2canvas does not support color functions
|
|
1235
1332
|
// radix uses: oklch and color(...)
|
|
@@ -1269,7 +1366,7 @@ function SharePanel(_ref) {
|
|
|
1269
1366
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Dialog.Title, null, "Compartilhar"), /*#__PURE__*/React.createElement(Flex, {
|
|
1270
1367
|
direction: "row",
|
|
1271
1368
|
gap: "4"
|
|
1272
|
-
},
|
|
1369
|
+
}, /*#__PURE__*/React.createElement(ShareButtonBar, null)));
|
|
1273
1370
|
}
|
|
1274
1371
|
|
|
1275
1372
|
var _templateObject$1;
|
|
@@ -1418,6 +1515,7 @@ function LeftPanel(_ref) {
|
|
|
1418
1515
|
},
|
|
1419
1516
|
pb: "3",
|
|
1420
1517
|
direction: "column",
|
|
1518
|
+
gap: "3",
|
|
1421
1519
|
justifyContent: "flex-end",
|
|
1422
1520
|
alignItems: "center"
|
|
1423
1521
|
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
@@ -1438,10 +1536,25 @@ function LeftPanel(_ref) {
|
|
|
1438
1536
|
}
|
|
1439
1537
|
}, _callee);
|
|
1440
1538
|
}))
|
|
1539
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
1540
|
+
content: "Compartilhar"
|
|
1441
1541
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
1442
1542
|
path: mdiShareVariantOutline,
|
|
1443
1543
|
size: "24px"
|
|
1444
|
-
})))
|
|
1544
|
+
}))), /*#__PURE__*/React.createElement(IconButton, {
|
|
1545
|
+
variant: "soft",
|
|
1546
|
+
size: "3",
|
|
1547
|
+
asChild: true
|
|
1548
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
1549
|
+
href: "https://www.redus.org.br/georedus-rede-de-dados-urbanos/formularios/cbf766bb-9a74-4bc5-897a-70b9151afbdb",
|
|
1550
|
+
target: "_blank",
|
|
1551
|
+
rel: "noreferrer nofollow"
|
|
1552
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
1553
|
+
content: "D\xFAvidas e sugest\xF5es"
|
|
1554
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
1555
|
+
path: mdiForumOutline,
|
|
1556
|
+
size: "24px"
|
|
1557
|
+
})))))
|
|
1445
1558
|
}) : /*#__PURE__*/React.createElement("div", {
|
|
1446
1559
|
style: {
|
|
1447
1560
|
flexGrow: 1,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redus/georedus-ui",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.8",
|
|
4
4
|
"packageManager": "yarn@4.0.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -72,7 +72,9 @@
|
|
|
72
72
|
"katex": "^0.16.22",
|
|
73
73
|
"lodash": "^4.17.21",
|
|
74
74
|
"query-string": "^9.1.1",
|
|
75
|
+
"react-copy-to-clipboard": "^5.1.0",
|
|
75
76
|
"react-highlight-words": "^0.21.0",
|
|
77
|
+
"react-share": "^5.1.0",
|
|
76
78
|
"react-use": "^17.5.0",
|
|
77
79
|
"rehype-katex": "^7.0.1",
|
|
78
80
|
"remark-math": "^6.0.0",
|