@dashspec/renderer 0.1.44 → 0.1.45

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.
@@ -2049,6 +2049,7 @@ declare const Spec: z.ZodObject<{
2049
2049
  open: z.ZodOptional<z.ZodString>;
2050
2050
  defaultArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>>>;
2051
2051
  availableWhen: z.ZodOptional<z.ZodString>;
2052
+ gap: z.ZodOptional<z.ZodNumber>;
2052
2053
  datasources: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnknown>, Record<string, unknown>, Record<string, unknown>>>>;
2053
2054
  panels: z.ZodRecord<z.ZodString, z.ZodObject<{
2054
2055
  kind: z.ZodString;
@@ -2474,6 +2475,7 @@ declare const Spec: z.ZodObject<{
2474
2475
  run: string | any[];
2475
2476
  mode: "latest" | "parallel" | "queue";
2476
2477
  }>> | undefined;
2478
+ gap?: number | undefined;
2477
2479
  title?: string | undefined;
2478
2480
  open?: string | undefined;
2479
2481
  defaultArgs?: Record<string, JsonValue> | undefined;
@@ -2555,6 +2557,7 @@ declare const Spec: z.ZodObject<{
2555
2557
  mode: "latest" | "parallel" | "queue";
2556
2558
  }>> | undefined;
2557
2559
  size?: "full" | "sm" | "md" | "lg" | "xl" | undefined;
2560
+ gap?: number | undefined;
2558
2561
  title?: string | undefined;
2559
2562
  presentation?: "modal" | "drawer" | undefined;
2560
2563
  open?: string | undefined;
@@ -2975,6 +2978,7 @@ declare const Spec: z.ZodObject<{
2975
2978
  run: string | any[];
2976
2979
  mode: "latest" | "parallel" | "queue";
2977
2980
  }>> | undefined;
2981
+ gap?: number | undefined;
2978
2982
  title?: string | undefined;
2979
2983
  open?: string | undefined;
2980
2984
  defaultArgs?: Record<string, JsonValue> | undefined;
@@ -3286,6 +3290,7 @@ declare const Spec: z.ZodObject<{
3286
3290
  mode: "latest" | "parallel" | "queue";
3287
3291
  }>> | undefined;
3288
3292
  size?: "full" | "sm" | "md" | "lg" | "xl" | undefined;
3293
+ gap?: number | undefined;
3289
3294
  title?: string | undefined;
3290
3295
  presentation?: "modal" | "drawer" | undefined;
3291
3296
  open?: string | undefined;
@@ -4468,6 +4473,7 @@ declare const Dashboard: z.ZodObject<{
4468
4473
  open: z.ZodOptional<z.ZodString>;
4469
4474
  defaultArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>>>;
4470
4475
  availableWhen: z.ZodOptional<z.ZodString>;
4476
+ gap: z.ZodOptional<z.ZodNumber>;
4471
4477
  datasources: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnknown>, Record<string, unknown>, Record<string, unknown>>>>;
4472
4478
  panels: z.ZodRecord<z.ZodString, z.ZodObject<{
4473
4479
  kind: z.ZodString;
@@ -4893,6 +4899,7 @@ declare const Dashboard: z.ZodObject<{
4893
4899
  run: string | any[];
4894
4900
  mode: "latest" | "parallel" | "queue";
4895
4901
  }>> | undefined;
4902
+ gap?: number | undefined;
4896
4903
  title?: string | undefined;
4897
4904
  open?: string | undefined;
4898
4905
  defaultArgs?: Record<string, JsonValue> | undefined;
@@ -4974,6 +4981,7 @@ declare const Dashboard: z.ZodObject<{
4974
4981
  mode: "latest" | "parallel" | "queue";
4975
4982
  }>> | undefined;
4976
4983
  size?: "full" | "sm" | "md" | "lg" | "xl" | undefined;
4984
+ gap?: number | undefined;
4977
4985
  title?: string | undefined;
4978
4986
  presentation?: "modal" | "drawer" | undefined;
4979
4987
  open?: string | undefined;
@@ -5394,6 +5402,7 @@ declare const Dashboard: z.ZodObject<{
5394
5402
  run: string | any[];
5395
5403
  mode: "latest" | "parallel" | "queue";
5396
5404
  }>> | undefined;
5405
+ gap?: number | undefined;
5397
5406
  title?: string | undefined;
5398
5407
  open?: string | undefined;
5399
5408
  defaultArgs?: Record<string, JsonValue> | undefined;
@@ -5705,6 +5714,7 @@ declare const Dashboard: z.ZodObject<{
5705
5714
  mode: "latest" | "parallel" | "queue";
5706
5715
  }>> | undefined;
5707
5716
  size?: "full" | "sm" | "md" | "lg" | "xl" | undefined;
5717
+ gap?: number | undefined;
5708
5718
  title?: string | undefined;
5709
5719
  presentation?: "modal" | "drawer" | undefined;
5710
5720
  open?: string | undefined;
@@ -6021,6 +6031,7 @@ declare const Dashboard: z.ZodObject<{
6021
6031
  run: string | any[];
6022
6032
  mode: "latest" | "parallel" | "queue";
6023
6033
  }>> | undefined;
6034
+ gap?: number | undefined;
6024
6035
  title?: string | undefined;
6025
6036
  open?: string | undefined;
6026
6037
  defaultArgs?: Record<string, JsonValue> | undefined;
@@ -6348,6 +6359,7 @@ declare const Dashboard: z.ZodObject<{
6348
6359
  mode: "latest" | "parallel" | "queue";
6349
6360
  }>> | undefined;
6350
6361
  size?: "full" | "sm" | "md" | "lg" | "xl" | undefined;
6362
+ gap?: number | undefined;
6351
6363
  title?: string | undefined;
6352
6364
  presentation?: "modal" | "drawer" | undefined;
6353
6365
  open?: string | undefined;
@@ -6700,6 +6712,8 @@ declare const Modal: z.ZodObject<{
6700
6712
  /** An expression: while false the modal can't be open, and a host drawer (`ui.Drawer`) isn't drawn (e.g. its rail
6701
6713
  * only on one view: "view == 'flow'"). Default always. */
6702
6714
  availableWhen: z.ZodOptional<z.ZodString>;
6715
+ /** Space between the modal's panels, px (default the dashboard's grid gap). */
6716
+ gap: z.ZodOptional<z.ZodNumber>;
6703
6717
  datasources: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnknown>, Record<string, unknown>, Record<string, unknown>>>>;
6704
6718
  panels: z.ZodRecord<z.ZodString, z.ZodObject<{
6705
6719
  kind: z.ZodString;
@@ -7125,6 +7139,7 @@ declare const Modal: z.ZodObject<{
7125
7139
  run: string | any[];
7126
7140
  mode: "latest" | "parallel" | "queue";
7127
7141
  }>> | undefined;
7142
+ gap?: number | undefined;
7128
7143
  title?: string | undefined;
7129
7144
  open?: string | undefined;
7130
7145
  defaultArgs?: Record<string, JsonValue> | undefined;
@@ -7206,6 +7221,7 @@ declare const Modal: z.ZodObject<{
7206
7221
  mode: "latest" | "parallel" | "queue";
7207
7222
  }>> | undefined;
7208
7223
  size?: "full" | "sm" | "md" | "lg" | "xl" | undefined;
7224
+ gap?: number | undefined;
7209
7225
  title?: string | undefined;
7210
7226
  presentation?: "modal" | "drawer" | undefined;
7211
7227
  open?: string | undefined;
@@ -7621,7 +7637,7 @@ declare class TransformError extends Error {
7621
7637
  declare function applyTransform(data: unknown, steps: readonly Step[], root: Scope, opts?: TransformOptions): unknown;
7622
7638
 
7623
7639
  /** This package's version. A test keeps it equal to package.json's; bump both together. */
7624
- declare const RENDERER_VERSION = "0.1.44";
7640
+ declare const RENDERER_VERSION = "0.1.45";
7625
7641
  /**
7626
7642
  * Whether `version` satisfies `range`. Supports what documents need: "1.2.3" (that or newer within the major, like
7627
7643
  * "^"), ">=1.2", ">1.2.3", "<2", "<=2.1", "^1.2", "~1.2.3", and several of them separated by spaces (all must hold).
package/dist/core.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { f as ACTION_KINDS, g as ACTION_SCHEMAS, h as API_VERSION, i as Action, j as ActionRef, k as Auth, B as BREAKPOINTS, l as BUILT_IN_DATASOURCE_TYPES, C as Callback, m as Connection, n as ConnectionSpec, o as DATE_PRESETS, D as Dashboard, p as DashboardInput, q as DataBinding, r as DataError, s as DataErrorCode, t as Datasource, u as DateRange, v as Display, w as Drill, x as Duration, y as EventHandler, z as EventMap, F as Expression, G as ExpressionError, I as FnProp, a$ as Grid, K as Handler, L as HelperSettings, M as Helpers, H as HttpClient, O as HttpClientInternals, P as Id, J as JsonValue, Q as Layout, U as LayoutItem, V as LoadOptions, X as LoadResult, Y as Metadata, Z as MigrateResult, _ as MigrationError, $ as Modal, a0 as NamedAction, N as NetworkOptions, a1 as Node, a2 as Panel, a3 as PanelControl, a4 as PanelMigration, a6 as Problem, a7 as RENDERER_VERSION, a8 as RESERVED_STATE_KEYS, a9 as RefRoot, aa as Reference, ab as Requires, R as ResolvedRequest, ac as SCHEMA_URL, S as Scope, ad as Severity, ae as Spec, b0 as StatusTone, af as Template, a as TimeSettings, ag as TokenSource, ah as TransformError, ai as TransformOptions, aj as TransformStep, ak as Translations, al as VARIABLE_KINDS, am as ValidateOptions, an as ValidationResult, ao as Variable, ap as WidgetCheck, aq as WidgetMigrations, as as applyTransform, at as buildRequestUrl, au as buildUrl, av as builtInWidgetChecks, aw as collectReferences, ax as compile, ay as createHelpers, az as createHttpClient, aA as dashboardJsonSchema, aB as evaluate, aC as evaluateSafe, aD as expressionReferences, aE as graphqlData, aF as interpolate, aG as interpolateUrl, aH as isCallbackSource, aI as isSafeUrl, aJ as loadDocument, aK as mergeConnections, aL as migrateDocument, aM as parse, aN as parseDuration, aO as placeholders, aP as plantDate, aQ as plantDayStart, aR as resolve, aS as resolveBaseUrl, aT as resolveRequest, aU as safeLink, aV as satisfies, aW as scope, aX as stripStrings, aY as templateReferences, aZ as translator, a_ as validateDocument } from './core-BoII3OIB.js';
1
+ export { f as ACTION_KINDS, g as ACTION_SCHEMAS, h as API_VERSION, i as Action, j as ActionRef, k as Auth, B as BREAKPOINTS, l as BUILT_IN_DATASOURCE_TYPES, C as Callback, m as Connection, n as ConnectionSpec, o as DATE_PRESETS, D as Dashboard, p as DashboardInput, q as DataBinding, r as DataError, s as DataErrorCode, t as Datasource, u as DateRange, v as Display, w as Drill, x as Duration, y as EventHandler, z as EventMap, F as Expression, G as ExpressionError, I as FnProp, a$ as Grid, K as Handler, L as HelperSettings, M as Helpers, H as HttpClient, O as HttpClientInternals, P as Id, J as JsonValue, Q as Layout, U as LayoutItem, V as LoadOptions, X as LoadResult, Y as Metadata, Z as MigrateResult, _ as MigrationError, $ as Modal, a0 as NamedAction, N as NetworkOptions, a1 as Node, a2 as Panel, a3 as PanelControl, a4 as PanelMigration, a6 as Problem, a7 as RENDERER_VERSION, a8 as RESERVED_STATE_KEYS, a9 as RefRoot, aa as Reference, ab as Requires, R as ResolvedRequest, ac as SCHEMA_URL, S as Scope, ad as Severity, ae as Spec, b0 as StatusTone, af as Template, a as TimeSettings, ag as TokenSource, ah as TransformError, ai as TransformOptions, aj as TransformStep, ak as Translations, al as VARIABLE_KINDS, am as ValidateOptions, an as ValidationResult, ao as Variable, ap as WidgetCheck, aq as WidgetMigrations, as as applyTransform, at as buildRequestUrl, au as buildUrl, av as builtInWidgetChecks, aw as collectReferences, ax as compile, ay as createHelpers, az as createHttpClient, aA as dashboardJsonSchema, aB as evaluate, aC as evaluateSafe, aD as expressionReferences, aE as graphqlData, aF as interpolate, aG as interpolateUrl, aH as isCallbackSource, aI as isSafeUrl, aJ as loadDocument, aK as mergeConnections, aL as migrateDocument, aM as parse, aN as parseDuration, aO as placeholders, aP as plantDate, aQ as plantDayStart, aR as resolve, aS as resolveBaseUrl, aT as resolveRequest, aU as safeLink, aV as satisfies, aW as scope, aX as stripStrings, aY as templateReferences, aZ as translator, a_ as validateDocument } from './core-Clqj6_ee.js';
2
2
  import 'zod';
3
3
  import 'react';
package/dist/core.js CHANGED
@@ -66,7 +66,7 @@ import {
66
66
  satisfies,
67
67
  translator,
68
68
  validateDocument
69
- } from "./chunk-HAYQEYMT.js";
69
+ } from "./chunk-YPHHTC36.js";
70
70
  import {
71
71
  ExpressionError,
72
72
  collectReferences,
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AnyWidgetDefinition, T as TreeState, H as HttpClient, R as ResolvedRequest, a as TimeSettings, D as Dashboard, N as NetworkOptions, J as JsonValue, S as Scope, W as WidgetDefinition, b as SlotDefinition, c as SlotRenderOptions, d as WidgetMeta, e as WidgetProps } from './core-BoII3OIB.js';
2
- export { f as ACTION_KINDS, g as ACTION_SCHEMAS, h as API_VERSION, i as Action, j as ActionRef, k as Auth, B as BREAKPOINTS, l as BUILT_IN_DATASOURCE_TYPES, C as Callback, m as Connection, n as ConnectionSpec, o as DATE_PRESETS, p as DashboardInput, q as DataBinding, r as DataError, s as DataErrorCode, t as Datasource, u as DateRange, v as Display, w as Drill, x as Duration, E as Emit, y as EventHandler, z as EventMap, F as Expression, G as ExpressionError, I as FnProp, K as Handler, L as HelperSettings, M as Helpers, O as HttpClientInternals, P as Id, Q as Layout, U as LayoutItem, V as LoadOptions, X as LoadResult, Y as Metadata, Z as MigrateResult, _ as MigrationError, $ as Modal, a0 as NamedAction, a1 as Node, a2 as Panel, a3 as PanelControl, a4 as PanelMigration, a5 as PanelState, a6 as Problem, a7 as RENDERER_VERSION, a8 as RESERVED_STATE_KEYS, a9 as RefRoot, aa as Reference, ab as Requires, ac as SCHEMA_URL, ad as Severity, ae as Spec, af as Template, ag as TokenSource, ah as TransformError, ai as TransformOptions, aj as TransformStep, ak as Translations, al as VARIABLE_KINDS, am as ValidateOptions, an as ValidationResult, ao as Variable, ap as WidgetCheck, aq as WidgetMigrations, ar as WidgetStore, as as applyTransform, at as buildRequestUrl, au as buildUrl, av as builtInWidgetChecks, aw as collectReferences, ax as compile, ay as createHelpers, az as createHttpClient, aA as dashboardJsonSchema, aB as evaluate, aC as evaluateSafe, aD as expressionReferences, aE as graphqlData, aF as interpolate, aG as interpolateUrl, aH as isCallbackSource, aI as isSafeUrl, aJ as loadDocument, aK as mergeConnections, aL as migrateDocument, aM as parse, aN as parseDuration, aO as placeholders, aP as plantDate, aQ as plantDayStart, aR as resolve, aS as resolveBaseUrl, aT as resolveRequest, aU as safeLink, aV as satisfies, aW as scope, aX as stripStrings, aY as templateReferences, aZ as translator, a_ as validateDocument } from './core-BoII3OIB.js';
1
+ import { A as AnyWidgetDefinition, T as TreeState, H as HttpClient, R as ResolvedRequest, a as TimeSettings, D as Dashboard, N as NetworkOptions, J as JsonValue, S as Scope, W as WidgetDefinition, b as SlotDefinition, c as SlotRenderOptions, d as WidgetMeta, e as WidgetProps } from './core-Clqj6_ee.js';
2
+ export { f as ACTION_KINDS, g as ACTION_SCHEMAS, h as API_VERSION, i as Action, j as ActionRef, k as Auth, B as BREAKPOINTS, l as BUILT_IN_DATASOURCE_TYPES, C as Callback, m as Connection, n as ConnectionSpec, o as DATE_PRESETS, p as DashboardInput, q as DataBinding, r as DataError, s as DataErrorCode, t as Datasource, u as DateRange, v as Display, w as Drill, x as Duration, E as Emit, y as EventHandler, z as EventMap, F as Expression, G as ExpressionError, I as FnProp, K as Handler, L as HelperSettings, M as Helpers, O as HttpClientInternals, P as Id, Q as Layout, U as LayoutItem, V as LoadOptions, X as LoadResult, Y as Metadata, Z as MigrateResult, _ as MigrationError, $ as Modal, a0 as NamedAction, a1 as Node, a2 as Panel, a3 as PanelControl, a4 as PanelMigration, a5 as PanelState, a6 as Problem, a7 as RENDERER_VERSION, a8 as RESERVED_STATE_KEYS, a9 as RefRoot, aa as Reference, ab as Requires, ac as SCHEMA_URL, ad as Severity, ae as Spec, af as Template, ag as TokenSource, ah as TransformError, ai as TransformOptions, aj as TransformStep, ak as Translations, al as VARIABLE_KINDS, am as ValidateOptions, an as ValidationResult, ao as Variable, ap as WidgetCheck, aq as WidgetMigrations, ar as WidgetStore, as as applyTransform, at as buildRequestUrl, au as buildUrl, av as builtInWidgetChecks, aw as collectReferences, ax as compile, ay as createHelpers, az as createHttpClient, aA as dashboardJsonSchema, aB as evaluate, aC as evaluateSafe, aD as expressionReferences, aE as graphqlData, aF as interpolate, aG as interpolateUrl, aH as isCallbackSource, aI as isSafeUrl, aJ as loadDocument, aK as mergeConnections, aL as migrateDocument, aM as parse, aN as parseDuration, aO as placeholders, aP as plantDate, aQ as plantDayStart, aR as resolve, aS as resolveBaseUrl, aT as resolveRequest, aU as safeLink, aV as satisfies, aW as scope, aX as stripStrings, aY as templateReferences, aZ as translator, a_ as validateDocument } from './core-Clqj6_ee.js';
3
3
  import * as react from 'react';
4
4
  import { CSSProperties, ReactNode, ComponentType } from 'react';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -1234,6 +1234,7 @@ declare function createDashboardRuntime(doc: Dashboard, options?: RuntimeOptions
1234
1234
  run: string | any[];
1235
1235
  mode: "latest" | "parallel" | "queue";
1236
1236
  }>> | undefined;
1237
+ gap?: number | undefined;
1237
1238
  title?: string | undefined;
1238
1239
  open?: string | undefined;
1239
1240
  defaultArgs?: Record<string, JsonValue> | undefined;
package/dist/index.js CHANGED
@@ -102,7 +102,7 @@ import {
102
102
  translator,
103
103
  validateDocument,
104
104
  widgetChecks
105
- } from "./chunk-HAYQEYMT.js";
105
+ } from "./chunk-YPHHTC36.js";
106
106
  import {
107
107
  Chips,
108
108
  asRows,
@@ -499,6 +499,8 @@ function createActionRunner(deps) {
499
499
  deps.dispatch(stateActions.openModal({ id: act.modal, args }));
500
500
  const m = doc.spec.modals?.[act.modal];
501
501
  if (m?.datasources) deps.engine.want(Object.keys(m.datasources));
502
+ const onOpen = m?.on?.open;
503
+ if (onOpen) await runAction({ do: "sequence", steps: onOpen }, event, key, mode);
502
504
  return;
503
505
  }
504
506
  case "closeModal":
@@ -6816,6 +6818,8 @@ function Grid({
6816
6818
  style: {
6817
6819
  ["--ds-i"]: i,
6818
6820
  minHeight: o.h * rowHeight + (o.h - 1) * gap,
6821
+ // Narrow layout: one item per line unless the caller sizes it.
6822
+ flex: "1 1 100%",
6819
6823
  ...flowStyle?.(o.panel, o.h * rowHeight + (o.h - 1) * gap)
6820
6824
  },
6821
6825
  children: children(o.panel)
@@ -7025,7 +7029,7 @@ function ModalHost() {
7025
7029
  view: null,
7026
7030
  columns: grid.columns,
7027
7031
  rowHeight: grid.rowHeight,
7028
- gap: grid.gap,
7032
+ gap: m.gap ?? grid.gap,
7029
7033
  exactHeights: grid.exactHeights,
7030
7034
  children: (pid) => /* @__PURE__ */ jsx28(PanelFrame, { id: pid })
7031
7035
  }
@@ -7077,7 +7081,7 @@ function ModalHost() {
7077
7081
  view: null,
7078
7082
  columns: grid.columns,
7079
7083
  rowHeight: grid.rowHeight,
7080
- gap: grid.gap,
7084
+ gap: m.gap ?? grid.gap,
7081
7085
  exactHeights: grid.exactHeights,
7082
7086
  children: (id) => /* @__PURE__ */ jsx28(PanelFrame, { id })
7083
7087
  }