@mappedin/viewer 0.59.4-ea5d866.0 → 0.59.5-3072f0a.0

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.
@@ -127,7 +127,7 @@ declare const Positioner: import("styled-components").IStyledComponent<"web", {
127
127
  onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
128
128
  onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
129
129
  onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
130
- onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
130
+ onBeforeInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
131
131
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
132
132
  onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
133
133
  onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
@@ -177,6 +177,8 @@ declare const Positioner: import("styled-components").IStyledComponent<"web", {
177
177
  onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
178
178
  onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
179
179
  onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
180
+ onResize?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
181
+ onResizeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
180
182
  onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
181
183
  onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
182
184
  onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
@@ -4,23 +4,14 @@ export declare const SEARCH_RESULT_MAX_WIDTH_DESKTOP = 320;
4
4
  export declare const SEARCH_RESULT_HEIGHT: 38;
5
5
  export declare const SEARCH_RESULT_HEIGHT_WITH_MATCH_DETAILS: 48;
6
6
  export declare const ResultWrapper: import("styled-components").IStyledComponent<"web", {
7
- hidden?: boolean | undefined | undefined;
8
7
  color?: string | undefined | undefined;
8
+ hidden?: boolean | undefined | undefined;
9
9
  key?: import("react").Key | null | undefined;
10
+ id?: string | undefined | undefined;
11
+ security?: string | undefined | undefined;
12
+ title?: string | undefined | undefined;
10
13
  slot?: string | undefined | undefined;
11
14
  style?: import("react").CSSProperties | undefined;
12
- title?: string | undefined | undefined;
13
- content?: string | undefined | undefined;
14
- dir?: string | undefined | undefined;
15
- security?: string | undefined | undefined;
16
- className?: string | undefined | undefined;
17
- id?: string | undefined | undefined;
18
- part?: string | undefined | undefined;
19
- prefix?: string | undefined | undefined;
20
- role?: import("react").AriaRole | undefined;
21
- children?: import("react").ReactNode | Iterable<import("react").ReactNode>;
22
- nonce?: string | undefined | undefined;
23
- tabIndex?: number | undefined | undefined;
24
15
  defaultChecked?: boolean | undefined | undefined;
25
16
  defaultValue?: string | number | readonly string[] | undefined;
26
17
  suppressContentEditableWarning?: boolean | undefined | undefined;
@@ -28,17 +19,24 @@ export declare const ResultWrapper: import("styled-components").IStyledComponent
28
19
  accessKey?: string | undefined | undefined;
29
20
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
30
21
  autoFocus?: boolean | undefined | undefined;
22
+ className?: string | undefined | undefined;
31
23
  contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
32
24
  contextMenu?: string | undefined | undefined;
25
+ dir?: string | undefined | undefined;
33
26
  draggable?: (boolean | "true" | "false") | undefined;
34
27
  enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
35
28
  lang?: string | undefined | undefined;
29
+ nonce?: string | undefined | undefined;
36
30
  spellCheck?: (boolean | "true" | "false") | undefined;
31
+ tabIndex?: number | undefined | undefined;
37
32
  translate?: "yes" | "no" | undefined | undefined;
38
33
  radioGroup?: string | undefined | undefined;
34
+ role?: import("react").AriaRole | undefined;
39
35
  about?: string | undefined | undefined;
36
+ content?: string | undefined | undefined;
40
37
  datatype?: string | undefined | undefined;
41
38
  inlist?: any;
39
+ prefix?: string | undefined | undefined;
42
40
  property?: string | undefined | undefined;
43
41
  rel?: string | undefined | undefined;
44
42
  resource?: string | undefined | undefined;
@@ -57,6 +55,8 @@ export declare const ResultWrapper: import("styled-components").IStyledComponent
57
55
  inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
58
56
  is?: string | undefined | undefined;
59
57
  exportparts?: string | undefined | undefined;
58
+ part?: string | undefined | undefined;
59
+ children?: import("react").ReactNode | Iterable<import("react").ReactNode>;
60
60
  "aria-activedescendant"?: string | undefined | undefined;
61
61
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
62
62
  "aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined | undefined;
@@ -131,7 +131,7 @@ export declare const ResultWrapper: import("styled-components").IStyledComponent
131
131
  onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
132
132
  onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
133
133
  onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
134
- onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
134
+ onBeforeInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
135
135
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
136
136
  onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
137
137
  onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
@@ -181,6 +181,8 @@ export declare const ResultWrapper: import("styled-components").IStyledComponent
181
181
  onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
182
182
  onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
183
183
  onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
184
+ onResize?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
185
+ onResizeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
184
186
  onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
185
187
  onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
186
188
  onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
@@ -1,22 +1,13 @@
1
1
  import { ComponentProps } from 'react';
2
2
  declare const Wrapper: import("styled-components").IStyledComponent<"web", {
3
- hidden?: boolean | undefined | undefined;
4
3
  color?: string | undefined | undefined;
4
+ hidden?: boolean | undefined | undefined;
5
5
  key?: import("react").Key | null | undefined;
6
+ id?: string | undefined | undefined;
7
+ security?: string | undefined | undefined;
8
+ title?: string | undefined | undefined;
6
9
  slot?: string | undefined | undefined;
7
10
  style?: import("react").CSSProperties | undefined;
8
- title?: string | undefined | undefined;
9
- content?: string | undefined | undefined;
10
- dir?: string | undefined | undefined;
11
- security?: string | undefined | undefined;
12
- className?: string | undefined | undefined;
13
- id?: string | undefined | undefined;
14
- part?: string | undefined | undefined;
15
- prefix?: string | undefined | undefined;
16
- role?: import("react").AriaRole | undefined;
17
- children?: import("react").ReactNode | Iterable<import("react").ReactNode>;
18
- nonce?: string | undefined | undefined;
19
- tabIndex?: number | undefined | undefined;
20
11
  defaultChecked?: boolean | undefined | undefined;
21
12
  defaultValue?: string | number | readonly string[] | undefined;
22
13
  suppressContentEditableWarning?: boolean | undefined | undefined;
@@ -24,17 +15,24 @@ declare const Wrapper: import("styled-components").IStyledComponent<"web", {
24
15
  accessKey?: string | undefined | undefined;
25
16
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
26
17
  autoFocus?: boolean | undefined | undefined;
18
+ className?: string | undefined | undefined;
27
19
  contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
28
20
  contextMenu?: string | undefined | undefined;
21
+ dir?: string | undefined | undefined;
29
22
  draggable?: (boolean | "true" | "false") | undefined;
30
23
  enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
31
24
  lang?: string | undefined | undefined;
25
+ nonce?: string | undefined | undefined;
32
26
  spellCheck?: (boolean | "true" | "false") | undefined;
27
+ tabIndex?: number | undefined | undefined;
33
28
  translate?: "yes" | "no" | undefined | undefined;
34
29
  radioGroup?: string | undefined | undefined;
30
+ role?: import("react").AriaRole | undefined;
35
31
  about?: string | undefined | undefined;
32
+ content?: string | undefined | undefined;
36
33
  datatype?: string | undefined | undefined;
37
34
  inlist?: any;
35
+ prefix?: string | undefined | undefined;
38
36
  property?: string | undefined | undefined;
39
37
  rel?: string | undefined | undefined;
40
38
  resource?: string | undefined | undefined;
@@ -53,6 +51,8 @@ declare const Wrapper: import("styled-components").IStyledComponent<"web", {
53
51
  inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
54
52
  is?: string | undefined | undefined;
55
53
  exportparts?: string | undefined | undefined;
54
+ part?: string | undefined | undefined;
55
+ children?: import("react").ReactNode | Iterable<import("react").ReactNode>;
56
56
  "aria-activedescendant"?: string | undefined | undefined;
57
57
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
58
58
  "aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined | undefined;
@@ -127,7 +127,7 @@ declare const Wrapper: import("styled-components").IStyledComponent<"web", {
127
127
  onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
128
128
  onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
129
129
  onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
130
- onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
130
+ onBeforeInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
131
131
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
132
132
  onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
133
133
  onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
@@ -177,6 +177,8 @@ declare const Wrapper: import("styled-components").IStyledComponent<"web", {
177
177
  onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
178
178
  onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
179
179
  onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
180
+ onResize?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
181
+ onResizeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
180
182
  onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
181
183
  onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
182
184
  onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
@@ -3,6 +3,5 @@ export * from './types';
3
3
  export type { TEventPayload, CameraTransform, Geometry } from './types';
4
4
  export * from './load-data';
5
5
  export * from './hydrate-data';
6
- export * from './load-annotations';
7
6
  export * from './utils';
8
7
  export * from './online-directions';
@@ -9,6 +9,10 @@ export type TLoadDataOptions = Partial<{
9
9
  }> & THydrateDataOptions;
10
10
  /**
11
11
  * Load a public MVF while bypassing the need for API keys.
12
+ *
13
+ * Resolves a signed bundle URL from the public Azure function, then hands it to
14
+ * the SDK via `bundleUri` so the download/parse/hydrate pipeline (including
15
+ * Range reads and the worker node graph) runs inside `getMapData`.
12
16
  */
13
17
  export declare const loadData: (mapId: string, url?: string, options?: TLoadDataOptions) => Promise<MapData>;
14
18
  /**
@@ -1,15 +1,16 @@
1
- import { Place } from '../sdk';
2
- type TIconSymbol = {
3
- id: string;
4
- src: string;
5
- };
6
- export declare const SelfServeIcons: {
7
- readonly Annotation: Record<string, TIconSymbol>;
8
- };
1
+ import { Annotation, Place } from '../sdk';
9
2
  /**
10
- * Load a base64 encoded SVG icon from `@mappedin/self-serve-icons`.
3
+ * Return the CDN URL for an annotation's icon symbol.
4
+ * @param annotation - The annotation whose icon to resolve
5
+ * @returns A `https://cdn.mappedin.com/annotator-symbols/...` URL, or undefined if no icon exists
11
6
  */
12
- export declare const loadSelfServeIcon: (type: keyof typeof SelfServeIcons, id: string) => string | undefined;
7
+ export declare const getAnnotationIconUrl: (annotation: Annotation) => string | undefined;
8
+ /**
9
+ * Return the arrow background colour for an annotation's icon (from the SVG's first rect fill).
10
+ * @param annotation - The annotation whose icon colour to resolve
11
+ * @returns A CSS colour string, or undefined if no icon exists
12
+ */
13
+ export declare const getAnnotationIconBackground: (annotation: Annotation) => string | undefined;
13
14
  /**
14
15
  * Get an icon from the `ICONS` object as an HTML string.
15
16
  */
@@ -27,4 +28,3 @@ export declare const attemptIconUrlForPlace: (place: Place) => string | undefine
27
28
  */
28
29
  export declare const attemptIconNameForPlace: (place: Place) => string | undefined;
29
30
  export declare const getFilledCategoryIconString: (categoryIcon: string) => string | undefined;
30
- export {};
@@ -6,7 +6,12 @@ type TMarker = {
6
6
  key: string;
7
7
  type: string;
8
8
  text?: string;
9
- elementFn: () => ReactNode | Promise<ReactNode>;
9
+ elementFn?: () => ReactNode | Promise<ReactNode>;
10
+ /**
11
+ * Prebuilt HTML string, or async factory. When set, skips React renderToString.
12
+ * Prefer this for hot paths (e.g. annotations) — SDK Markers.add only accepts a string.
13
+ */
14
+ html?: string | (() => string | Promise<string>);
10
15
  onPointerDown?: () => void;
11
16
  onClick?: () => void;
12
17
  onWheel?: (e: WheelEvent) => void;
@@ -21,6 +26,7 @@ declare class MarkersController {
21
26
  private reactionDisposers;
22
27
  private markersVisible;
23
28
  private sdkMarkersByKey;
29
+ private annotationRootByContentEl;
24
30
  placeByMarkerId: Record<string, Place>;
25
31
  constructor({ rootStore, mapStore }: {
26
32
  rootStore: RootStore;
@@ -39,6 +45,13 @@ declare class MarkersController {
39
45
  private getMarkerColor;
40
46
  private getAnnotationRank;
41
47
  private getAreaRank;
48
+ /**
49
+ * Resolve (and memoize) the annotation marker root inside an SDK marker's content element.
50
+ * Cached because it is hit for every annotation marker on every selection change.
51
+ * @param marker - The SDK marker to look inside
52
+ * @returns The annotation root element, or undefined if this marker has none
53
+ */
54
+ private getAnnotationRoot;
42
55
  private forEachMarker;
43
56
  private handleZoomChange;
44
57
  private zoomOnWheel;
@@ -153,7 +153,7 @@ declare class UIStore {
153
153
  get shareButtonVisible(): boolean;
154
154
  get mainUIVisible(): boolean;
155
155
  get mainUIMaxHeight(): number;
156
- get appPadding(): 0 | 10 | 20 | 15;
156
+ get appPadding(): 0 | 20 | 10 | 15;
157
157
  get makerPopUpVisible(): boolean;
158
158
  get metadataCardVisible(): boolean;
159
159
  get availableDepartureModes(): E_DEPARTURE_MODE[];
@@ -0,0 +1,7 @@
1
+ import type RootStore from '../stores/root-store';
2
+ export declare const registerTestStore: (store: RootStore) => void;
3
+ /**
4
+ * Dispose every registered store. Must run while `document` still exists so
5
+ * their removeEventListener/clearTimeout teardown actually runs.
6
+ */
7
+ export declare const cleanupTestStores: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mappedin/viewer",
3
- "version": "0.59.4-ea5d866.0",
3
+ "version": "0.59.5-3072f0a.0",
4
4
  "type": "module",
5
5
  "browser": "./dist/index.js",
6
6
  "license": "UNLICENSED",
@@ -18,9 +18,9 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "@ladle/react": "^5.0.3",
21
- "@mappedin/blue-dot": "6.17.0-v6-13d60ac3.0",
22
- "@mappedin/dynamic-focus": "6.17.0-v6-13d60ac3.0",
23
- "@mappedin/mappedin-js": "6.17.1-v6-13d60ac3.0",
21
+ "@mappedin/blue-dot": "6.23.0-v6-e66bf5fa.0",
22
+ "@mappedin/dynamic-focus": "6.23.0-v6-e66bf5fa.0",
23
+ "@mappedin/mappedin-js": "6.23.1-v6-e66bf5fa.0",
24
24
  "@mappedin/mvf": "3.0.0-69b7308.0",
25
25
  "@mappedin/self-serve-icons": "1.105.0-alpha.SRV-2719-add-bleed-kit-annotation.1754600609",
26
26
  "@napi-rs/canvas": "^0.1.89",
@@ -31,6 +31,7 @@
31
31
  "@turf/difference": "^7.2.0",
32
32
  "@turf/geojson-rbush": "^7.2.0",
33
33
  "@turf/helpers": "^7.2.0",
34
+ "@types/escape-html": "1.0.4",
34
35
  "@types/geojson": "^7946.0.16",
35
36
  "@types/lodash.isequal": "^4.5.8",
36
37
  "@types/lodash.merge": "^4.6.9",
@@ -46,6 +47,7 @@
46
47
  "@vitest/coverage-istanbul": "^3.2.6",
47
48
  "dompurify": "^3.4.11",
48
49
  "dotenv": "^16.4.5",
50
+ "escape-html": "1.0.3",
49
51
  "escape-string-regexp": "^5.0.0",
50
52
  "eslint": "^8.45.0",
51
53
  "eslint-plugin-react-hooks": "^4.6.0",
@@ -1,2 +0,0 @@
1
- import { Annotation } from './mappedin-js';
2
- export declare const loadAnnotationAsset: (annotation: Annotation) => string | undefined;