@fleet-frontend/mower-maps 0.2.5-beta.10 → 0.2.5-beta.11

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
@@ -23197,7 +23197,7 @@ const useChargingPile = ({ viewBox, rotation = 0 }) => {
23197
23197
  return items;
23198
23198
  };
23199
23199
 
23200
- const CharginPile = React__default.memo(({ viewBox, rotation = 0, sizeScale = 1, sizeInSvgUnits = false, isHighlight = true, }) => {
23200
+ const CharginPile = React__default.memo(({ viewBox, rotation = 0, sizeScale = 1, sizeInSvgUnits = false, minDisplaySizePx, isHighlight = true, }) => {
23201
23201
  const items = useChargingPile({ viewBox: viewBox || null, rotation });
23202
23202
  const containerStyle = useMemo(() => ({
23203
23203
  position: 'absolute',
@@ -23209,13 +23209,18 @@ const CharginPile = React__default.memo(({ viewBox, rotation = 0, sizeScale = 1,
23209
23209
  zIndex: 750,
23210
23210
  opacity: isHighlight ? SvgMapOpacity.HIGHLIGHT : SvgMapOpacity.UN_HIGHLIGHT,
23211
23211
  }), [isHighlight]);
23212
+ const useMinPx = Boolean(sizeInSvgUnits && viewBox && minDisplaySizePx != null && minDisplaySizePx > 0);
23212
23213
  return (jsx("div", { style: containerStyle, children: items?.map((item, idx) => (jsx("div", { className: "charging-pile", style: {
23213
23214
  position: 'absolute',
23214
23215
  width: sizeInSvgUnits && viewBox
23215
- ? `${(item.size / Math.max(viewBox.width, 1)) * 100 * sizeScale}%`
23216
+ ? useMinPx
23217
+ ? `max(${minDisplaySizePx}px, ${(item.size / Math.max(viewBox.width, 1)) * 100 * sizeScale}%)`
23218
+ : `${(item.size / Math.max(viewBox.width, 1)) * 100 * sizeScale}%`
23216
23219
  : item.size * sizeScale,
23217
23220
  height: sizeInSvgUnits && viewBox
23218
- ? `${(item.size / Math.max(viewBox.height, 1)) * 100 * sizeScale}%`
23221
+ ? useMinPx
23222
+ ? `max(${minDisplaySizePx}px, ${(item.size / Math.max(viewBox.height, 1)) * 100 * sizeScale}%)`
23223
+ : `${(item.size / Math.max(viewBox.height, 1)) * 100 * sizeScale}%`
23219
23224
  : item.size * sizeScale,
23220
23225
  left: `${item.leftPct}%`,
23221
23226
  top: `${item.topPct}%`,
@@ -23228,6 +23233,8 @@ const CharginPile = React__default.memo(({ viewBox, rotation = 0, sizeScale = 1,
23228
23233
  const MAX_STATIC_SIZE = 640;
23229
23234
  const MAX_STATIC_MAP_RETRY = 3;
23230
23235
  const STATIC_MAP_RETRY_COOLDOWN_MS = 5000;
23236
+ /** 放大镜内充电桩屏幕像素下限,避免过小导致通道与桩视觉错位 */
23237
+ const MAGNIFIER_CHARGING_PILE_MIN_DISPLAY_PX = 20;
23231
23238
  const Magnifier = ({ visible, dragState, polygonPoints, fillColor = 'rgba(255, 122, 51, 0.1)', strokeColor = 'rgba(255, 122, 51, 1)', strokeWidth = 2, zoom = 3, size = 200, }) => {
23232
23239
  const { svgViewBox, mapRef, googleMapStaticApiKey, drag } = useCommonContext();
23233
23240
  const { svgElementDatas, svgRef } = useSvgEditContext();
@@ -23581,7 +23588,7 @@ const Magnifier = ({ visible, dragState, polygonPoints, fillColor = 'rgba(255, 1
23581
23588
  ? 3.6 / styleZoomFactor
23582
23589
  : 3 / styleZoomFactor;
23583
23590
  return (jsx("circle", { cx: x, cy: y, r: pointRadius, fill: pointFill, stroke: pointStroke, strokeWidth: pointStrokeWidth }, idx));
23584
- })] })), dragState.dragType === 'new' && dragState.edgeInfo && (jsx(Fragment, { children: jsx("line", { x1: dragState.edgeInfo.startPoint.x, y1: dragState.edgeInfo.startPoint.y, x2: dragState.edgeInfo.endPoint.x, y2: dragState.edgeInfo.endPoint.y, stroke: "#999", strokeWidth: (strokeWidth * 3.2) / styleZoomFactor, strokeDasharray: `${6 / styleZoomFactor},${6 / styleZoomFactor}` }) }))] }), jsx(CharginPile, { viewBox: magnifierViewBox || null, rotation: actureRotate, sizeInSvgUnits: true,
23591
+ })] })), dragState.dragType === 'new' && dragState.edgeInfo && (jsx(Fragment, { children: jsx("line", { x1: dragState.edgeInfo.startPoint.x, y1: dragState.edgeInfo.startPoint.y, x2: dragState.edgeInfo.endPoint.x, y2: dragState.edgeInfo.endPoint.y, stroke: "#999", strokeWidth: (strokeWidth * 3.2) / styleZoomFactor, strokeDasharray: `${6 / styleZoomFactor},${6 / styleZoomFactor}` }) }))] }), jsx(CharginPile, { viewBox: magnifierViewBox || null, rotation: actureRotate, sizeInSvgUnits: true, minDisplaySizePx: MAGNIFIER_CHARGING_PILE_MIN_DISPLAY_PX,
23585
23592
  // 充电桩最多保持原始尺寸,不允许放大超过 1 倍
23586
23593
  sizeScale: Math.min(1, 1 / styleZoomFactor) })] }));
23587
23594
  // 使用 Portal 渲染到 body,避免层级问题
package/dist/index.js CHANGED
@@ -23217,7 +23217,7 @@ const useChargingPile = ({ viewBox, rotation = 0 }) => {
23217
23217
  return items;
23218
23218
  };
23219
23219
 
23220
- const CharginPile = React.memo(({ viewBox, rotation = 0, sizeScale = 1, sizeInSvgUnits = false, isHighlight = true, }) => {
23220
+ const CharginPile = React.memo(({ viewBox, rotation = 0, sizeScale = 1, sizeInSvgUnits = false, minDisplaySizePx, isHighlight = true, }) => {
23221
23221
  const items = useChargingPile({ viewBox: viewBox || null, rotation });
23222
23222
  const containerStyle = React.useMemo(() => ({
23223
23223
  position: 'absolute',
@@ -23229,13 +23229,18 @@ const CharginPile = React.memo(({ viewBox, rotation = 0, sizeScale = 1, sizeInSv
23229
23229
  zIndex: 750,
23230
23230
  opacity: isHighlight ? SvgMapOpacity.HIGHLIGHT : SvgMapOpacity.UN_HIGHLIGHT,
23231
23231
  }), [isHighlight]);
23232
+ const useMinPx = Boolean(sizeInSvgUnits && viewBox && minDisplaySizePx != null && minDisplaySizePx > 0);
23232
23233
  return (jsxRuntime.jsx("div", { style: containerStyle, children: items?.map((item, idx) => (jsxRuntime.jsx("div", { className: "charging-pile", style: {
23233
23234
  position: 'absolute',
23234
23235
  width: sizeInSvgUnits && viewBox
23235
- ? `${(item.size / Math.max(viewBox.width, 1)) * 100 * sizeScale}%`
23236
+ ? useMinPx
23237
+ ? `max(${minDisplaySizePx}px, ${(item.size / Math.max(viewBox.width, 1)) * 100 * sizeScale}%)`
23238
+ : `${(item.size / Math.max(viewBox.width, 1)) * 100 * sizeScale}%`
23236
23239
  : item.size * sizeScale,
23237
23240
  height: sizeInSvgUnits && viewBox
23238
- ? `${(item.size / Math.max(viewBox.height, 1)) * 100 * sizeScale}%`
23241
+ ? useMinPx
23242
+ ? `max(${minDisplaySizePx}px, ${(item.size / Math.max(viewBox.height, 1)) * 100 * sizeScale}%)`
23243
+ : `${(item.size / Math.max(viewBox.height, 1)) * 100 * sizeScale}%`
23239
23244
  : item.size * sizeScale,
23240
23245
  left: `${item.leftPct}%`,
23241
23246
  top: `${item.topPct}%`,
@@ -23248,6 +23253,8 @@ const CharginPile = React.memo(({ viewBox, rotation = 0, sizeScale = 1, sizeInSv
23248
23253
  const MAX_STATIC_SIZE = 640;
23249
23254
  const MAX_STATIC_MAP_RETRY = 3;
23250
23255
  const STATIC_MAP_RETRY_COOLDOWN_MS = 5000;
23256
+ /** 放大镜内充电桩屏幕像素下限,避免过小导致通道与桩视觉错位 */
23257
+ const MAGNIFIER_CHARGING_PILE_MIN_DISPLAY_PX = 20;
23251
23258
  const Magnifier = ({ visible, dragState, polygonPoints, fillColor = 'rgba(255, 122, 51, 0.1)', strokeColor = 'rgba(255, 122, 51, 1)', strokeWidth = 2, zoom = 3, size = 200, }) => {
23252
23259
  const { svgViewBox, mapRef, googleMapStaticApiKey, drag } = useCommonContext();
23253
23260
  const { svgElementDatas, svgRef } = useSvgEditContext();
@@ -23601,7 +23608,7 @@ const Magnifier = ({ visible, dragState, polygonPoints, fillColor = 'rgba(255, 1
23601
23608
  ? 3.6 / styleZoomFactor
23602
23609
  : 3 / styleZoomFactor;
23603
23610
  return (jsxRuntime.jsx("circle", { cx: x, cy: y, r: pointRadius, fill: pointFill, stroke: pointStroke, strokeWidth: pointStrokeWidth }, idx));
23604
- })] })), dragState.dragType === 'new' && dragState.edgeInfo && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx("line", { x1: dragState.edgeInfo.startPoint.x, y1: dragState.edgeInfo.startPoint.y, x2: dragState.edgeInfo.endPoint.x, y2: dragState.edgeInfo.endPoint.y, stroke: "#999", strokeWidth: (strokeWidth * 3.2) / styleZoomFactor, strokeDasharray: `${6 / styleZoomFactor},${6 / styleZoomFactor}` }) }))] }), jsxRuntime.jsx(CharginPile, { viewBox: magnifierViewBox || null, rotation: actureRotate, sizeInSvgUnits: true,
23611
+ })] })), dragState.dragType === 'new' && dragState.edgeInfo && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx("line", { x1: dragState.edgeInfo.startPoint.x, y1: dragState.edgeInfo.startPoint.y, x2: dragState.edgeInfo.endPoint.x, y2: dragState.edgeInfo.endPoint.y, stroke: "#999", strokeWidth: (strokeWidth * 3.2) / styleZoomFactor, strokeDasharray: `${6 / styleZoomFactor},${6 / styleZoomFactor}` }) }))] }), jsxRuntime.jsx(CharginPile, { viewBox: magnifierViewBox || null, rotation: actureRotate, sizeInSvgUnits: true, minDisplaySizePx: MAGNIFIER_CHARGING_PILE_MIN_DISPLAY_PX,
23605
23612
  // 充电桩最多保持原始尺寸,不允许放大超过 1 倍
23606
23613
  sizeScale: Math.min(1, 1 / styleZoomFactor) })] }));
23607
23614
  // 使用 Portal 渲染到 body,避免层级问题
@@ -9,8 +9,10 @@ interface ChargingPileProps {
9
9
  rotation?: number;
10
10
  sizeScale?: number;
11
11
  sizeInSvgUnits?: boolean;
12
+ /** 放大镜等场景:屏幕像素下限,避免图标过小与通道线错位感(仅与 sizeInSvgUnits 一起生效) */
13
+ minDisplaySizePx?: number;
12
14
  isHighlight?: boolean;
13
15
  }
14
- declare const CharginPile: React.MemoExoticComponent<({ viewBox, rotation, sizeScale, sizeInSvgUnits, isHighlight, }: ChargingPileProps) => import("react/jsx-runtime").JSX.Element>;
16
+ declare const CharginPile: React.MemoExoticComponent<({ viewBox, rotation, sizeScale, sizeInSvgUnits, minDisplaySizePx, isHighlight, }: ChargingPileProps) => import("react/jsx-runtime").JSX.Element>;
15
17
  export default CharginPile;
16
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/render/charginPile/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,UAAU,iBAAiB;IACzB,OAAO,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,QAAA,MAAM,WAAW,6FAOZ,iBAAiB,6CAiDrB,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/render/charginPile/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,UAAU,iBAAiB;IACzB,OAAO,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,0DAA0D;IAC1D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,QAAA,MAAM,WAAW,+GAQZ,iBAAiB,6CAwDrB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/render/svgElement/PolygonELement/components/Magnifier/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAe5E,UAAU,SAAS;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAClC,eAAe,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE;QACR,UAAU,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QACrC,QAAQ,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QACnC,UAAU,EAAE,MAAM,CAAC;KACpB,GAAG,IAAI,CAAC;IACT,QAAQ,EAAE,UAAU,GAAG,KAAK,GAAG,IAAI,CAAC;CACrC;AAED,UAAU,cAAc;IACtB,cAAc;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW;IACX,SAAS,EAAE,SAAS,CAAC;IACrB,iBAAiB;IACjB,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,WAAW;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA0evC,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/render/svgElement/PolygonELement/components/Magnifier/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAiB5E,UAAU,SAAS;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAClC,eAAe,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE;QACR,UAAU,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QACrC,QAAQ,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QACnC,UAAU,EAAE,MAAM,CAAC;KACpB,GAAG,IAAI,CAAC;IACT,QAAQ,EAAE,UAAU,GAAG,KAAK,GAAG,IAAI,CAAC;CACrC;AAED,UAAU,cAAc;IACtB,cAAc;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW;IACX,SAAS,EAAE,SAAS,CAAC;IACrB,iBAAiB;IACjB,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,WAAW;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA2evC,CAAC;AAEF,eAAe,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fleet-frontend/mower-maps",
3
- "version": "0.2.5-beta.10",
3
+ "version": "0.2.5-beta.11",
4
4
  "type": "module",
5
5
  "description": "a mower maps in google maps",
6
6
  "main": "dist/index.js",