@holistics/anfra-sdk 0.23.1 → 0.24.0-rc.1

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.
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-RXPNL7UR.js";
15
15
  import {
16
16
  version
17
- } from "./chunk-3HX7IZ7E.js";
17
+ } from "./chunk-OQ52YGQV.js";
18
18
  import {
19
19
  abortError,
20
20
  createEndpoint
@@ -683,6 +683,17 @@ var Query = class extends Observable {
683
683
  throw err;
684
684
  }
685
685
  }
686
+ /**
687
+ * Opens the host's panel at this query, as a reader asked to inspect it: wire it to your own
688
+ * button, badge or menu. `tab` names the panel's tab by its full id (`inspect.queries`); left out,
689
+ * or one the host doesn't show, the host picks its own (Data, which shows its rows unless it set another).
690
+ * Call it from a reader's click: without one it opens nothing and reports a problem. Resolves
691
+ * true when the panel opened.
692
+ */
693
+ async inspect(options = {}) {
694
+ this.assertLive();
695
+ return this.app.inspect("query", this.name, options.tab);
696
+ }
686
697
  /**
687
698
  * Opens the menu on these rows of this query: the items plugins and the host offer for a point
688
699
  * of data, such as "View underlying data". Call it from your chart's own right-click handler,
@@ -889,6 +900,17 @@ var Control = class extends Observable {
889
900
  this.assertLive();
890
901
  return this.app.locate("control", this.name);
891
902
  }
903
+ /**
904
+ * Opens the host's panel at this control, as a reader asked to inspect it: wire it to your own
905
+ * button, badge or menu. `tab` names the panel's tab by its full id (`inspect.queries`); left out,
906
+ * or one the host doesn't show, the host picks its own (Queries, which shows what it filters unless it set another).
907
+ * Call it from a reader's click: without one it opens nothing and reports a problem. Resolves
908
+ * true when the panel opened.
909
+ */
910
+ async inspect(options = {}) {
911
+ this.assertLive();
912
+ return this.app.inspect("control", this.name, options.tab);
913
+ }
892
914
  /** False once `remove()` took it out of its app. */
893
915
  get isRemoved() {
894
916
  return this.removed;
@@ -2253,6 +2275,8 @@ var App = class extends Observable {
2253
2275
  /** The id the next query created gets. */
2254
2276
  __publicField(this, "nextQueryId", 1);
2255
2277
  __publicField(this, "removedListeners", /* @__PURE__ */ new Set());
2278
+ /** @internal The frame's reveal, set by its bootstrap; absent outside a frame. */
2279
+ __publicField(this, "revealer");
2256
2280
  /**
2257
2281
  * @internal This app's index among the frame's apps, which is how a marked element names it
2258
2282
  * (`data-anfra-query="1/revenue"`); 0 unless set by the instance that created it.
@@ -2863,6 +2887,19 @@ var App = class extends Observable {
2863
2887
  ...this._appliedSelection ? { appliedSelection: inspectSelection(this._appliedSelection) } : {}
2864
2888
  };
2865
2889
  }
2890
+ /**
2891
+ * @internal Backs `query.inspect()` and `control.inspect()`: ask the host to open its panel at
2892
+ * the entity. False outside a frame.
2893
+ */
2894
+ inspect(entity, name, tab) {
2895
+ if (!this.revealer) return Promise.resolve(false);
2896
+ return this.revealer({
2897
+ app: this.index,
2898
+ entity,
2899
+ name,
2900
+ ...tab !== void 0 ? { tab } : {}
2901
+ });
2902
+ }
2866
2903
  /**
2867
2904
  * Bring an entity's marked elements into view: scroll to the first, show the overlay on all for
2868
2905
  * a moment. False, and nothing done, when the document has none marked with it (or there is no
@@ -3386,6 +3423,33 @@ function installInspection(kernel) {
3386
3423
  });
3387
3424
  }
3388
3425
 
3426
+ // src/app/reveal.ts
3427
+ var KIND = { query: "Query", control: "Control" };
3428
+ function activated(win) {
3429
+ const activation = win.navigator.userActivation;
3430
+ return activation ? activation.isActive : true;
3431
+ }
3432
+ function installReveal(kernel) {
3433
+ const reveal = async (request) => {
3434
+ if (!activated(kernel.window)) {
3435
+ reportError("call.inspect", new ValidationError(
3436
+ `${KIND[request.entity]} '${request.name}' can't open the panel without a reader's click. Call inspect() from a click handler, such as a button's.`,
3437
+ request.name
3438
+ ));
3439
+ return false;
3440
+ }
3441
+ try {
3442
+ return await kernel.call("anfra.reveal", request) === true;
3443
+ } catch (err) {
3444
+ reportError("call.inspect", err);
3445
+ return false;
3446
+ }
3447
+ };
3448
+ kernel.onApp((app) => {
3449
+ app.revealer = reveal;
3450
+ });
3451
+ }
3452
+
3389
3453
  // src/app/annotationBadges.ts
3390
3454
  var ANNOTATIONS_ATTRIBUTE = "data-anfra-annotations";
3391
3455
  function drawnBy(element) {
@@ -3590,6 +3654,7 @@ function bootstrap(win, setups = []) {
3590
3654
  installInspection(own);
3591
3655
  installCore(createKernel("core", shared, { Query, Control }));
3592
3656
  shared.contentUi = installContentUi(own);
3657
+ installReveal(own);
3593
3658
  installAnnotationBadges(own, shared.contentUi);
3594
3659
  own.on("theme", (theme) => {
3595
3660
  const resolved = resolveTheme(theme);
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "0.23.1";
2
+ var version = "0.24.0-rc.1";
3
3
 
4
4
  export {
5
5
  version
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  LINEAGE_TAB,
3
3
  plural
4
- } from "./chunk-33HI2ODM.js";
4
+ } from "./chunk-KSE7HX53.js";
5
5
 
6
6
  // src/plugins/inspect/model/trust.ts
7
7
  var TRUST_LEVELS = {
@@ -526,8 +526,8 @@ var components_default = `/*
526
526
  .a-kbd-group { display: inline-flex; flex: none; align-items: center; gap: 4px; }
527
527
 
528
528
  /* Sidebar: shadcn's SidebarGroupLabel, SidebarMenuButton (.a-nav-item), SidebarMenuSub (.a-tree) and
529
- SidebarMenuSubButton (.a-tree-row). The current page is aria-current="page" (or data-active): a
530
- raised chip with a hairline, and a violet icon. */
529
+ SidebarMenuSubButton (.a-tree-row). The current page is aria-current="page" (or data-active): the
530
+ soft neutral fill and weight 500, its icon still ink. */
531
531
  .a-nav-label {
532
532
  display: flex;
533
533
  flex-shrink: 0;
@@ -574,13 +574,10 @@ var components_default = `/*
574
574
  .a-tree-row:is(:disabled, [aria-disabled="true"]) { pointer-events: none; color: var(--anfra-color-text-disabled); }
575
575
  .a-nav-item:is([aria-current="page"], [data-active]),
576
576
  .a-tree-row:is([aria-current="page"], [data-active]) {
577
- background: var(--anfra-color-background-current-default);
577
+ background: var(--anfra-color-background-active);
578
578
  color: var(--anfra-color-text-default);
579
- box-shadow: inset 0 0 0 1px var(--anfra-color-border-weak);
579
+ font-weight: 500;
580
580
  }
581
- .a-nav-item:is([aria-current="page"], [data-active]) { font-weight: 500; }
582
- .a-nav-item:is([aria-current="page"], [data-active]) svg,
583
- .a-tree-row:is([aria-current="page"], [data-active]) svg { color: var(--anfra-color-icon-highlight-default); }
584
581
  .a-tree {
585
582
  display: flex;
586
583
  flex-direction: column;
@@ -604,7 +601,6 @@ var components_default = `/*
604
601
  var FALLBACKS = {
605
602
  "--anfra-color-background-default": "var(--anfra-color-bg)",
606
603
  "--anfra-color-background-raised-default": "var(--anfra-color-bg)",
607
- "--anfra-color-background-current-default": "var(--anfra-color-bg)",
608
604
  "--anfra-color-background-secondary-default": "var(--anfra-color-bg-sunken)",
609
605
  "--anfra-color-background-hover": "var(--anfra-color-hover)",
610
606
  "--anfra-color-background-active": "var(--anfra-color-active)",
@@ -637,7 +633,6 @@ var FALLBACKS = {
637
633
  "--anfra-color-text-warning-default": "var(--anfra-color-warning)",
638
634
  "--anfra-color-text-success-default": "var(--anfra-color-success)",
639
635
  "--anfra-color-border-default": "var(--anfra-color-border)",
640
- "--anfra-color-border-weak": "var(--anfra-color-border)",
641
636
  "--anfra-color-border-hover": "var(--anfra-color-muted)",
642
637
  "--anfra-color-border-disabled": "var(--anfra-color-border)",
643
638
  "--anfra-color-border-highlight-strong": "var(--anfra-color-accent)",
@@ -648,7 +643,6 @@ var FALLBACKS = {
648
643
  "--anfra-color-focus-ring-default": "var(--anfra-color-accent)",
649
644
  "--anfra-color-icon-weak": "var(--anfra-color-muted)",
650
645
  "--anfra-color-icon-disabled": "var(--anfra-color-muted)",
651
- "--anfra-color-icon-highlight-default": "var(--anfra-color-accent)",
652
646
  "--anfra-e1": "0 0 0 1px var(--anfra-color-border), 0 1px 2px oklch(0 0 0 / 0.06)",
653
647
  "--anfra-e2": "0 0 0 1px var(--anfra-color-border), 0 12px 32px -12px oklch(0 0 0 / 0.3)",
654
648
  "--anfra-ease-out": "cubic-bezier(0.22, 1, 0.36, 1)",
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  entityGone,
7
7
  formatCondition
8
- } from "./chunk-33HI2ODM.js";
8
+ } from "./chunk-KSE7HX53.js";
9
9
 
10
10
  // src/plugins/lineage/model.ts
11
11
  var LINEAGE_KINDS = ["control", "block", "query", "metric", "dimension", "dataset", "model", "table"];
@@ -8,7 +8,7 @@ import {
8
8
  STRUCTURE_TAB,
9
9
  entityGone,
10
10
  hasEntity
11
- } from "./chunk-33HI2ODM.js";
11
+ } from "./chunk-KSE7HX53.js";
12
12
 
13
13
  // src/plugins/inspect/model/requests.ts
14
14
  function describe(call, request) {
@@ -196,6 +196,10 @@ function describeError(err) {
196
196
  var RUNTIME_LIMIT = 50;
197
197
  var CONSOLE_LIMIT = 200;
198
198
  var states = /* @__PURE__ */ new WeakMap();
199
+ function follow(panel, state, target) {
200
+ if ("entity" in target) panel.show(QUERIES_TAB, target);
201
+ else state.reveal(panel, target);
202
+ }
199
203
  function stateOf(mount) {
200
204
  let state = states.get(mount);
201
205
  if (!state) {
@@ -251,13 +255,6 @@ function createState() {
251
255
  state.revealed = { target, nonce: ++nonce };
252
256
  if ("node" in target) {
253
257
  panel.show(STRUCTURE_TAB, target.node);
254
- } else if ("entity" in target) {
255
- const key = `${target.entity}:${target.app}/${target.name}`;
256
- state.queries.open.add(key);
257
- state.queries.closed.delete(`${target.app}:${target.entity === "query" ? "queries" : "controls"}`);
258
- state.queries.search = "";
259
- state.queries.filter = "all";
260
- panel.show(QUERIES_TAB);
261
258
  } else if ("table" in target) {
262
259
  state.data.open.add(`${target.app}/${target.table}`);
263
260
  panel.show(DATA_TAB);
@@ -287,10 +284,6 @@ function createState() {
287
284
  const slash = key.indexOf("/");
288
285
  if (!hasEntity(apps, "query", Number(key.slice(0, slash)), key.slice(slash + 1))) state.data.open.delete(key);
289
286
  }
290
- const target = state.revealed?.target;
291
- if (target && "entity" in target && !hasEntity(apps, target.entity, target.app, target.name)) {
292
- state.revealed = void 0;
293
- }
294
287
  },
295
288
  subscribe(listener) {
296
289
  listeners.add(listener);
@@ -307,6 +300,7 @@ export {
307
300
  queryOf,
308
301
  isCurrent,
309
302
  attributeRequests,
303
+ follow,
310
304
  stateOf,
311
305
  dropState
312
306
  };
package/dist/common.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { A as ApiErrorCode, D as DataAppError, a as DataAppErrorInit, E as ErrorCode, b as ErrorContextEntry, c as ErrorDetails, d as ErrorScope, F as FromHttpStatusOptions, G as GENERIC_CODES, e as GenericCode, V as ValidationError, f as callFailed, g as connectionFailed, h as forbidden, i as fromHttpStatus, j as hasErrorCode, k as invalidRequest, l as isDataAppError } from './errors-CWaxgIdV.js';
2
2
  export { A as Aggregation, a as Annotation, b as AnnotationInput, c as AnnotationKind, d as AnnotationSeverity, e as AppDeclaration, f as AppJson, g as ArrowType, B as Backend, h as BackendCondition, i as BackendDateDrill, j as BackendExportRequest, k as BackendFilter, l as BackendLineageRequest, m as BackendQueryRequest, n as BackendQueryResult, o as BackendSort, C as CallStamp, p as ColumnMeta, q as Condition, r as ConditionValue, s as ControlMappingJson, t as CrossFilterJson, D as DatasetDescriptor, u as DatasetRelationship, v as DateDrillDeclaration, w as DateGrain, x as DateTransformation, E as EntityKind, y as EntityRef, z as EntityUsage, F as ExecuteOptions, G as ExecuteSummary, H as ExportFormat, I as ExportFormatOptions, J as ExportOptions, K as ExportResult, L as FILTER_AGGREGATIONS, M as FieldLineage, N as FieldSuggestionsRequest, O as FilterAggregation, P as FilterDeclaration, Q as FilterValueType, R as InspectedApp, S as InspectedControl, T as InspectedError, U as InspectedQuery, V as InspectedSelection, W as InspectedStructure, X as LineageCard, Y as LineageDiagram, Z as LineageNode, _ as LineageOptions, $ as LineageResult, a0 as LineageTarget, a1 as Listener, a2 as LocateKind, a3 as LocateTarget, a4 as MappingJson, a5 as Operator, a6 as QueryCacheResult, a7 as QueryCacheSettings, a8 as QueryDebug, a9 as QueryDeclaration, aa as QueryInput, ab as QueryInputDefaults, ac as QueryPagination, ad as QueryPivot, ae as QueryRequest, af as QueryResult, ag as QuerySeeds, ah as QuerySort, ai as QueryStamp, aj as QueryState, ak as QueryTimings, al as RangeAnchor, am as RenderFormat, an as RenderRequest, ao as Rendering, ap as ResolvedRowsAnchor, aq as Row, ar as RowsAnchor, as as SdkEnvironment, at as SdkFeatures, au as Selection, av as SelectionCondition, aw as SemanticType, ax as SeriesAnchor, ay as SeriesPoint, az as StructureKind, aA as StructureNode, aB as Unsubscribe, aC as User, aD as ValueAnchor, aE as WeekStartDay } from './types-BiRAlSSk.js';
3
3
  export { A as AppConsoleEvent, a as AppErrorEvent, b as AppErrorKind } from './runtimeErrors-gswksjDk.js';
4
- export { B as BridgeError, a as BridgeMessage, D as DEFAULT_TOKENS, b as DESIGN_TOKENS, F as FrameMessage, H as HostMessage, M as MenuEntry, c as MenuTarget, d as MenuTargetKind, N as NodeTarget, P as PROVISION_ELEMENT_ID, e as PluginInfo, f as Provision, R as RowsTarget, T as THEME_TOKENS, g as TargetPoint, h as TargetRect, i as Theme, j as ThemeInput, k as ThemeScheme, l as ThemeToken, m as ThemeTokens, n as checkTarget, o as designTheme, r as resolveTheme } from './theme-C9Tuzqu7.js';
4
+ export { B as BridgeError, a as BridgeMessage, D as DEFAULT_TOKENS, b as DESIGN_TOKENS, F as FrameMessage, H as HostMessage, M as MenuEntry, c as MenuTarget, d as MenuTargetKind, N as NodeTarget, P as PROVISION_ELEMENT_ID, e as PluginInfo, f as Provision, R as RowsTarget, T as THEME_TOKENS, g as TargetPoint, h as TargetRect, i as Theme, j as ThemeInput, k as ThemeScheme, l as ThemeToken, m as ThemeTokens, n as checkTarget, o as designTheme, r as resolveTheme } from './theme-CWkVSteW.js';
@@ -5,11 +5,11 @@ import {
5
5
  declaredFilters,
6
6
  isActive,
7
7
  queryInputs
8
- } from "./chunk-CLXZMA5D.js";
8
+ } from "./chunk-HA3ZB3LG.js";
9
9
  import {
10
10
  attributeRequests,
11
11
  stateOf
12
- } from "./chunk-UWRQXPPG.js";
12
+ } from "./chunk-XREEBDSR.js";
13
13
  import "./chunk-GPBYPSWK.js";
14
14
  import "./chunk-HELL45MM.js";
15
15
  import {
@@ -27,13 +27,15 @@ import {
27
27
  queryTrust,
28
28
  table,
29
29
  trustIndicator
30
- } from "./chunk-2TTGSNHA.js";
30
+ } from "./chunk-TPWCVL24.js";
31
31
  import "./chunk-K633QHGO.js";
32
32
  import {
33
+ QUERIES_TAB,
33
34
  entityNodeKey,
34
35
  formatAgo,
36
+ hasEntity,
35
37
  plural
36
- } from "./chunk-33HI2ODM.js";
38
+ } from "./chunk-KSE7HX53.js";
37
39
  import "./chunk-PKBMQBKP.js";
38
40
 
39
41
  // src/plugins/inspect/tabs/data.ts
@@ -82,6 +84,7 @@ function latestRows(requests) {
82
84
  return requests?.find(({ entry }) => entry.status === "ok" && entry.preview && entry.columns && !entry.stamp?.variant && (entry.input?.pagination?.page ?? 1) === 1)?.entry;
83
85
  }
84
86
  var handled = /* @__PURE__ */ new WeakMap();
87
+ var handledReveal = /* @__PURE__ */ new WeakMap();
85
88
  function dataTab(root, context) {
86
89
  const doc = context.document;
87
90
  const { panel } = context;
@@ -173,7 +176,7 @@ function dataTab(root, context) {
173
176
  onclick: (event) => {
174
177
  event.preventDefault();
175
178
  event.stopPropagation();
176
- state.reveal(panel, { entity: "query", app: index, name });
179
+ panel.show(QUERIES_TAB, { entity: "query", app: index, name });
177
180
  }
178
181
  }, icon(doc, "query"))
179
182
  ], () => body(name, query, latest), {
@@ -210,18 +213,28 @@ function dataTab(root, context) {
210
213
  });
211
214
  }, { head, also: [state.subscribe] });
212
215
  root.append(h(doc, "style", {}, CSS));
213
- const reveal = () => {
214
- const revealed = state.revealed;
215
- if (!revealed || !("table" in revealed.target) || handled.get(state) === revealed.nonce) return;
216
- if (!panel.snapshot) return;
217
- handled.set(state, revealed.nonce);
216
+ const bringIntoView = (app, name) => {
217
+ state.data.open.add(`${app}/${name}`);
218
218
  if (search) setSearch("");
219
- const key = `table:${revealed.target.app}/${revealed.target.table}`;
219
+ else tab.redraw();
220
+ const key = `table:${app}/${name}`;
220
221
  queueMicrotask(() => {
221
222
  const found = [...root.querySelectorAll("details[data-key]")].find((element) => element.dataset.key === key);
222
223
  if (found) flash(found);
223
224
  });
224
225
  };
226
+ const reveal = () => {
227
+ const linked = state.revealed;
228
+ if (linked && "table" in linked.target && handled.get(state) !== linked.nonce && panel.snapshot) {
229
+ handled.set(state, linked.nonce);
230
+ bringIntoView(linked.target.app, linked.target.table);
231
+ }
232
+ const revealed = panel.revealed;
233
+ if (!revealed || revealed.entity !== "query" || revealed.tab !== context.tab || handledReveal.get(panel) === revealed.nonce) return;
234
+ if (!panel.snapshot || !hasEntity(panel.snapshot.apps, "query", revealed.app, revealed.name)) return;
235
+ handledReveal.set(panel, revealed.nonce);
236
+ bringIntoView(revealed.app, revealed.name);
237
+ };
225
238
  reveal();
226
239
  const stops = [panel.subscribe(reveal), state.subscribe(reveal)];
227
240
  return () => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  stateOf
3
- } from "./chunk-UWRQXPPG.js";
3
+ } from "./chunk-XREEBDSR.js";
4
4
  import "./chunk-GPBYPSWK.js";
5
5
  import "./chunk-HELL45MM.js";
6
6
  import {
@@ -14,13 +14,15 @@ import {
14
14
  link,
15
15
  note,
16
16
  popover
17
- } from "./chunk-2TTGSNHA.js";
17
+ } from "./chunk-TPWCVL24.js";
18
18
  import {
19
19
  controlMappings,
20
20
  crossFilters,
21
21
  wiringChecks
22
22
  } from "./chunk-K633QHGO.js";
23
- import "./chunk-33HI2ODM.js";
23
+ import {
24
+ QUERIES_TAB
25
+ } from "./chunk-KSE7HX53.js";
24
26
  import "./chunk-PKBMQBKP.js";
25
27
 
26
28
  // src/plugins/inspect/tabs/declaration.ts
@@ -99,7 +101,7 @@ function declarationTab(root, context) {
99
101
  "data-tip": `Show ${check.about.name} in Queries`,
100
102
  "data-key": `check:${index}:${i}`,
101
103
  "data-testid": `check-${index}-${i}`,
102
- onclick: () => state.reveal(panel, { entity: check.about.entity, app: index, name: check.about.name })
104
+ onclick: () => panel.show(QUERIES_TAB, { entity: check.about.entity, app: index, name: check.about.name })
103
105
  },
104
106
  h(doc, "span", { class: `mark ${tone}`, role: "img", "aria-label": label }, mark),
105
107
  h(doc, "span", {}, named(check.message, entityNames(app)))
@@ -133,7 +135,7 @@ function declarationTab(root, context) {
133
135
  const controls = [...Object.keys(app.declaration.filters), ...Object.keys(app.declaration.dateDrills)];
134
136
  const mappings = controlMappings(app);
135
137
  const crosses = crossFilters(app);
136
- const entity = (kind, name) => link(doc, name, () => state.reveal(panel, { entity: kind, app: index, name }), {
138
+ const entity = (kind, name) => link(doc, name, () => panel.show(QUERIES_TAB, { entity: kind, app: index, name }), {
137
139
  "data-tip": `Show ${name} in Queries`,
138
140
  "data-testid": `wiring-${kind}-${name}`
139
141
  });
package/dist/host.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { PluginInfo, Theme, ThemeInput, Provision } from './app.js';
2
2
  import { DatasetDescriptor, User } from './app.js';
3
- import { C as Command, T as Tab, a as CallOptions, P as Panel, b as CommandState, c as Plugin, M as Middleware, d as CommandContribution, e as TabContribution, f as Contribution } from './plugin-CG0mVS1X.js';
4
- export { g as CallContext, h as CallDefinition, i as CallHandler, j as Caller, k as CommandRun, l as CommandStateContext, E as EventCheck, F as FrameHalf, H as HandlerCallOptions, m as HandlerContext, n as HostHalf, o as MountContext, p as PanelVerb, S as Snapshot, q as TabContext, r as definePlugin } from './plugin-CG0mVS1X.js';
3
+ import { C as Command, T as Tab, a as CallOptions, P as Panel, b as CommandState, c as Plugin, M as Middleware, d as CommandContribution, e as TabContribution, f as Contribution } from './plugin-CZmRhV4r.js';
4
+ export { g as CallContext, h as CallDefinition, i as CallHandler, j as Caller, k as CommandRun, l as CommandStateContext, E as EventCheck, F as FrameHalf, H as HandlerCallOptions, m as HandlerContext, n as HostHalf, o as MountContext, p as PanelVerb, R as Reveal, q as RevealTarget, S as Snapshot, r as TabContext, s as definePlugin } from './plugin-CZmRhV4r.js';
5
5
  export { A as AppConsoleEvent, a as AppErrorEvent, b as AppErrorKind } from './runtimeErrors-gswksjDk.js';
6
6
 
7
7
  interface HostOptions {
@@ -29,6 +29,13 @@ interface HostOptions {
29
29
  * can draw its own UI on them instead.
30
30
  */
31
31
  contributions?: (contribution: Contribution) => boolean;
32
+ /**
33
+ * The tab a reveal of each kind opens when its call names no tab the host shows: the definition's
34
+ * `query.inspect()` and `control.inspect()`, and the "Inspect" item in the menu. Unless given,
35
+ * `inspect.data` for a query and `inspect.queries` for a control. A kind set to a tab the host
36
+ * doesn't show opens nothing.
37
+ */
38
+ revealTabs?: Partial<RevealTabs>;
32
39
  /** The theme plugin UI follows: tabs, and frame halves in the plugin layer. Light defaults unless given. */
33
40
  theme?: ThemeInput;
34
41
  /**
@@ -38,6 +45,12 @@ interface HostOptions {
38
45
  */
39
46
  captureConsole?: boolean;
40
47
  }
48
+ /** The tab a reveal opens for each kind of entity, when its call names none. */
49
+ interface RevealTabs {
50
+ query: string;
51
+ control: string;
52
+ }
53
+ declare const DEFAULT_REVEAL_TABS: RevealTabs;
41
54
  interface MountOptions {
42
55
  /** Where the frame goes: it is appended to this element. */
43
56
  container: HTMLElement;
@@ -154,5 +167,5 @@ declare function checkOrigin(origin: unknown): string;
154
167
  */
155
168
  declare function contentPolicy(allowOrigins?: readonly string[]): string;
156
169
 
157
- export { CallOptions, Command, CommandContribution, CommandState, Contribution, Middleware, Panel, Plugin, SCRIPT_ORIGINS, Tab, TabContribution, checkOrigin, composeFrameScript, contentPolicy, createHost, provisionDocument };
158
- export type { Host, HostOptions, MountOptions, MountedDataApp, ProvisionOptions };
170
+ export { CallOptions, Command, CommandContribution, CommandState, Contribution, DEFAULT_REVEAL_TABS, Middleware, Panel, Plugin, SCRIPT_ORIGINS, Tab, TabContribution, checkOrigin, composeFrameScript, contentPolicy, createHost, provisionDocument };
171
+ export type { Host, HostOptions, MountOptions, MountedDataApp, ProvisionOptions, RevealTabs };