@mappedin/viewer 0.28.3-e764ae7.0 → 0.29.1-257c107.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.
@@ -61,6 +61,10 @@ export type TStartViewerCommonOptions = {
61
61
  * Option to hide the current app state from being shown in the URL.
62
62
  */
63
63
  hideRouterState?: boolean;
64
+ /**
65
+ * Option to hide the map ID from being shown in the URL.
66
+ */
67
+ hideMapIdInUrl?: boolean;
64
68
  };
65
69
  export type TStartViewerOptions = {
66
70
  /**
@@ -0,0 +1,5 @@
1
+ import { TStartViewerOptions, TStartViewerWithLocalDataOptions } from '../types/options';
2
+ /**
3
+ * Throws if the options are not valid. Logs warnings if the options are valid but used in a non-optimal way.
4
+ */
5
+ export declare const assertOptions: (options: TStartViewerOptions | TStartViewerWithLocalDataOptions) => void;
@@ -0,0 +1 @@
1
+ export {};
@@ -5,16 +5,30 @@ type TRouterGoOptions = {
5
5
  replace?: boolean;
6
6
  };
7
7
  type TParams = Record<string, string | string[] | undefined>;
8
+ type TRouterStoreOptions = {
9
+ /**
10
+ * The history object to use for navigation.
11
+ */
12
+ history: History;
13
+ /**
14
+ * The base path for the router. The router will ensure this path is present in the state at all times.
15
+ */
16
+ base?: string;
17
+ /**
18
+ * An array of allowed paths in the state (not including the base path). If specified, the router will filter
19
+ * out any paths that are not in this list.
20
+ */
21
+ allowedPaths?: string[];
22
+ };
8
23
  declare class RouterStore {
9
24
  private base;
25
+ private allowedPaths;
10
26
  private _path;
11
27
  private _params;
12
28
  private history;
13
29
  private disposer;
14
- constructor({ history, base }: {
15
- history: History;
16
- base?: string;
17
- });
30
+ constructor({ history, base, allowedPaths }: TRouterStoreOptions);
31
+ private createAllowedPaths;
18
32
  private encodeParam;
19
33
  private decodeParam;
20
34
  private encodeParams;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mappedin/viewer",
3
- "version": "0.28.3-e764ae7.0",
3
+ "version": "0.29.1-257c107.0",
4
4
  "type": "module",
5
5
  "browser": "./dist/index.js",
6
6
  "license": "UNLICENSED",