crumb-widget 1.0.1 → 1.0.2

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/dist/module.d.ts CHANGED
@@ -1,22 +1,54 @@
1
- import { CrumbWidgetConfig, Column } from './types';
2
- export type { CrumbWidgetConfig, Column };
3
- export interface MountOptions extends CrumbWidgetConfig {
4
- /** URL of the BMLT root server (required) */
5
- rootServerUrl: string;
6
- /** Service body IDs to filter by (defaults to all) */
7
- serviceBodyIds?: number[];
8
- }
9
- /**
10
- * Mount the Crumb Widget into the given element.
11
- *
12
- * @example
13
- * ```ts
14
- * import { mountCrumbWidget } from 'crumb-widget';
15
- *
16
- * mountCrumbWidget(document.getElementById('my-widget'), {
17
- * rootServerUrl: 'https://bmlt.example.org/main_server/',
18
- * serviceBodyIds: [1, 2, 3],
19
- * });
20
- * ```
21
- */
22
- export declare function mountCrumbWidget(el: HTMLElement, options: MountOptions): void;
1
+ export declare type Column = 'time' | 'name' | 'location' | 'address' | 'service_body';
2
+
3
+ export declare interface CrumbWidgetConfig {
4
+ language?: string;
5
+ defaultView?: 'list' | 'map';
6
+ columns?: Column[];
7
+ geolocation?: boolean;
8
+ geolocationRadius?: number;
9
+ height?: number;
10
+ darkMode?: 'auto' | true | false;
11
+ nowOffset?: number;
12
+ map?: {
13
+ tiles?: TilesConfig;
14
+ tiles_dark?: TilesConfig;
15
+ markers?: {
16
+ location?: MarkerConfig;
17
+ };
18
+ };
19
+ }
20
+
21
+ declare interface MarkerConfig {
22
+ html: string;
23
+ width: number;
24
+ height: number;
25
+ }
26
+
27
+ /**
28
+ * Mount the Crumb Widget into the given element.
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * import { mountCrumbWidget } from 'crumb-widget';
33
+ *
34
+ * mountCrumbWidget(document.getElementById('my-widget'), {
35
+ * rootServerUrl: 'https://bmlt.example.org/main_server/',
36
+ * serviceBodyIds: [1, 2, 3],
37
+ * });
38
+ * ```
39
+ */
40
+ export declare function mountCrumbWidget(el: HTMLElement, options: MountOptions): void;
41
+
42
+ export declare interface MountOptions extends CrumbWidgetConfig {
43
+ /** URL of the BMLT root server (required) */
44
+ rootServerUrl: string;
45
+ /** Service body IDs to filter by (defaults to all) */
46
+ serviceBodyIds?: number[];
47
+ }
48
+
49
+ declare interface TilesConfig {
50
+ url: string;
51
+ attribution: string;
52
+ }
53
+
54
+ export { }
package/dist/module.js CHANGED
@@ -10126,7 +10126,7 @@ var sl = [
10126
10126
  "address"
10127
10127
  ];
10128
10128
  function cl(e, t) {
10129
- Z.rootServerUrl = t.rootServerUrl, Z.serviceBodyIds = t.serviceBodyIds ?? [], Z.containerId = e.id || "crumb-widget", Z.defaultView = t.defaultView ?? "list", Z.locationMarker = t.map?.markers?.location, Z.tiles = t.map?.tiles, Z.tilesDark = t.map?.tiles_dark, Z.columns = t.columns ?? sl, Z.geolocation = t.geolocation ?? !1, Z.geolocationRadius = t.geolocationRadius ?? 10, Z.height = t.height, Z.darkMode = t.darkMode ?? !1, Z.nowOffset = t.nowOffset ?? 10, $o(t.language ?? (typeof navigator < "u" ? navigator.language : "en")), Z.darkMode === "auto" ? e.classList.add("bmlt-dark-auto") : Z.darkMode === !0 && e.classList.add("bmlt-dark-force"), console.log("[crumb-widget] v1.0.1+1bae01c"), Gr(ol, {
10129
+ Z.rootServerUrl = t.rootServerUrl, Z.serviceBodyIds = t.serviceBodyIds ?? [], Z.containerId = e.id || "crumb-widget", Z.defaultView = t.defaultView ?? "list", Z.locationMarker = t.map?.markers?.location, Z.tiles = t.map?.tiles, Z.tilesDark = t.map?.tiles_dark, Z.columns = t.columns ?? sl, Z.geolocation = t.geolocation ?? !1, Z.geolocationRadius = t.geolocationRadius ?? 10, Z.height = t.height, Z.darkMode = t.darkMode ?? !1, Z.nowOffset = t.nowOffset ?? 10, $o(t.language ?? (typeof navigator < "u" ? navigator.language : "en")), Z.darkMode === "auto" ? e.classList.add("bmlt-dark-auto") : Z.darkMode === !0 && e.classList.add("bmlt-dark-force"), console.log("[crumb-widget] v1.0.2+1bae01c"), Gr(ol, {
10130
10130
  target: e,
10131
10131
  props: { config: Z }
10132
10132
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crumb-widget",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -9,8 +9,7 @@
9
9
  },
10
10
  "files": [
11
11
  "dist/module.js",
12
- "dist/module.d.ts",
13
- "dist/types.d.ts"
12
+ "dist/module.d.ts"
14
13
  ],
15
14
  "module": "./dist/module.js",
16
15
  "types": "./dist/module.d.ts",