@fleet-frontend/mower-maps 0.2.5-beta.12 → 0.2.5-beta.14
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/dist/index.esm.js
CHANGED
|
@@ -20048,12 +20048,12 @@ function styleInject(css, ref) {
|
|
|
20048
20048
|
}
|
|
20049
20049
|
}
|
|
20050
20050
|
|
|
20051
|
-
var css_248z$
|
|
20052
|
-
var styles$
|
|
20053
|
-
styleInject(css_248z$
|
|
20051
|
+
var css_248z$8 = ".index-module_edit__-5VvX {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n pointer-events: auto;\n z-index: 1000;\n cursor: move;\n touch-action: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n.index-module_edit__-5VvX .index-module_border__JdNLM {\n position: absolute;\n inset: -10px;\n border: 2px dashed rgb(241, 102, 41);\n border-radius: 2px;\n pointer-events: none;\n}\n.index-module_edit__-5VvX .index-module_drag__uvdPG {\n position: absolute;\n inset: -10px;\n border-radius: 2px;\n}\n.index-module_edit__-5VvX .index-module_rotate__H-KIZ {\n position: absolute;\n top: -20px;\n right: -20px;\n width: 20px;\n height: 20px;\n cursor: grab;\n z-index: 1001;\n pointer-events: auto;\n}\n.index-module_edit__-5VvX .index-module_move__mZF8s {\n position: absolute;\n bottom: -20px;\n left: -20px;\n width: 20px;\n height: 20px;\n cursor: move;\n z-index: 1001;\n pointer-events: auto;\n}";
|
|
20052
|
+
var styles$8 = {"edit":"index-module_edit__-5VvX","border":"index-module_border__JdNLM","drag":"index-module_drag__uvdPG","rotate":"index-module_rotate__H-KIZ","move":"index-module_move__mZF8s"};
|
|
20053
|
+
styleInject(css_248z$8);
|
|
20054
20054
|
|
|
20055
20055
|
const RotateHandle = ({ onRotateStart, isRotating }) => {
|
|
20056
|
-
return (jsx("div", { className: styles$
|
|
20056
|
+
return (jsx("div", { className: styles$8.rotate, onMouseDown: (e) => onRotateStart(e), onTouchStart: (e) => onRotateStart(e), style: { cursor: isRotating ? 'grabbing' : 'grab' }, dangerouslySetInnerHTML: { __html: DEFAULT_ROTATE_ICON } }));
|
|
20057
20057
|
};
|
|
20058
20058
|
|
|
20059
20059
|
/**
|
|
@@ -20130,7 +20130,7 @@ const DragHandle = ({ onDragStart, isDragging }) => {
|
|
|
20130
20130
|
if (!isMobileDevice()) {
|
|
20131
20131
|
return null;
|
|
20132
20132
|
}
|
|
20133
|
-
return (jsx("div", { className: styles$
|
|
20133
|
+
return (jsx("div", { className: styles$8.move, onMouseDown: (e) => {
|
|
20134
20134
|
onDragStart(e);
|
|
20135
20135
|
}, onTouchStart: (e) => onDragStart(e), onMouseUp: (e) => {
|
|
20136
20136
|
// onDragEnd(e);
|
|
@@ -20162,7 +20162,7 @@ const MapDrag = ({ map: _map, dragCallbacks, onBoundaryLabelsCollapse, onTransfo
|
|
|
20162
20162
|
if (!isDragMap) {
|
|
20163
20163
|
return null;
|
|
20164
20164
|
}
|
|
20165
|
-
return (jsxs("div", { ref: containerRef, className: styles$
|
|
20165
|
+
return (jsxs("div", { ref: containerRef, className: styles$8.edit, style: { cursor: isDragging ? 'grabbing' : 'move' }, children: [jsx("div", { className: styles$8.border }), canRotateMap && jsx(RotateHandle, { onRotateStart: handleRotateStart, isRotating: isRotating }), jsx("div", { className: styles$8.drag, onMouseDown: handleDragStartEvent, onTouchStart: handleDragStartEvent }), jsx(DragHandle, { onDragStart: handleDragStartEvent, isDragging: isDragging })] }));
|
|
20166
20166
|
};
|
|
20167
20167
|
|
|
20168
20168
|
const SvgEditContext = createContext({
|
|
@@ -23595,9 +23595,9 @@ const Magnifier = ({ visible, dragState, polygonPoints, fillColor = 'rgba(255, 1
|
|
|
23595
23595
|
return ReactDOM.createPortal(magnifierContent, document.body);
|
|
23596
23596
|
};
|
|
23597
23597
|
|
|
23598
|
-
var css_248z$
|
|
23599
|
-
var styles$
|
|
23600
|
-
styleInject(css_248z$
|
|
23598
|
+
var css_248z$7 = ".index-module_pointerCursor__Ee6pr {\n cursor: pointer;\n}\n\n.index-module_polygonPath__PynOn {\n pointer-events: stroke;\n cursor: pointer;\n}\n\n.index-module_dragging__xSFdO {\n cursor: grabbing;\n}\n\n.index-module_notCreate__bFnkV {\n cursor: no-drop;\n}";
|
|
23599
|
+
var styles$7 = {"pointerCursor":"index-module_pointerCursor__Ee6pr","polygonPath":"index-module_polygonPath__PynOn","dragging":"index-module_dragging__xSFdO","notCreate":"index-module_notCreate__bFnkV"};
|
|
23600
|
+
styleInject(css_248z$7);
|
|
23601
23601
|
|
|
23602
23602
|
/**
|
|
23603
23603
|
* 几何计算工具函数
|
|
@@ -24020,28 +24020,102 @@ const useCheckElement = () => {
|
|
|
24020
24020
|
};
|
|
24021
24021
|
};
|
|
24022
24022
|
|
|
24023
|
+
var css_248z$6 = ".Tooltip-module_tooltip__Wexlk {\n position: fixed;\n background-color: #fff;\n border-radius: 4px;\n height: 20px;\n line-height: 20px;\n font-size: 12px;\n color: #211F1F;\n padding: 0 4px;\n white-space: nowrap;\n z-index: 9999;\n cursor: pointer;\n user-select: none;\n}\n.Tooltip-module_tooltip__Wexlk.Tooltip-module_tooltipHover__Tfqme {\n height: 30px;\n padding: 5px 12px;\n}\n.Tooltip-module_tooltip__Wexlk.Tooltip-module_tooltipHover__Tfqme:hover {\n background-color: #FFEFE6;\n}";
|
|
24024
|
+
var styles$6 = {"tooltip":"Tooltip-module_tooltip__Wexlk","tooltipHover":"Tooltip-module_tooltipHover__Tfqme"};
|
|
24025
|
+
styleInject(css_248z$6);
|
|
24026
|
+
|
|
24027
|
+
var classnames = {exports: {}};
|
|
24028
|
+
|
|
24029
|
+
/*!
|
|
24030
|
+
Copyright (c) 2018 Jed Watson.
|
|
24031
|
+
Licensed under the MIT License (MIT), see
|
|
24032
|
+
http://jedwatson.github.io/classnames
|
|
24033
|
+
*/
|
|
24034
|
+
|
|
24035
|
+
(function (module) {
|
|
24036
|
+
/* global define */
|
|
24037
|
+
|
|
24038
|
+
(function () {
|
|
24039
|
+
|
|
24040
|
+
var hasOwn = {}.hasOwnProperty;
|
|
24041
|
+
|
|
24042
|
+
function classNames () {
|
|
24043
|
+
var classes = '';
|
|
24044
|
+
|
|
24045
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
24046
|
+
var arg = arguments[i];
|
|
24047
|
+
if (arg) {
|
|
24048
|
+
classes = appendClass(classes, parseValue(arg));
|
|
24049
|
+
}
|
|
24050
|
+
}
|
|
24051
|
+
|
|
24052
|
+
return classes;
|
|
24053
|
+
}
|
|
24054
|
+
|
|
24055
|
+
function parseValue (arg) {
|
|
24056
|
+
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
24057
|
+
return arg;
|
|
24058
|
+
}
|
|
24059
|
+
|
|
24060
|
+
if (typeof arg !== 'object') {
|
|
24061
|
+
return '';
|
|
24062
|
+
}
|
|
24063
|
+
|
|
24064
|
+
if (Array.isArray(arg)) {
|
|
24065
|
+
return classNames.apply(null, arg);
|
|
24066
|
+
}
|
|
24067
|
+
|
|
24068
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
24069
|
+
return arg.toString();
|
|
24070
|
+
}
|
|
24071
|
+
|
|
24072
|
+
var classes = '';
|
|
24073
|
+
|
|
24074
|
+
for (var key in arg) {
|
|
24075
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
24076
|
+
classes = appendClass(classes, key);
|
|
24077
|
+
}
|
|
24078
|
+
}
|
|
24079
|
+
|
|
24080
|
+
return classes;
|
|
24081
|
+
}
|
|
24082
|
+
|
|
24083
|
+
function appendClass (value, newClass) {
|
|
24084
|
+
if (!newClass) {
|
|
24085
|
+
return value;
|
|
24086
|
+
}
|
|
24087
|
+
|
|
24088
|
+
if (value) {
|
|
24089
|
+
return value + ' ' + newClass;
|
|
24090
|
+
}
|
|
24091
|
+
|
|
24092
|
+
return value + newClass;
|
|
24093
|
+
}
|
|
24094
|
+
|
|
24095
|
+
if (module.exports) {
|
|
24096
|
+
classNames.default = classNames;
|
|
24097
|
+
module.exports = classNames;
|
|
24098
|
+
} else {
|
|
24099
|
+
window.classNames = classNames;
|
|
24100
|
+
}
|
|
24101
|
+
}());
|
|
24102
|
+
} (classnames));
|
|
24103
|
+
|
|
24104
|
+
var classnamesExports = classnames.exports;
|
|
24105
|
+
var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
24106
|
+
|
|
24023
24107
|
const Tooltip = ({ open, x, y, text, style, onClick }) => {
|
|
24024
24108
|
if (!open)
|
|
24025
24109
|
return null;
|
|
24026
24110
|
const tooltipStyle = {
|
|
24027
|
-
position: 'fixed',
|
|
24028
24111
|
left: x,
|
|
24029
24112
|
top: y,
|
|
24030
|
-
backgroundColor: '#fff',
|
|
24031
|
-
borderRadius: '4px',
|
|
24032
|
-
height: '20px',
|
|
24033
|
-
lineHeight: '16px',
|
|
24034
|
-
fontSize: '12px',
|
|
24035
|
-
color: '#211F1F',
|
|
24036
|
-
padding: '2px 4px',
|
|
24037
|
-
whiteSpace: 'nowrap',
|
|
24038
|
-
zIndex: 9999,
|
|
24039
|
-
cursor: 'pointer',
|
|
24040
|
-
userSelect: 'none',
|
|
24041
24113
|
...style,
|
|
24042
24114
|
};
|
|
24043
24115
|
// 使用 createPortal 挂载到 body
|
|
24044
|
-
return createPortal(jsx("div", {
|
|
24116
|
+
return createPortal(jsx("div", { className: classNames(styles$6.tooltip, {
|
|
24117
|
+
[styles$6.tooltipHover]: !!onClick,
|
|
24118
|
+
}), style: tooltipStyle, onClick: (e) => {
|
|
24045
24119
|
e.preventDefault();
|
|
24046
24120
|
e.stopPropagation();
|
|
24047
24121
|
onClick?.();
|
|
@@ -24187,6 +24261,7 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24187
24261
|
const [tooltipIndex, setTooltipIndex] = useState(null);
|
|
24188
24262
|
const [tooltipPos, setTooltipPos] = useState({ x: 0, y: 0 });
|
|
24189
24263
|
const [completeTooltipOpen, setCompleteTooltipOpen] = useState(false);
|
|
24264
|
+
const [moveTooltipOpen, setMoveTooltipOpen] = useState(false);
|
|
24190
24265
|
const updateTooltipPos = (target) => {
|
|
24191
24266
|
const rect = target.getBoundingClientRect();
|
|
24192
24267
|
setTooltipPos({
|
|
@@ -24326,9 +24401,12 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24326
24401
|
edgeInfo: edgeInfo,
|
|
24327
24402
|
dragType: 'new',
|
|
24328
24403
|
});
|
|
24329
|
-
//
|
|
24404
|
+
// 边上新点:insertIndex 可能与当前 selectedVertexIndex 相同(例如原选中 2,在 1-2 间插入后仍写 2),
|
|
24405
|
+
// React 会跳过 setState,依赖 selectedVertexIndex 的 useLayoutEffect 不会跑,故用微任务直接震一次
|
|
24330
24406
|
if (platform === PlatformType.H5 && editMapInfo?.elementType === DataType.OBSTACLE) {
|
|
24331
|
-
|
|
24407
|
+
void Promise.resolve().then(() => {
|
|
24408
|
+
onH5FirstSelectObstaclePoint?.();
|
|
24409
|
+
});
|
|
24332
24410
|
}
|
|
24333
24411
|
// 将新创建的点设为选中态,便于后续直接拖拽
|
|
24334
24412
|
setSelectedVertexIndex(insertIndex);
|
|
@@ -24342,6 +24420,7 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24342
24420
|
calculatePerpendicularFoot$1,
|
|
24343
24421
|
platform,
|
|
24344
24422
|
editMapInfo?.elementType,
|
|
24423
|
+
onH5FirstSelectObstaclePoint,
|
|
24345
24424
|
]);
|
|
24346
24425
|
// H5平台长按边线创建新顶点
|
|
24347
24426
|
const handleEdgeLongPressStart = useCallback((e, edgeStartIndex) => {
|
|
@@ -24451,8 +24530,8 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24451
24530
|
}, [dragState.currentPosition, checkCanNotCreateAtPosition, coordinates]);
|
|
24452
24531
|
const generateVertexClassName = useMemo(() => {
|
|
24453
24532
|
if (!dragState.isDragging)
|
|
24454
|
-
return styles$
|
|
24455
|
-
return showNotCreateCursor ? styles$
|
|
24533
|
+
return styles$7.pointerCursor;
|
|
24534
|
+
return showNotCreateCursor ? styles$7.notCreate : styles$7.dragging;
|
|
24456
24535
|
}, [dragState.isDragging, showNotCreateCursor]);
|
|
24457
24536
|
// 使用 useRef 来存储 requestAnimationFrame ID
|
|
24458
24537
|
const rafIdRef = useRef(null);
|
|
@@ -24743,7 +24822,7 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24743
24822
|
WebkitTouchCallout: 'none',
|
|
24744
24823
|
touchAction: 'none',
|
|
24745
24824
|
} })] }));
|
|
24746
|
-
})()] })), renderCoordinates.length >= 2 && (jsx("polygon", { className: canSelect ? styles$
|
|
24825
|
+
})()] })), renderCoordinates.length >= 2 && (jsx("polygon", { className: canSelect ? styles$7.pointerCursor : '', points: polygonPoints, fill: isHover ? hoverFillColor || fillColor : fillColor, fillOpacity: fillOpacity, stroke: "none" // 边框透明
|
|
24747
24826
|
, onClick: onPolygonClick })), jsx("g", { children: renderCoordinates.length >= 2 &&
|
|
24748
24827
|
pathSegments.map((segment, index) => {
|
|
24749
24828
|
if (segment.points.length < 2)
|
|
@@ -24751,14 +24830,14 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24751
24830
|
const pathData = createPathData(segment.points);
|
|
24752
24831
|
const isDash = segment.type === 1;
|
|
24753
24832
|
if (isDash && showStraddleBoundaryBorder) {
|
|
24754
|
-
return (jsx(DashPath, { className: canSelect ? styles$
|
|
24833
|
+
return (jsx(DashPath, { className: canSelect ? styles$7.polygonPath : '', points: segment.points, stroke: strokeColor, strokeWidth: isHover ? strokeWidth + 1 : strokeWidth, strokeOpacity: strokeOpacity }, index));
|
|
24755
24834
|
}
|
|
24756
24835
|
return (jsxs(Fragment, { children: [(editMode || createMode) && (jsx("path", { d: pathData, fill: "none", stroke: '#fff', strokeWidth: strokeWidth * 2, strokeOpacity: strokeOpacity, strokeLinecap: "round", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke", style: {
|
|
24757
24836
|
userSelect: 'none',
|
|
24758
24837
|
WebkitUserSelect: 'none',
|
|
24759
24838
|
WebkitTouchCallout: 'none',
|
|
24760
24839
|
touchAction: 'none',
|
|
24761
|
-
} }, 'warp' + index)), jsx("path", { d: pathData, fill: "none", stroke: strokeColor, strokeWidth: isHover ? strokeWidth + 1 : strokeWidth, strokeOpacity: strokeOpacity, strokeLinecap: "round", strokeLinejoin: "round", className: canSelect ? styles$
|
|
24840
|
+
} }, 'warp' + index)), jsx("path", { d: pathData, fill: "none", stroke: strokeColor, strokeWidth: isHover ? strokeWidth + 1 : strokeWidth, strokeOpacity: strokeOpacity, strokeLinecap: "round", strokeLinejoin: "round", className: canSelect ? styles$7.polygonPath : '', vectorEffect: "non-scaling-stroke", onClick: onPathClick, style: {
|
|
24762
24841
|
userSelect: 'none',
|
|
24763
24842
|
WebkitUserSelect: 'none',
|
|
24764
24843
|
WebkitTouchCallout: 'none',
|
|
@@ -24789,7 +24868,7 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24789
24868
|
: platform === PlatformType.H5
|
|
24790
24869
|
? strokeWidth * 2
|
|
24791
24870
|
: strokeWidth;
|
|
24792
|
-
return (jsx("line", { ...edgeLineCommon, stroke: edgeStroke, strokeWidth: edgeStrokeWidth, ...(isH5SolidHitOnly ? { strokeLinecap: 'round' } : {}), className: editMode ? styles$
|
|
24871
|
+
return (jsx("line", { ...edgeLineCommon, stroke: edgeStroke, strokeWidth: edgeStrokeWidth, ...(isH5SolidHitOnly ? { strokeLinecap: 'round' } : {}), className: editMode ? styles$7.pointerCursor : '', style: edgeLineStyle, vectorEffect: "non-scaling-stroke", ...(platform === PlatformType.H5
|
|
24793
24872
|
? {
|
|
24794
24873
|
onTouchStart: createReactEventHandler((e) => handleEdgeLongPressStart(e, index)),
|
|
24795
24874
|
onTouchEnd: createReactEventHandler(() => handleEdgeLongPressEnd()),
|
|
@@ -24859,7 +24938,7 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24859
24938
|
isDoubleClickingRef.current = false;
|
|
24860
24939
|
}, 300);
|
|
24861
24940
|
// 打开删除确认 Tooltip(仅在可编辑时)
|
|
24862
|
-
if (editMode || (createMode && completed)) {
|
|
24941
|
+
if ((editMode || (createMode && completed)) && renderCoordinates.length > 3) {
|
|
24863
24942
|
updateTooltipPos(e.target);
|
|
24864
24943
|
setTooltipIndex(idx);
|
|
24865
24944
|
}
|
|
@@ -24936,17 +25015,25 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24936
25015
|
}
|
|
24937
25016
|
}
|
|
24938
25017
|
},
|
|
24939
|
-
onMouseEnter:
|
|
24940
|
-
|
|
25018
|
+
onMouseEnter: (e) => {
|
|
25019
|
+
if (canComplete) {
|
|
24941
25020
|
setCompleteTooltipOpen(true);
|
|
25021
|
+
}
|
|
25022
|
+
if (editMode || (createMode && completed)) {
|
|
25023
|
+
setMoveTooltipOpen(true);
|
|
25024
|
+
}
|
|
25025
|
+
if (tooltipIndex === null) {
|
|
24942
25026
|
updateTooltipPos(e.target);
|
|
24943
25027
|
}
|
|
24944
|
-
|
|
24945
|
-
onMouseLeave:
|
|
24946
|
-
|
|
25028
|
+
},
|
|
25029
|
+
onMouseLeave: () => {
|
|
25030
|
+
if (canComplete) {
|
|
24947
25031
|
setCompleteTooltipOpen(false);
|
|
24948
25032
|
}
|
|
24949
|
-
|
|
25033
|
+
if (editMode || (createMode && completed)) {
|
|
25034
|
+
setMoveTooltipOpen(false);
|
|
25035
|
+
}
|
|
25036
|
+
},
|
|
24950
25037
|
}) }), platform === PlatformType.H5 && tooltipIndex === idx && coordinates.length > 3 && (jsxs("g", { transform: `translate(${coord[0] + 4 * overlayScale * 2}, ${coord[1] - 4 * overlayScale * 2}) scale(${overlayScale * 2})`, onClick: (e) => {
|
|
24951
25038
|
e.preventDefault();
|
|
24952
25039
|
e.stopPropagation();
|
|
@@ -24977,7 +25064,7 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24977
25064
|
onVertexDelete(renderCoordinates?.length - 1 - tooltipIndex);
|
|
24978
25065
|
}
|
|
24979
25066
|
setTooltipIndex(null);
|
|
24980
|
-
} })), platform === PlatformType.WEB && completeTooltipOpen && (jsx(Tooltip, { open: true, x: tooltipPos.x, y: tooltipPos.y, text: "Click to finish" }))] }));
|
|
25067
|
+
} })), platform === PlatformType.WEB && completeTooltipOpen && (jsx(Tooltip, { open: true, x: tooltipPos.x, y: tooltipPos.y, text: "Click to finish" })), platform === PlatformType.WEB && moveTooltipOpen && tooltipIndex === null && (jsx(Tooltip, { open: true, x: tooltipPos.x, y: tooltipPos.y, text: 'Drag to change' + (renderCoordinates.length > 3 ? ', double click to remove' : '') }))] }));
|
|
24981
25068
|
};
|
|
24982
25069
|
|
|
24983
25070
|
const MowPartitionContext = createContext({
|
|
@@ -28032,86 +28119,6 @@ var css_248z$1 = ".index-module_mapEdit__XC5Gw {\n position: absolute;\n left:
|
|
|
28032
28119
|
var styles$1 = {"mapEdit":"index-module_mapEdit__XC5Gw","createMode":"index-module_createMode__14EPH","notCreateCursor":"index-module_notCreateCursor__1-OjF"};
|
|
28033
28120
|
styleInject(css_248z$1);
|
|
28034
28121
|
|
|
28035
|
-
var classnames = {exports: {}};
|
|
28036
|
-
|
|
28037
|
-
/*!
|
|
28038
|
-
Copyright (c) 2018 Jed Watson.
|
|
28039
|
-
Licensed under the MIT License (MIT), see
|
|
28040
|
-
http://jedwatson.github.io/classnames
|
|
28041
|
-
*/
|
|
28042
|
-
|
|
28043
|
-
(function (module) {
|
|
28044
|
-
/* global define */
|
|
28045
|
-
|
|
28046
|
-
(function () {
|
|
28047
|
-
|
|
28048
|
-
var hasOwn = {}.hasOwnProperty;
|
|
28049
|
-
|
|
28050
|
-
function classNames () {
|
|
28051
|
-
var classes = '';
|
|
28052
|
-
|
|
28053
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
28054
|
-
var arg = arguments[i];
|
|
28055
|
-
if (arg) {
|
|
28056
|
-
classes = appendClass(classes, parseValue(arg));
|
|
28057
|
-
}
|
|
28058
|
-
}
|
|
28059
|
-
|
|
28060
|
-
return classes;
|
|
28061
|
-
}
|
|
28062
|
-
|
|
28063
|
-
function parseValue (arg) {
|
|
28064
|
-
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
28065
|
-
return arg;
|
|
28066
|
-
}
|
|
28067
|
-
|
|
28068
|
-
if (typeof arg !== 'object') {
|
|
28069
|
-
return '';
|
|
28070
|
-
}
|
|
28071
|
-
|
|
28072
|
-
if (Array.isArray(arg)) {
|
|
28073
|
-
return classNames.apply(null, arg);
|
|
28074
|
-
}
|
|
28075
|
-
|
|
28076
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
28077
|
-
return arg.toString();
|
|
28078
|
-
}
|
|
28079
|
-
|
|
28080
|
-
var classes = '';
|
|
28081
|
-
|
|
28082
|
-
for (var key in arg) {
|
|
28083
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
28084
|
-
classes = appendClass(classes, key);
|
|
28085
|
-
}
|
|
28086
|
-
}
|
|
28087
|
-
|
|
28088
|
-
return classes;
|
|
28089
|
-
}
|
|
28090
|
-
|
|
28091
|
-
function appendClass (value, newClass) {
|
|
28092
|
-
if (!newClass) {
|
|
28093
|
-
return value;
|
|
28094
|
-
}
|
|
28095
|
-
|
|
28096
|
-
if (value) {
|
|
28097
|
-
return value + ' ' + newClass;
|
|
28098
|
-
}
|
|
28099
|
-
|
|
28100
|
-
return value + newClass;
|
|
28101
|
-
}
|
|
28102
|
-
|
|
28103
|
-
if (module.exports) {
|
|
28104
|
-
classNames.default = classNames;
|
|
28105
|
-
module.exports = classNames;
|
|
28106
|
-
} else {
|
|
28107
|
-
window.classNames = classNames;
|
|
28108
|
-
}
|
|
28109
|
-
}());
|
|
28110
|
-
} (classnames));
|
|
28111
|
-
|
|
28112
|
-
var classnamesExports = classnames.exports;
|
|
28113
|
-
var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
28114
|
-
|
|
28115
28122
|
/******************************************************************************
|
|
28116
28123
|
Copyright (c) Microsoft Corporation.
|
|
28117
28124
|
|
package/dist/index.js
CHANGED
|
@@ -20068,12 +20068,12 @@ function styleInject(css, ref) {
|
|
|
20068
20068
|
}
|
|
20069
20069
|
}
|
|
20070
20070
|
|
|
20071
|
-
var css_248z$
|
|
20072
|
-
var styles$
|
|
20073
|
-
styleInject(css_248z$
|
|
20071
|
+
var css_248z$8 = ".index-module_edit__-5VvX {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n pointer-events: auto;\n z-index: 1000;\n cursor: move;\n touch-action: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n.index-module_edit__-5VvX .index-module_border__JdNLM {\n position: absolute;\n inset: -10px;\n border: 2px dashed rgb(241, 102, 41);\n border-radius: 2px;\n pointer-events: none;\n}\n.index-module_edit__-5VvX .index-module_drag__uvdPG {\n position: absolute;\n inset: -10px;\n border-radius: 2px;\n}\n.index-module_edit__-5VvX .index-module_rotate__H-KIZ {\n position: absolute;\n top: -20px;\n right: -20px;\n width: 20px;\n height: 20px;\n cursor: grab;\n z-index: 1001;\n pointer-events: auto;\n}\n.index-module_edit__-5VvX .index-module_move__mZF8s {\n position: absolute;\n bottom: -20px;\n left: -20px;\n width: 20px;\n height: 20px;\n cursor: move;\n z-index: 1001;\n pointer-events: auto;\n}";
|
|
20072
|
+
var styles$8 = {"edit":"index-module_edit__-5VvX","border":"index-module_border__JdNLM","drag":"index-module_drag__uvdPG","rotate":"index-module_rotate__H-KIZ","move":"index-module_move__mZF8s"};
|
|
20073
|
+
styleInject(css_248z$8);
|
|
20074
20074
|
|
|
20075
20075
|
const RotateHandle = ({ onRotateStart, isRotating }) => {
|
|
20076
|
-
return (jsxRuntime.jsx("div", { className: styles$
|
|
20076
|
+
return (jsxRuntime.jsx("div", { className: styles$8.rotate, onMouseDown: (e) => onRotateStart(e), onTouchStart: (e) => onRotateStart(e), style: { cursor: isRotating ? 'grabbing' : 'grab' }, dangerouslySetInnerHTML: { __html: DEFAULT_ROTATE_ICON } }));
|
|
20077
20077
|
};
|
|
20078
20078
|
|
|
20079
20079
|
/**
|
|
@@ -20150,7 +20150,7 @@ const DragHandle = ({ onDragStart, isDragging }) => {
|
|
|
20150
20150
|
if (!isMobileDevice()) {
|
|
20151
20151
|
return null;
|
|
20152
20152
|
}
|
|
20153
|
-
return (jsxRuntime.jsx("div", { className: styles$
|
|
20153
|
+
return (jsxRuntime.jsx("div", { className: styles$8.move, onMouseDown: (e) => {
|
|
20154
20154
|
onDragStart(e);
|
|
20155
20155
|
}, onTouchStart: (e) => onDragStart(e), onMouseUp: (e) => {
|
|
20156
20156
|
// onDragEnd(e);
|
|
@@ -20182,7 +20182,7 @@ const MapDrag = ({ map: _map, dragCallbacks, onBoundaryLabelsCollapse, onTransfo
|
|
|
20182
20182
|
if (!isDragMap) {
|
|
20183
20183
|
return null;
|
|
20184
20184
|
}
|
|
20185
|
-
return (jsxRuntime.jsxs("div", { ref: containerRef, className: styles$
|
|
20185
|
+
return (jsxRuntime.jsxs("div", { ref: containerRef, className: styles$8.edit, style: { cursor: isDragging ? 'grabbing' : 'move' }, children: [jsxRuntime.jsx("div", { className: styles$8.border }), canRotateMap && jsxRuntime.jsx(RotateHandle, { onRotateStart: handleRotateStart, isRotating: isRotating }), jsxRuntime.jsx("div", { className: styles$8.drag, onMouseDown: handleDragStartEvent, onTouchStart: handleDragStartEvent }), jsxRuntime.jsx(DragHandle, { onDragStart: handleDragStartEvent, isDragging: isDragging })] }));
|
|
20186
20186
|
};
|
|
20187
20187
|
|
|
20188
20188
|
const SvgEditContext = React.createContext({
|
|
@@ -23615,9 +23615,9 @@ const Magnifier = ({ visible, dragState, polygonPoints, fillColor = 'rgba(255, 1
|
|
|
23615
23615
|
return ReactDOM.createPortal(magnifierContent, document.body);
|
|
23616
23616
|
};
|
|
23617
23617
|
|
|
23618
|
-
var css_248z$
|
|
23619
|
-
var styles$
|
|
23620
|
-
styleInject(css_248z$
|
|
23618
|
+
var css_248z$7 = ".index-module_pointerCursor__Ee6pr {\n cursor: pointer;\n}\n\n.index-module_polygonPath__PynOn {\n pointer-events: stroke;\n cursor: pointer;\n}\n\n.index-module_dragging__xSFdO {\n cursor: grabbing;\n}\n\n.index-module_notCreate__bFnkV {\n cursor: no-drop;\n}";
|
|
23619
|
+
var styles$7 = {"pointerCursor":"index-module_pointerCursor__Ee6pr","polygonPath":"index-module_polygonPath__PynOn","dragging":"index-module_dragging__xSFdO","notCreate":"index-module_notCreate__bFnkV"};
|
|
23620
|
+
styleInject(css_248z$7);
|
|
23621
23621
|
|
|
23622
23622
|
/**
|
|
23623
23623
|
* 几何计算工具函数
|
|
@@ -24040,28 +24040,102 @@ const useCheckElement = () => {
|
|
|
24040
24040
|
};
|
|
24041
24041
|
};
|
|
24042
24042
|
|
|
24043
|
+
var css_248z$6 = ".Tooltip-module_tooltip__Wexlk {\n position: fixed;\n background-color: #fff;\n border-radius: 4px;\n height: 20px;\n line-height: 20px;\n font-size: 12px;\n color: #211F1F;\n padding: 0 4px;\n white-space: nowrap;\n z-index: 9999;\n cursor: pointer;\n user-select: none;\n}\n.Tooltip-module_tooltip__Wexlk.Tooltip-module_tooltipHover__Tfqme {\n height: 30px;\n padding: 5px 12px;\n}\n.Tooltip-module_tooltip__Wexlk.Tooltip-module_tooltipHover__Tfqme:hover {\n background-color: #FFEFE6;\n}";
|
|
24044
|
+
var styles$6 = {"tooltip":"Tooltip-module_tooltip__Wexlk","tooltipHover":"Tooltip-module_tooltipHover__Tfqme"};
|
|
24045
|
+
styleInject(css_248z$6);
|
|
24046
|
+
|
|
24047
|
+
var classnames = {exports: {}};
|
|
24048
|
+
|
|
24049
|
+
/*!
|
|
24050
|
+
Copyright (c) 2018 Jed Watson.
|
|
24051
|
+
Licensed under the MIT License (MIT), see
|
|
24052
|
+
http://jedwatson.github.io/classnames
|
|
24053
|
+
*/
|
|
24054
|
+
|
|
24055
|
+
(function (module) {
|
|
24056
|
+
/* global define */
|
|
24057
|
+
|
|
24058
|
+
(function () {
|
|
24059
|
+
|
|
24060
|
+
var hasOwn = {}.hasOwnProperty;
|
|
24061
|
+
|
|
24062
|
+
function classNames () {
|
|
24063
|
+
var classes = '';
|
|
24064
|
+
|
|
24065
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
24066
|
+
var arg = arguments[i];
|
|
24067
|
+
if (arg) {
|
|
24068
|
+
classes = appendClass(classes, parseValue(arg));
|
|
24069
|
+
}
|
|
24070
|
+
}
|
|
24071
|
+
|
|
24072
|
+
return classes;
|
|
24073
|
+
}
|
|
24074
|
+
|
|
24075
|
+
function parseValue (arg) {
|
|
24076
|
+
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
24077
|
+
return arg;
|
|
24078
|
+
}
|
|
24079
|
+
|
|
24080
|
+
if (typeof arg !== 'object') {
|
|
24081
|
+
return '';
|
|
24082
|
+
}
|
|
24083
|
+
|
|
24084
|
+
if (Array.isArray(arg)) {
|
|
24085
|
+
return classNames.apply(null, arg);
|
|
24086
|
+
}
|
|
24087
|
+
|
|
24088
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
24089
|
+
return arg.toString();
|
|
24090
|
+
}
|
|
24091
|
+
|
|
24092
|
+
var classes = '';
|
|
24093
|
+
|
|
24094
|
+
for (var key in arg) {
|
|
24095
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
24096
|
+
classes = appendClass(classes, key);
|
|
24097
|
+
}
|
|
24098
|
+
}
|
|
24099
|
+
|
|
24100
|
+
return classes;
|
|
24101
|
+
}
|
|
24102
|
+
|
|
24103
|
+
function appendClass (value, newClass) {
|
|
24104
|
+
if (!newClass) {
|
|
24105
|
+
return value;
|
|
24106
|
+
}
|
|
24107
|
+
|
|
24108
|
+
if (value) {
|
|
24109
|
+
return value + ' ' + newClass;
|
|
24110
|
+
}
|
|
24111
|
+
|
|
24112
|
+
return value + newClass;
|
|
24113
|
+
}
|
|
24114
|
+
|
|
24115
|
+
if (module.exports) {
|
|
24116
|
+
classNames.default = classNames;
|
|
24117
|
+
module.exports = classNames;
|
|
24118
|
+
} else {
|
|
24119
|
+
window.classNames = classNames;
|
|
24120
|
+
}
|
|
24121
|
+
}());
|
|
24122
|
+
} (classnames));
|
|
24123
|
+
|
|
24124
|
+
var classnamesExports = classnames.exports;
|
|
24125
|
+
var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
24126
|
+
|
|
24043
24127
|
const Tooltip = ({ open, x, y, text, style, onClick }) => {
|
|
24044
24128
|
if (!open)
|
|
24045
24129
|
return null;
|
|
24046
24130
|
const tooltipStyle = {
|
|
24047
|
-
position: 'fixed',
|
|
24048
24131
|
left: x,
|
|
24049
24132
|
top: y,
|
|
24050
|
-
backgroundColor: '#fff',
|
|
24051
|
-
borderRadius: '4px',
|
|
24052
|
-
height: '20px',
|
|
24053
|
-
lineHeight: '16px',
|
|
24054
|
-
fontSize: '12px',
|
|
24055
|
-
color: '#211F1F',
|
|
24056
|
-
padding: '2px 4px',
|
|
24057
|
-
whiteSpace: 'nowrap',
|
|
24058
|
-
zIndex: 9999,
|
|
24059
|
-
cursor: 'pointer',
|
|
24060
|
-
userSelect: 'none',
|
|
24061
24133
|
...style,
|
|
24062
24134
|
};
|
|
24063
24135
|
// 使用 createPortal 挂载到 body
|
|
24064
|
-
return ReactDOM.createPortal(jsxRuntime.jsx("div", {
|
|
24136
|
+
return ReactDOM.createPortal(jsxRuntime.jsx("div", { className: classNames(styles$6.tooltip, {
|
|
24137
|
+
[styles$6.tooltipHover]: !!onClick,
|
|
24138
|
+
}), style: tooltipStyle, onClick: (e) => {
|
|
24065
24139
|
e.preventDefault();
|
|
24066
24140
|
e.stopPropagation();
|
|
24067
24141
|
onClick?.();
|
|
@@ -24207,6 +24281,7 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24207
24281
|
const [tooltipIndex, setTooltipIndex] = React.useState(null);
|
|
24208
24282
|
const [tooltipPos, setTooltipPos] = React.useState({ x: 0, y: 0 });
|
|
24209
24283
|
const [completeTooltipOpen, setCompleteTooltipOpen] = React.useState(false);
|
|
24284
|
+
const [moveTooltipOpen, setMoveTooltipOpen] = React.useState(false);
|
|
24210
24285
|
const updateTooltipPos = (target) => {
|
|
24211
24286
|
const rect = target.getBoundingClientRect();
|
|
24212
24287
|
setTooltipPos({
|
|
@@ -24346,9 +24421,12 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24346
24421
|
edgeInfo: edgeInfo,
|
|
24347
24422
|
dragType: 'new',
|
|
24348
24423
|
});
|
|
24349
|
-
//
|
|
24424
|
+
// 边上新点:insertIndex 可能与当前 selectedVertexIndex 相同(例如原选中 2,在 1-2 间插入后仍写 2),
|
|
24425
|
+
// React 会跳过 setState,依赖 selectedVertexIndex 的 useLayoutEffect 不会跑,故用微任务直接震一次
|
|
24350
24426
|
if (platform === exports.PlatformType.H5 && editMapInfo?.elementType === exports.DataType.OBSTACLE) {
|
|
24351
|
-
|
|
24427
|
+
void Promise.resolve().then(() => {
|
|
24428
|
+
onH5FirstSelectObstaclePoint?.();
|
|
24429
|
+
});
|
|
24352
24430
|
}
|
|
24353
24431
|
// 将新创建的点设为选中态,便于后续直接拖拽
|
|
24354
24432
|
setSelectedVertexIndex(insertIndex);
|
|
@@ -24362,6 +24440,7 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24362
24440
|
calculatePerpendicularFoot$1,
|
|
24363
24441
|
platform,
|
|
24364
24442
|
editMapInfo?.elementType,
|
|
24443
|
+
onH5FirstSelectObstaclePoint,
|
|
24365
24444
|
]);
|
|
24366
24445
|
// H5平台长按边线创建新顶点
|
|
24367
24446
|
const handleEdgeLongPressStart = React.useCallback((e, edgeStartIndex) => {
|
|
@@ -24471,8 +24550,8 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24471
24550
|
}, [dragState.currentPosition, checkCanNotCreateAtPosition, coordinates]);
|
|
24472
24551
|
const generateVertexClassName = React.useMemo(() => {
|
|
24473
24552
|
if (!dragState.isDragging)
|
|
24474
|
-
return styles$
|
|
24475
|
-
return showNotCreateCursor ? styles$
|
|
24553
|
+
return styles$7.pointerCursor;
|
|
24554
|
+
return showNotCreateCursor ? styles$7.notCreate : styles$7.dragging;
|
|
24476
24555
|
}, [dragState.isDragging, showNotCreateCursor]);
|
|
24477
24556
|
// 使用 useRef 来存储 requestAnimationFrame ID
|
|
24478
24557
|
const rafIdRef = React.useRef(null);
|
|
@@ -24763,7 +24842,7 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24763
24842
|
WebkitTouchCallout: 'none',
|
|
24764
24843
|
touchAction: 'none',
|
|
24765
24844
|
} })] }));
|
|
24766
|
-
})()] })), renderCoordinates.length >= 2 && (jsxRuntime.jsx("polygon", { className: canSelect ? styles$
|
|
24845
|
+
})()] })), renderCoordinates.length >= 2 && (jsxRuntime.jsx("polygon", { className: canSelect ? styles$7.pointerCursor : '', points: polygonPoints, fill: isHover ? hoverFillColor || fillColor : fillColor, fillOpacity: fillOpacity, stroke: "none" // 边框透明
|
|
24767
24846
|
, onClick: onPolygonClick })), jsxRuntime.jsx("g", { children: renderCoordinates.length >= 2 &&
|
|
24768
24847
|
pathSegments.map((segment, index) => {
|
|
24769
24848
|
if (segment.points.length < 2)
|
|
@@ -24771,14 +24850,14 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24771
24850
|
const pathData = createPathData(segment.points);
|
|
24772
24851
|
const isDash = segment.type === 1;
|
|
24773
24852
|
if (isDash && showStraddleBoundaryBorder) {
|
|
24774
|
-
return (jsxRuntime.jsx(DashPath, { className: canSelect ? styles$
|
|
24853
|
+
return (jsxRuntime.jsx(DashPath, { className: canSelect ? styles$7.polygonPath : '', points: segment.points, stroke: strokeColor, strokeWidth: isHover ? strokeWidth + 1 : strokeWidth, strokeOpacity: strokeOpacity }, index));
|
|
24775
24854
|
}
|
|
24776
24855
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [(editMode || createMode) && (jsxRuntime.jsx("path", { d: pathData, fill: "none", stroke: '#fff', strokeWidth: strokeWidth * 2, strokeOpacity: strokeOpacity, strokeLinecap: "round", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke", style: {
|
|
24777
24856
|
userSelect: 'none',
|
|
24778
24857
|
WebkitUserSelect: 'none',
|
|
24779
24858
|
WebkitTouchCallout: 'none',
|
|
24780
24859
|
touchAction: 'none',
|
|
24781
|
-
} }, 'warp' + index)), jsxRuntime.jsx("path", { d: pathData, fill: "none", stroke: strokeColor, strokeWidth: isHover ? strokeWidth + 1 : strokeWidth, strokeOpacity: strokeOpacity, strokeLinecap: "round", strokeLinejoin: "round", className: canSelect ? styles$
|
|
24860
|
+
} }, 'warp' + index)), jsxRuntime.jsx("path", { d: pathData, fill: "none", stroke: strokeColor, strokeWidth: isHover ? strokeWidth + 1 : strokeWidth, strokeOpacity: strokeOpacity, strokeLinecap: "round", strokeLinejoin: "round", className: canSelect ? styles$7.polygonPath : '', vectorEffect: "non-scaling-stroke", onClick: onPathClick, style: {
|
|
24782
24861
|
userSelect: 'none',
|
|
24783
24862
|
WebkitUserSelect: 'none',
|
|
24784
24863
|
WebkitTouchCallout: 'none',
|
|
@@ -24809,7 +24888,7 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24809
24888
|
: platform === exports.PlatformType.H5
|
|
24810
24889
|
? strokeWidth * 2
|
|
24811
24890
|
: strokeWidth;
|
|
24812
|
-
return (jsxRuntime.jsx("line", { ...edgeLineCommon, stroke: edgeStroke, strokeWidth: edgeStrokeWidth, ...(isH5SolidHitOnly ? { strokeLinecap: 'round' } : {}), className: editMode ? styles$
|
|
24891
|
+
return (jsxRuntime.jsx("line", { ...edgeLineCommon, stroke: edgeStroke, strokeWidth: edgeStrokeWidth, ...(isH5SolidHitOnly ? { strokeLinecap: 'round' } : {}), className: editMode ? styles$7.pointerCursor : '', style: edgeLineStyle, vectorEffect: "non-scaling-stroke", ...(platform === exports.PlatformType.H5
|
|
24813
24892
|
? {
|
|
24814
24893
|
onTouchStart: createReactEventHandler((e) => handleEdgeLongPressStart(e, index)),
|
|
24815
24894
|
onTouchEnd: createReactEventHandler(() => handleEdgeLongPressEnd()),
|
|
@@ -24879,7 +24958,7 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24879
24958
|
isDoubleClickingRef.current = false;
|
|
24880
24959
|
}, 300);
|
|
24881
24960
|
// 打开删除确认 Tooltip(仅在可编辑时)
|
|
24882
|
-
if (editMode || (createMode && completed)) {
|
|
24961
|
+
if ((editMode || (createMode && completed)) && renderCoordinates.length > 3) {
|
|
24883
24962
|
updateTooltipPos(e.target);
|
|
24884
24963
|
setTooltipIndex(idx);
|
|
24885
24964
|
}
|
|
@@ -24956,17 +25035,25 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24956
25035
|
}
|
|
24957
25036
|
}
|
|
24958
25037
|
},
|
|
24959
|
-
onMouseEnter:
|
|
24960
|
-
|
|
25038
|
+
onMouseEnter: (e) => {
|
|
25039
|
+
if (canComplete) {
|
|
24961
25040
|
setCompleteTooltipOpen(true);
|
|
25041
|
+
}
|
|
25042
|
+
if (editMode || (createMode && completed)) {
|
|
25043
|
+
setMoveTooltipOpen(true);
|
|
25044
|
+
}
|
|
25045
|
+
if (tooltipIndex === null) {
|
|
24962
25046
|
updateTooltipPos(e.target);
|
|
24963
25047
|
}
|
|
24964
|
-
|
|
24965
|
-
onMouseLeave:
|
|
24966
|
-
|
|
25048
|
+
},
|
|
25049
|
+
onMouseLeave: () => {
|
|
25050
|
+
if (canComplete) {
|
|
24967
25051
|
setCompleteTooltipOpen(false);
|
|
24968
25052
|
}
|
|
24969
|
-
|
|
25053
|
+
if (editMode || (createMode && completed)) {
|
|
25054
|
+
setMoveTooltipOpen(false);
|
|
25055
|
+
}
|
|
25056
|
+
},
|
|
24970
25057
|
}) }), platform === exports.PlatformType.H5 && tooltipIndex === idx && coordinates.length > 3 && (jsxRuntime.jsxs("g", { transform: `translate(${coord[0] + 4 * overlayScale * 2}, ${coord[1] - 4 * overlayScale * 2}) scale(${overlayScale * 2})`, onClick: (e) => {
|
|
24971
25058
|
e.preventDefault();
|
|
24972
25059
|
e.stopPropagation();
|
|
@@ -24997,7 +25084,7 @@ const PolygonElement = ({ canSelect = false, isHover = false, points, fillColor
|
|
|
24997
25084
|
onVertexDelete(renderCoordinates?.length - 1 - tooltipIndex);
|
|
24998
25085
|
}
|
|
24999
25086
|
setTooltipIndex(null);
|
|
25000
|
-
} })), platform === exports.PlatformType.WEB && completeTooltipOpen && (jsxRuntime.jsx(Tooltip, { open: true, x: tooltipPos.x, y: tooltipPos.y, text: "Click to finish" }))] }));
|
|
25087
|
+
} })), platform === exports.PlatformType.WEB && completeTooltipOpen && (jsxRuntime.jsx(Tooltip, { open: true, x: tooltipPos.x, y: tooltipPos.y, text: "Click to finish" })), platform === exports.PlatformType.WEB && moveTooltipOpen && tooltipIndex === null && (jsxRuntime.jsx(Tooltip, { open: true, x: tooltipPos.x, y: tooltipPos.y, text: 'Drag to change' + (renderCoordinates.length > 3 ? ', double click to remove' : '') }))] }));
|
|
25001
25088
|
};
|
|
25002
25089
|
|
|
25003
25090
|
const MowPartitionContext = React.createContext({
|
|
@@ -28052,86 +28139,6 @@ var css_248z$1 = ".index-module_mapEdit__XC5Gw {\n position: absolute;\n left:
|
|
|
28052
28139
|
var styles$1 = {"mapEdit":"index-module_mapEdit__XC5Gw","createMode":"index-module_createMode__14EPH","notCreateCursor":"index-module_notCreateCursor__1-OjF"};
|
|
28053
28140
|
styleInject(css_248z$1);
|
|
28054
28141
|
|
|
28055
|
-
var classnames = {exports: {}};
|
|
28056
|
-
|
|
28057
|
-
/*!
|
|
28058
|
-
Copyright (c) 2018 Jed Watson.
|
|
28059
|
-
Licensed under the MIT License (MIT), see
|
|
28060
|
-
http://jedwatson.github.io/classnames
|
|
28061
|
-
*/
|
|
28062
|
-
|
|
28063
|
-
(function (module) {
|
|
28064
|
-
/* global define */
|
|
28065
|
-
|
|
28066
|
-
(function () {
|
|
28067
|
-
|
|
28068
|
-
var hasOwn = {}.hasOwnProperty;
|
|
28069
|
-
|
|
28070
|
-
function classNames () {
|
|
28071
|
-
var classes = '';
|
|
28072
|
-
|
|
28073
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
28074
|
-
var arg = arguments[i];
|
|
28075
|
-
if (arg) {
|
|
28076
|
-
classes = appendClass(classes, parseValue(arg));
|
|
28077
|
-
}
|
|
28078
|
-
}
|
|
28079
|
-
|
|
28080
|
-
return classes;
|
|
28081
|
-
}
|
|
28082
|
-
|
|
28083
|
-
function parseValue (arg) {
|
|
28084
|
-
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
28085
|
-
return arg;
|
|
28086
|
-
}
|
|
28087
|
-
|
|
28088
|
-
if (typeof arg !== 'object') {
|
|
28089
|
-
return '';
|
|
28090
|
-
}
|
|
28091
|
-
|
|
28092
|
-
if (Array.isArray(arg)) {
|
|
28093
|
-
return classNames.apply(null, arg);
|
|
28094
|
-
}
|
|
28095
|
-
|
|
28096
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
28097
|
-
return arg.toString();
|
|
28098
|
-
}
|
|
28099
|
-
|
|
28100
|
-
var classes = '';
|
|
28101
|
-
|
|
28102
|
-
for (var key in arg) {
|
|
28103
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
28104
|
-
classes = appendClass(classes, key);
|
|
28105
|
-
}
|
|
28106
|
-
}
|
|
28107
|
-
|
|
28108
|
-
return classes;
|
|
28109
|
-
}
|
|
28110
|
-
|
|
28111
|
-
function appendClass (value, newClass) {
|
|
28112
|
-
if (!newClass) {
|
|
28113
|
-
return value;
|
|
28114
|
-
}
|
|
28115
|
-
|
|
28116
|
-
if (value) {
|
|
28117
|
-
return value + ' ' + newClass;
|
|
28118
|
-
}
|
|
28119
|
-
|
|
28120
|
-
return value + newClass;
|
|
28121
|
-
}
|
|
28122
|
-
|
|
28123
|
-
if (module.exports) {
|
|
28124
|
-
classNames.default = classNames;
|
|
28125
|
-
module.exports = classNames;
|
|
28126
|
-
} else {
|
|
28127
|
-
window.classNames = classNames;
|
|
28128
|
-
}
|
|
28129
|
-
}());
|
|
28130
|
-
} (classnames));
|
|
28131
|
-
|
|
28132
|
-
var classnamesExports = classnames.exports;
|
|
28133
|
-
var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
28134
|
-
|
|
28135
28142
|
/******************************************************************************
|
|
28136
28143
|
Copyright (c) Microsoft Corporation.
|
|
28137
28144
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../../src/render/svgElement/PolygonELement/components/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../../src/render/svgElement/PolygonELement/components/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,UAAU,YAAY;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA2BnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","source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