@mosaicajs/components 0.1.0-rc.4 → 0.1.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.
Files changed (52) hide show
  1. package/dist/artifact-card.d.ts +20 -26
  2. package/dist/artifact-card.js +20 -26
  3. package/dist/base.d.ts +21 -29
  4. package/dist/base.js +18 -26
  5. package/dist/basemap.d.ts +2 -2
  6. package/dist/cluster-filter.d.ts +19 -25
  7. package/dist/cluster-filter.js +19 -25
  8. package/dist/colour-editor.d.ts +16 -36
  9. package/dist/colour-editor.js +16 -36
  10. package/dist/context.d.ts +4 -4
  11. package/dist/context.js +4 -4
  12. package/dist/count.d.ts +16 -15
  13. package/dist/count.js +16 -15
  14. package/dist/events.d.ts +63 -68
  15. package/dist/explorer.d.ts +76 -119
  16. package/dist/explorer.js +76 -121
  17. package/dist/field-card.d.ts +24 -56
  18. package/dist/field-card.js +24 -56
  19. package/dist/filter-panel.d.ts +31 -45
  20. package/dist/filter-panel.js +31 -45
  21. package/dist/filter.d.ts +20 -28
  22. package/dist/filter.js +20 -28
  23. package/dist/hierarchy.d.ts +35 -36
  24. package/dist/hierarchy.js +35 -36
  25. package/dist/index.d.ts +5 -4
  26. package/dist/index.js +5 -4
  27. package/dist/item-card.d.ts +34 -55
  28. package/dist/item-card.js +34 -55
  29. package/dist/key-picker.d.ts +5 -5
  30. package/dist/key-picker.js +5 -5
  31. package/dist/layer-picker.d.ts +11 -9
  32. package/dist/layer-picker.js +11 -9
  33. package/dist/map.d.ts +134 -172
  34. package/dist/map.js +136 -188
  35. package/dist/mosaica-components.js +5599 -1594
  36. package/dist/mosaica-components.js.LICENSE.txt +80 -16
  37. package/dist/mosaica-components.js.sri +1 -1
  38. package/dist/mosaica-components.json +2 -2
  39. package/dist/parts.d.ts +3 -4
  40. package/dist/parts.js +3 -4
  41. package/dist/selection.d.ts +21 -27
  42. package/dist/selection.js +21 -27
  43. package/dist/states.d.ts +15 -20
  44. package/dist/status.d.ts +26 -38
  45. package/dist/status.js +26 -38
  46. package/dist/store-element.d.ts +8 -7
  47. package/dist/store-element.js +8 -7
  48. package/dist/tokens.d.ts +12 -13
  49. package/dist/tokens.js +12 -13
  50. package/dist/view-picker.d.ts +10 -6
  51. package/dist/view-picker.js +10 -6
  52. package/package.json +6 -6
@@ -3,48 +3,45 @@ import { type ArtifactDetail, type Refusal } from '@mosaicajs/client';
3
3
  import { MosaicaElement } from './base.js';
4
4
  import './count.js';
5
5
  /**
6
- * The opened artifact: its name, its masked count, its description, layer and key, the kind of
7
- * shape its layer draws, its parents and its children in this view, Fit to cluster, and buttons
8
- * that put a `member_of` clause on it as a filter, as a highlight, or as a filter to what is
9
- * outside it. A `member_of` clause selects by membership, where a drawn region selects by shape;
10
- * they differ for an artifact whose members are spread across the map. Fit is absent on a filter
11
- * layer, which draws nothing. Pressing a parent or child opens it.
6
+ * Use the artifact card to show an artifact the viewer has opened on the map, such as a cluster. An
7
+ * artifact is a named group of items in an annotation layer. The card's count covers every member
8
+ * the viewer may see, so it does not change as the map moves. Pressing one of the artifact's
9
+ * parents or children opens that one instead.
12
10
  *
13
- * A host's buttons in the `actions` slot sit beside the close button.
11
+ * The card reads the store's opened artifact, or the `artifact` you set.
14
12
  *
15
- * The count is over the artifact's whole membership as the viewer sees it and does not change with
16
- * the view. An artifact with no name shows a dash in the headline and its key in its own field.
17
- * The server gives the same refusal for every artifact it withholds. The artifact is the store's
18
- * (`Store.openArtifact`), or the `artifact` property.
13
+ * The card's buttons filter or highlight the map by the artifact's members wherever they are, or
14
+ * filter to everything outside it. Fit to cluster fires `mosaica-artifactfit`, and
15
+ * `<mosaica-explorer>` responds by fitting its map to the artifact. A filter layer draws nothing,
16
+ * so its artifacts have no Fit button.
19
17
  *
20
- * @summary The opened artifact, with its lineage and its filter buttons.
18
+ * @summary A card showing an artifact's details, parents and children.
21
19
  * @tagname mosaica-artifact-card
22
20
  * @category Elements
23
21
  * @slot actions - Buttons beside the close button, such as the explorer's Pin.
24
22
  * @fires {CustomEvent<MosaicaEventDetails['mosaica-artifactfit']>} mosaica-artifactfit - Fit to
25
23
  * cluster was pressed. `<mosaica-explorer>` fits its map to the artifact.
26
- * @fires {CustomEvent<MosaicaEventDetails['mosaica-clausechange']>} mosaica-clausechange - A clause
27
- * button put a `member_of` clause on or took it off.
24
+ * @fires {CustomEvent<MosaicaEventDetails['mosaica-clausechange']>} mosaica-clausechange - A filter
25
+ * or highlight button added or removed a `member_of` clause.
28
26
  * @fires {CustomEvent<MosaicaEventDetails['mosaica-close']>} mosaica-close - The close button was
29
27
  * pressed, with `what` set to `artifact`.
30
- * @csspart title - The heading: the level's or the layer's title, holding the close button while
31
- * the card shows an artifact or a refusal.
28
+ * @csspart title - The heading, with the level's or layer's title and the close button.
32
29
  * @csspart close - The close button.
33
30
  * @csspart state - The state line, with `data-state`.
34
31
  * @csspart refusal - The words "Not available", with `data-code` set to the refusal's code.
35
- * @csspart reason - The server's reason for the refusal, on a line under "Not available".
36
- * @csspart headline - The artifact's name, with `data-unnamed` where it has none.
37
- * @csspart count - The masked count.
32
+ * @csspart reason - The server's reason for the refusal, under "Not available".
33
+ * @csspart headline - The artifact's name, with `data-unnamed` if it has none.
34
+ * @csspart count - The count of items the viewer may see.
38
35
  * @csspart content - The artifact's description, or its attached topic.
39
36
  * @csspart value - The layer and the key.
40
- * @csspart shape - What the layer's shape is, with `data-kind` (`derived`, `predicate` or
37
+ * @csspart shape - How the layer's shapes are made, with `data-kind` (`derived`, `predicate` or
41
38
  * `authored`).
42
39
  * @csspart label - The headings above the parents and the children.
43
40
  * @csspart parents - The list of parents.
44
41
  * @csspart parent - One parent, with `data-id`.
45
42
  * @csspart children - The list of children in this view.
46
43
  * @csspart child - One child, with `data-id`.
47
- * @csspart name - A parent's or a child's name, with `data-unnamed` where it has none.
44
+ * @csspart name - A parent's or child's name, with `data-unnamed` if it has none.
48
45
  * @csspart fit - The Fit to cluster button.
49
46
  * @csspart verbs - The clause buttons.
50
47
  * @csspart filter - The Filter to this button, with `aria-pressed` while its clause is on.
@@ -53,15 +50,12 @@ import './count.js';
53
50
  */
54
51
  export declare class MosaicaArtifactCard extends MosaicaElement {
55
52
  static styles: import("lit").CSSResult[];
56
- /**
57
- * The artifact to show, for a host that fetches the drill-down itself. Set with `refusal` or
58
- * alone, it replaces the store's opened artifact.
59
- */
53
+ /** The artifact to show, if you fetch its details yourself. It replaces the store's opened artifact. */
60
54
  accessor artifact: {
61
55
  id: bigint;
62
56
  detail: ArtifactDetail;
63
57
  } | null;
64
- /** A refusal to show in place of an artifact, for a host that fetches the drill-down itself. */
58
+ /** A refusal to show instead of an artifact, if you fetch its details yourself. */
65
59
  accessor refusal: Refusal | null;
66
60
  private get shown();
67
61
  /**
@@ -57,48 +57,45 @@ const SHAPE_TEXT = {
57
57
  authored: 'The same for everyone'
58
58
  };
59
59
  /**
60
- * The opened artifact: its name, its masked count, its description, layer and key, the kind of
61
- * shape its layer draws, its parents and its children in this view, Fit to cluster, and buttons
62
- * that put a `member_of` clause on it as a filter, as a highlight, or as a filter to what is
63
- * outside it. A `member_of` clause selects by membership, where a drawn region selects by shape;
64
- * they differ for an artifact whose members are spread across the map. Fit is absent on a filter
65
- * layer, which draws nothing. Pressing a parent or child opens it.
60
+ * Use the artifact card to show an artifact the viewer has opened on the map, such as a cluster. An
61
+ * artifact is a named group of items in an annotation layer. The card's count covers every member
62
+ * the viewer may see, so it does not change as the map moves. Pressing one of the artifact's
63
+ * parents or children opens that one instead.
66
64
  *
67
- * A host's buttons in the `actions` slot sit beside the close button.
65
+ * The card reads the store's opened artifact, or the `artifact` you set.
68
66
  *
69
- * The count is over the artifact's whole membership as the viewer sees it and does not change with
70
- * the view. An artifact with no name shows a dash in the headline and its key in its own field.
71
- * The server gives the same refusal for every artifact it withholds. The artifact is the store's
72
- * (`Store.openArtifact`), or the `artifact` property.
67
+ * The card's buttons filter or highlight the map by the artifact's members wherever they are, or
68
+ * filter to everything outside it. Fit to cluster fires `mosaica-artifactfit`, and
69
+ * `<mosaica-explorer>` responds by fitting its map to the artifact. A filter layer draws nothing,
70
+ * so its artifacts have no Fit button.
73
71
  *
74
- * @summary The opened artifact, with its lineage and its filter buttons.
72
+ * @summary A card showing an artifact's details, parents and children.
75
73
  * @tagname mosaica-artifact-card
76
74
  * @category Elements
77
75
  * @slot actions - Buttons beside the close button, such as the explorer's Pin.
78
76
  * @fires {CustomEvent<MosaicaEventDetails['mosaica-artifactfit']>} mosaica-artifactfit - Fit to
79
77
  * cluster was pressed. `<mosaica-explorer>` fits its map to the artifact.
80
- * @fires {CustomEvent<MosaicaEventDetails['mosaica-clausechange']>} mosaica-clausechange - A clause
81
- * button put a `member_of` clause on or took it off.
78
+ * @fires {CustomEvent<MosaicaEventDetails['mosaica-clausechange']>} mosaica-clausechange - A filter
79
+ * or highlight button added or removed a `member_of` clause.
82
80
  * @fires {CustomEvent<MosaicaEventDetails['mosaica-close']>} mosaica-close - The close button was
83
81
  * pressed, with `what` set to `artifact`.
84
- * @csspart title - The heading: the level's or the layer's title, holding the close button while
85
- * the card shows an artifact or a refusal.
82
+ * @csspart title - The heading, with the level's or layer's title and the close button.
86
83
  * @csspart close - The close button.
87
84
  * @csspart state - The state line, with `data-state`.
88
85
  * @csspart refusal - The words "Not available", with `data-code` set to the refusal's code.
89
- * @csspart reason - The server's reason for the refusal, on a line under "Not available".
90
- * @csspart headline - The artifact's name, with `data-unnamed` where it has none.
91
- * @csspart count - The masked count.
86
+ * @csspart reason - The server's reason for the refusal, under "Not available".
87
+ * @csspart headline - The artifact's name, with `data-unnamed` if it has none.
88
+ * @csspart count - The count of items the viewer may see.
92
89
  * @csspart content - The artifact's description, or its attached topic.
93
90
  * @csspart value - The layer and the key.
94
- * @csspart shape - What the layer's shape is, with `data-kind` (`derived`, `predicate` or
91
+ * @csspart shape - How the layer's shapes are made, with `data-kind` (`derived`, `predicate` or
95
92
  * `authored`).
96
93
  * @csspart label - The headings above the parents and the children.
97
94
  * @csspart parents - The list of parents.
98
95
  * @csspart parent - One parent, with `data-id`.
99
96
  * @csspart children - The list of children in this view.
100
97
  * @csspart child - One child, with `data-id`.
101
- * @csspart name - A parent's or a child's name, with `data-unnamed` where it has none.
98
+ * @csspart name - A parent's or child's name, with `data-unnamed` if it has none.
102
99
  * @csspart fit - The Fit to cluster button.
103
100
  * @csspart verbs - The clause buttons.
104
101
  * @csspart filter - The Filter to this button, with `aria-pressed` while its clause is on.
@@ -214,14 +211,11 @@ let MosaicaArtifactCard = (() => {
214
211
  `
215
212
  ];
216
213
  #artifact_accessor_storage = __runInitializers(this, _artifact_initializers, null);
217
- /**
218
- * The artifact to show, for a host that fetches the drill-down itself. Set with `refusal` or
219
- * alone, it replaces the store's opened artifact.
220
- */
214
+ /** The artifact to show, if you fetch its details yourself. It replaces the store's opened artifact. */
221
215
  get artifact() { return this.#artifact_accessor_storage; }
222
216
  set artifact(value) { this.#artifact_accessor_storage = value; }
223
217
  #refusal_accessor_storage = (__runInitializers(this, _artifact_extraInitializers), __runInitializers(this, _refusal_initializers, null));
224
- /** A refusal to show in place of an artifact, for a host that fetches the drill-down itself. */
218
+ /** A refusal to show instead of an artifact, if you fetch its details yourself. */
225
219
  get refusal() { return this.#refusal_accessor_storage; }
226
220
  set refusal(value) { this.#refusal_accessor_storage = value; }
227
221
  get shown() {
package/dist/base.d.ts CHANGED
@@ -2,9 +2,9 @@ import { LitElement, type PropertyValues } from 'lit';
2
2
  import { type SelectionShape, type Store, type TokenSupplier } from '@mosaicajs/client';
3
3
  import type { SelectionShapeDetail, MosaicaEventDetails } from './events.js';
4
4
  /**
5
- * Where an element's store came from: its `store` property, a `<mosaica-store>` or
6
- * `<mosaica-explorer>` above it (`context`), one it built itself from `viewer-url`, `token` or
7
- * `authorise` (`own`), or none (`detached`), in which case it renders its detached state.
5
+ * Where an element's store came from: `property` is its `store` property, `context` a
6
+ * `<mosaica-store>` or `<mosaica-explorer>` above it, and `own` a store it built from `viewer-url`,
7
+ * `token` or `authorise`. `detached` means it has none and shows its detached state.
8
8
  */
9
9
  export type StoreSource = 'property' | 'context' | 'own' | 'detached';
10
10
  /**
@@ -23,39 +23,32 @@ export type StoreSource = 'property' | 'context' | 'own' | 'detached';
23
23
  * refetch the view. An own store lives until `dispose()` or until its attributes change.
24
24
  */
25
25
  export declare abstract class MosaicaElement extends LitElement {
26
- /**
27
- * The store to read, which outranks a store from context and the element's own. The element does
28
- * not dispose a store it was given.
29
- */
26
+ /** The store to use, ahead of one from context or one the element would build. The element never disposes it. */
30
27
  accessor store: Store | null;
31
28
  /**
32
- * The viewer plane's base URL. Only `<mosaica-map>`, `<mosaica-explorer>` and `<mosaica-store>`
33
- * read it, to build their own store where no `store` property or context supplies one. Each route
34
- * is appended to it after any trailing slash is dropped, so a full URL such as
35
- * `https://maps.example.org` and a path on the page's own server such as `/mosaica` both work.
36
- * Unset, requests go to `/v1/...` on the page's own origin. Changing it builds a new store. With
37
- * no `token`, a store built before `authorise` is set asks once with no token, and is replaced
38
- * when `authorise` arrives.
29
+ * The base URL of the Mosaica viewer server, for the store the element builds: a full URL such as
30
+ * `https://maps.example.org`, or a path such as `/mosaica`. Unset, the page's own origin. Read only
31
+ * by the map, the explorer and `<mosaica-store>`. Changing it builds a new store.
39
32
  */
40
33
  accessor viewerUrl: string;
41
34
  /**
42
- * A viewer token for the store the element builds from `viewer-url`. Only the map, the explorer
43
- * and `<mosaica-store>` read it. Without it or `authorise`, the store sends no token, which an
44
- * open server (`serve.open`) serves. Changing it builds a new store.
35
+ * A viewer token for the store the element builds. Without `token` or `authorise`, only an open
36
+ * server (`serve.open`) answers. Read only by the map, the explorer and `<mosaica-store>`.
37
+ * Changing it builds a new store.
45
38
  */
46
39
  accessor token: string;
47
40
  /**
48
- * A token supplier, used in place of `token`, which the store calls to renew the token before it
49
- * expires. Setting another function builds a new store, since a store serves one viewer (see
50
- * `Store` in `@mosaicajs/client`), so a framework keeps the function stable across renders.
41
+ * A function that returns a viewer token, used instead of `token` and called again before the
42
+ * token expires. A different function builds a new store, so keep it stable across renders. Set
43
+ * it together with `viewer-url`: a store built from `viewer-url` alone first sends a request with
44
+ * no token, and is replaced when `authorise` arrives.
51
45
  */
52
46
  accessor authorise: TokenSupplier | null;
53
47
  /**
54
- * The most artifacts one level of a drawn layer shows in one tile, for the store the element
55
- * builds; at most `/v1/meta`'s `selection.max_artifacts_per_tile`. Only the map, the explorer
56
- * and `<mosaica-store>` read it. Unset, the store asks for 50, or the server's maximum where
57
- * that is smaller.
58
- * Changing it builds a new store.
48
+ * The most artifacts one level of a layer shows per map tile, for the store the element builds.
49
+ * Unset, 50, or the server's `selection.max_artifacts_per_tile` if lower. A value above that
50
+ * maximum is refused. Read only by the map, the explorer and `<mosaica-store>`. Changing it
51
+ * builds a new store.
59
52
  */
60
53
  accessor artifactsPerTile: number | null;
61
54
  /** Whether this element builds its own store from attributes when nothing else supplies one. */
@@ -70,7 +63,7 @@ export declare abstract class MosaicaElement extends LitElement {
70
63
  private metaHeld;
71
64
  private consumer;
72
65
  private unsubscribe;
73
- /** The store this element reads, from whichever source won; `null` while detached. */
66
+ /** The store this element is using, or `null` if it has none. */
74
67
  get activeStore(): Store | null;
75
68
  /** Where `activeStore` came from. */
76
69
  get source(): StoreSource;
@@ -100,9 +93,8 @@ export declare abstract class MosaicaElement extends LitElement {
100
93
  /** Every projection change lands here; the default asks for a render. */
101
94
  protected onStoreChange(): void;
102
95
  /**
103
- * Dispose of the store this element built and detach from it. Disconnecting does not do this, so
104
- * a host that removes an element for good calls it. A store handed in by property or context is
105
- * left for its owner to dispose.
96
+ * Dispose of the store this element built. Removing the element from the page does not, so call
97
+ * this when you are done with the element. A store you passed in is left to you.
106
98
  */
107
99
  dispose(): void;
108
100
  }
package/dist/base.js CHANGED
@@ -85,47 +85,40 @@ let MosaicaElement = (() => {
85
85
  if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
86
86
  }
87
87
  #store_accessor_storage = __runInitializers(this, _store_initializers, null);
88
- /**
89
- * The store to read, which outranks a store from context and the element's own. The element does
90
- * not dispose a store it was given.
91
- */
88
+ /** The store to use, ahead of one from context or one the element would build. The element never disposes it. */
92
89
  get store() { return this.#store_accessor_storage; }
93
90
  set store(value) { this.#store_accessor_storage = value; }
94
91
  #viewerUrl_accessor_storage = (__runInitializers(this, _store_extraInitializers), __runInitializers(this, _viewerUrl_initializers, ''));
95
92
  /**
96
- * The viewer plane's base URL. Only `<mosaica-map>`, `<mosaica-explorer>` and `<mosaica-store>`
97
- * read it, to build their own store where no `store` property or context supplies one. Each route
98
- * is appended to it after any trailing slash is dropped, so a full URL such as
99
- * `https://maps.example.org` and a path on the page's own server such as `/mosaica` both work.
100
- * Unset, requests go to `/v1/...` on the page's own origin. Changing it builds a new store. With
101
- * no `token`, a store built before `authorise` is set asks once with no token, and is replaced
102
- * when `authorise` arrives.
93
+ * The base URL of the Mosaica viewer server, for the store the element builds: a full URL such as
94
+ * `https://maps.example.org`, or a path such as `/mosaica`. Unset, the page's own origin. Read only
95
+ * by the map, the explorer and `<mosaica-store>`. Changing it builds a new store.
103
96
  */
104
97
  get viewerUrl() { return this.#viewerUrl_accessor_storage; }
105
98
  set viewerUrl(value) { this.#viewerUrl_accessor_storage = value; }
106
99
  #token_accessor_storage = (__runInitializers(this, _viewerUrl_extraInitializers), __runInitializers(this, _token_initializers, ''));
107
100
  /**
108
- * A viewer token for the store the element builds from `viewer-url`. Only the map, the explorer
109
- * and `<mosaica-store>` read it. Without it or `authorise`, the store sends no token, which an
110
- * open server (`serve.open`) serves. Changing it builds a new store.
101
+ * A viewer token for the store the element builds. Without `token` or `authorise`, only an open
102
+ * server (`serve.open`) answers. Read only by the map, the explorer and `<mosaica-store>`.
103
+ * Changing it builds a new store.
111
104
  */
112
105
  get token() { return this.#token_accessor_storage; }
113
106
  set token(value) { this.#token_accessor_storage = value; }
114
107
  #authorise_accessor_storage = (__runInitializers(this, _token_extraInitializers), __runInitializers(this, _authorise_initializers, null));
115
108
  /**
116
- * A token supplier, used in place of `token`, which the store calls to renew the token before it
117
- * expires. Setting another function builds a new store, since a store serves one viewer (see
118
- * `Store` in `@mosaicajs/client`), so a framework keeps the function stable across renders.
109
+ * A function that returns a viewer token, used instead of `token` and called again before the
110
+ * token expires. A different function builds a new store, so keep it stable across renders. Set
111
+ * it together with `viewer-url`: a store built from `viewer-url` alone first sends a request with
112
+ * no token, and is replaced when `authorise` arrives.
119
113
  */
120
114
  get authorise() { return this.#authorise_accessor_storage; }
121
115
  set authorise(value) { this.#authorise_accessor_storage = value; }
122
116
  #artifactsPerTile_accessor_storage = (__runInitializers(this, _authorise_extraInitializers), __runInitializers(this, _artifactsPerTile_initializers, null));
123
117
  /**
124
- * The most artifacts one level of a drawn layer shows in one tile, for the store the element
125
- * builds; at most `/v1/meta`'s `selection.max_artifacts_per_tile`. Only the map, the explorer
126
- * and `<mosaica-store>` read it. Unset, the store asks for 50, or the server's maximum where
127
- * that is smaller.
128
- * Changing it builds a new store.
118
+ * The most artifacts one level of a layer shows per map tile, for the store the element builds.
119
+ * Unset, 50, or the server's `selection.max_artifacts_per_tile` if lower. A value above that
120
+ * maximum is refused. Read only by the map, the explorer and `<mosaica-store>`. Changing it
121
+ * builds a new store.
129
122
  */
130
123
  get artifactsPerTile() { return this.#artifactsPerTile_accessor_storage; }
131
124
  set artifactsPerTile(value) { this.#artifactsPerTile_accessor_storage = value; }
@@ -141,7 +134,7 @@ let MosaicaElement = (() => {
141
134
  metaHeld = false;
142
135
  consumer = null;
143
136
  unsubscribe = null;
144
- /** The store this element reads, from whichever source won; `null` while detached. */
137
+ /** The store this element is using, or `null` if it has none. */
145
138
  get activeStore() {
146
139
  return this.resolvedStore;
147
140
  }
@@ -285,9 +278,8 @@ let MosaicaElement = (() => {
285
278
  this.requestUpdate();
286
279
  }
287
280
  /**
288
- * Dispose of the store this element built and detach from it. Disconnecting does not do this, so
289
- * a host that removes an element for good calls it. A store handed in by property or context is
290
- * left for its owner to dispose.
281
+ * Dispose of the store this element built. Removing the element from the page does not, so call
282
+ * this when you are done with the element. A store you passed in is left to you.
291
283
  */
292
284
  dispose() {
293
285
  const own = this.ownStore;
package/dist/basemap.d.ts CHANGED
@@ -2,8 +2,8 @@ import type { Layer } from '@deck.gl/core';
2
2
  import type { Store } from '@mosaicajs/client';
3
3
  import { type BasemapValue, type DensityCamera } from '@mosaicajs/deck';
4
4
  /**
5
- * What `<mosaica-map>`'s `basemap` takes: one {@link BasemapValue} for every view, a mapping from
6
- * view id to one, or a deck.gl layer the host built, drawn as it is.
5
+ * The value of `<mosaica-map>`'s `basemap`: one {@link BasemapValue} for every view, an object
6
+ * mapping view ids to one each, or a deck.gl layer you built, which is drawn as it is.
7
7
  */
8
8
  export type BasemapChoice = BasemapValue | Readonly<Record<string, BasemapValue>> | Layer;
9
9
  /**
@@ -8,48 +8,42 @@ type Offer = {
8
8
  beyond: boolean;
9
9
  };
10
10
  /**
11
- * The search box of a layer's field card: its list offers the layer's artifacts, and choosing one
12
- * puts its `member_of` clause on in the filter position (`Store.setMembers`).
11
+ * Use `<mosaica-cluster-filter>` when you want to search a layer's clusters without the field card
12
+ * around it. Set `layer` to a layer `meta.layers` lists.
13
13
  *
14
- * With the box empty, the list offers the layer's top-level clusters (its roots, or its first level
15
- * on a levelled layer), largest first. Typing searches the layer's names through
16
- * `POST /v1/artifacts/browse`, every level on a levelled layer, and each match shows its path, the
17
- * names of its nearest parents in grey, cut from the left so the nearest stay. On a levelled layer
18
- * the path names only parents the list has already met. Each row's count is exact, from the
19
- * aggregate route (`Store.setAggregate`) over the rows listed, one grouping per level on a layer
20
- * with several, under the store's filters without this layer's own filter clauses, so a cluster
21
- * its clauses exclude is still counted. A row shows no count until the answer lands. The list opens
22
- * over what sits below the box, in the top layer.
14
+ * With the box empty, the list offers the layer's top-level clusters, largest first. Typing
15
+ * searches the cluster names at every level. In the list, the arrow keys move between rows, Enter
16
+ * chooses one, and Escape closes the list.
23
17
  *
24
- * Choosing a row puts its clause on, with the row's name as the clause's label, and pressing a
25
- * chosen row takes it off. The arrow keys move through the list, Enter chooses the row reached, the
26
- * first by default, and Escape closes the list.
18
+ * Each row counts the items the filters match in that cluster without applying this layer's own
19
+ * filter, so a cluster the viewer has filtered out still shows its count. Choosing a row filters
20
+ * the map to the cluster's members, and choosing it again removes that filter.
27
21
  *
28
- * @summary A layer's field card's search box.
22
+ * @summary A search box that filters the map by a layer's clusters.
29
23
  * @tagname mosaica-cluster-filter
30
24
  * @category Elements
31
- * @fires {CustomEvent<MosaicaEventDetails['mosaica-clausechange']>} mosaica-clausechange - A row put
32
- * a `member_of` clause on or took it off.
25
+ * @fires {CustomEvent<MosaicaEventDetails['mosaica-clausechange']>} mosaica-clausechange - Choosing a
26
+ * row added or removed a `member_of` clause.
33
27
  * @csspart entry - The search box.
34
28
  * @csspart values - The list, while it is open.
35
29
  * @csspart option - One cluster in the list, with `data-id` and `aria-selected` while its clause is
36
30
  * on.
37
- * @csspart name - A row's name, with `data-unnamed` where it has none.
31
+ * @csspart name - A row's name, with `data-unnamed` if the cluster has none.
38
32
  * @csspart path - A row's path of parents' names.
39
33
  * @csspart value-count - A row's exact count.
40
- * @csspart more - The note under the box: no match, or that more match than the list holds.
41
- * @csspart refusal - The words "Clusters unavailable", with `data-code`, where the list was refused.
34
+ * @csspart more - The note under the box when nothing matches, or when more match than are listed.
35
+ * @csspart refusal - The words "Clusters unavailable", with `data-code`, if the list was refused.
42
36
  */
43
37
  export declare class MosaicaClusterFilter extends MosaicaElement {
44
38
  static styles: import("lit").CSSResult[];
45
- /** The layer whose clusters are offered, a name `meta.layers` lists. Unset or unknown, the field renders nothing. */
39
+ /** The layer whose clusters are offered, a name `meta.layers` lists. Unset or unknown, the box shows nothing. */
46
40
  accessor layer: string;
47
- /** The search box's placeholder, in place of the field's own. */
41
+ /** Placeholder text for the box, in place of the default. */
48
42
  accessor placeholder: string;
49
43
  /**
50
- * Where set, the box picks a cluster rather than filtering by it: choosing a row calls this with
51
- * its `mosaica_id` as a decimal string, its name, its path of parents' names as the list shows
52
- * it and its `rung`, changes no clause and empties the box, and no row shows as chosen.
44
+ * Turns the box into a cluster picker. Choosing a row calls this with the cluster's `mosaica_id`
45
+ * (as a decimal string), its name, its parents' names as the list shows them, and its level
46
+ * (`rung`), then empties the box. No filter changes.
53
47
  */
54
48
  accessor choose: ((cluster: {
55
49
  id: string;
@@ -57,37 +57,31 @@ function pathText(path, beyond, n) {
57
57
  /** How many parents a match's path is walked up, nearest first. */
58
58
  const PATH_DEPTH = 3;
59
59
  /**
60
- * The search box of a layer's field card: its list offers the layer's artifacts, and choosing one
61
- * puts its `member_of` clause on in the filter position (`Store.setMembers`).
60
+ * Use `<mosaica-cluster-filter>` when you want to search a layer's clusters without the field card
61
+ * around it. Set `layer` to a layer `meta.layers` lists.
62
62
  *
63
- * With the box empty, the list offers the layer's top-level clusters (its roots, or its first level
64
- * on a levelled layer), largest first. Typing searches the layer's names through
65
- * `POST /v1/artifacts/browse`, every level on a levelled layer, and each match shows its path, the
66
- * names of its nearest parents in grey, cut from the left so the nearest stay. On a levelled layer
67
- * the path names only parents the list has already met. Each row's count is exact, from the
68
- * aggregate route (`Store.setAggregate`) over the rows listed, one grouping per level on a layer
69
- * with several, under the store's filters without this layer's own filter clauses, so a cluster
70
- * its clauses exclude is still counted. A row shows no count until the answer lands. The list opens
71
- * over what sits below the box, in the top layer.
63
+ * With the box empty, the list offers the layer's top-level clusters, largest first. Typing
64
+ * searches the cluster names at every level. In the list, the arrow keys move between rows, Enter
65
+ * chooses one, and Escape closes the list.
72
66
  *
73
- * Choosing a row puts its clause on, with the row's name as the clause's label, and pressing a
74
- * chosen row takes it off. The arrow keys move through the list, Enter chooses the row reached, the
75
- * first by default, and Escape closes the list.
67
+ * Each row counts the items the filters match in that cluster without applying this layer's own
68
+ * filter, so a cluster the viewer has filtered out still shows its count. Choosing a row filters
69
+ * the map to the cluster's members, and choosing it again removes that filter.
76
70
  *
77
- * @summary A layer's field card's search box.
71
+ * @summary A search box that filters the map by a layer's clusters.
78
72
  * @tagname mosaica-cluster-filter
79
73
  * @category Elements
80
- * @fires {CustomEvent<MosaicaEventDetails['mosaica-clausechange']>} mosaica-clausechange - A row put
81
- * a `member_of` clause on or took it off.
74
+ * @fires {CustomEvent<MosaicaEventDetails['mosaica-clausechange']>} mosaica-clausechange - Choosing a
75
+ * row added or removed a `member_of` clause.
82
76
  * @csspart entry - The search box.
83
77
  * @csspart values - The list, while it is open.
84
78
  * @csspart option - One cluster in the list, with `data-id` and `aria-selected` while its clause is
85
79
  * on.
86
- * @csspart name - A row's name, with `data-unnamed` where it has none.
80
+ * @csspart name - A row's name, with `data-unnamed` if the cluster has none.
87
81
  * @csspart path - A row's path of parents' names.
88
82
  * @csspart value-count - A row's exact count.
89
- * @csspart more - The note under the box: no match, or that more match than the list holds.
90
- * @csspart refusal - The words "Clusters unavailable", with `data-code`, where the list was refused.
83
+ * @csspart more - The note under the box when nothing matches, or when more match than are listed.
84
+ * @csspart refusal - The words "Clusters unavailable", with `data-code`, if the list was refused.
91
85
  */
92
86
  let MosaicaClusterFilter = (() => {
93
87
  let _classSuper = MosaicaElement;
@@ -225,18 +219,18 @@ let MosaicaClusterFilter = (() => {
225
219
  `
226
220
  ];
227
221
  #layer_accessor_storage = __runInitializers(this, _layer_initializers, '');
228
- /** The layer whose clusters are offered, a name `meta.layers` lists. Unset or unknown, the field renders nothing. */
222
+ /** The layer whose clusters are offered, a name `meta.layers` lists. Unset or unknown, the box shows nothing. */
229
223
  get layer() { return this.#layer_accessor_storage; }
230
224
  set layer(value) { this.#layer_accessor_storage = value; }
231
225
  #placeholder_accessor_storage = (__runInitializers(this, _layer_extraInitializers), __runInitializers(this, _placeholder_initializers, ''));
232
- /** The search box's placeholder, in place of the field's own. */
226
+ /** Placeholder text for the box, in place of the default. */
233
227
  get placeholder() { return this.#placeholder_accessor_storage; }
234
228
  set placeholder(value) { this.#placeholder_accessor_storage = value; }
235
229
  #choose_accessor_storage = (__runInitializers(this, _placeholder_extraInitializers), __runInitializers(this, _choose_initializers, null));
236
230
  /**
237
- * Where set, the box picks a cluster rather than filtering by it: choosing a row calls this with
238
- * its `mosaica_id` as a decimal string, its name, its path of parents' names as the list shows
239
- * it and its `rung`, changes no clause and empties the box, and no row shows as chosen.
231
+ * Turns the box into a cluster picker. Choosing a row calls this with the cluster's `mosaica_id`
232
+ * (as a decimal string), its name, its parents' names as the list shows them, and its level
233
+ * (`rung`), then empties the box. No filter changes.
240
234
  */
241
235
  get choose() { return this.#choose_accessor_storage; }
242
236
  set choose(value) { this.#choose_accessor_storage = value; }