@perspective-dev/viewer 5.8.0 → 5.9.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 (27) hide show
  1. package/dist/cdn/perspective-viewer.js +10 -10
  2. package/dist/cdn/perspective-viewer.js.map +3 -3
  3. package/dist/custom-elements.json +59 -2
  4. package/dist/docs/perspective-docs.json +1 -1
  5. package/dist/esm/bootstrap.d.ts +32 -3
  6. package/dist/esm/perspective-viewer.d.ts +5 -3
  7. package/dist/esm/perspective-viewer.js +115 -111
  8. package/dist/esm/perspective-viewer.js.map +3 -3
  9. package/dist/ts-rs/Layout.d.ts +1 -1
  10. package/dist/ts-rs/OptionalUpdate.d.ts +4 -0
  11. package/dist/ts-rs/PanelViewerConfig.d.ts +3 -3
  12. package/dist/ts-rs/SplitLayout.d.ts +2 -1
  13. package/dist/ts-rs/ViewerConfig.d.ts +14 -10
  14. package/dist/ts-rs/ViewerConfigUpdate.d.ts +4 -0
  15. package/dist/ts-rs/WorkspaceConfig.d.ts +16 -2
  16. package/dist/ts-rs/WorkspaceConfigUpdate.d.ts +7 -6
  17. package/dist/wasm/perspective-viewer.d.ts +30 -25
  18. package/dist/wasm/perspective-viewer.js +126 -121
  19. package/dist/wasm/perspective-viewer.wasm +0 -0
  20. package/dist/wasm/perspective-viewer.wasm.d.ts +16 -16
  21. package/package.json +5 -5
  22. /package/dist/wasm/snippets/{perspective-viewer-941ba6dae7521dbe → perspective-viewer-d50f032e5aa67e6f}/inline0.js +0 -0
  23. /package/dist/wasm/snippets/{perspective-viewer-941ba6dae7521dbe → perspective-viewer-d50f032e5aa67e6f}/inline1.js +0 -0
  24. /package/dist/wasm/snippets/{perspective-viewer-941ba6dae7521dbe → perspective-viewer-d50f032e5aa67e6f}/inline2.js +0 -0
  25. /package/dist/wasm/snippets/{perspective-viewer-941ba6dae7521dbe → perspective-viewer-d50f032e5aa67e6f}/inline3.js +0 -0
  26. /package/dist/wasm/snippets/{perspective-viewer-941ba6dae7521dbe → perspective-viewer-d50f032e5aa67e6f}/inline4.js +0 -0
  27. /package/dist/wasm/snippets/{perspective-viewer-941ba6dae7521dbe → perspective-viewer-d50f032e5aa67e6f}/inline5.js +0 -0
@@ -4,6 +4,6 @@ import type { TabLayout } from "./TabLayout.d.ts";
4
4
 
5
5
  /**
6
6
  * A dashboard's panel arrangement: nested splits whose leaves are tab stacks
7
- * of panel ids, naming every panel exactly once.
7
+ * of panel ids, naming each panel at most once.
8
8
  */
9
9
  export type Layout = { "type": "split-layout" } & SplitLayout | { "type": "tab-layout" } & TabLayout;
@@ -1,3 +1,7 @@
1
1
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
2
 
3
+ /**
4
+ * One field of a field-wise update: absent leaves the field unchanged,
5
+ * `null` resets it to its default and a value replaces it.
6
+ */
3
7
  export type OptionalUpdate<T> = null | T;
@@ -46,9 +46,9 @@ plugin: string,
46
46
  plugin_config: { [key in string]?: JsonValue },
47
47
  /**
48
48
  * The `Table` this panel renders: its hosted name in a
49
- * [`WorkspaceConfig`] `panels` entry (`T = String`), and a
50
- * [`TableRef`] — a name, or a recursively inlined derived-table
51
- * definition — in the single-panel `save()` format.
49
+ * [`WorkspaceConfig`](super::WorkspaceConfig) `panels` entry
50
+ * (`T = String`), and a [`TableRef`] — a name, or a recursively inlined
51
+ * derived-table definition — in the single-panel `save()` format.
52
52
  */
53
53
  table: T,
54
54
  /**
@@ -11,7 +11,8 @@ export type SplitLayout = {
11
11
  */
12
12
  children: Array<Layout>,
13
13
  /**
14
- * Each child's fraction of the split, one per child, summing to 1.
14
+ * Each child's share of the split, one per child, as a proportion of
15
+ * their total.
15
16
  */
16
17
  sizes: Array<number>,
17
18
  /**
@@ -11,14 +11,18 @@ import type { Windows } from "./Windows.d.ts";
11
11
  import type { JsonValue } from "./serde_json/JsonValue.d.ts";
12
12
 
13
13
  /**
14
- * The state of an entire `custom_elements::PerspectiveViewerElement` component
15
- * and its `Plugin`: the element-level `settings` flag plus the per-panel
16
- * [`PanelViewerConfig`]. The split exists so the workspace config format
17
- * can serialize panel entries *without* a `settings` key (it is element-level
18
- * state there, carried by the top-level `active` field instead), while the
19
- * single-panel format flattens back to the legacy shape.
14
+ * The state of an entire `<perspective-viewer>` element and its plugin: the
15
+ * element-level `settings` flag plus the per-panel [`PanelViewerConfig`].
16
+ * The split exists so the workspace config format can serialize panel
17
+ * entries *without* a `settings` key (it is element-level state there,
18
+ * carried by the top-level `active` field instead), while the single-panel
19
+ * format flattens back to the legacy shape.
20
20
  */
21
- export type ViewerConfig<V = string, T = TableRef> = { settings: boolean,
21
+ export type ViewerConfig<V = string, T = TableRef> = {
22
+ /**
23
+ * Whether the settings sidebar is open.
24
+ */
25
+ settings: boolean,
22
26
  /**
23
27
  * The `@perspective-dev/viewer` version that wrote this config,
24
28
  * stamped on save and named in the error when such a config is rejected.
@@ -49,9 +53,9 @@ plugin: string,
49
53
  plugin_config: { [key in string]?: JsonValue },
50
54
  /**
51
55
  * The `Table` this panel renders: its hosted name in a
52
- * [`WorkspaceConfig`] `panels` entry (`T = String`), and a
53
- * [`TableRef`] — a name, or a recursively inlined derived-table
54
- * definition — in the single-panel `save()` format.
56
+ * [`WorkspaceConfig`](super::WorkspaceConfig) `panels` entry
57
+ * (`T = String`), and a [`TableRef`] — a name, or a recursively inlined
58
+ * derived-table definition — in the single-panel `save()` format.
55
59
  */
56
60
  table: T,
57
61
  /**
@@ -11,6 +11,10 @@ import type { TableRef } from "./TableRef.d.ts";
11
11
  import type { Windows } from "./Windows.d.ts";
12
12
  import type { JsonValue } from "./serde_json/JsonValue.d.ts";
13
13
 
14
+ /**
15
+ * The `restore()` argument: a field-wise update of a panel's state, where an
16
+ * absent key is unchanged, `null` resets and a value replaces.
17
+ */
14
18
  export type ViewerConfigUpdate = {
15
19
  /**
16
20
  * The `@perspective-dev/viewer` version a saved config was written
@@ -7,14 +7,28 @@ import type { PanelViewerConfig } from "./PanelViewerConfig.d.ts";
7
7
  /**
8
8
  * The workspace config format (`{version, active?, layout, panels}`) —
9
9
  * the multi-panel counterpart of the single-panel [`ViewerConfig`] — as
10
- * emitted by [`PerspectiveViewerElement::save`].
10
+ * emitted by `saveWorkspace()`.
11
11
  *
12
12
  * - `panels` entries are [`PanelViewerConfig`]s: per-panel state only, no
13
13
  * `settings` key (element-level state).
14
14
  * - `active` names the panel targeted by the *open* settings sidebar; it is
15
15
  * omitted when the sidebar is closed.
16
+ *
17
+ * [`ViewerConfig`]: super::ViewerConfig
18
+ */
19
+ export type WorkspaceConfig = {
20
+ /**
21
+ * The `@perspective-dev/viewer` version that wrote this workspace.
22
+ */
23
+ version: string,
24
+ /**
25
+ * The panel targeted by the open settings sidebar.
26
+ */
27
+ active?: string,
28
+ /**
29
+ * The panel arrangement.
16
30
  */
17
- export type WorkspaceConfig = { version: string, active?: string, layout: Layout | null,
31
+ layout: Layout | null,
18
32
  /**
19
33
  * `BTreeMap` (not `HashMap`) so `save()` serializes panels in a
20
34
  * DETERMINISTIC (sorted) key order — a fresh `HashMap` per call
@@ -6,10 +6,11 @@ import type { OptionalUpdate } from "./OptionalUpdate.d.ts";
6
6
  import type { ViewerConfigInitial } from "./ViewerConfigInitial.d.ts";
7
7
 
8
8
  /**
9
- * The [`PerspectiveViewerElement::restoreWorkspace`] argument: a field-wise
10
- * update of the element's workspace state, like [`ViewerConfigUpdate`] for a
11
- * panel, where an absent key is unchanged, `null` resets and a value
12
- * replaces.
9
+ * The `restoreWorkspace()` argument: a field-wise update of the element's
10
+ * workspace state, like [`ViewerConfigUpdate`] for a panel, where an absent
11
+ * key is unchanged, `null` resets and a value replaces.
12
+ *
13
+ * [`ViewerConfigUpdate`]: super::ViewerConfigUpdate
13
14
  */
14
15
  export type WorkspaceConfigUpdate = {
15
16
  /**
@@ -23,8 +24,8 @@ version?: string,
23
24
  */
24
25
  active?: OptionalUpdate<string>,
25
26
  /**
26
- * The layout tree to stage, naming every `panels` key (or, without
27
- * `panels`, every existing panel id) exactly once.
27
+ * The layout tree to stage, naming `panels` keys (or, without `panels`,
28
+ * existing panel ids) at most once; a panel it omits is dropped.
28
29
  */
29
30
  layout?: Layout,
30
31
  /**
@@ -1760,19 +1760,24 @@ export class View {
1760
1760
  */
1761
1761
  on_delete(on_delete: Function): Promise<any>;
1762
1762
  /**
1763
- * Register a callback which is invoked whenever rows are removed from
1764
- * this [`View`]'s [`Table`] by [`Table::remove`], with an object
1765
- * containing `port_id` and `indices`, the removed `index` column
1766
- * values as an Arrow of one column named after the index.
1767
- *
1768
- * [`Table::replace`] reports the keys it does not re-supply and
1769
- * [`Table::clear`] reports every key. `on_remove` never fires for a
1770
- * [`Table`] without an `index`.
1763
+ * Register a callback which is invoked whenever rows leave this
1764
+ * [`View`], with an object containing `port_id`, `indices` (their keys
1765
+ * as an Arrow of one column per key column named after it) and `cause`,
1766
+ * one of `"key"`, `"filter"` or `"group"`.
1767
+ *
1768
+ * For a [`View`] without `group_by` the keys are the `index` columns of
1769
+ * the [`Table`], which must have one: `"key"` when [`Table::remove`]
1770
+ * removed them ([`Table::replace`] reports the keys it does not
1771
+ * re-supply and [`Table::clear`] every key) and `"filter"` when
1772
+ * [`Table::update`] moved them outside the [`View`]'s `filter`. For a
1773
+ * [`View`] with `group_by` the keys are the `group_by` columns of each
1774
+ * group which no longer has any rows, `"group"`, `null` below the
1775
+ * group's depth. It fires once per cause per update step.
1771
1776
  *
1772
1777
  * # JavaScript Examples
1773
1778
  *
1774
1779
  * ```javascript
1775
- * const id = await view.on_remove(({ indices, port_id }) => {
1780
+ * const id = await view.on_remove(({ indices, port_id, cause }) => {
1776
1781
  * replica.remove(indices);
1777
1782
  * });
1778
1783
  * ```
@@ -2168,22 +2173,22 @@ export interface InitOutput {
2168
2173
  readonly virtualdataslice_setStringCol: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
2169
2174
  readonly virtualserver_handleRequest: (a: number, b: number, c: number) => number;
2170
2175
  readonly virtualserver_new: (a: number, b: number) => void;
2171
- readonly __wasm_bindgen_func_elem_7632: (a: number, b: number) => void;
2172
- readonly __wasm_bindgen_func_elem_20819: (a: number, b: number) => void;
2173
- readonly __wasm_bindgen_func_elem_21433: (a: number, b: number) => void;
2174
- readonly __wasm_bindgen_func_elem_22881: (a: number, b: number) => void;
2175
- readonly __wasm_bindgen_func_elem_27560: (a: number, b: number) => void;
2176
- readonly __wasm_bindgen_func_elem_36047: (a: number, b: number, c: number, d: number) => void;
2177
- readonly __wasm_bindgen_func_elem_8749: (a: number, b: number, c: number) => void;
2178
- readonly __wasm_bindgen_func_elem_8750: (a: number, b: number, c: number) => void;
2179
- readonly __wasm_bindgen_func_elem_8751: (a: number, b: number, c: number) => void;
2180
- readonly __wasm_bindgen_func_elem_8747: (a: number, b: number, c: number) => void;
2181
- readonly __wasm_bindgen_func_elem_20842: (a: number, b: number, c: number) => void;
2182
- readonly __wasm_bindgen_func_elem_21437: (a: number, b: number, c: number) => void;
2183
- readonly __wasm_bindgen_func_elem_27562: (a: number, b: number, c: number) => void;
2184
- readonly __wasm_bindgen_func_elem_23511: (a: number, b: number) => number;
2185
- readonly __wasm_bindgen_func_elem_21436: (a: number, b: number) => void;
2186
- readonly __wasm_bindgen_func_elem_23512: (a: number, b: number) => void;
2176
+ readonly __wasm_bindgen_func_elem_20596: (a: number, b: number) => void;
2177
+ readonly __wasm_bindgen_func_elem_7550: (a: number, b: number) => void;
2178
+ readonly __wasm_bindgen_func_elem_21211: (a: number, b: number) => void;
2179
+ readonly __wasm_bindgen_func_elem_22623: (a: number, b: number) => void;
2180
+ readonly __wasm_bindgen_func_elem_27298: (a: number, b: number) => void;
2181
+ readonly __wasm_bindgen_func_elem_36104: (a: number, b: number, c: number, d: number) => void;
2182
+ readonly __wasm_bindgen_func_elem_20619: (a: number, b: number, c: number) => void;
2183
+ readonly __wasm_bindgen_func_elem_8627: (a: number, b: number, c: number) => void;
2184
+ readonly __wasm_bindgen_func_elem_8628: (a: number, b: number, c: number) => void;
2185
+ readonly __wasm_bindgen_func_elem_8629: (a: number, b: number, c: number) => void;
2186
+ readonly __wasm_bindgen_func_elem_8625: (a: number, b: number, c: number) => void;
2187
+ readonly __wasm_bindgen_func_elem_21215: (a: number, b: number, c: number) => void;
2188
+ readonly __wasm_bindgen_func_elem_27300: (a: number, b: number, c: number) => void;
2189
+ readonly __wasm_bindgen_func_elem_23270: (a: number, b: number) => number;
2190
+ readonly __wasm_bindgen_func_elem_21214: (a: number, b: number) => void;
2191
+ readonly __wasm_bindgen_func_elem_23271: (a: number, b: number) => void;
2187
2192
  readonly __wbindgen_export: (a: number, b: number) => number;
2188
2193
  readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
2189
2194
  readonly __wbindgen_export3: (a: number) => void;