@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.
- package/dist/artifact-card.d.ts +20 -26
- package/dist/artifact-card.js +20 -26
- package/dist/base.d.ts +21 -29
- package/dist/base.js +18 -26
- package/dist/basemap.d.ts +2 -2
- package/dist/cluster-filter.d.ts +19 -25
- package/dist/cluster-filter.js +19 -25
- package/dist/colour-editor.d.ts +16 -36
- package/dist/colour-editor.js +16 -36
- package/dist/context.d.ts +4 -4
- package/dist/context.js +4 -4
- package/dist/count.d.ts +16 -15
- package/dist/count.js +16 -15
- package/dist/events.d.ts +63 -68
- package/dist/explorer.d.ts +76 -119
- package/dist/explorer.js +76 -121
- package/dist/field-card.d.ts +24 -56
- package/dist/field-card.js +24 -56
- package/dist/filter-panel.d.ts +31 -45
- package/dist/filter-panel.js +31 -45
- package/dist/filter.d.ts +20 -28
- package/dist/filter.js +20 -28
- package/dist/hierarchy.d.ts +35 -36
- package/dist/hierarchy.js +35 -36
- package/dist/index.d.ts +5 -4
- package/dist/index.js +5 -4
- package/dist/item-card.d.ts +34 -55
- package/dist/item-card.js +34 -55
- package/dist/key-picker.d.ts +5 -5
- package/dist/key-picker.js +5 -5
- package/dist/layer-picker.d.ts +11 -9
- package/dist/layer-picker.js +11 -9
- package/dist/map.d.ts +134 -172
- package/dist/map.js +136 -188
- package/dist/mosaica-components.js +5599 -1594
- package/dist/mosaica-components.js.LICENSE.txt +80 -16
- package/dist/mosaica-components.js.sri +1 -1
- package/dist/mosaica-components.json +2 -2
- package/dist/parts.d.ts +3 -4
- package/dist/parts.js +3 -4
- package/dist/selection.d.ts +21 -27
- package/dist/selection.js +21 -27
- package/dist/states.d.ts +15 -20
- package/dist/status.d.ts +26 -38
- package/dist/status.js +26 -38
- package/dist/store-element.d.ts +8 -7
- package/dist/store-element.js +8 -7
- package/dist/tokens.d.ts +12 -13
- package/dist/tokens.js +12 -13
- package/dist/view-picker.d.ts +10 -6
- package/dist/view-picker.js +10 -6
- package/package.json +6 -6
package/dist/status.js
CHANGED
|
@@ -41,53 +41,41 @@ import { NOTHING_VISIBLE, renderState, seesNothing, showsContent, stateOf } from
|
|
|
41
41
|
import { chrome, tokens } from './tokens.js';
|
|
42
42
|
import './count.js';
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* date the first cell is a dot alone, titled "Up to date", and while it updates a grey dot alone,
|
|
50
|
-
* titled "Updating", so the strip keeps its width through a pan. Where the viewer can see no item in
|
|
51
|
-
* the view at all, it is a grey dot alone titled "Nothing visible to you", which the map says in
|
|
52
|
-
* words. Otherwise it names the state in two or three words beside its dot (Connecting,
|
|
53
|
-
* Reconnecting, Server unreachable, Server did not answer, Server busy, Nothing in view, Data
|
|
54
|
-
* updated, View refused, Session expired) with the action the state offers: Refresh when the data
|
|
55
|
-
* changed, Retry when the view was refused, the server did not answer or is too busy, and Sign in
|
|
56
|
-
* on expiry where `reauthorise` is set. View refused has the server's reason on a line under it.
|
|
57
|
-
* The counts grey out while they are not current. The strip sizes to its content and does not
|
|
58
|
-
* wrap. `compact` shortens the figures (`16.8M of 21.4M match`) and drops the shown count.
|
|
59
|
-
* `expanded` renders the figures again as a card below the strip.
|
|
44
|
+
* Use the status line with a map so that viewers know whether what they see is current and how much
|
|
45
|
+
* of the data it covers. A typical line reads `● | 16,822,190 of 21,406,522 match | 5,390 shown`,
|
|
46
|
+
* where the first figure is the items the filters match out of those the viewer may see. The
|
|
47
|
+
* figures count the camera's box, or the selected region while there is one. While a highlight is
|
|
48
|
+
* set, the counts cell reads `N highlighted of M`.
|
|
60
49
|
*
|
|
61
|
-
*
|
|
62
|
-
* the
|
|
63
|
-
*
|
|
64
|
-
* store's `status.refusal`, which `mosaica-statechange` carries, and the refusal's code is on the
|
|
65
|
-
* refusal part's `data-code`.
|
|
50
|
+
* While the view is up to date, the first cell is a dot alone. When something goes wrong, the cell
|
|
51
|
+
* names the state and offers a button if the viewer can act, such as Retry when the server is busy.
|
|
52
|
+
* Sign in appears when the session expires only if you have set `reauthorise`.
|
|
66
53
|
*
|
|
67
|
-
*
|
|
54
|
+
* Screen readers announce a refusal or an expiry, because the state cell is an `aria-live` region.
|
|
55
|
+
* The counts sit outside it, so they are not read out every time the map pans.
|
|
56
|
+
*
|
|
57
|
+
* @summary A status line showing whether the map is up to date and how many items it shows.
|
|
68
58
|
* @tagname mosaica-status
|
|
69
59
|
* @category Elements
|
|
70
|
-
* @fires {CustomEvent<MosaicaEventDetails['mosaica-statechange']>} mosaica-statechange -
|
|
71
|
-
*
|
|
72
|
-
* @fires {CustomEvent<MosaicaEventDetails['mosaica-expired']>} mosaica-expired -
|
|
73
|
-
*
|
|
60
|
+
* @fires {CustomEvent<MosaicaEventDetails['mosaica-statechange']>} mosaica-statechange - The panel
|
|
61
|
+
* state changed, including on the first render.
|
|
62
|
+
* @fires {CustomEvent<MosaicaEventDetails['mosaica-expired']>} mosaica-expired - The session expired.
|
|
63
|
+
* Fires once each time.
|
|
74
64
|
* @csspart strip - The one-line strip.
|
|
75
65
|
* @csspart state - The state's dot and words, with `data-state` set to the panel state.
|
|
76
66
|
* @csspart refusal - The words "View refused", or "Server busy", with `data-code` set to the
|
|
77
67
|
* refusal's code.
|
|
78
|
-
* @csspart reason - The server's reason for a refusal,
|
|
79
|
-
*
|
|
80
|
-
* @csspart
|
|
81
|
-
* @csspart
|
|
82
|
-
* too busy.
|
|
83
|
-
* @csspart reauthorise - The Sign in button, on expiry where `reauthorise` is set.
|
|
68
|
+
* @csspart reason - The server's reason for a refusal, under "View refused".
|
|
69
|
+
* @csspart refresh - The Refresh button, shown when the data has changed.
|
|
70
|
+
* @csspart retry - The Retry button, after a refusal, no answer or a busy server.
|
|
71
|
+
* @csspart reauthorise - The Sign in button, shown on expiry if `reauthorise` is set.
|
|
84
72
|
* @csspart count-shown - The `<mosaica-count>` of marks shown.
|
|
85
|
-
* @csspart count-matched - The `<mosaica-count>`
|
|
86
|
-
* @csspart count-highlighted - The `<mosaica-count>`
|
|
73
|
+
* @csspart count-matched - The `<mosaica-count>` of items the filters match.
|
|
74
|
+
* @csspart count-highlighted - The `<mosaica-count>` of highlighted items, while a highlight is set.
|
|
87
75
|
* @csspart count-of - The matched count the highlighted count is out of, while a highlight is set.
|
|
88
76
|
* @csspart count-visible - The `<mosaica-count>` of items the viewer may see here, which the matched
|
|
89
77
|
* count is out of.
|
|
90
|
-
* @csspart card - The card of figures,
|
|
78
|
+
* @csspart card - The card of figures, when `expanded` is set.
|
|
91
79
|
*/
|
|
92
80
|
let MosaicaStatus = (() => {
|
|
93
81
|
let _classSuper = MosaicaElement;
|
|
@@ -213,15 +201,15 @@ let MosaicaStatus = (() => {
|
|
|
213
201
|
`
|
|
214
202
|
];
|
|
215
203
|
#expanded_accessor_storage = __runInitializers(this, _expanded_initializers, false);
|
|
216
|
-
/**
|
|
204
|
+
/** Adds a card of the figures below the strip. */
|
|
217
205
|
get expanded() { return this.#expanded_accessor_storage; }
|
|
218
206
|
set expanded(value) { this.#expanded_accessor_storage = value; }
|
|
219
207
|
#compact_accessor_storage = (__runInitializers(this, _expanded_extraInitializers), __runInitializers(this, _compact_initializers, false));
|
|
220
|
-
/** Shortens the figures to one decimal (`16.8M`) and drops the shown count
|
|
208
|
+
/** Shortens the figures to one decimal (`16.8M`) and drops the shown count. */
|
|
221
209
|
get compact() { return this.#compact_accessor_storage; }
|
|
222
210
|
set compact(value) { this.#compact_accessor_storage = value; }
|
|
223
211
|
#reauthorise_accessor_storage = (__runInitializers(this, _compact_extraInitializers), __runInitializers(this, _reauthorise_initializers, null));
|
|
224
|
-
/**
|
|
212
|
+
/** A function the Sign in button calls when the session has expired. Without it there is no Sign in button. */
|
|
225
213
|
get reauthorise() { return this.#reauthorise_accessor_storage; }
|
|
226
214
|
set reauthorise(value) { this.#reauthorise_accessor_storage = value; }
|
|
227
215
|
lastState = (__runInitializers(this, _reauthorise_extraInitializers), null);
|
package/dist/store-element.d.ts
CHANGED
|
@@ -2,17 +2,18 @@ import { nothing, type TemplateResult } from 'lit';
|
|
|
2
2
|
import type { Store } from '@mosaicajs/client';
|
|
3
3
|
import { MosaicaElement } from './base.js';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Use `<mosaica-store>` when you lay out the elements yourself, so that the map, the filter panel
|
|
6
|
+
* and the cards all show the same view and filters. The elements inside it find its store through
|
|
7
|
+
* context, which means you do not pass the store to each one. Put each map of a different view in
|
|
8
|
+
* its own wrapper. `<mosaica-explorer>` provides its own store, so it needs no wrapper.
|
|
8
9
|
*
|
|
9
|
-
*
|
|
10
|
-
* `viewer-url
|
|
10
|
+
* The wrapper uses the store in its `store` property. When that is not set, it builds one from
|
|
11
|
+
* `viewer-url` and `token` or `authorise`.
|
|
11
12
|
*
|
|
12
|
-
* @summary
|
|
13
|
+
* @summary A wrapper that shares one store between the elements inside it.
|
|
13
14
|
* @tagname mosaica-store
|
|
14
15
|
* @category Elements
|
|
15
|
-
* @slot - The
|
|
16
|
+
* @slot - The elements that use the store.
|
|
16
17
|
*/
|
|
17
18
|
export declare class MosaicaStore extends MosaicaElement {
|
|
18
19
|
static styles: import("lit").CSSResult;
|
package/dist/store-element.js
CHANGED
|
@@ -4,17 +4,18 @@ import { MosaicaElement } from './base.js';
|
|
|
4
4
|
import { storeContext } from './context.js';
|
|
5
5
|
import { attachContextRoot, defineOnce } from './define.js';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Use `<mosaica-store>` when you lay out the elements yourself, so that the map, the filter panel
|
|
8
|
+
* and the cards all show the same view and filters. The elements inside it find its store through
|
|
9
|
+
* context, which means you do not pass the store to each one. Put each map of a different view in
|
|
10
|
+
* its own wrapper. `<mosaica-explorer>` provides its own store, so it needs no wrapper.
|
|
10
11
|
*
|
|
11
|
-
*
|
|
12
|
-
* `viewer-url
|
|
12
|
+
* The wrapper uses the store in its `store` property. When that is not set, it builds one from
|
|
13
|
+
* `viewer-url` and `token` or `authorise`.
|
|
13
14
|
*
|
|
14
|
-
* @summary
|
|
15
|
+
* @summary A wrapper that shares one store between the elements inside it.
|
|
15
16
|
* @tagname mosaica-store
|
|
16
17
|
* @category Elements
|
|
17
|
-
* @slot - The
|
|
18
|
+
* @slot - The elements that use the store.
|
|
18
19
|
*/
|
|
19
20
|
export class MosaicaStore extends MosaicaElement {
|
|
20
21
|
static styles = css `
|
package/dist/tokens.d.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The theme every element shares, as a Lit `CSSResult
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* default
|
|
8
|
-
* by the `color-scheme` the element inherits from the page.
|
|
2
|
+
* The theme every element shares, as a Lit `CSSResult`. Add it to your own Lit element's `styles`
|
|
3
|
+
* to use the same tokens. The elements take every colour and font, the corner radii, the shadow,
|
|
4
|
+
* the map's height and the spacing of the map's corners from the `--mosaica-*` custom properties
|
|
5
|
+
* that the components reference lists under Theme tokens; other spacing is fixed. Set a token on an element or any ancestor, including an
|
|
6
|
+
* enclosing `<mosaica-explorer>`, to override its default. Each colour has a light and a dark
|
|
7
|
+
* default, chosen by the page's `color-scheme`.
|
|
9
8
|
*
|
|
10
|
-
* The
|
|
11
|
-
*
|
|
9
|
+
* The colours the map uses for data are not tokens. Set them with the map's `palette`,
|
|
10
|
+
* `category-palette` and `ramp`.
|
|
12
11
|
*
|
|
13
|
-
* The default font is Instrument Sans
|
|
14
|
-
*
|
|
12
|
+
* The default font is Instrument Sans if the page has loaded it. The elements fetch no fonts, so
|
|
13
|
+
* link it from your page if you want it.
|
|
15
14
|
*
|
|
16
15
|
* @cssprop --mosaica-surface - The background of panels, cards, inputs and buttons.
|
|
17
16
|
* @cssprop --mosaica-surface-2 - The background of a chip, a hovered row and a chosen row.
|
|
@@ -48,8 +47,8 @@
|
|
|
48
47
|
* @cssprop --mosaica-font-mono - The font family of identifiers.
|
|
49
48
|
* @cssprop --mosaica-shadow - The shadow under anything that floats over the map: the status
|
|
50
49
|
* strip, the map toolbar, the map tooltip, cards and popovers.
|
|
51
|
-
* @cssprop --mosaica-space - The gap between the map's
|
|
52
|
-
* it separates items in one corner.
|
|
50
|
+
* @cssprop --mosaica-space - The gap between the content in the map's corners and the map's edges.
|
|
51
|
+
* Half of it separates items in one corner.
|
|
53
52
|
* @cssprop --mosaica-density - A multiplier on `--mosaica-space`'s default.
|
|
54
53
|
* @cssprop --mosaica-map-height - The map's height.
|
|
55
54
|
*/
|
package/dist/tokens.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
2
|
/**
|
|
3
|
-
* The theme every element shares, as a Lit `CSSResult
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* default
|
|
9
|
-
* by the `color-scheme` the element inherits from the page.
|
|
3
|
+
* The theme every element shares, as a Lit `CSSResult`. Add it to your own Lit element's `styles`
|
|
4
|
+
* to use the same tokens. The elements take every colour and font, the corner radii, the shadow,
|
|
5
|
+
* the map's height and the spacing of the map's corners from the `--mosaica-*` custom properties
|
|
6
|
+
* that the components reference lists under Theme tokens; other spacing is fixed. Set a token on an element or any ancestor, including an
|
|
7
|
+
* enclosing `<mosaica-explorer>`, to override its default. Each colour has a light and a dark
|
|
8
|
+
* default, chosen by the page's `color-scheme`.
|
|
10
9
|
*
|
|
11
|
-
* The
|
|
12
|
-
*
|
|
10
|
+
* The colours the map uses for data are not tokens. Set them with the map's `palette`,
|
|
11
|
+
* `category-palette` and `ramp`.
|
|
13
12
|
*
|
|
14
|
-
* The default font is Instrument Sans
|
|
15
|
-
*
|
|
13
|
+
* The default font is Instrument Sans if the page has loaded it. The elements fetch no fonts, so
|
|
14
|
+
* link it from your page if you want it.
|
|
16
15
|
*
|
|
17
16
|
* @cssprop --mosaica-surface - The background of panels, cards, inputs and buttons.
|
|
18
17
|
* @cssprop --mosaica-surface-2 - The background of a chip, a hovered row and a chosen row.
|
|
@@ -49,8 +48,8 @@ import { css } from 'lit';
|
|
|
49
48
|
* @cssprop --mosaica-font-mono - The font family of identifiers.
|
|
50
49
|
* @cssprop --mosaica-shadow - The shadow under anything that floats over the map: the status
|
|
51
50
|
* strip, the map toolbar, the map tooltip, cards and popovers.
|
|
52
|
-
* @cssprop --mosaica-space - The gap between the map's
|
|
53
|
-
* it separates items in one corner.
|
|
51
|
+
* @cssprop --mosaica-space - The gap between the content in the map's corners and the map's edges.
|
|
52
|
+
* Half of it separates items in one corner.
|
|
54
53
|
* @cssprop --mosaica-density - A multiplier on `--mosaica-space`'s default.
|
|
55
54
|
* @cssprop --mosaica-map-height - The map's height.
|
|
56
55
|
*/
|
package/dist/view-picker.d.ts
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
2
2
|
import { MosaicaElement } from './base.js';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* last left it on, else at its first view. Renders nothing where the bundle offers one entry.
|
|
4
|
+
* Use the view picker when the bundle lays its items out in more than one way and viewers should
|
|
5
|
+
* choose the layout. Each view that belongs to no group is one entry, and so is each group of
|
|
6
|
+
* views. When there is only one entry, the picker shows nothing.
|
|
8
7
|
*
|
|
9
|
-
*
|
|
8
|
+
* Choosing a group opens the view the viewer last left that group on, or the group's first view.
|
|
9
|
+
* When the current view's group shares keys with the chosen group, the picker opens the view under
|
|
10
|
+
* the current key instead, so that the viewer stays on the same year or quarter. Viewers step
|
|
11
|
+
* between the views inside a group with `<mosaica-key-picker>`.
|
|
12
|
+
*
|
|
13
|
+
* @summary A drop-down menu for switching views.
|
|
10
14
|
* @tagname mosaica-view-picker
|
|
11
15
|
* @category Elements
|
|
12
16
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-viewswitch']>} mosaica-viewswitch - The view
|
|
13
17
|
* changed.
|
|
14
|
-
* @csspart field - The select and its chevron,
|
|
18
|
+
* @csspart field - The select and its chevron, shown as the view's title in bold.
|
|
15
19
|
* @csspart select - The select.
|
|
16
20
|
*/
|
|
17
21
|
export declare class MosaicaViewPicker extends MosaicaElement {
|
package/dist/view-picker.js
CHANGED
|
@@ -6,17 +6,21 @@ import { icon } from './icons.js';
|
|
|
6
6
|
import { switchView } from './view-switch.js';
|
|
7
7
|
import { chrome, tokens } from './tokens.js';
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* last left it on, else at its first view. Renders nothing where the bundle offers one entry.
|
|
9
|
+
* Use the view picker when the bundle lays its items out in more than one way and viewers should
|
|
10
|
+
* choose the layout. Each view that belongs to no group is one entry, and so is each group of
|
|
11
|
+
* views. When there is only one entry, the picker shows nothing.
|
|
13
12
|
*
|
|
14
|
-
*
|
|
13
|
+
* Choosing a group opens the view the viewer last left that group on, or the group's first view.
|
|
14
|
+
* When the current view's group shares keys with the chosen group, the picker opens the view under
|
|
15
|
+
* the current key instead, so that the viewer stays on the same year or quarter. Viewers step
|
|
16
|
+
* between the views inside a group with `<mosaica-key-picker>`.
|
|
17
|
+
*
|
|
18
|
+
* @summary A drop-down menu for switching views.
|
|
15
19
|
* @tagname mosaica-view-picker
|
|
16
20
|
* @category Elements
|
|
17
21
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-viewswitch']>} mosaica-viewswitch - The view
|
|
18
22
|
* changed.
|
|
19
|
-
* @csspart field - The select and its chevron,
|
|
23
|
+
* @csspart field - The select and its chevron, shown as the view's title in bold.
|
|
20
24
|
* @csspart select - The select.
|
|
21
25
|
*/
|
|
22
26
|
export class MosaicaViewPicker extends MosaicaElement {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mosaicajs/components",
|
|
3
|
-
"version": "0.1.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "The mosaica-* web components: a map, filters, counts, item cards and an explorer over a Mosaica server, plus a single-file bundle.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mosaica",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"directory": "clients/ts/components"
|
|
20
20
|
},
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
|
-
"author": "
|
|
22
|
+
"author": "mosaicadb",
|
|
23
23
|
"type": "module",
|
|
24
24
|
"main": "./dist/index.js",
|
|
25
25
|
"types": "./dist/index.d.ts",
|
|
@@ -112,8 +112,8 @@
|
|
|
112
112
|
},
|
|
113
113
|
"dependencies": {
|
|
114
114
|
"@lit/context": "^1.1.0",
|
|
115
|
-
"@mosaicajs/client": "0.1.0
|
|
116
|
-
"@mosaicajs/deck": "0.1.0
|
|
115
|
+
"@mosaicajs/client": "0.1.0",
|
|
116
|
+
"@mosaicajs/deck": "0.1.0"
|
|
117
117
|
},
|
|
118
118
|
"peerDependencies": {
|
|
119
119
|
"@deck.gl/aggregation-layers": "^9.3.7",
|
|
@@ -127,12 +127,12 @@
|
|
|
127
127
|
"@deck.gl/core": "^9.3.7",
|
|
128
128
|
"@deck.gl/layers": "^9.3.7",
|
|
129
129
|
"@luma.gl/core": "^9.3.6",
|
|
130
|
-
"happy-dom": "^
|
|
130
|
+
"happy-dom": "^21.0.4",
|
|
131
131
|
"lit": "^3.3.0",
|
|
132
132
|
"playwright": "^1.62.1",
|
|
133
133
|
"typescript": "^5.9.0",
|
|
134
134
|
"vite": "^8.2.0",
|
|
135
|
-
"vitest": "^
|
|
135
|
+
"vitest": "^4.1.12",
|
|
136
136
|
"esbuild": "^0.28.0"
|
|
137
137
|
},
|
|
138
138
|
"publishConfig": {
|