@fleet-frontend/mower-maps 0.2.0-beta.7 → 0.2.0-beta.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/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ export { default as MowerMapRenderer } from './render/MowerMapRenderer';
|
|
|
2
2
|
export { default as BoundarySvgRender } from './render/BoundarySvgRender';
|
|
3
3
|
export type { MapConfig, AntennaConfig, MowerPositionConfig, MowerMapRendererProps, MowerMapRendererRef, DragState, DragCallbacks, } from './types/renderer';
|
|
4
4
|
export type { PathConfig } from './types/processor';
|
|
5
|
-
export {
|
|
5
|
+
export { CreateStatus, MobileEditMode, RecordTypeEnum, RecordFunctionEnum, } from './context/mapEdit';
|
|
6
|
+
export type { EditMapInfo, ElementRecordParams } from './context/mapEdit';
|
|
6
7
|
export type { MapData, SubMap, MapElement, BoundaryData, ObstacleData, VisionOffData, DoodleData, TunnelData, } from './types';
|
|
7
8
|
export type { MapBounds, Point } from './types/utils';
|
|
8
9
|
export { MapDataProcessor, PathDataProcessor } from './processor';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG1E,YAAY,EACV,SAAS,EACT,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,SAAS,EACT,aAAa,GACd,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG1E,YAAY,EACV,SAAS,EACT,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,SAAS,EACT,aAAa,GACd,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAG1E,YAAY,EACV,OAAO,EACP,MAAM,EACN,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,UAAU,EACV,UAAU,GACX,MAAM,SAAS,CAAC;AAGjB,YAAY,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAElE,YAAY,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,aAAa,CAAC;AAEhE,cAAc,aAAa,CAAC;AAG5B,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG1D,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/index.esm.js
CHANGED
|
@@ -291,7 +291,7 @@ function initObstacle() {
|
|
|
291
291
|
const obstacle = {
|
|
292
292
|
id: null,
|
|
293
293
|
area: 0,
|
|
294
|
-
name: '
|
|
294
|
+
name: 'off-imit island',
|
|
295
295
|
status: 1,
|
|
296
296
|
end_timestamp: 0,
|
|
297
297
|
start_timestamp: 0,
|
|
@@ -16282,11 +16282,11 @@ const BoundaryElement = ({ data }) => {
|
|
|
16282
16282
|
*/
|
|
16283
16283
|
const strokeWidth = useMemo(() => {
|
|
16284
16284
|
// 如果是h5选中的情况下,边界需要加粗
|
|
16285
|
-
if (
|
|
16285
|
+
if (editMapInfo?.selectElement?.id === data.id) {
|
|
16286
16286
|
return dp2px((style.lineWidth || 3) * 2);
|
|
16287
16287
|
}
|
|
16288
16288
|
return dp2px(style.lineWidth || 3);
|
|
16289
|
-
}, [
|
|
16289
|
+
}, [style, editMapInfo]);
|
|
16290
16290
|
/**
|
|
16291
16291
|
* 点击边界的回调
|
|
16292
16292
|
*/
|
|
@@ -18371,23 +18371,19 @@ var classnamesExports = classnames.exports;
|
|
|
18371
18371
|
var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
18372
18372
|
|
|
18373
18373
|
const ChannelClipPath = React__default.memo(() => {
|
|
18374
|
-
const {
|
|
18374
|
+
const { svgViewBox } = useCommonContext();
|
|
18375
|
+
const { svgElementDatas } = useSvgEditContext();
|
|
18375
18376
|
const boundaryData = svgElementDatas?.[DataType.BOUNDARY] || [];
|
|
18376
18377
|
const [minX, minY, maxX, maxY] = useMemo(() => {
|
|
18377
|
-
const baseVal =
|
|
18378
|
+
const baseVal = svgViewBox;
|
|
18378
18379
|
return [
|
|
18379
18380
|
baseVal?.x || 0,
|
|
18380
18381
|
baseVal?.y || 0,
|
|
18381
18382
|
baseVal?.x + (baseVal?.width || 0),
|
|
18382
18383
|
baseVal?.y + (baseVal?.height || 0),
|
|
18383
18384
|
];
|
|
18384
|
-
}, [
|
|
18385
|
-
|
|
18386
|
-
svgRef?.viewBox.baseVal?.y,
|
|
18387
|
-
svgRef?.viewBox.baseVal?.width,
|
|
18388
|
-
svgRef?.viewBox.baseVal?.height,
|
|
18389
|
-
]);
|
|
18390
|
-
console.log('boundaryData---->', svgRef?.viewBox.baseVal);
|
|
18385
|
+
}, [svgViewBox]);
|
|
18386
|
+
console.log('boundaryData---->', svgViewBox);
|
|
18391
18387
|
/**
|
|
18392
18388
|
* 判断多边形是否为逆时针方向
|
|
18393
18389
|
* 使用叉积法计算多边形的有向面积
|
|
@@ -18547,6 +18543,7 @@ const ChannelClipPath = React__default.memo(() => {
|
|
|
18547
18543
|
if (partitionCoords.length >= 3) {
|
|
18548
18544
|
// 判断方向并构建路径
|
|
18549
18545
|
const isclockwise = isCounterclockwise(partitionCoords);
|
|
18546
|
+
console.log('partitionCoords===', partitionCoords, isclockwise);
|
|
18550
18547
|
const partitionPath = buildPathData(partitionCoords, isclockwise);
|
|
18551
18548
|
baseD += ` ${partitionPath}`;
|
|
18552
18549
|
}
|
package/dist/index.js
CHANGED
|
@@ -311,7 +311,7 @@ function initObstacle() {
|
|
|
311
311
|
const obstacle = {
|
|
312
312
|
id: null,
|
|
313
313
|
area: 0,
|
|
314
|
-
name: '
|
|
314
|
+
name: 'off-imit island',
|
|
315
315
|
status: 1,
|
|
316
316
|
end_timestamp: 0,
|
|
317
317
|
start_timestamp: 0,
|
|
@@ -16302,11 +16302,11 @@ const BoundaryElement = ({ data }) => {
|
|
|
16302
16302
|
*/
|
|
16303
16303
|
const strokeWidth = React.useMemo(() => {
|
|
16304
16304
|
// 如果是h5选中的情况下,边界需要加粗
|
|
16305
|
-
if (
|
|
16305
|
+
if (editMapInfo?.selectElement?.id === data.id) {
|
|
16306
16306
|
return dp2px((style.lineWidth || 3) * 2);
|
|
16307
16307
|
}
|
|
16308
16308
|
return dp2px(style.lineWidth || 3);
|
|
16309
|
-
}, [
|
|
16309
|
+
}, [style, editMapInfo]);
|
|
16310
16310
|
/**
|
|
16311
16311
|
* 点击边界的回调
|
|
16312
16312
|
*/
|
|
@@ -18391,23 +18391,19 @@ var classnamesExports = classnames.exports;
|
|
|
18391
18391
|
var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
18392
18392
|
|
|
18393
18393
|
const ChannelClipPath = React.memo(() => {
|
|
18394
|
-
const {
|
|
18394
|
+
const { svgViewBox } = useCommonContext();
|
|
18395
|
+
const { svgElementDatas } = useSvgEditContext();
|
|
18395
18396
|
const boundaryData = svgElementDatas?.[exports.DataType.BOUNDARY] || [];
|
|
18396
18397
|
const [minX, minY, maxX, maxY] = React.useMemo(() => {
|
|
18397
|
-
const baseVal =
|
|
18398
|
+
const baseVal = svgViewBox;
|
|
18398
18399
|
return [
|
|
18399
18400
|
baseVal?.x || 0,
|
|
18400
18401
|
baseVal?.y || 0,
|
|
18401
18402
|
baseVal?.x + (baseVal?.width || 0),
|
|
18402
18403
|
baseVal?.y + (baseVal?.height || 0),
|
|
18403
18404
|
];
|
|
18404
|
-
}, [
|
|
18405
|
-
|
|
18406
|
-
svgRef?.viewBox.baseVal?.y,
|
|
18407
|
-
svgRef?.viewBox.baseVal?.width,
|
|
18408
|
-
svgRef?.viewBox.baseVal?.height,
|
|
18409
|
-
]);
|
|
18410
|
-
console.log('boundaryData---->', svgRef?.viewBox.baseVal);
|
|
18405
|
+
}, [svgViewBox]);
|
|
18406
|
+
console.log('boundaryData---->', svgViewBox);
|
|
18411
18407
|
/**
|
|
18412
18408
|
* 判断多边形是否为逆时针方向
|
|
18413
18409
|
* 使用叉积法计算多边形的有向面积
|
|
@@ -18567,6 +18563,7 @@ const ChannelClipPath = React.memo(() => {
|
|
|
18567
18563
|
if (partitionCoords.length >= 3) {
|
|
18568
18564
|
// 判断方向并构建路径
|
|
18569
18565
|
const isclockwise = isCounterclockwise(partitionCoords);
|
|
18566
|
+
console.log('partitionCoords===', partitionCoords, isclockwise);
|
|
18570
18567
|
const partitionPath = buildPathData(partitionCoords, isclockwise);
|
|
18571
18568
|
baseD += ` ${partitionPath}`;
|
|
18572
18569
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/render/svgElement/ChannelClipPath/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/render/svgElement/ChannelClipPath/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,QAAA,MAAM,eAAe,0EAiNnB,CAAC;AAEH,eAAe,eAAe,CAAC"}
|