@perspective-dev/viewer 5.9.1 → 5.9.3

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 (55) hide show
  1. package/dist/cdn/perspective-viewer.js +11 -11
  2. package/dist/cdn/perspective-viewer.js.map +4 -4
  3. package/dist/css/blueprint.css +1 -1
  4. package/dist/css/botanical.css +1 -1
  5. package/dist/css/dracula.css +1 -1
  6. package/dist/css/eggplant.css +1 -1
  7. package/dist/css/gruvbox-dark.css +1 -1
  8. package/dist/css/gruvbox.css +1 -1
  9. package/dist/css/intl/ar.css +1 -1
  10. package/dist/css/intl/de.css +1 -1
  11. package/dist/css/intl/es.css +1 -1
  12. package/dist/css/intl/fr.css +1 -1
  13. package/dist/css/intl/ja.css +1 -1
  14. package/dist/css/intl/pt.css +1 -1
  15. package/dist/css/intl/zh.css +1 -1
  16. package/dist/css/intl.css +1 -1
  17. package/dist/css/ledger.css +1 -1
  18. package/dist/css/monokai.css +1 -1
  19. package/dist/css/nord.css +1 -1
  20. package/dist/css/phosphor.css +1 -1
  21. package/dist/css/pro-dark.css +1 -1
  22. package/dist/css/pro-light.css +1 -1
  23. package/dist/css/pro.css +1 -1
  24. package/dist/css/solarized-dark.css +1 -1
  25. package/dist/css/solarized.css +1 -1
  26. package/dist/css/themes.css +1 -1
  27. package/dist/css/vaporwave.css +1 -1
  28. package/dist/css/velvet.css +1 -1
  29. package/dist/custom-elements.json +234 -5
  30. package/dist/docs/perspective-docs.json +1 -1
  31. package/dist/esm/extensions.d.ts +11 -1
  32. package/dist/esm/perspective-viewer.d.ts +6 -0
  33. package/dist/esm/perspective-viewer.js +139 -127
  34. package/dist/esm/perspective-viewer.js.map +4 -4
  35. package/dist/esm/plugin.d.ts +7 -0
  36. package/dist/ts-rs/CommandLocation.d.ts +6 -0
  37. package/dist/ts-rs/CommandSchema.d.ts +7 -0
  38. package/dist/ts-rs/CommandSchemaOptions.d.ts +12 -0
  39. package/dist/ts-rs/CommandSpec.d.ts +10 -0
  40. package/dist/ts-rs/PerspectiveHit.d.ts +41 -0
  41. package/dist/ts-rs/PerspectiveHitKind.d.ts +6 -0
  42. package/dist/ts-rs/PerspectiveHitRef.d.ts +7 -0
  43. package/dist/ts-rs/ViewConfigUpdate.d.ts +111 -0
  44. package/dist/wasm/perspective-viewer.d.ts +197 -22
  45. package/dist/wasm/perspective-viewer.js +324 -132
  46. package/dist/wasm/perspective-viewer.wasm +0 -0
  47. package/dist/wasm/perspective-viewer.wasm.d.ts +20 -16
  48. package/dist/wasm/snippets/perspective-viewer-6f5a8e60bb1339b4/inline3.js +8 -0
  49. package/package.json +8 -6
  50. package/dist/wasm/snippets/perspective-viewer-659c02666b5f5853/inline1.js +0 -1
  51. /package/dist/wasm/snippets/{perspective-viewer-659c02666b5f5853 → perspective-viewer-6f5a8e60bb1339b4}/inline0.js +0 -0
  52. /package/dist/wasm/snippets/{perspective-viewer-659c02666b5f5853/inline2.js → perspective-viewer-6f5a8e60bb1339b4/inline1.js} +0 -0
  53. /package/dist/wasm/snippets/{perspective-viewer-659c02666b5f5853/inline3.js → perspective-viewer-6f5a8e60bb1339b4/inline2.js} +0 -0
  54. /package/dist/wasm/snippets/{perspective-viewer-659c02666b5f5853 → perspective-viewer-6f5a8e60bb1339b4}/inline4.js +0 -0
  55. /package/dist/wasm/snippets/{perspective-viewer-659c02666b5f5853 → perspective-viewer-6f5a8e60bb1339b4}/inline5.js +0 -0
@@ -1,5 +1,6 @@
1
1
  import type { View } from "@perspective-dev/client";
2
2
  import type { PluginStaticConfig } from "../../dist/ts-rs/PluginStaticConfig.d.ts";
3
+ import type { PerspectiveHitTest } from "../../dist/wasm/perspective-viewer.js";
3
4
  /**
4
5
  * The `IPerspectiveViewerPlugin` interface defines the necessary API for a
5
6
  * `<perspective-viewer>` plugin, which also must be an `HTMLElement` via the
@@ -191,6 +192,12 @@ export interface IPerspectiveViewerPlugin {
191
192
  * selection UI may omit it.
192
193
  */
193
194
  deselect?(): Promise<void>;
195
+ /**
196
+ * OPTIONAL — the `{ frame, ref }` this plugin drew at the viewport point
197
+ * `(x, y)`, or `undefined` over nothing; the viewer resolves it to a
198
+ * `PerspectiveHit`.
199
+ */
200
+ hit_test?(x: number, y: number): Promise<PerspectiveHitTest | undefined>;
194
201
  /**
195
202
  * Free any resources acquired by this plugin and prepare to be deleted.
196
203
  */
@@ -0,0 +1,6 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ /**
4
+ * A surface a command schema can be evaluated for.
5
+ */
6
+ export type CommandLocation = "context-menu" | "datagrid-row" | "datagrid-cell" | "chart-tooltip";
@@ -0,0 +1,7 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { CommandSpec } from "./CommandSpec.d.ts";
3
+
4
+ /**
5
+ * The commands a command schema offers for one context.
6
+ */
7
+ export type CommandSchema = { commands: Array<CommandSpec>, };
@@ -0,0 +1,12 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { CommandLocation } from "./CommandLocation.d.ts";
3
+
4
+ /**
5
+ * Options for the `setCommandSchema()` method.
6
+ */
7
+ export type CommandSchemaOptions = {
8
+ /**
9
+ * The surfaces the schema is evaluated for, `["context-menu"]` when
10
+ * omitted.
11
+ */
12
+ scopes?: Array<CommandLocation>, };
@@ -0,0 +1,10 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ /**
4
+ * One row a command schema contributes to a menu.
5
+ */
6
+ export type CommandSpec = { "kind": "Command", key: string, label: string, disabled?: boolean, icon?: string,
7
+ /**
8
+ * Tooltip text where the command is a button, the `label` when absent.
9
+ */
10
+ title?: string, } | { "kind": "Group", key: string, label: string, commands: Array<CommandSpec>, };
@@ -0,0 +1,41 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { PerspectiveHitKind } from "./PerspectiveHitKind.d.ts";
3
+ import type { Scalar } from "./Scalar.d.ts";
4
+ import type { ViewConfigUpdate } from "./ViewConfigUpdate.d.ts";
5
+
6
+ /**
7
+ * What a plugin rendered at a location, resolved against its view frame.
8
+ */
9
+ export type PerspectiveHit = { kind: PerspectiveHitKind,
10
+ /**
11
+ * The view row index at draw time.
12
+ */
13
+ y?: number,
14
+ /**
15
+ * The view column index at draw time.
16
+ */
17
+ x?: number,
18
+ /**
19
+ * The row's `__ID__`: its index value(s), or its `group_by` path.
20
+ */
21
+ id?: Array<Scalar>,
22
+ /**
23
+ * The `group_by` values of the row, outermost first.
24
+ */
25
+ row_path: Array<Scalar>,
26
+ /**
27
+ * The `split_by` values of the column, outermost first.
28
+ */
29
+ column_path: Array<Scalar>,
30
+ /**
31
+ * The column targeted, as in `perspective-click`.
32
+ */
33
+ column_names: Array<string>,
34
+ /**
35
+ * The cell's value, for a `"cell"` hit.
36
+ */
37
+ value?: Scalar,
38
+ /**
39
+ * A `restore()` patch whose filters select the target.
40
+ */
41
+ config: ViewConfigUpdate, };
@@ -0,0 +1,6 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ /**
4
+ * Which axes a `PerspectiveHit` addresses.
5
+ */
6
+ export type PerspectiveHitKind = "cell" | "row" | "column";
@@ -0,0 +1,7 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ /**
4
+ * A location in a `PerspectiveViewFrame`'s coordinates: a view row and/or a
5
+ * view column index.
6
+ */
7
+ export type PerspectiveHitRef = { y?: number, x?: number, };
@@ -0,0 +1,111 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { Aggregate } from "./Aggregate.d.ts";
3
+ import type { Expressions } from "./Expressions.d.ts";
4
+ import type { Filter } from "./Filter.d.ts";
5
+ import type { FilterReducer } from "./FilterReducer.d.ts";
6
+ import type { GroupRollupMode } from "./GroupRollupMode.d.ts";
7
+ import type { Sort } from "./Sort.d.ts";
8
+ import type { SplitRollupMode } from "./SplitRollupMode.d.ts";
9
+ import type { Windows } from "./Windows.d.ts";
10
+
11
+ export type ViewConfigUpdate = {
12
+ /**
13
+ * A group by _groups_ the dataset by the unique values of each column used
14
+ * as a group by - a close analogue in SQL to the `GROUP BY` statement.
15
+ * The underlying dataset is aggregated to show the values belonging to
16
+ * each group, and a total row is calculated for each group, showing
17
+ * the currently selected aggregated value (e.g. `sum`) of the column.
18
+ * Group by are useful for hierarchies, categorizing data and
19
+ * attributing values, i.e. showing the number of units sold based on
20
+ * State and City. In Perspective, group by are represented as an array
21
+ * of string column names to pivot, are applied in the order provided;
22
+ * For example, a group by of `["State", "City", "Postal Code"]` shows
23
+ * the values for each Postal Code, which are grouped by City,
24
+ * which are in turn grouped by State.
25
+ */
26
+ group_by?: Array<string>,
27
+ /**
28
+ * A split by _splits_ the dataset by the unique values of each column used
29
+ * as a split by. The underlying dataset is not aggregated, and a new
30
+ * column is created for each unique value of the split by. Each newly
31
+ * created column contains the parts of the dataset that correspond to
32
+ * the column header, i.e. a `View` that has `["State"]` as its split
33
+ * by will have a new column for each state. In Perspective, Split By
34
+ * are represented as an array of string column names to pivot.
35
+ */
36
+ split_by?: Array<string>,
37
+ /**
38
+ * The `columns` property specifies which columns should be included in the
39
+ * [`crate::View`]'s output. This allows users to show or hide a specific
40
+ * subset of columns, as well as control the order in which columns
41
+ * appear to the user. This is represented in Perspective as an array
42
+ * of string column names.
43
+ */
44
+ columns?: Array<string | null>,
45
+ /**
46
+ * The `filter` property specifies columns on which the query can be
47
+ * filtered, returning rows that pass the specified filter condition.
48
+ * This is analogous to the `WHERE` clause in SQL. There is no limit on
49
+ * the number of columns where `filter` is applied, but the resulting
50
+ * dataset is one that passes all the filter conditions, i.e. the
51
+ * filters are joined with an `AND` condition.
52
+ *
53
+ * Perspective represents `filter` as an array of arrays, with the values
54
+ * of each inner array being a string column name, a string filter
55
+ * operator, and a filter operand in the type of the column.
56
+ */
57
+ filter?: Array<Filter>,
58
+ /**
59
+ * The `sort` property specifies columns on which the query should be
60
+ * sorted, analogous to `ORDER BY` in SQL. A column can be sorted
61
+ * regardless of its data type, and sorts can be applied in ascending
62
+ * or descending order. Perspective represents `sort` as an array of
63
+ * arrays, with the values of each inner array being a string column
64
+ * name and a string sort direction. When `column-pivots` are applied,
65
+ * the additional sort directions `"col asc"` and `"col desc"` will
66
+ * determine the order of pivot columns groups.
67
+ *
68
+ * `sort` is the ONLY thing that orders a `View`'s rows — without it
69
+ * they keep the `Table`'s natural (insertion) order, which any
70
+ * consumer reading rows sequentially will reflect. Not to be
71
+ * confused with a window column's `order_by`, which orders rows
72
+ * WITHIN a window frame and does not reorder the `View`.
73
+ */
74
+ sort?: Array<Sort>,
75
+ /**
76
+ * The `expressions` property specifies _new_ columns in Perspective that
77
+ * are created using existing column values or arbitary scalar values
78
+ * defined within the expression. In `<perspective-viewer>`,
79
+ * expressions are added using the "New Column" button in the side
80
+ * panel.
81
+ */
82
+ expressions?: Expressions,
83
+ /**
84
+ * The `windows` property declares ordered, partitioned rolling
85
+ * computations (moving aggregates, cumulative sums) as _new_ columns
86
+ * keyed by output alias (`{"name": {...spec}}`, symmetric with
87
+ * `expressions`), analogous to SQL window functions. See
88
+ * [`crate::config::WindowSpec`].
89
+ */
90
+ windows?: Windows,
91
+ /**
92
+ * Aggregates perform a calculation over an entire column, and are
93
+ * displayed when one or more [Group By](#group-by) are applied to the
94
+ * `View`. Aggregates can be specified by the user, or Perspective will
95
+ * use the following sensible default aggregates based on column type:
96
+ *
97
+ * - "sum" for `integer` and `float` columns
98
+ * - "count" for all other columns
99
+ *
100
+ * Perspective provides a selection of aggregate functions that can be
101
+ * applied to columns in the `View` constructor using a dictionary of
102
+ * column name to aggregate function name.
103
+ *
104
+ * An aggregate also determines the column's RESULT TYPE, which need
105
+ * not match the input: `"count"` yields an `integer` whatever it
106
+ * counts, so a `date` column left on the default `"count"` is an
107
+ * `integer` in the resulting `View` — no longer a date. Set an
108
+ * aggregate that preserves the type (e.g. `"any"`, `"last"`) when
109
+ * the original type matters, such as a date used as a chart axis.
110
+ */
111
+ aggregates?: { [key in string]?: Aggregate }, group_by_depth?: number, filter_op?: FilterReducer, group_rollup_mode?: GroupRollupMode, split_rollup_mode?: SplitRollupMode, };
@@ -191,6 +191,12 @@ export type * from "../ts-rs/Notation.d.ts";
191
191
  export type * from "../ts-rs/DatetimeFormat.d.ts";
192
192
  export type * from "../ts-rs/ConfigDefaultsOptions.d.ts";
193
193
  export type * from "../ts-rs/ColumnConfigDefaultsOptions.d.ts";
194
+ export type * from "../ts-rs/CommandSchema.d.ts";
195
+ export type * from "../ts-rs/CommandSpec.d.ts";
196
+ export type * from "../ts-rs/CommandLocation.d.ts";
197
+ export type * from "../ts-rs/CommandSchemaOptions.d.ts";
198
+ export type * from "../ts-rs/PerspectiveHit.d.ts";
199
+ export type * from "../ts-rs/PerspectiveHitRef.d.ts";
194
200
 
195
201
  export type ExportData =
196
202
  | string
@@ -216,6 +222,82 @@ import type {ViewerConfigUpdate} from "../ts-rs/ViewerConfigUpdate.d.ts";
216
222
  import type {ViewerConfigInitial} from "../ts-rs/ViewerConfigInitial.d.ts";
217
223
  import type {WorkspaceConfig} from "../ts-rs/WorkspaceConfig.d.ts";
218
224
  import type {WorkspaceConfigUpdate} from "../ts-rs/WorkspaceConfigUpdate.d.ts";
225
+ import type {CommandSchema} from "../ts-rs/CommandSchema.d.ts";
226
+ import type {CommandSpec} from "../ts-rs/CommandSpec.d.ts";
227
+ import type {CommandLocation} from "../ts-rs/CommandLocation.d.ts";
228
+ import type {CommandSchemaOptions} from "../ts-rs/CommandSchemaOptions.d.ts";
229
+ import type {PerspectiveHit} from "../ts-rs/PerspectiveHit.d.ts";
230
+ import type {PerspectiveHitRef} from "../ts-rs/PerspectiveHitRef.d.ts";
231
+
232
+ /** A surface a command schema is evaluated for. */
233
+ export type PerspectiveCommandLocation = CommandLocation;
234
+
235
+ /**
236
+ * A window of a plugin's viewport, in the shape of the parsed
237
+ * `to_columns_string({ id: true })` result and the `column_paths()` area.
238
+ */
239
+ export interface PerspectiveViewFrame {
240
+ /** The view row index of `data`'s first entry. */
241
+ start_row: number;
242
+
243
+ /** The view column index of `paths[0]`. */
244
+ start_col: number;
245
+
246
+ /** The `data` key of each column from `start_col`. */
247
+ paths: string[];
248
+
249
+ /** One level per `split_by` plus the column name, each over `paths`. */
250
+ column_paths: Scalar[][];
251
+
252
+ /** Columns keyed by path, with `__ROW_PATH__` and `__ID__` when present. */
253
+ data: Record<string, unknown[]>;
254
+ }
255
+
256
+ /** What a plugin rendered at a viewport point, before the viewer resolves it. */
257
+ export interface PerspectiveHitTest {
258
+ frame: PerspectiveViewFrame;
259
+ ref: PerspectiveHitRef;
260
+ }
261
+
262
+ /** One `queryCommands()` result: the context the schema saw and what it returned. */
263
+ export interface PerspectiveCommands {
264
+ context: PerspectiveCommandContext;
265
+ commands: CommandSpec[];
266
+ }
267
+
268
+ /** What a command schema is evaluated against. */
269
+ export interface PerspectiveCommandContext {
270
+ location: PerspectiveCommandLocation;
271
+
272
+ /** The targeted panel, absent only at zero panels. */
273
+ panel?: string;
274
+
275
+ /** The name of the panel's `Table`. */
276
+ table?: string;
277
+
278
+ /** The name of the panel's plugin. */
279
+ plugin?: string;
280
+
281
+ /** The panel's view config, as `getViewConfig()` reports it. */
282
+ view_config?: ViewConfig;
283
+
284
+ /** Viewport coordinates of the pointer that initiated the command, for the context menu. */
285
+ point?: { x: number; y: number };
286
+
287
+ /** What the plugin rendered at the location, absent over tabs and chrome. */
288
+ hit?: PerspectiveHit;
289
+ }
290
+
291
+ /** A synchronous, effect-free function declaring the commands for a context. */
292
+ export type PerspectiveCommandSchema = (
293
+ context: PerspectiveCommandContext,
294
+ ) => CommandSchema;
295
+
296
+ /** The `detail` of a `perspective-command` event. */
297
+ export interface PerspectiveCommandEventDetail {
298
+ key: string;
299
+ context: PerspectiveCommandContext;
300
+ }
219
301
 
220
302
 
221
303
 
@@ -702,9 +784,10 @@ export class PerspectiveViewerElement {
702
784
  * opening user turn.
703
785
  * - `config.entitlements` - access grants limiting which tools the agent
704
786
  * is offered (and may call): any of `"read_view"`, `"configure_view"`,
705
- * `"manage_layout"`, `"read_docs"`, `"read_data"`. Omitted, all but
706
- * `"read_data"` are granted; `["read_view", "read_docs"]` yields a
707
- * read-only agent.
787
+ * `"manage_layout"`, `"read_docs"`, `"execute_code"`, `"read_data"`.
788
+ * Omitted, all but `"execute_code"` and `"read_data"` are granted;
789
+ * `["read_view", "read_docs"]` yields a read-only agent. Users may
790
+ * switch granted entitlements off from the chat panel, never on.
708
791
  *
709
792
  * # JavaScript Examples
710
793
  *
@@ -728,7 +811,8 @@ export class PerspectiveViewerElement {
728
811
  * conversation history (and the chat sidebar's transcript) until
729
812
  * `agentReset()`; a call made while a turn is already running rejects.
730
813
  * Tool activity is emitted as `perspective-agent-tool` CustomEvents on
731
- * this element.
814
+ * this element. A failed turn rejects with an `Error` whose `retry()`
815
+ * method retries it, returning a `Promise` that settles like this one.
732
816
  *
733
817
  * # JavaScript Examples
734
818
  *
@@ -744,8 +828,8 @@ export class PerspectiveViewerElement {
744
828
  agentReset(): Promise<any>;
745
829
  connectedCallback(): void;
746
830
  /**
747
- * Copy this viewer's `View` or `Table` data as CSV to the system
748
- * clipboard.
831
+ * Copy this viewer's `View` or `Table` data to the system clipboard from
832
+ * within a user gesture, rejecting if nothing could be written.
749
833
  *
750
834
  * # Arguments
751
835
  *
@@ -996,6 +1080,36 @@ export class PerspectiveViewerElement {
996
1080
  * [`View::get_config`])
997
1081
  */
998
1082
  getViewConfig(options?: PanelOptions | null): Promise<ViewConfig>;
1083
+ /**
1084
+ * Redraw each panel's plugin from its current `View` without re-creating
1085
+ * the view, such as after a command changed state its buttons read; calls
1086
+ * within one task run as one.
1087
+ *
1088
+ * # Arguments
1089
+ *
1090
+ * - `options.panel` - Limits the redraw to one panel.
1091
+ *
1092
+ * # JavaScript Examples
1093
+ *
1094
+ * ```javascript
1095
+ * viewer.addEventListener("perspective-command", (e) => {
1096
+ * flagged.add(e.detail.context.hit.id);
1097
+ * viewer.invalidate({ panel: e.detail.context.panel });
1098
+ * });
1099
+ * ```
1100
+ */
1101
+ invalidate(options?: PanelOptions | null): Promise<void>;
1102
+ /**
1103
+ * Dispatch `perspective-command` for the app command `key` picked against
1104
+ * `context`, as the context menu does.
1105
+ *
1106
+ * # JavaScript Examples
1107
+ *
1108
+ * ```javascript
1109
+ * viewer.invokeCommand("ticket", result.context);
1110
+ * ```
1111
+ */
1112
+ invokeCommand(key: string, context: PerspectiveCommandContext): void;
999
1113
  /**
1000
1114
  * Loads a [`Client`], or optionally [`Table`], or optionally a Javascript
1001
1115
  * `Promise` which returns a [`Client`] or [`Table`], in this viewer.
@@ -1074,6 +1188,27 @@ export class PerspectiveViewerElement {
1074
1188
  */
1075
1189
  load(client: Client | Table | Promise<Client | Table>): Promise<void>;
1076
1190
  constructor(elem: HTMLElement);
1191
+ /**
1192
+ * Evaluate the app's command schema at `location` for each of `refs`,
1193
+ * resolved against `frame`, the viewport read of the panel plugin
1194
+ * `plugin`; `undefined` when `location` is outside the schema's scopes
1195
+ * or no schema is set.
1196
+ *
1197
+ * # Arguments
1198
+ *
1199
+ * - `plugin` - The calling plugin element, which identifies its panel.
1200
+ * - `location` - The surface being rendered.
1201
+ * - `frame` - The plugin's viewport read, as `to_columns_string({ id: true
1202
+ * })` and `column_paths()` returned it.
1203
+ * - `refs` - One view row and/or column index per button.
1204
+ *
1205
+ * # JavaScript Examples
1206
+ *
1207
+ * ```javascript
1208
+ * const results = viewer.queryCommands(this, "datagrid-row", frame, [{ y: 12 }]);
1209
+ * ```
1210
+ */
1211
+ queryCommands(plugin: HTMLElement, location: PerspectiveCommandLocation, frame: PerspectiveViewFrame, refs: PerspectiveHitRef[]): PerspectiveCommands[] | undefined;
1077
1212
  /**
1078
1213
  * Remove the panel with id `name` from the layout, disposing its engines
1079
1214
  * (its `View` is deleted and its `Table` reference released). The last
@@ -1362,6 +1497,30 @@ export class PerspectiveViewerElement {
1362
1497
  * ```
1363
1498
  */
1364
1499
  setAutoSize(autosize: boolean): void;
1500
+ /**
1501
+ * Set the function that declares this viewer's custom commands, replacing
1502
+ * any previously set, and re-query every plugin's command buttons when it
1503
+ * or its scopes changed.
1504
+ *
1505
+ * # Arguments
1506
+ *
1507
+ * - `schema` - A synchronous function from a command context to a `{
1508
+ * commands }` list, or `null` to remove the current one.
1509
+ * - `options.scopes` - The surfaces the schema is evaluated for,
1510
+ * `["context-menu"]` when omitted.
1511
+ *
1512
+ * # JavaScript Examples
1513
+ *
1514
+ * ```javascript
1515
+ * await viewer.setCommandSchema(
1516
+ * (ctx) => ({
1517
+ * commands: [{ kind: "Command", key: "hello", label: "Hello" }],
1518
+ * }),
1519
+ * { scopes: ["context-menu", "datagrid-row"] },
1520
+ * );
1521
+ * ```
1522
+ */
1523
+ setCommandSchema(schema?: PerspectiveCommandSchema | null, options?: CommandSchemaOptions | null): Promise<void>;
1365
1524
  /**
1366
1525
  * Set the selection [`perspective_js::JsViewWindow`] for the named panel,
1367
1526
  * or the active panel when `panel` is omitted.
@@ -1387,6 +1546,18 @@ export class PerspectiveViewerElement {
1387
1546
  * ```
1388
1547
  */
1389
1548
  setThrottle(val?: number | null): void;
1549
+ /**
1550
+ * Open a menu of `commands` at viewport `point`, dispatching
1551
+ * `perspective-command` with `context` for a pick; resolves when the menu
1552
+ * closes.
1553
+ *
1554
+ * # JavaScript Examples
1555
+ *
1556
+ * ```javascript
1557
+ * await viewer.showCommandMenu(result.context, group.commands, { x: e.clientX, y: e.clientY });
1558
+ * ```
1559
+ */
1560
+ showCommandMenu(context: PerspectiveCommandContext, commands: CommandSpec[], point: { x: number; y: number }): Promise<void>;
1390
1561
  /**
1391
1562
  * Asynchronously opens the column settings for a specific column.
1392
1563
  * When finished, the `<perspective-viewer>` element will emit a
@@ -2052,8 +2223,11 @@ export interface InitOutput {
2052
2223
  readonly perspectiveviewerelement_getThemes: (a: number) => number;
2053
2224
  readonly perspectiveviewerelement_getView: (a: number, b: number) => number;
2054
2225
  readonly perspectiveviewerelement_getViewConfig: (a: number, b: number) => number;
2226
+ readonly perspectiveviewerelement_invalidate: (a: number, b: number, c: number) => void;
2227
+ readonly perspectiveviewerelement_invokeCommand: (a: number, b: number, c: number, d: number, e: number) => void;
2055
2228
  readonly perspectiveviewerelement_load: (a: number, b: number, c: number) => void;
2056
2229
  readonly perspectiveviewerelement_new: (a: number) => number;
2230
+ readonly perspectiveviewerelement_queryCommands: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
2057
2231
  readonly perspectiveviewerelement_removePanel: (a: number, b: number, c: number) => number;
2058
2232
  readonly perspectiveviewerelement_reset: (a: number, b: number, c: number) => number;
2059
2233
  readonly perspectiveviewerelement_resetError: (a: number) => number;
@@ -2067,8 +2241,10 @@ export interface InitOutput {
2067
2241
  readonly perspectiveviewerelement_setActivePanel: (a: number, b: number, c: number) => number;
2068
2242
  readonly perspectiveviewerelement_setAutoPause: (a: number, b: number) => number;
2069
2243
  readonly perspectiveviewerelement_setAutoSize: (a: number, b: number) => void;
2244
+ readonly perspectiveviewerelement_setCommandSchema: (a: number, b: number, c: number, d: number) => void;
2070
2245
  readonly perspectiveviewerelement_setSelection: (a: number, b: number, c: number, d: number) => void;
2071
2246
  readonly perspectiveviewerelement_setThrottle: (a: number, b: number, c: number) => void;
2247
+ readonly perspectiveviewerelement_showCommandMenu: (a: number, b: number, c: number, d: number) => number;
2072
2248
  readonly perspectiveviewerelement_toggleColumnSettings: (a: number, b: number, c: number, d: number) => number;
2073
2249
  readonly perspectiveviewerelement_toggleConfig: (a: number, b: number) => number;
2074
2250
  readonly registerPlugin: (a: number, b: number) => void;
@@ -2181,22 +2357,21 @@ export interface InitOutput {
2181
2357
  readonly virtualdataslice_setStringCol: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
2182
2358
  readonly virtualserver_handleRequest: (a: number, b: number, c: number) => number;
2183
2359
  readonly virtualserver_new: (a: number, b: number) => void;
2184
- readonly __wasm_bindgen_func_elem_7566: (a: number, b: number) => void;
2185
- readonly __wasm_bindgen_func_elem_20655: (a: number, b: number) => void;
2186
- readonly __wasm_bindgen_func_elem_21269: (a: number, b: number) => void;
2187
- readonly __wasm_bindgen_func_elem_22680: (a: number, b: number) => void;
2188
- readonly __wasm_bindgen_func_elem_27384: (a: number, b: number) => void;
2189
- readonly __wasm_bindgen_func_elem_36185: (a: number, b: number, c: number, d: number) => void;
2190
- readonly __wasm_bindgen_func_elem_8643: (a: number, b: number, c: number) => void;
2191
- readonly __wasm_bindgen_func_elem_8644: (a: number, b: number, c: number) => void;
2192
- readonly __wasm_bindgen_func_elem_8645: (a: number, b: number, c: number) => void;
2193
- readonly __wasm_bindgen_func_elem_8641: (a: number, b: number, c: number) => void;
2194
- readonly __wasm_bindgen_func_elem_20678: (a: number, b: number, c: number) => void;
2195
- readonly __wasm_bindgen_func_elem_21273: (a: number, b: number, c: number) => void;
2196
- readonly __wasm_bindgen_func_elem_27386: (a: number, b: number, c: number) => void;
2197
- readonly __wasm_bindgen_func_elem_23327: (a: number, b: number) => number;
2198
- readonly __wasm_bindgen_func_elem_21272: (a: number, b: number) => void;
2199
- readonly __wasm_bindgen_func_elem_23328: (a: number, b: number) => void;
2360
+ readonly __wasm_bindgen_func_elem_5185: (a: number, b: number) => void;
2361
+ readonly __wasm_bindgen_func_elem_21028: (a: number, b: number) => void;
2362
+ readonly __wasm_bindgen_func_elem_21730: (a: number, b: number) => void;
2363
+ readonly __wasm_bindgen_func_elem_22975: (a: number, b: number) => void;
2364
+ readonly __wasm_bindgen_func_elem_27811: (a: number, b: number) => void;
2365
+ readonly __wasm_bindgen_func_elem_36159: (a: number, b: number, c: number, d: number) => void;
2366
+ readonly __wasm_bindgen_func_elem_8948: (a: number, b: number, c: number) => void;
2367
+ readonly __wasm_bindgen_func_elem_8949: (a: number, b: number, c: number) => void;
2368
+ readonly __wasm_bindgen_func_elem_8950: (a: number, b: number, c: number) => void;
2369
+ readonly __wasm_bindgen_func_elem_21145: (a: number, b: number, c: number) => void;
2370
+ readonly __wasm_bindgen_func_elem_21737: (a: number, b: number, c: number) => void;
2371
+ readonly __wasm_bindgen_func_elem_27828: (a: number, b: number, c: number) => void;
2372
+ readonly __wasm_bindgen_func_elem_23773: (a: number, b: number) => number;
2373
+ readonly __wasm_bindgen_func_elem_21736: (a: number, b: number) => void;
2374
+ readonly __wasm_bindgen_func_elem_23774: (a: number, b: number) => void;
2200
2375
  readonly __wbindgen_export: (a: number, b: number) => number;
2201
2376
  readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
2202
2377
  readonly __wbindgen_export3: (a: number) => void;