@opendfieldmap/sdk 0.1.0-alpha.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.
- package/LICENSE +661 -0
- package/README.md +30 -0
- package/dist/assets/map-pattern.svg +19 -0
- package/dist/assets/marker-hover.webp +0 -0
- package/dist/assets/marker-select.webp +0 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/scale.d.ts +5 -0
- package/dist/components/switches.d.ts +9 -0
- package/dist/components/types.d.ts +29 -0
- package/dist/fonts.d.ts +2 -0
- package/dist/icons.d.ts +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +846 -0
- package/dist/index.js.map +7 -0
- package/dist/state.d.ts +7 -0
- package/dist/style.css +1842 -0
- package/dist/types.d.ts +94 -0
- package/dist/widget.d.ts +3 -0
- package/package.json +29 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { OEMManifest, OEMResources } from '@opendfieldmap/core';
|
|
2
|
+
/** Stable top-level region identifiers published by OEM. */
|
|
3
|
+
export type OEMRegionId = 'Valley_4' | 'Wuling' | 'Dijiang' | 'Weekraid_1';
|
|
4
|
+
/** Short region aliases accepted for parity with existing OEM links. */
|
|
5
|
+
export type OEMRegionCode = 'VL' | 'WL' | 'DJ' | 'ES';
|
|
6
|
+
/** Region values accepted by the Widget configuration. */
|
|
7
|
+
export type OEMRegionSelector = OEMRegionId | OEMRegionCode;
|
|
8
|
+
/** Floor identifiers currently used by OEM tile sets. */
|
|
9
|
+
export type OEMFloorId = 'M' | 'L1' | 'L2' | 'L3' | 'L4' | 'B1' | 'B2' | 'B3' | 'B4';
|
|
10
|
+
/** Locales with complete place-name data in the current static release. */
|
|
11
|
+
export type OEMLocale = 'en-US' | 'zh-CN' | 'zh-HK' | 'ja-JP' | 'ko-KR' | 'ru-RU' | 'es-ES' | 'fr-FR' | 'de-DE' | 'it-IT' | 'id-ID' | 'pt-BR' | 'th-TH' | 'vi-VN';
|
|
12
|
+
/** Center coordinates in the selected region's max-native-zoom pixel space. */
|
|
13
|
+
export interface OEMWidgetCenter {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Declarative content and initial-view configuration.
|
|
19
|
+
*
|
|
20
|
+
* Omitted values use the defaults documented on each property.
|
|
21
|
+
*/
|
|
22
|
+
export interface OEMWidgetConfig {
|
|
23
|
+
/** Initial region. Defaults to the manifest's default region. */
|
|
24
|
+
region?: OEMRegionSelector;
|
|
25
|
+
/** Initial subregion ID. Defaults to the complete region (null). */
|
|
26
|
+
subregion?: string | null;
|
|
27
|
+
/** Initial floor. Defaults to M. */
|
|
28
|
+
floor?: OEMFloorId;
|
|
29
|
+
/** Place-name locale. Defaults to the closest supported browser locale. */
|
|
30
|
+
locale?: OEMLocale;
|
|
31
|
+
/** Marker type keys to show, * for all, or false for none. Defaults to false. */
|
|
32
|
+
markerTypes?: readonly string[] | '*' | false;
|
|
33
|
+
/** Whether place names are loaded and displayed. Defaults to true. */
|
|
34
|
+
labels?: boolean;
|
|
35
|
+
/** Whether subregion boundaries are loaded and displayed. Defaults to false. */
|
|
36
|
+
boundaries?: boolean;
|
|
37
|
+
/** Whether nearby markers are grouped by point type. Defaults to true. */
|
|
38
|
+
markerClustering?: boolean;
|
|
39
|
+
/** Initial zoom, clamped to the selected region's supported range. Defaults to the region preset. */
|
|
40
|
+
zoom?: number;
|
|
41
|
+
/** Initial map center. Defaults to the selected region or subregion preset. */
|
|
42
|
+
center?: OEMWidgetCenter;
|
|
43
|
+
}
|
|
44
|
+
/** Complete creation options for an embeddable OEM Widget. */
|
|
45
|
+
export interface OEMWidgetOptions extends OEMWidgetConfig {
|
|
46
|
+
/** Static CDN endpoints. Defaults to the planned OEM production endpoints. */
|
|
47
|
+
resources?: OEMResources;
|
|
48
|
+
/** Preloaded manifest for tests or controlled hosts. */
|
|
49
|
+
manifest?: OEMManifest;
|
|
50
|
+
/** Whether the Atlos-aligned region and subregion selector is shown. Defaults to true. */
|
|
51
|
+
showRegionSelector?: boolean;
|
|
52
|
+
/** Whether the Atlos-aligned floor selector is shown. Defaults to true. */
|
|
53
|
+
showFloorSelector?: boolean;
|
|
54
|
+
/** Whether the Atlos-aligned scale bar is shown. Defaults to true. */
|
|
55
|
+
showScaleBar?: boolean;
|
|
56
|
+
/** Prevents user drag and trackpad-pan gestures. Defaults to false. */
|
|
57
|
+
lockDrag?: boolean;
|
|
58
|
+
/** Prevents user wheel, pinch, keyboard, double-click, and scale-bar zoom. Defaults to false. */
|
|
59
|
+
lockZoom?: boolean;
|
|
60
|
+
/** Visual theme. Defaults to light. */
|
|
61
|
+
theme?: 'light' | 'dark';
|
|
62
|
+
/** Optional class added to the Widget root. */
|
|
63
|
+
className?: string;
|
|
64
|
+
/** Aborts creation and destroys the Widget when triggered. */
|
|
65
|
+
signal?: AbortSignal;
|
|
66
|
+
onReady?: (widget: OEMWidget) => void;
|
|
67
|
+
onStateChange?: (state: OEMWidgetState) => void;
|
|
68
|
+
onError?: (error: Error) => void;
|
|
69
|
+
}
|
|
70
|
+
/** Fully resolved runtime state emitted by an OEM Widget. */
|
|
71
|
+
export interface OEMWidgetState {
|
|
72
|
+
regionId: OEMRegionId;
|
|
73
|
+
subregionId: string | null;
|
|
74
|
+
floorId: OEMFloorId;
|
|
75
|
+
locale: OEMLocale;
|
|
76
|
+
markerTypes: string[] | '*';
|
|
77
|
+
labels: boolean;
|
|
78
|
+
boundaries: boolean;
|
|
79
|
+
markerClustering: boolean;
|
|
80
|
+
zoom: number;
|
|
81
|
+
center: OEMWidgetCenter;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Restricted Widget handle exposed to host applications.
|
|
85
|
+
*
|
|
86
|
+
* It intentionally does not expose Leaflet, custom point interaction, or drawing.
|
|
87
|
+
*/
|
|
88
|
+
export interface OEMWidget {
|
|
89
|
+
readonly destroyed: boolean;
|
|
90
|
+
getState(): OEMWidgetState;
|
|
91
|
+
setOptions(options: OEMWidgetConfig): Promise<void>;
|
|
92
|
+
resize(): void;
|
|
93
|
+
destroy(): void;
|
|
94
|
+
}
|
package/dist/widget.d.ts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@opendfieldmap/sdk",
|
|
3
|
+
"version": "0.1.0-alpha.0",
|
|
4
|
+
"description": "Embeddable Open Endfield Map widget",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "AGPL-3.0-only",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"README.md",
|
|
10
|
+
"LICENSE"
|
|
11
|
+
],
|
|
12
|
+
"sideEffects": [
|
|
13
|
+
"**/*.css"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./style.css": "./dist/style.css"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@opendfieldmap/core": "^0.1.0-alpha.0",
|
|
24
|
+
"@opendfieldmap/map": "^0.1.0-alpha.0"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
}
|
|
29
|
+
}
|