@wemap/core 14.6.0-beta.1 → 14.6.0-beta.3
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/LICENSE +23 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +340 -311
- package/dist/src/CoreConfig.d.ts +19 -1
- package/dist/src/CoreConfig.d.ts.map +1 -1
- package/dist/src/helpers/SnippetParser.d.ts +1 -1
- package/dist/src/services/BuildingService.d.ts +1 -1
- package/dist/src/services/PinpointCache.d.ts +1 -1
- package/dist/src/services/PinpointManager.d.ts +1 -1
- package/dist/src/services/PinpointService.d.ts.map +1 -1
- package/dist/src/theme.d.ts +36 -0
- package/dist/src/theme.d.ts.map +1 -0
- package/dist/src/types/common.d.ts +1 -1
- package/dist/src/types/pinpoint.d.ts +3 -2
- package/dist/src/types/pinpoint.d.ts.map +1 -1
- package/dist/src/utils/map.d.ts +1 -1
- package/package.json +20 -2
package/dist/src/CoreConfig.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { BoundingBox } from '
|
|
1
|
+
import { BoundingBox } from '@wemap/geo';
|
|
2
2
|
import { PinpointManager } from './services/PinpointManager';
|
|
3
3
|
import { SnippetParser } from './helpers/SnippetParser';
|
|
4
4
|
import { Building } from './types/indoor';
|
|
5
|
+
import { WemapTheme } from './theme';
|
|
5
6
|
/**
|
|
6
7
|
* Initialization options for the Core SDK
|
|
7
8
|
*/
|
|
@@ -12,6 +13,11 @@ export interface InitOptions {
|
|
|
12
13
|
token: string;
|
|
13
14
|
/** Environment to use - defaults to 'production' */
|
|
14
15
|
env?: 'production' | 'development';
|
|
16
|
+
/**
|
|
17
|
+
* SDK visual design tokens. Merged over the built-in defaults; unset fields
|
|
18
|
+
* keep their default. Not read from the livemap snippet — SDK-specific.
|
|
19
|
+
*/
|
|
20
|
+
theme?: Partial<WemapTheme>;
|
|
15
21
|
}
|
|
16
22
|
type Snippet = ReturnType<typeof SnippetParser.parse>;
|
|
17
23
|
/** Indoor settings from the livemap snippet (`indoor.enable`, `indoor.minZoom`). */
|
|
@@ -47,6 +53,7 @@ export interface IndoorOptions {
|
|
|
47
53
|
*/
|
|
48
54
|
export declare class CoreConfig {
|
|
49
55
|
private static snippet;
|
|
56
|
+
private static theme;
|
|
50
57
|
private livemapService;
|
|
51
58
|
private env;
|
|
52
59
|
/**
|
|
@@ -127,6 +134,17 @@ export declare class CoreConfig {
|
|
|
127
134
|
scrollZoom: any;
|
|
128
135
|
interactive: boolean;
|
|
129
136
|
};
|
|
137
|
+
/**
|
|
138
|
+
* The resolved SDK theme (built-in defaults merged with any `core.init`
|
|
139
|
+
* override). Returns the defaults when the SDK has not been initialized.
|
|
140
|
+
*/
|
|
141
|
+
static getTheme(): WemapTheme;
|
|
142
|
+
/**
|
|
143
|
+
* The resolved theme as CSS custom properties
|
|
144
|
+
* (`{ '--wemap-color-primary': '#…', … }`). UI packages apply these to their
|
|
145
|
+
* root element; their stylesheets reference the variables.
|
|
146
|
+
*/
|
|
147
|
+
static getThemeCssVariables(): Record<string, string>;
|
|
130
148
|
/**
|
|
131
149
|
* Build a building provider for the initialized livemap: a function that
|
|
132
150
|
* returns the buildings whose bbox intersects a given viewport.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreConfig.d.ts","sourceRoot":"","sources":["../../src/CoreConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAG9C,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"CoreConfig.d.ts","sourceRoot":"","sources":["../../src/CoreConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAA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;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,UAAU;IAI7B;;;;OAIG;IACH,MAAM,CAAC,oBAAoB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIrD;;;;;;;;;;;;;;;OAeG;IACH,sBAAsB,IAAI,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,EAAE,CAAC;IAMpE;;;;;;;;;;;;OAYG;IACH,qBAAqB,IAAI,eAAe;CAGzC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI,YAAmB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SchemaKey, SchemaProperty, MapObjectType } from '../schemas/types';
|
|
2
|
-
import { BoundingBox } from '
|
|
2
|
+
import { BoundingBox } from '@wemap/geo';
|
|
3
3
|
export declare class SnippetParser {
|
|
4
4
|
static snippet: Record<string, any>;
|
|
5
5
|
static mapObject: MapObjectType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BoundingBox } from '
|
|
1
|
+
import { BoundingBox } from '@wemap/geo';
|
|
2
2
|
import { Pinpoint, PinpointResolver, PinpointSearchQuery, PinpointSearchResponse } from '../types/pinpoint';
|
|
3
3
|
/**
|
|
4
4
|
* Public façade for pinpoint retrieval/search operations bound to a livemap.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PinpointService.d.ts","sourceRoot":"","sources":["../../../src/services/PinpointService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,QAAQ,EACR,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"PinpointService.d.ts","sourceRoot":"","sources":["../../../src/services/PinpointService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,QAAQ,EACR,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;AAwB3B;;;GAGG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAC,SAAS,CAAO;IAC/B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;gBAEnB,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;IAK7C,MAAM,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAenE,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAM5C;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAsBnC,yCAAyC;IACzC,iBAAiB,CAAC,KAAK,EAAE,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CAkC/E"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SDK-wide visual design tokens.
|
|
3
|
+
*
|
|
4
|
+
* Theme lives in `@wemap/core` (not `@wemap/map`) so every UI-bearing package —
|
|
5
|
+
* `@wemap/map` today, a future `@wemap/ui` — resolves the same tokens and stays
|
|
6
|
+
* visually consistent. Core owns the token **data** and the CSS-variable **name
|
|
7
|
+
* contract**; it ships no CSS. Each UI package styles its own DOM against
|
|
8
|
+
* `var(--wemap-*)`.
|
|
9
|
+
*
|
|
10
|
+
* Tokens are SDK-specific and are **not** read from the livemap snippet. Set them
|
|
11
|
+
* via `core.init({ theme })`; unset fields fall back to {@link DEFAULT_THEME}.
|
|
12
|
+
*
|
|
13
|
+
* @see docs/adr/0001-theming-tokens-in-core.md
|
|
14
|
+
*/
|
|
15
|
+
export interface WemapTheme {
|
|
16
|
+
/** Brand colour — markers, cluster bubbles, route line, user location, highlights. */
|
|
17
|
+
colorPrimary: string;
|
|
18
|
+
/** Content (icon/text) rendered on top of {@link colorPrimary}. */
|
|
19
|
+
colorOnPrimary: string;
|
|
20
|
+
/** Background of surfaces such as controls and popups. */
|
|
21
|
+
colorSurface: string;
|
|
22
|
+
/** Content (text/icon) rendered on top of {@link colorSurface}. */
|
|
23
|
+
colorOnSurface: string;
|
|
24
|
+
}
|
|
25
|
+
/** Built-in theme, used when `core.init` is called without a `theme` override. */
|
|
26
|
+
export declare const DEFAULT_THEME: WemapTheme;
|
|
27
|
+
/** Merge a partial theme over {@link DEFAULT_THEME}. Unset fields keep defaults. */
|
|
28
|
+
export declare function resolveTheme(overrides?: Partial<WemapTheme>): WemapTheme;
|
|
29
|
+
/**
|
|
30
|
+
* The public CSS custom-property contract. UI packages reference these names
|
|
31
|
+
* (`var(--wemap-color-primary)`, …); per-surface variables (e.g.
|
|
32
|
+
* `--wemap-color-cluster`) are defined in each package's stylesheet and fall
|
|
33
|
+
* back to these.
|
|
34
|
+
*/
|
|
35
|
+
export declare function themeToCssVariables(theme: WemapTheme): Record<string, string>;
|
|
36
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,UAAU;IACzB,sFAAsF;IACtF,YAAY,EAAE,MAAM,CAAC;IACrB,mEAAmE;IACnE,cAAc,EAAE,MAAM,CAAC;IACvB,0DAA0D;IAC1D,YAAY,EAAE,MAAM,CAAC;IACrB,mEAAmE;IACnE,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,kFAAkF;AAClF,eAAO,MAAM,aAAa,EAAE,UAK3B,CAAC;AAEF,oFAAoF;AACpF,wBAAgB,YAAY,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAO7E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** A read-only model of a Wemap pinpoint. */
|
|
2
2
|
export interface Pinpoint {
|
|
3
3
|
id: number;
|
|
4
4
|
name: string;
|
|
@@ -11,6 +11,7 @@ export interface Pinpoint {
|
|
|
11
11
|
category?: number;
|
|
12
12
|
image_url?: string;
|
|
13
13
|
address?: string;
|
|
14
|
+
external_data: Record<string, unknown> | null;
|
|
14
15
|
}
|
|
15
16
|
/** Bounds params returned by {@link boundsToDelta}. */
|
|
16
17
|
export interface PinpointBoundsParams {
|
|
@@ -44,6 +45,6 @@ export interface PinpointSearchResponse {
|
|
|
44
45
|
export interface PinpointResolver {
|
|
45
46
|
getById(id: number): Promise<Pinpoint | null>;
|
|
46
47
|
getLoadedPinpoints(): Pinpoint[];
|
|
47
|
-
preloadViewport(bounds: import('
|
|
48
|
+
preloadViewport(bounds: import('@wemap/geo').BoundingBox, level?: number | null): Promise<void>;
|
|
48
49
|
}
|
|
49
50
|
//# sourceMappingURL=pinpoint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pinpoint.d.ts","sourceRoot":"","sources":["../../../src/types/pinpoint.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"pinpoint.d.ts","sourceRoot":"","sources":["../../../src/types/pinpoint.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACj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o';
|
|
2
2
|
import { LatLngLike } from '../types/common';
|
|
3
3
|
export declare const defaultBounds: BoundingBox;
|
|
4
4
|
export declare const correctBounds: (bounds: BoundingBox) => BoundingBox;
|
package/package.json
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wemap/core",
|
|
3
|
-
"version": "14.6.0-beta.
|
|
3
|
+
"version": "14.6.0-beta.3",
|
|
4
|
+
"description": "Core configuration, livemap services and shared types for the Wemap SDK.",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"author": "Wemap SAS",
|
|
7
|
+
"homepage": "https://github.com/wemap/wemap-sdk-js#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/wemap/wemap-sdk-js.git",
|
|
11
|
+
"directory": "packages/core"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/wemap/wemap-sdk-js/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"wemap",
|
|
18
|
+
"sdk",
|
|
19
|
+
"livemap"
|
|
20
|
+
],
|
|
4
21
|
"type": "module",
|
|
5
22
|
"private": false,
|
|
6
23
|
"publishConfig": {
|
|
@@ -14,11 +31,12 @@
|
|
|
14
31
|
"types": "./dist/index.d.ts"
|
|
15
32
|
}
|
|
16
33
|
},
|
|
34
|
+
"sideEffects": false,
|
|
17
35
|
"files": [
|
|
18
36
|
"dist"
|
|
19
37
|
],
|
|
20
38
|
"dependencies": {
|
|
21
|
-
"@wemap/geo": "14.6.0-beta.
|
|
39
|
+
"@wemap/geo": "14.6.0-beta.3",
|
|
22
40
|
"@types/geojson": "^7946.0.16"
|
|
23
41
|
}
|
|
24
42
|
}
|