crumb-widget 1.5.0 → 1.5.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 +48 -8
- package/dist/module.js +2520 -2312
- package/package.json +27 -25
package/dist/module.d.ts
CHANGED
|
@@ -1,21 +1,61 @@
|
|
|
1
|
-
import { CrumbWidgetConfig, Column } from './types';
|
|
2
|
-
export type { CrumbWidgetConfig, Column };
|
|
1
|
+
import { CrumbWidgetConfig, Column, TilesConfig, MarkerConfig } from './types';
|
|
2
|
+
export type { CrumbWidgetConfig, Column, TilesConfig, MarkerConfig };
|
|
3
|
+
/**
|
|
4
|
+
* Options accepted by {@link mountCrumbWidget}. Extends {@link CrumbWidgetConfig}
|
|
5
|
+
* with the two fields that are required up-front in library mode:
|
|
6
|
+
*
|
|
7
|
+
* - `serverUrl` — the BMLT root server to query (required).
|
|
8
|
+
* - `serviceBodyIds` — optional list of service bodies to scope the query to;
|
|
9
|
+
* when omitted, the widget queries all meetings on the server.
|
|
10
|
+
*
|
|
11
|
+
* All inherited fields from {@link CrumbWidgetConfig} are optional and follow
|
|
12
|
+
* the same defaults as the IIFE bundle.
|
|
13
|
+
*/
|
|
3
14
|
export interface MountOptions extends CrumbWidgetConfig {
|
|
4
|
-
/** URL of the BMLT server (required) */
|
|
15
|
+
/** URL of the BMLT root server (required), e.g. `https://bmlt.example.org/main_server/`. */
|
|
5
16
|
serverUrl: string;
|
|
6
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Service body IDs to filter by. Defaults to all (every meeting on the
|
|
19
|
+
* server). The search is recursive — child service bodies are included.
|
|
20
|
+
*/
|
|
7
21
|
serviceBodyIds?: number[];
|
|
8
22
|
}
|
|
9
23
|
/**
|
|
10
|
-
* Mount the Crumb Widget into the given element.
|
|
24
|
+
* Mount the Crumb Widget into the given DOM element.
|
|
25
|
+
*
|
|
26
|
+
* The element should be empty — the widget renders its full UI into it. The
|
|
27
|
+
* element's `id` (or `"crumb-widget"` if it has none) is used as a stable
|
|
28
|
+
* identifier for in-page anchors and routing.
|
|
29
|
+
*
|
|
30
|
+
* Calling this function:
|
|
31
|
+
*
|
|
32
|
+
* 1. Validates and stores the supplied options into the shared config store.
|
|
33
|
+
* 2. Resolves the active language (explicit `options.language` →
|
|
34
|
+
* `navigator.language` → `"en"`) and initializes the i18n store.
|
|
35
|
+
* 3. Applies the dark-mode class to the element when `darkMode` is `true` or
|
|
36
|
+
* `'auto'`.
|
|
37
|
+
* 4. Mounts the root Svelte component, which kicks off the BMLT data load.
|
|
11
38
|
*
|
|
12
|
-
*
|
|
39
|
+
* The function returns synchronously — meeting data loads asynchronously
|
|
40
|
+
* after mount and the widget shows a loading state until it arrives.
|
|
41
|
+
*
|
|
42
|
+
* @param el - The host element to render the widget into.
|
|
43
|
+
* @param options - Configuration. See {@link MountOptions}.
|
|
44
|
+
*
|
|
45
|
+
* @example Minimal mount
|
|
13
46
|
* ```ts
|
|
14
|
-
*
|
|
47
|
+
* mountCrumbWidget(document.getElementById('widget')!, {
|
|
48
|
+
* serverUrl: 'https://bmlt.example.org/main_server/',
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
15
51
|
*
|
|
16
|
-
*
|
|
52
|
+
* @example With service bodies and custom view
|
|
53
|
+
* ```ts
|
|
54
|
+
* mountCrumbWidget(document.getElementById('widget')!, {
|
|
17
55
|
* serverUrl: 'https://bmlt.example.org/main_server/',
|
|
18
56
|
* serviceBodyIds: [1, 2, 3],
|
|
57
|
+
* view: 'both',
|
|
58
|
+
* darkMode: 'auto',
|
|
19
59
|
* });
|
|
20
60
|
* ```
|
|
21
61
|
*/
|