@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/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# `@opendfieldmap/sdk`
|
|
2
|
+
|
|
3
|
+
Embeddable Open Endfield Map Widget for web applications.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @opendfieldmap/sdk
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { createOEMWidget } from '@opendfieldmap/sdk';
|
|
11
|
+
import '@opendfieldmap/sdk/style.css';
|
|
12
|
+
|
|
13
|
+
const widget = await createOEMWidget('#map', {
|
|
14
|
+
region: 'Valley_4',
|
|
15
|
+
floor: 'M',
|
|
16
|
+
locale: 'en-US',
|
|
17
|
+
markerTypes: ['crate_i', 'aurylene'],
|
|
18
|
+
labels: true,
|
|
19
|
+
markerClustering: true,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
await widget.setOptions({ boundaries: true });
|
|
23
|
+
widget.destroy();
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The host element must have an explicit height. Region, floor, and scale controls are enabled by default. Import `@opendfieldmap/sdk/style.css` once in the host application.
|
|
27
|
+
|
|
28
|
+
The package uses named, typed options and is safe to import during SSR. Widget creation must run in a browser. Tiles and map data are selected through a schema v1 release manifest and loaded from the configured static origin.
|
|
29
|
+
|
|
30
|
+
See the repository documentation for the complete API, resource protocol, localized guides, and release workflow.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<svg width="141" height="141" viewBox="0 0 141 141" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_2186_881)">
|
|
3
|
+
<path d="M3.31 0H0V3.31H3.31V0Z" fill="#333333"/>
|
|
4
|
+
<path d="M3.31 140.48H0V143.79H3.31V140.48Z" fill="#333333"/>
|
|
5
|
+
<path d="M141.57 140.48V141.64H140.41V142.64H142.57V140.48H141.57ZM1.08002 1.15002V3.31002H2.08002V2.15002H3.23002V1.15002H1.08002ZM5.23002 1.15002V2.15002H138.41V1.15002H5.23002ZM5.23002 141.64V142.64H138.41V141.64H5.23002ZM2.08002 140.48H1.08002V142.64H3.23002V141.64H2.08002V140.48ZM2.08002 5.31002H1.08002V138.48H2.08002V5.31002ZM140.41 1.15002V2.15002H141.57V3.31002H142.57V1.15002H140.41ZM141.57 5.31002V138.48H142.57V5.31002H141.57Z" fill="#333333"/>
|
|
6
|
+
<path d="M136.992 6.00987L126.272 16.7296L126.979 17.4367L137.699 6.71698L136.992 6.00987Z" fill="#333333"/>
|
|
7
|
+
<path d="M6.65291 6.01604L5.9458 6.72314L16.6655 17.4429L17.3726 16.7358L6.65291 6.01604Z" fill="#333333"/>
|
|
8
|
+
<path d="M16.6617 126.342L5.94196 137.062L6.64906 137.769L17.3688 127.049L16.6617 126.342Z" fill="#333333"/>
|
|
9
|
+
<path d="M126.985 126.346L126.278 127.053L136.998 137.773L137.705 137.066L126.985 126.346Z" fill="#333333"/>
|
|
10
|
+
<path d="M116.37 116.09L116.02 116.45L119.56 119.98L119.91 119.63L116.37 116.09ZM111.37 111.09L111.02 111.45L114.56 114.98L114.91 114.63L111.37 111.09ZM106.37 106.09L106.02 106.45L109.56 109.98L109.91 109.63L106.37 106.09ZM101.37 101.09L101.02 101.45L104.56 104.98L104.91 104.63L101.37 101.09ZM96.37 96.1501L96.02 96.5L99.56 100.03L99.91 99.6801L96.37 96.1501ZM91.42 91.1501L91.07 91.5L94.61 95.03L94.96 94.6801L91.42 91.1501ZM86.42 86.2L86.07 86.55L89.61 90.08L89.96 89.7301L86.42 86.2ZM81.48 81.2L81.12 81.5501L84.66 85.09L85.01 84.7301L81.48 81.2ZM76.48 76.2L76.12 76.5501L80 80.39L80.35 80.03L76.48 76.2ZM73.48 73.2L72.17 71.9001L71.83 71.5501L71.48 71.9001L71.83 72.25L75 75.4401L75.35 75.0801L73.48 73.2ZM66.88 66.6L66.52 66.95L69.84 70.27L70.06 70.49L70.41 70.13L66.88 66.6ZM61.93 61.6501L61.57 62L65.11 65.5401L65.46 65.18L61.93 61.6501ZM57 56.7001L56.64 57.05L60.18 60.59L60.53 60.23L57 56.7001ZM52.05 51.7001L51.69 52.05L55.23 55.59L55.58 55.23L52.05 51.7001ZM47.05 46.7001L46.69 47.05L50.23 50.59L50.58 50.23L47.05 46.7001ZM42.1 41.75L41.74 42.1L45.28 45.64L45.63 45.28L42.1 41.75ZM37.1 36.75L36.74 37.1L40.28 40.64L40.63 40.28L37.1 36.75ZM32.1 31.8L31.74 32.1501L35.28 35.69L35.63 35.3301L32.1 31.8ZM27.28 27L26.92 27.35L30.46 30.89L30.81 30.5301L27.28 27ZM22.28 22.05L22 22.4L25.54 25.9401L25.89 25.58L22.28 22.05Z" fill="#333333"/>
|
|
11
|
+
<path d="M27.27 116.09L23.73 119.63L24.09 119.98L27.62 116.45L27.27 116.09ZM32.22 111.09L28.68 114.63L29 115L32.53 111.47L32.22 111.09ZM37.22 106.15L33.68 109.68L34.04 110.03L37.57 106.5L37.22 106.15ZM42.17 101.15L38.63 104.68L38.99 105.03L42.52 101.5L42.17 101.15ZM47.17 96.1501L43.63 99.6801L43.99 100.03L47.52 96.5L47.17 96.1501ZM52.17 91.1501L48.63 94.6801L48.99 95.03L52.52 91.5L52.17 91.1501ZM57 86.4001L53.46 89.9301L53.82 90.28L57.35 86.75L57 86.4001ZM62 81.4001L58.38 85L58.74 85.3601L62.27 81.82L62 81.4001ZM67 76.4001L63.33 80L63.69 80.3601L67.22 76.82L67 76.4001ZM71.95 71.4001L71.6 71.75L69.97 73.3701L68.41 74.93L68.77 75.2901L70.33 73.7301L71.95 72.1L72.3 71.75L71.95 71.4001ZM76.95 66.4001L73.63 69.71L73.41 69.93L73.76 70.2901L73.99 70.06L77.12 67L76.95 66.4001ZM81.95 61.4501L78.41 64.9801L78.76 65.34L82.07 62L81.95 61.4501ZM86.95 56.5L83.41 60.03L83.76 60.39L87 57.05L86.95 56.5ZM91.95 51.5L88.41 55.03L88.76 55.39L92 52.1L91.95 51.5ZM96.9 46.5L93 50.3301L93.35 50.69L96.89 47.1501L96.9 46.5ZM101.9 41.55L98 45.3801L98.35 45.7401L101.89 42.2001L101.9 41.55ZM106.9 36.55L103.36 40.0801L103.71 40.44L107.25 36.9001L106.9 36.55ZM111.9 31.6L108.36 35.1301L108.71 35.4901L112.25 31.9501L111.9 31.6ZM116.36 27L112.83 30.5301L113.18 30.89L116.72 27.35L116.36 27ZM121.36 22.05L117.83 25.58L118.18 25.9401L121.72 22.4L121.36 22.05Z" fill="#333333"/>
|
|
12
|
+
<path d="M73.81 69.91H69.84V73.88H73.81V69.91Z" fill="#333333"/>
|
|
13
|
+
</g>
|
|
14
|
+
<defs>
|
|
15
|
+
<clipPath id="clip0_2186_881">
|
|
16
|
+
<rect width="140.41" height="140.48" fill="white"/>
|
|
17
|
+
</clipPath>
|
|
18
|
+
</defs>
|
|
19
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Control, ControlContext } from './types';
|
|
2
|
+
/** Creates the RGN control and its hover/focus subregion rail. */
|
|
3
|
+
export declare const createRegionControl: (context: ControlContext) => Control & {
|
|
4
|
+
element: HTMLElement;
|
|
5
|
+
};
|
|
6
|
+
/** Creates the Atlos LYR control and its floor selection rail. */
|
|
7
|
+
export declare const createLayerControl: (context: ControlContext) => Control & {
|
|
8
|
+
element: HTMLElement;
|
|
9
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { OEMControlMessages, OEMManifest } from '@opendfieldmap/core';
|
|
2
|
+
import type { OEMWidgetConfig, OEMWidgetState } from '../types';
|
|
3
|
+
/** Lifecycle contract shared by built-in controls. */
|
|
4
|
+
export interface Control {
|
|
5
|
+
sync(state: OEMWidgetState): void;
|
|
6
|
+
destroy?(): void;
|
|
7
|
+
}
|
|
8
|
+
/** Coordinates the one persistent flyout allowed across all switch controls. */
|
|
9
|
+
export interface Panels {
|
|
10
|
+
expand(owner: HTMLElement): void;
|
|
11
|
+
collapse(owner: HTMLElement): void;
|
|
12
|
+
collapseAll(): void;
|
|
13
|
+
}
|
|
14
|
+
/** Dependencies supplied by the Widget coordinator to built-in controls. */
|
|
15
|
+
export interface ControlContext {
|
|
16
|
+
manifest: OEMManifest;
|
|
17
|
+
zoomLocked: boolean;
|
|
18
|
+
apply(update: OEMWidgetConfig): void;
|
|
19
|
+
zoomTo(zoom: number, options: {
|
|
20
|
+
animate: boolean;
|
|
21
|
+
}): void;
|
|
22
|
+
panels: Panels;
|
|
23
|
+
}
|
|
24
|
+
/** Creates a reset, keyboard-accessible button for a control component. */
|
|
25
|
+
export declare const createButton: (className: string) => HTMLButtonElement;
|
|
26
|
+
/** Applies a localized accessible name to a control without embedding UI copy. */
|
|
27
|
+
export declare const setLabel: (element: HTMLElement, label: string) => void;
|
|
28
|
+
/** Resolves a control message bundle through the manifest locale fallback. */
|
|
29
|
+
export declare const getMessages: (manifest: OEMManifest, locale: string) => OEMControlMessages;
|
package/dist/fonts.d.ts
ADDED
package/dist/icons.d.ts
ADDED
package/dist/index.d.ts
ADDED