@eyeon/map 2.0.1 → 2.0.2
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/README.md +18 -1
- package/dist/assets/MapViewer.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/chunks/MapViewer.js +1745 -356
- package/dist/chunks/MapViewer.js.map +1 -1
- package/dist/chunks/stacking.js +1321 -0
- package/dist/chunks/stacking.js.map +1 -0
- package/dist/core/geometry/index.d.ts +41 -4
- package/dist/core/geometry/index.d.ts.map +1 -1
- package/dist/core/hostChrome.d.ts +20 -0
- package/dist/core/hostChrome.d.ts.map +1 -0
- package/dist/core/import/index.d.ts +48 -3
- package/dist/core/import/index.d.ts.map +1 -1
- package/dist/core/import/svgStyle.d.ts +21 -0
- package/dist/core/import/svgStyle.d.ts.map +1 -0
- package/dist/core/import/svgTransform.d.ts +49 -0
- package/dist/core/import/svgTransform.d.ts.map +1 -0
- package/dist/core/index.d.ts +3 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +207 -266
- package/dist/core/index.js.map +1 -1
- package/dist/core/layerStyles.d.ts +28 -0
- package/dist/core/layerStyles.d.ts.map +1 -0
- package/dist/core/publish/index.d.ts +8 -2
- package/dist/core/publish/index.d.ts.map +1 -1
- package/dist/core/routing/graph-tools.d.ts +5 -1
- package/dist/core/routing/graph-tools.d.ts.map +1 -1
- package/dist/core/stacking.d.ts +61 -0
- package/dist/core/stacking.d.ts.map +1 -0
- package/dist/core/types.d.ts +27 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/editor/MapEditor.d.ts +28 -16
- package/dist/editor/MapEditor.d.ts.map +1 -1
- package/dist/editor/canvas/EditorCanvas.d.ts +15 -3
- package/dist/editor/canvas/EditorCanvas.d.ts.map +1 -1
- package/dist/editor/canvas/coords.d.ts +21 -0
- package/dist/editor/canvas/coords.d.ts.map +1 -0
- package/dist/editor/draftOps.d.ts +19 -0
- package/dist/editor/draftOps.d.ts.map +1 -0
- package/dist/editor/geometryEdit.d.ts +34 -0
- package/dist/editor/geometryEdit.d.ts.map +1 -0
- package/dist/editor/index.css +1281 -145
- package/dist/editor/index.d.ts +8 -2
- package/dist/editor/index.d.ts.map +1 -1
- package/dist/editor/index.js +2293 -585
- package/dist/editor/index.js.map +1 -1
- package/dist/editor/labels.d.ts +5 -0
- package/dist/editor/labels.d.ts.map +1 -0
- package/dist/editor/panels/FloorsPanel.d.ts +60 -0
- package/dist/editor/panels/FloorsPanel.d.ts.map +1 -0
- package/dist/editor/panels/ImportReviewPanel.d.ts +22 -0
- package/dist/editor/panels/ImportReviewPanel.d.ts.map +1 -0
- package/dist/editor/panels/Inspector.d.ts +4 -2
- package/dist/editor/panels/Inspector.d.ts.map +1 -1
- package/dist/editor/panels/LeftRail.d.ts +19 -6
- package/dist/editor/panels/LeftRail.d.ts.map +1 -1
- package/dist/editor/panels/PreviewOverlay.d.ts +11 -2
- package/dist/editor/panels/PreviewOverlay.d.ts.map +1 -1
- package/dist/editor/portalSurface.d.ts +11 -0
- package/dist/editor/portalSurface.d.ts.map +1 -0
- package/dist/editor/previewDocument.d.ts +9 -0
- package/dist/editor/previewDocument.d.ts.map +1 -0
- package/dist/editor/tools.d.ts +20 -0
- package/dist/editor/tools.d.ts.map +1 -0
- package/dist/test-maps/shops-at-south-town/BASE - Shops At South Town.ai +26780 -26
- package/dist/test-maps/shops-at-south-town/LF - Shops At South Town.ai +4487 -2
- package/dist/test-maps/shops-at-south-town/SVG/BASE - Shops At South Town.svg +567 -0
- package/dist/test-maps/shops-at-south-town/SVG/LF - Shops At South Town.svg +238 -0
- package/dist/test-maps/shops-at-south-town/SVG/UF - Shops At South Town.svg +276 -0
- package/dist/test-maps/shops-at-south-town/UF - Shops At South Town.ai +4228 -1
- package/dist/viewer/MapViewer.d.ts +14 -3
- package/dist/viewer/MapViewer.d.ts.map +1 -1
- package/dist/viewer/camera.d.ts +34 -0
- package/dist/viewer/camera.d.ts.map +1 -0
- package/dist/viewer/components/CameraRig.d.ts +18 -0
- package/dist/viewer/components/CameraRig.d.ts.map +1 -0
- package/dist/viewer/components/LevelMeshes.d.ts +6 -1
- package/dist/viewer/components/LevelMeshes.d.ts.map +1 -1
- package/dist/viewer/components/MapScene.d.ts +6 -1
- package/dist/viewer/components/MapScene.d.ts.map +1 -1
- package/dist/viewer/components/SvgVectorLayer.d.ts +18 -0
- package/dist/viewer/components/SvgVectorLayer.d.ts.map +1 -0
- package/dist/viewer/index.css +124 -35
- package/dist/viewer/index.d.ts +4 -0
- package/dist/viewer/index.d.ts.map +1 -1
- package/dist/viewer/index.js +9 -4
- package/dist/viewer/index.js.map +1 -1
- package/dist/viewer/ui/MapControls.d.ts +14 -0
- package/dist/viewer/ui/MapControls.d.ts.map +1 -0
- package/dist/viewer/ui/RuntimeChrome.d.ts +3 -3
- package/dist/viewer/ui/RuntimeChrome.d.ts.map +1 -1
- package/package.json +7 -3
- package/dist/chunks/graph-tools.js +0 -153
- package/dist/chunks/graph-tools.js.map +0 -1
- package/dist/chunks/pathfinding.js +0 -343
- package/dist/chunks/pathfinding.js.map +0 -1
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { PublishedDocument, ThemeDefaults } from '../core';
|
|
2
|
+
import { MapViewerHost, PublishedDocument, ThemeDefaults } from '../core';
|
|
3
3
|
export interface MapViewerProps {
|
|
4
4
|
/** Published (or draft) document. If omitted, fetched from webApiURI. */
|
|
5
5
|
document?: PublishedDocument | null;
|
|
6
6
|
webApiURI?: string;
|
|
7
7
|
/** Prefer fetching /v1/map/document */
|
|
8
8
|
centerId?: number;
|
|
9
|
-
|
|
9
|
+
/** Public / preview / kiosk surface. Never includes Map options (editor rail). */
|
|
10
|
+
host?: MapViewerHost;
|
|
10
11
|
kioskId?: number | null;
|
|
11
12
|
selectedRetailerId?: number | null;
|
|
12
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Media proxy base, appended with the encoded SVG URL (v1 `IMAGE_PROXY_URL`
|
|
15
|
+
* contract, e.g. `/eyeon-portal/media?url=`). Needed wherever the outdoor
|
|
16
|
+
* SVG origin sends no CORS headers.
|
|
17
|
+
*/
|
|
18
|
+
imageProxyUrl?: string | null;
|
|
13
19
|
themeOverrides?: Partial<ThemeDefaults>;
|
|
14
20
|
onExtractedAmenities?: (codes: string[]) => void;
|
|
15
21
|
onSelectShape?: (shapeId: number) => void;
|
|
22
|
+
/** Controlled floor when embedded (e.g. PORTAL default). */
|
|
23
|
+
activeLevelId?: number | null;
|
|
24
|
+
onActiveLevelChange?: (levelId: number) => void;
|
|
25
|
+
/** Click a store/amenity to route. Off when PORTAL is assigning. Default true. */
|
|
26
|
+
routeOnSelect?: boolean;
|
|
16
27
|
createRouteRef?: React.MutableRefObject<{
|
|
17
28
|
createRouteToStore: (retailerId: number) => void;
|
|
18
29
|
createRouteToAmenity: (amenityCode: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapViewer.d.ts","sourceRoot":"","sources":["../../src/viewer/MapViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"MapViewer.d.ts","sourceRoot":"","sources":["../../src/viewer/MapViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAC9E,OAAO,KAAK,EAEV,aAAa,EAEb,iBAAiB,EACjB,aAAa,EACd,MAAM,SAAS,CAAC;AAajB,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,cAAc;IAC7B,yEAAyE;IACzE,QAAQ,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kFAAkF;IAClF,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACxC,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACjD,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,4DAA4D;IAC5D,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,kFAAkF;IAClF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC;QACtC,kBAAkB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;QACjD,oBAAoB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;QACpD,UAAU,EAAE,MAAM,IAAI,CAAC;KACxB,GAAG,IAAI,CAAC,CAAC;IACV,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAqBD,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,qBAqR9C;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { SceneBounds, Vec2 } from '../core';
|
|
2
|
+
/**
|
|
3
|
+
* Stored geometry is raw SVG user space, where Y grows downward. The scene
|
|
4
|
+
* mirrors Y once so the camera can keep a conventional `up = [0, 1, 0]`.
|
|
5
|
+
*
|
|
6
|
+
* Do not "fix" orientation by setting `up = [0, -1, 0]` instead: three.js
|
|
7
|
+
* derives the camera's right axis from `up × forward`, so a negative up also
|
|
8
|
+
* mirrors X and the map renders rotated 180° rather than flipped.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SCENE_FLIP_SCALE: [number, number, number];
|
|
11
|
+
/** Stored SVG-space point → view space, matching `SCENE_FLIP_SCALE`. */
|
|
12
|
+
export declare function dataToViewPoint(point: Vec2): Vec2;
|
|
13
|
+
/** Stored SVG-space bounds → view space, for camera and controls placement. */
|
|
14
|
+
export declare function viewBoundsFromData(bounds: SceneBounds): SceneBounds;
|
|
15
|
+
/**
|
|
16
|
+
* Fit an orthographic camera so the map fills the canvas on the limiting
|
|
17
|
+
* axis (width or height) with no extra inset.
|
|
18
|
+
*/
|
|
19
|
+
export declare function fitOrthoZoom(viewWidth: number, viewHeight: number, worldWidth: number, worldHeight: number): number;
|
|
20
|
+
export declare function boundsExtent(bounds: SceneBounds): {
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
};
|
|
24
|
+
export declare function nextOrthoZoom(current: number, direction: 1 | -1, step: number, min: number, max: number): number;
|
|
25
|
+
export declare function orbitMouseButtons(is3d: boolean): {
|
|
26
|
+
LEFT: number;
|
|
27
|
+
MIDDLE: number;
|
|
28
|
+
RIGHT: number;
|
|
29
|
+
};
|
|
30
|
+
export declare function orbitTouches(is3d: boolean): {
|
|
31
|
+
ONE: number;
|
|
32
|
+
TWO: number;
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=camera.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../src/viewer/camera.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEjD;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAc,CAAC;AAErE,wEAAwE;AACxE,wBAAgB,eAAe,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,CAEjD;AAED,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAOnE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,MAAM,CAIR;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAKnF;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,EACjB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,MAAM,CAIR;AAUD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAKA;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAKxE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { OrbitControls } from 'three-stdlib';
|
|
3
|
+
import { SceneBounds, ThemeDefaults } from '../../core';
|
|
4
|
+
export interface MapCameraHandle {
|
|
5
|
+
zoomIn: () => void;
|
|
6
|
+
zoomOut: () => void;
|
|
7
|
+
reset: () => void;
|
|
8
|
+
}
|
|
9
|
+
export interface CameraRigProps {
|
|
10
|
+
/** View-space bounds — already Y-flipped by the scene, so up is +Y. */
|
|
11
|
+
bounds: SceneBounds;
|
|
12
|
+
theme: ThemeDefaults;
|
|
13
|
+
is3d: boolean;
|
|
14
|
+
controlsRef: React.RefObject<OrbitControls | null>;
|
|
15
|
+
cameraRef?: React.Ref<MapCameraHandle | null>;
|
|
16
|
+
}
|
|
17
|
+
export declare function CameraRig({ bounds, theme, is3d, controlsRef, cameraRef, }: CameraRigProps): null;
|
|
18
|
+
//# sourceMappingURL=CameraRig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CameraRig.d.ts","sourceRoot":"","sources":["../../../src/viewer/components/CameraRig.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8D,MAAM,OAAO,CAAC;AAEnF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG7D,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,uEAAuE;IACvE,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IACnD,SAAS,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;CAC/C;AAED,wBAAgB,SAAS,CAAC,EACxB,MAAM,EACN,KAAK,EACL,IAAI,EACJ,WAAW,EACX,SAAS,GACV,EAAE,cAAc,QAuFhB"}
|
|
@@ -6,6 +6,11 @@ export interface LevelMeshesProps {
|
|
|
6
6
|
is3d: boolean;
|
|
7
7
|
selectedRetailerId?: number | null;
|
|
8
8
|
onSelectShape?: (shapeId: number) => void;
|
|
9
|
+
/**
|
|
10
|
+
* When true (outdoor with live SVG), only interactive shapes are drawn —
|
|
11
|
+
* decoration comes from SvgVectorLayer.
|
|
12
|
+
*/
|
|
13
|
+
interactiveOnly?: boolean;
|
|
9
14
|
}
|
|
10
|
-
export declare function LevelMeshes({ level, theme, is3d, selectedRetailerId, onSelectShape, }: LevelMeshesProps): React.JSX.Element;
|
|
15
|
+
export declare function LevelMeshes({ level, theme, is3d, selectedRetailerId, onSelectShape, interactiveOnly, }: LevelMeshesProps): React.JSX.Element;
|
|
11
16
|
//# sourceMappingURL=LevelMeshes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LevelMeshes.d.ts","sourceRoot":"","sources":["../../../src/viewer/components/LevelMeshes.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAa,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"LevelMeshes.d.ts","sourceRoot":"","sources":["../../../src/viewer/components/LevelMeshes.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAa,MAAM,YAAY,CAAC;AAuC3E,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,cAAc,CAAC;IACtB,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,KAAK,EACL,IAAI,EACJ,kBAAkB,EAClB,aAAa,EACb,eAAuB,GACxB,EAAE,gBAAgB,qBA8FlB"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { PathResult, PublishedDocument, ThemeDefaults } from '../../core';
|
|
3
|
+
import { MapCameraHandle } from './CameraRig';
|
|
3
4
|
export interface MapSceneProps {
|
|
4
5
|
doc: PublishedDocument;
|
|
5
6
|
theme: ThemeDefaults;
|
|
6
7
|
activeLevelId: number | null;
|
|
7
8
|
route: PathResult | null;
|
|
8
9
|
selectedRetailerId?: number | null;
|
|
10
|
+
cameraRef?: React.Ref<MapCameraHandle | null>;
|
|
9
11
|
onSelectShape?: (shapeId: number, levelId: number) => void;
|
|
12
|
+
imageProxyUrl?: string | null;
|
|
13
|
+
/** Keep pointer events inside the map canvas host so header/footer stay clickable. */
|
|
14
|
+
eventSource?: React.RefObject<HTMLElement | null>;
|
|
10
15
|
}
|
|
11
|
-
export declare function MapScene({ doc, theme, activeLevelId, route, selectedRetailerId, onSelectShape, }: MapSceneProps): React.JSX.Element;
|
|
16
|
+
export declare function MapScene({ doc, theme, activeLevelId, route, selectedRetailerId, cameraRef, onSelectShape, imageProxyUrl, eventSource, }: MapSceneProps): React.JSX.Element;
|
|
12
17
|
//# sourceMappingURL=MapScene.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapScene.d.ts","sourceRoot":"","sources":["../../../src/viewer/components/MapScene.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"MapScene.d.ts","sourceRoot":"","sources":["../../../src/viewer/components/MapScene.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAI/C,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAK/E,OAAO,EAAa,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAU9D,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,iBAAiB,CAAC;IACvB,KAAK,EAAE,aAAa,CAAC;IACrB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;IAC9C,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,sFAAsF;IACtF,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CACnD;AAED,wBAAgB,QAAQ,CAAC,EACvB,GAAG,EACH,KAAK,EACL,aAAa,EACb,KAAK,EACL,kBAAkB,EAClB,SAAS,EACT,aAAa,EACb,aAAa,EACb,WAAW,GACZ,EAAE,aAAa,qBA0If"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** Same contract as v1 `getMediaProxyUrl`: proxy base + encoded URL, no query key. */
|
|
3
|
+
export declare function resolveFetchUrl(url: string, imageProxyUrl?: string | null): string;
|
|
4
|
+
export interface SvgVectorLayerProps {
|
|
5
|
+
url: string;
|
|
6
|
+
/** sourceSvgId values held in cm_shapes — skip drawing these (DB owns them). */
|
|
7
|
+
suppressIds?: ReadonlySet<string>;
|
|
8
|
+
imageProxyUrl?: string | null;
|
|
9
|
+
is3d?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Live outdoor SVG as real vector geometry (not a raster texture).
|
|
13
|
+
* Applies house-style colors for reserved layer names; otherwise keeps
|
|
14
|
+
* Illustrator fills. Skips route-path* and interactive ids owned by the DB.
|
|
15
|
+
* Coordinates stay in SVG user space — `MapScene` flips the whole scene.
|
|
16
|
+
*/
|
|
17
|
+
export declare function SvgVectorLayer({ url, suppressIds, imageProxyUrl, is3d, }: SvgVectorLayerProps): React.JSX.Element | null;
|
|
18
|
+
//# sourceMappingURL=SvgVectorLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SvgVectorLayer.d.ts","sourceRoot":"","sources":["../../../src/viewer/components/SvgVectorLayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAoC5D,sFAAsF;AACtF,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAGlF;AAED,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,gFAAgF;IAChF,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAWD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAC7B,GAAG,EACH,WAAW,EACX,aAAa,EACb,IAAY,GACb,EAAE,mBAAmB,4BAkHrB"}
|
package/dist/viewer/index.css
CHANGED
|
@@ -4,15 +4,28 @@
|
|
|
4
4
|
height: 100%;
|
|
5
5
|
min-height: 320px;
|
|
6
6
|
overflow: hidden;
|
|
7
|
-
background: var(--map-bg, #
|
|
8
|
-
font
|
|
7
|
+
background: var(--map-bg, #FFFFFF);
|
|
8
|
+
/* Inherit the host application's font; hosts may override with the variable. */
|
|
9
|
+
font-family: var(--eyeon-map-font-family, inherit);
|
|
9
10
|
font-size: 13px;
|
|
10
11
|
color: #0f172a;
|
|
11
12
|
}
|
|
12
13
|
|
|
14
|
+
.eyeon-map-viewer button,
|
|
15
|
+
.eyeon-map-viewer input,
|
|
16
|
+
.eyeon-map-viewer select,
|
|
17
|
+
.eyeon-map-viewer textarea {
|
|
18
|
+
font-family: inherit;
|
|
19
|
+
}
|
|
20
|
+
|
|
13
21
|
.eyeon-map-viewer__canvas {
|
|
14
22
|
position: absolute;
|
|
15
23
|
inset: 0;
|
|
24
|
+
cursor: grab;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.eyeon-map-viewer__canvas:active {
|
|
28
|
+
cursor: grabbing;
|
|
16
29
|
}
|
|
17
30
|
|
|
18
31
|
.eyeon-map-viewer__loading,
|
|
@@ -29,7 +42,7 @@
|
|
|
29
42
|
z-index: 2;
|
|
30
43
|
top: 12px;
|
|
31
44
|
left: 12px;
|
|
32
|
-
width: min(320px, calc(100% -
|
|
45
|
+
width: min(320px, calc(100% - 124px));
|
|
33
46
|
display: flex;
|
|
34
47
|
flex-direction: column;
|
|
35
48
|
gap: 8px;
|
|
@@ -46,16 +59,20 @@
|
|
|
46
59
|
gap: 8px;
|
|
47
60
|
}
|
|
48
61
|
|
|
49
|
-
.eyeon-map-chrome__search-
|
|
50
|
-
|
|
51
|
-
|
|
62
|
+
.eyeon-map-chrome__search-input {
|
|
63
|
+
width: 100%;
|
|
64
|
+
box-sizing: border-box;
|
|
65
|
+
border: 1px solid #e2e8f0;
|
|
52
66
|
border-radius: 8px;
|
|
53
67
|
background: #fff;
|
|
54
68
|
box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
|
|
55
|
-
padding:
|
|
56
|
-
font-size:
|
|
57
|
-
|
|
58
|
-
|
|
69
|
+
padding: 10px 12px;
|
|
70
|
+
font-size: 13px;
|
|
71
|
+
outline: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.eyeon-map-chrome__search-input:focus {
|
|
75
|
+
border-color: #0763b1;
|
|
59
76
|
}
|
|
60
77
|
|
|
61
78
|
.eyeon-map-chrome__amenities {
|
|
@@ -69,6 +86,7 @@
|
|
|
69
86
|
}
|
|
70
87
|
|
|
71
88
|
.eyeon-map-chrome__amenity {
|
|
89
|
+
position: relative;
|
|
72
90
|
width: 40px;
|
|
73
91
|
height: 40px;
|
|
74
92
|
border: 0;
|
|
@@ -103,13 +121,10 @@
|
|
|
103
121
|
}
|
|
104
122
|
}
|
|
105
123
|
|
|
106
|
-
.eyeon-map-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
padding: 8px 10px;
|
|
111
|
-
font-size: 13px;
|
|
112
|
-
margin-bottom: 8px;
|
|
124
|
+
.eyeon-map-chrome__empty {
|
|
125
|
+
color: #64748b;
|
|
126
|
+
font-size: 12px;
|
|
127
|
+
padding: 8px 4px;
|
|
113
128
|
}
|
|
114
129
|
|
|
115
130
|
.eyeon-map-chrome__group-title {
|
|
@@ -133,7 +148,8 @@
|
|
|
133
148
|
font-size: 13px;
|
|
134
149
|
}
|
|
135
150
|
|
|
136
|
-
.eyeon-map-chrome__item:hover
|
|
151
|
+
.eyeon-map-chrome__item:hover,
|
|
152
|
+
.eyeon-map-chrome__item.is-selected {
|
|
137
153
|
background: #f1f5f9;
|
|
138
154
|
}
|
|
139
155
|
|
|
@@ -182,29 +198,102 @@
|
|
|
182
198
|
font-weight: 500 !important;
|
|
183
199
|
}
|
|
184
200
|
|
|
185
|
-
.eyeon-map-
|
|
201
|
+
.eyeon-map-controls {
|
|
202
|
+
position: absolute;
|
|
203
|
+
inset: 0;
|
|
204
|
+
z-index: 3;
|
|
205
|
+
pointer-events: none;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.eyeon-map-controls__stack {
|
|
209
|
+
pointer-events: auto;
|
|
186
210
|
position: absolute;
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
left: auto;
|
|
190
|
-
top: auto;
|
|
211
|
+
top: 10px;
|
|
212
|
+
right: 10px;
|
|
191
213
|
display: flex;
|
|
192
|
-
|
|
193
|
-
|
|
214
|
+
flex-direction: column;
|
|
215
|
+
gap: 8px;
|
|
216
|
+
width: 94px;
|
|
194
217
|
}
|
|
195
218
|
|
|
196
|
-
.eyeon-map-
|
|
219
|
+
.eyeon-map-controls__floors {
|
|
220
|
+
display: flex;
|
|
221
|
+
flex-direction: column;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.eyeon-map-controls__floor,
|
|
225
|
+
.eyeon-map-controls__reset,
|
|
226
|
+
.eyeon-map-controls__zoom-btn {
|
|
227
|
+
color: #fff;
|
|
228
|
+
background-color: #0763b1;
|
|
197
229
|
border: 0;
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
padding: 8px 10px;
|
|
202
|
-
font-size: 12px;
|
|
203
|
-
font-weight: 600;
|
|
230
|
+
font-size: 11px;
|
|
231
|
+
font-weight: 500;
|
|
232
|
+
letter-spacing: 0.02em;
|
|
204
233
|
cursor: pointer;
|
|
234
|
+
transition: background-color 200ms;
|
|
205
235
|
}
|
|
206
236
|
|
|
207
|
-
.eyeon-map-
|
|
208
|
-
|
|
209
|
-
|
|
237
|
+
.eyeon-map-controls__floor,
|
|
238
|
+
.eyeon-map-controls__reset {
|
|
239
|
+
width: 100%;
|
|
240
|
+
min-height: 27px;
|
|
241
|
+
padding: 6px 10px;
|
|
242
|
+
text-align: center;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.eyeon-map-controls__floor:hover,
|
|
246
|
+
.eyeon-map-controls__reset:hover,
|
|
247
|
+
.eyeon-map-controls__zoom-btn:hover {
|
|
248
|
+
background-color: #054983;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.eyeon-map-controls__floor.is-active {
|
|
252
|
+
background-color: #054983;
|
|
253
|
+
cursor: default;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.eyeon-map-controls__floor:first-child {
|
|
257
|
+
border-radius: 5px 5px 0 0;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.eyeon-map-controls__floor:last-child {
|
|
261
|
+
border-radius: 0 0 5px 5px;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.eyeon-map-controls__floor:only-child {
|
|
265
|
+
border-radius: 5px;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.eyeon-map-controls__floor:not(:first-child):not(:last-child) {
|
|
269
|
+
border-radius: 0;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.eyeon-map-controls__reset {
|
|
273
|
+
border-radius: 5px;
|
|
274
|
+
text-transform: uppercase;
|
|
275
|
+
letter-spacing: 0.05em;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.eyeon-map-controls__zoom {
|
|
279
|
+
display: flex;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.eyeon-map-controls__zoom-btn {
|
|
283
|
+
flex: 1;
|
|
284
|
+
height: 27px;
|
|
285
|
+
display: flex;
|
|
286
|
+
align-items: center;
|
|
287
|
+
justify-content: center;
|
|
288
|
+
font-size: 14px;
|
|
289
|
+
font-weight: 400;
|
|
290
|
+
padding: 0;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.eyeon-map-controls__zoom-btn:first-child {
|
|
294
|
+
border-radius: 5px 0 0 5px;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.eyeon-map-controls__zoom-btn:last-child {
|
|
298
|
+
border-radius: 0 5px 5px 0;
|
|
210
299
|
}
|
package/dist/viewer/index.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export { MapViewer, type MapViewerProps } from './MapViewer';
|
|
2
|
+
export type { MapViewerHost, MapHost, ViewerChrome } from '../core';
|
|
3
|
+
export { mapSurface, viewerChrome, isMapViewerHost } from '../core';
|
|
2
4
|
export { MapScene } from './components/MapScene';
|
|
3
5
|
export { RuntimeChrome } from './ui/RuntimeChrome';
|
|
6
|
+
export { MapControls, type MapControlsProps } from './ui/MapControls';
|
|
7
|
+
export type { MapCameraHandle } from './components/CameraRig';
|
|
4
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/viewer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/viewer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACtE,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,cAAc,CAAC"}
|
package/dist/viewer/index.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { M as r, a as
|
|
1
|
+
import { M as r, a as s, b as o, R as m } from "../chunks/MapViewer.js";
|
|
2
|
+
import { i, m as t, v as M } from "../chunks/stacking.js";
|
|
2
3
|
export {
|
|
3
|
-
r as
|
|
4
|
-
|
|
5
|
-
o as
|
|
4
|
+
r as MapControls,
|
|
5
|
+
s as MapScene,
|
|
6
|
+
o as MapViewer,
|
|
7
|
+
m as RuntimeChrome,
|
|
8
|
+
i as isMapViewerHost,
|
|
9
|
+
t as mapSurface,
|
|
10
|
+
M as viewerChrome
|
|
6
11
|
};
|
|
7
12
|
//# sourceMappingURL=index.js.map
|
package/dist/viewer/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PublishedLevel } from '../../core';
|
|
3
|
+
export interface MapControlsProps {
|
|
4
|
+
levels: PublishedLevel[];
|
|
5
|
+
activeLevelId: number | null;
|
|
6
|
+
onActiveLevelChange: (id: number) => void;
|
|
7
|
+
onZoomIn: () => void;
|
|
8
|
+
onZoomOut: () => void;
|
|
9
|
+
onReset: () => void;
|
|
10
|
+
showFloors?: boolean;
|
|
11
|
+
showZoomReset?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function MapControls({ levels, activeLevelId, onActiveLevelChange, onZoomIn, onZoomOut, onReset, showFloors, showZoomReset, }: MapControlsProps): React.JSX.Element | null;
|
|
14
|
+
//# sourceMappingURL=MapControls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapControls.d.ts","sourceRoot":"","sources":["../../../src/viewer/ui/MapControls.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGjD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,aAAa,EACb,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACT,OAAO,EACP,UAAiB,EACjB,aAAoB,GACrB,EAAE,gBAAgB,4BAiElB"}
|
|
@@ -3,8 +3,6 @@ import { CmAmenityCatalogItem, PathResult, PublishedDocument } from '../../core'
|
|
|
3
3
|
export interface RuntimeChromeProps {
|
|
4
4
|
doc: PublishedDocument;
|
|
5
5
|
amenities: CmAmenityCatalogItem[];
|
|
6
|
-
searchOpen: boolean;
|
|
7
|
-
onSearchOpenChange: (open: boolean) => void;
|
|
8
6
|
activeLevelId: number | null;
|
|
9
7
|
onActiveLevelChange: (id: number) => void;
|
|
10
8
|
fromAnchorId: number | null;
|
|
@@ -14,6 +12,8 @@ export interface RuntimeChromeProps {
|
|
|
14
12
|
accessibleOnly: boolean;
|
|
15
13
|
onAccessibleOnlyChange: (v: boolean) => void;
|
|
16
14
|
route: PathResult | null;
|
|
15
|
+
showSearch?: boolean;
|
|
16
|
+
showAmenities?: boolean;
|
|
17
17
|
}
|
|
18
|
-
export declare function RuntimeChrome({ doc, amenities,
|
|
18
|
+
export declare function RuntimeChrome({ doc, amenities, onActiveLevelChange, fromAnchorId, toAnchorId, onFromChange, onToChange, accessibleOnly, onAccessibleOnlyChange, route, showSearch, showAmenities, }: RuntimeChromeProps): React.JSX.Element | null;
|
|
19
19
|
//# sourceMappingURL=RuntimeChrome.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuntimeChrome.d.ts","sourceRoot":"","sources":["../../../src/viewer/ui/RuntimeChrome.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,EACV,oBAAoB,EACpB,UAAU,EACV,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,iBAAiB,CAAC;IACvB,SAAS,EAAE,oBAAoB,EAAE,CAAC;IAClC,
|
|
1
|
+
{"version":3,"file":"RuntimeChrome.d.ts","sourceRoot":"","sources":["../../../src/viewer/ui/RuntimeChrome.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,EACV,oBAAoB,EACpB,UAAU,EACV,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,iBAAiB,CAAC;IACvB,SAAS,EAAE,oBAAoB,EAAE,CAAC;IAClC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1C,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACxC,cAAc,EAAE,OAAO,CAAC;IACxB,sBAAsB,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAyBD,wBAAgB,aAAa,CAAC,EAC5B,GAAG,EACH,SAAS,EACT,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,UAAU,EACV,cAAc,EACd,sBAAsB,EACtB,KAAK,EACL,UAAiB,EACjB,aAAoB,GACrB,EAAE,kBAAkB,4BAuMpB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eyeon/map",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "EyeOn Center Map v2 — core, viewer, and editor",
|
|
5
5
|
"author": "EyeOn LLC",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -16,11 +16,15 @@
|
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
18
18
|
"types": "./dist/core/index.d.ts",
|
|
19
|
-
"
|
|
19
|
+
"require": "./dist/core/index.js",
|
|
20
|
+
"import": "./dist/core/index.js",
|
|
21
|
+
"default": "./dist/core/index.js"
|
|
20
22
|
},
|
|
21
23
|
"./core": {
|
|
22
24
|
"types": "./dist/core/index.d.ts",
|
|
23
|
-
"
|
|
25
|
+
"require": "./dist/core/index.js",
|
|
26
|
+
"import": "./dist/core/index.js",
|
|
27
|
+
"default": "./dist/core/index.js"
|
|
24
28
|
},
|
|
25
29
|
"./viewer": {
|
|
26
30
|
"types": "./dist/viewer/index.d.ts",
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { D as x, n as v, d as A, p as k, a as M } from "./pathfinding.js";
|
|
2
|
-
function b(i, l, r, s = x) {
|
|
3
|
-
const n = i.filter((e) => r.includes(e.id));
|
|
4
|
-
if (n.length < 2) return null;
|
|
5
|
-
const d = n.reduce((e, u) => u.id < e.id ? u : e), o = [];
|
|
6
|
-
for (const e of n)
|
|
7
|
-
e.id !== d.id && A(e, d) <= s && o.push(e.id);
|
|
8
|
-
if (o.length === 0) return null;
|
|
9
|
-
const f = new Set(o), h = [];
|
|
10
|
-
for (const e of l) {
|
|
11
|
-
let u = !1;
|
|
12
|
-
if (f.has(e.fromAnchorId) && (e.fromAnchorId = d.id, u = !0), f.has(e.toAnchorId) && (e.toAnchorId = d.id, u = !0), e.fromAnchorId === e.toAnchorId) {
|
|
13
|
-
h.push(e.id);
|
|
14
|
-
continue;
|
|
15
|
-
}
|
|
16
|
-
u && h.push(e.id);
|
|
17
|
-
}
|
|
18
|
-
return {
|
|
19
|
-
survivingAnchorId: d.id,
|
|
20
|
-
removedAnchorIds: o,
|
|
21
|
-
rewiredEdgeIds: h
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
function E(i, l = x) {
|
|
25
|
-
const r = [], s = /* @__PURE__ */ new Set();
|
|
26
|
-
for (let n = 0; n < i.length; n++) {
|
|
27
|
-
if (s.has(i[n].id)) continue;
|
|
28
|
-
const d = [i[n].id];
|
|
29
|
-
for (let o = n + 1; o < i.length; o++)
|
|
30
|
-
s.has(i[o].id) || i[n].levelId === i[o].levelId && A(i[n], i[o]) <= l && (d.push(i[o].id), s.add(i[o].id));
|
|
31
|
-
d.length > 1 && (s.add(i[n].id), r.push(d));
|
|
32
|
-
}
|
|
33
|
-
return r;
|
|
34
|
-
}
|
|
35
|
-
function T(i, l, r, s = x) {
|
|
36
|
-
let n = null;
|
|
37
|
-
for (const o of l) {
|
|
38
|
-
const f = v(i, o);
|
|
39
|
-
f && (!n || f.distance < n.distance) && (n = { point: f.point, distance: f.distance });
|
|
40
|
-
}
|
|
41
|
-
if (!n) return null;
|
|
42
|
-
const d = r.find(
|
|
43
|
-
(o) => o.levelId === i.levelId && A(o, n.point) <= s
|
|
44
|
-
);
|
|
45
|
-
return {
|
|
46
|
-
unitAnchorId: i.id,
|
|
47
|
-
junctionAnchor: d ? { x: d.x, y: d.y, existingId: d.id } : { x: n.point.x, y: n.point.y },
|
|
48
|
-
edge: {
|
|
49
|
-
fromAnchorId: i.id,
|
|
50
|
-
toAnchorId: d == null ? void 0 : d.id
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
function C(i, l, r, s) {
|
|
55
|
-
if (r.length === 0) return null;
|
|
56
|
-
const n = r.flat();
|
|
57
|
-
if (n.length === 0) return null;
|
|
58
|
-
let d = 0, o = 0;
|
|
59
|
-
for (const e of n)
|
|
60
|
-
d += e.x, o += e.y;
|
|
61
|
-
const f = { x: d / n.length, y: o / n.length }, h = k(f, r) ? f : n[0];
|
|
62
|
-
return {
|
|
63
|
-
id: s,
|
|
64
|
-
levelId: l,
|
|
65
|
-
shapeId: i,
|
|
66
|
-
kind: "unit",
|
|
67
|
-
x: h.x,
|
|
68
|
-
y: h.y,
|
|
69
|
-
connectorId: null
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
function j(i, l, r = 20) {
|
|
73
|
-
if (i.length === 0)
|
|
74
|
-
return { anchors: [], edges: [] };
|
|
75
|
-
let s = 1 / 0, n = 1 / 0, d = -1 / 0, o = -1 / 0;
|
|
76
|
-
for (const t of i)
|
|
77
|
-
for (const c of t)
|
|
78
|
-
s = Math.min(s, c.x), n = Math.min(n, c.y), d = Math.max(d, c.x), o = Math.max(o, c.y);
|
|
79
|
-
const f = Math.max(1, Math.ceil((d - s) / r)), h = Math.max(1, Math.ceil((o - n) / r)), e = [];
|
|
80
|
-
for (let t = 0; t < h; t++)
|
|
81
|
-
for (let c = 0; c < f; c++) {
|
|
82
|
-
const g = s + (c + 0.5) * r, I = n + (t + 0.5) * r, m = { x: g, y: I };
|
|
83
|
-
k(m, i) && (l.length > 0 && k(m, l) || e.push({ key: `${c},${t}`, x: g, y: I, col: c, row: t }));
|
|
84
|
-
}
|
|
85
|
-
const u = new Map(e.map((t) => [t.key, t])), y = e.map((t) => ({
|
|
86
|
-
tempId: t.key,
|
|
87
|
-
x: t.x,
|
|
88
|
-
y: t.y,
|
|
89
|
-
kind: "junction"
|
|
90
|
-
})), p = [], a = /* @__PURE__ */ new Set();
|
|
91
|
-
for (const t of e) {
|
|
92
|
-
const c = [
|
|
93
|
-
[t.col + 1, t.row],
|
|
94
|
-
[t.col, t.row + 1]
|
|
95
|
-
];
|
|
96
|
-
for (const [g, I] of c) {
|
|
97
|
-
const m = `${g},${I}`;
|
|
98
|
-
if (!u.has(m)) continue;
|
|
99
|
-
const w = t.key < m ? `${t.key}|${m}` : `${m}|${t.key}`;
|
|
100
|
-
a.has(w) || (a.add(w), p.push({ fromTempId: t.key, toTempId: m }));
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return { anchors: y, edges: p };
|
|
104
|
-
}
|
|
105
|
-
function D(i, l, r, s, n = x, d) {
|
|
106
|
-
const o = [], f = [];
|
|
107
|
-
let h = s;
|
|
108
|
-
const e = (u, y) => {
|
|
109
|
-
const p = o.find(
|
|
110
|
-
(t) => A(t, { x: u, y }) <= n
|
|
111
|
-
);
|
|
112
|
-
if (p) return p.id;
|
|
113
|
-
const a = h++;
|
|
114
|
-
return o.push({
|
|
115
|
-
id: a,
|
|
116
|
-
levelId: l,
|
|
117
|
-
shapeId: null,
|
|
118
|
-
kind: "junction",
|
|
119
|
-
x: u,
|
|
120
|
-
y,
|
|
121
|
-
connectorId: null
|
|
122
|
-
}), a;
|
|
123
|
-
};
|
|
124
|
-
for (const u of i) {
|
|
125
|
-
const y = M(u, d);
|
|
126
|
-
for (const p of y)
|
|
127
|
-
for (let a = 0; a < p.length - 1; a++) {
|
|
128
|
-
const t = e(p[a].x, p[a].y), c = e(p[a + 1].x, p[a + 1].y);
|
|
129
|
-
t === c || f.some(
|
|
130
|
-
(I) => I.fromAnchorId === t && I.toAnchorId === c || I.fromAnchorId === c && I.toAnchorId === t
|
|
131
|
-
) || f.push({
|
|
132
|
-
id: h++,
|
|
133
|
-
mapId: r,
|
|
134
|
-
fromAnchorId: t,
|
|
135
|
-
toAnchorId: c,
|
|
136
|
-
weight: null,
|
|
137
|
-
directed: !1,
|
|
138
|
-
accessible: !0,
|
|
139
|
-
kind: "walk"
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return { anchors: o, edges: f, nextId: h };
|
|
144
|
-
}
|
|
145
|
-
export {
|
|
146
|
-
T as a,
|
|
147
|
-
j as b,
|
|
148
|
-
E as f,
|
|
149
|
-
D as i,
|
|
150
|
-
C as u,
|
|
151
|
-
b as w
|
|
152
|
-
};
|
|
153
|
-
//# sourceMappingURL=graph-tools.js.map
|