@xenosystem/blocks 0.13.8 → 0.13.10

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.
@@ -1,18 +1,3 @@
1
- import {
2
- EndIcon,
3
- LoopIcon,
4
- MetronomeIcon,
5
- PauseIcon,
6
- PlayIcon,
7
- PlayPauseIcon,
8
- RecordIcon,
9
- ShuttleLeftIcon,
10
- ShuttleRightIcon,
11
- StartIcon,
12
- StepBackIcon,
13
- StepForwardIcon,
14
- StopIcon
15
- } from "./chunk-GTN5EDY3.js";
16
1
  import {
17
2
  CancelGlyph,
18
3
  CaseGlyph,
@@ -249,6 +234,92 @@ function LockStateIcon({ locked, size }) {
249
234
  return locked ? /* @__PURE__ */ jsx5(LockIcon, { size }) : /* @__PURE__ */ jsx5(UnlockIcon, { size });
250
235
  }
251
236
 
237
+ // src/time/transport/react/icons.tsx
238
+ import Pause from "@xenosystem/elements/elements/pause";
239
+ import Play from "@xenosystem/elements/elements/play";
240
+ import Stop from "@xenosystem/elements/elements/stop";
241
+ import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
242
+ var base3 = (size) => ({
243
+ width: size,
244
+ height: size,
245
+ viewBox: "0 0 24 24",
246
+ fill: "none",
247
+ stroke: "currentColor",
248
+ strokeWidth: 1.5,
249
+ strokeLinecap: "round",
250
+ strokeLinejoin: "round",
251
+ "aria-hidden": true
252
+ });
253
+ var PlayIcon = fromElement(Play, 12);
254
+ var PauseIcon = fromElement(Pause, 12);
255
+ var StopIcon = fromElement(Stop);
256
+ function RecordIcon({ size = 11 }) {
257
+ return /* @__PURE__ */ jsx6("svg", { ...base3(size), fill: "currentColor", stroke: "none", children: /* @__PURE__ */ jsx6("rect", { x: "6", y: "6", width: "12", height: "12", rx: "3" }) });
258
+ }
259
+ function StartIcon({ size = 11 }) {
260
+ return /* @__PURE__ */ jsxs6("svg", { ...base3(size), children: [
261
+ /* @__PURE__ */ jsx6("path", { d: "M19 20 9 12l10-8z" }),
262
+ /* @__PURE__ */ jsx6("path", { d: "M5 19V5" })
263
+ ] });
264
+ }
265
+ function EndIcon({ size = 11 }) {
266
+ return /* @__PURE__ */ jsxs6("svg", { ...base3(size), children: [
267
+ /* @__PURE__ */ jsx6("path", { d: "m5 4 10 8-10 8z" }),
268
+ /* @__PURE__ */ jsx6("path", { d: "M19 5v14" })
269
+ ] });
270
+ }
271
+ function StepBackIcon({ size = 11 }) {
272
+ return /* @__PURE__ */ jsx6("svg", { ...base3(size), children: /* @__PURE__ */ jsx6("path", { d: "M15 18 9 12l6-6" }) });
273
+ }
274
+ function StepForwardIcon({ size = 11 }) {
275
+ return /* @__PURE__ */ jsx6("svg", { ...base3(size), children: /* @__PURE__ */ jsx6("path", { d: "m9 6 6 6-6 6" }) });
276
+ }
277
+ function ShuttleLeftIcon({ size = 11 }) {
278
+ return /* @__PURE__ */ jsxs6("svg", { ...base3(size), children: [
279
+ /* @__PURE__ */ jsx6("path", { d: "M11 19 2 12l9-7z" }),
280
+ /* @__PURE__ */ jsx6("path", { d: "M22 19l-9-7 9-7z" })
281
+ ] });
282
+ }
283
+ function ShuttleRightIcon({ size = 11 }) {
284
+ return /* @__PURE__ */ jsxs6("svg", { ...base3(size), children: [
285
+ /* @__PURE__ */ jsx6("path", { d: "m13 19 9-7-9-7z" }),
286
+ /* @__PURE__ */ jsx6("path", { d: "m2 19 9-7-9-7z" })
287
+ ] });
288
+ }
289
+ function LoopIcon({ size = 11 }) {
290
+ return /* @__PURE__ */ jsxs6("svg", { ...base3(size), children: [
291
+ /* @__PURE__ */ jsx6("path", { d: "m17 2 4 4-4 4" }),
292
+ /* @__PURE__ */ jsx6("path", { d: "M3 11v-1a4 4 0 0 1 4-4h14" }),
293
+ /* @__PURE__ */ jsx6("path", { d: "m7 22-4-4 4-4" }),
294
+ /* @__PURE__ */ jsx6("path", { d: "M21 13v1a4 4 0 0 1-4 4H3" })
295
+ ] });
296
+ }
297
+ function MetronomeIcon({ size = 11 }) {
298
+ return /* @__PURE__ */ jsxs6("svg", { ...base3(size), children: [
299
+ /* @__PURE__ */ jsx6("path", { d: "M9 3h6l4 18H5z" }),
300
+ /* @__PURE__ */ jsx6("path", { d: "m12 18 4-11" })
301
+ ] });
302
+ }
303
+ function PlayPauseIcon({ playing, size }) {
304
+ return playing ? /* @__PURE__ */ jsx6(PauseIcon, { size }) : /* @__PURE__ */ jsx6(PlayIcon, { size });
305
+ }
306
+ var TRANSPORT_ICONS = {
307
+ "transport/PlayIcon": PlayIcon,
308
+ "transport/PauseIcon": PauseIcon,
309
+ "transport/PlayPauseIcon": PlayPauseIcon,
310
+ "transport/StopIcon": StopIcon,
311
+ "transport/RecordIcon": RecordIcon,
312
+ "transport/StartIcon": StartIcon,
313
+ "transport/EndIcon": EndIcon,
314
+ "transport/StepBackIcon": StepBackIcon,
315
+ "transport/StepForwardIcon": StepForwardIcon,
316
+ "transport/ShuttleLeftIcon": ShuttleLeftIcon,
317
+ "transport/ShuttleRightIcon": ShuttleRightIcon,
318
+ "transport/LoopIcon": LoopIcon,
319
+ "transport/MetronomeIcon": MetronomeIcon
320
+ };
321
+ var TRANSPORT_RUNTIME_UNITS = [];
322
+
252
323
  // src/icons/index.ts
253
324
  var ICONS = Object.freeze({
254
325
  // transport
@@ -307,6 +378,19 @@ var ICONS = Object.freeze({
307
378
  var ICON_UNITS = Object.keys(ICONS);
308
379
 
309
380
  export {
381
+ StopIcon,
382
+ RecordIcon,
383
+ StartIcon,
384
+ EndIcon,
385
+ StepBackIcon,
386
+ StepForwardIcon,
387
+ ShuttleLeftIcon,
388
+ ShuttleRightIcon,
389
+ LoopIcon,
390
+ MetronomeIcon,
391
+ PlayPauseIcon,
392
+ TRANSPORT_ICONS,
393
+ TRANSPORT_RUNTIME_UNITS,
310
394
  TreeIcon,
311
395
  EyedropperIcon,
312
396
  SwapIcon,
@@ -1401,18 +1401,59 @@ declare const METRICS_PANEL_ID = "xeno.core.metrics";
1401
1401
  declare const metricsManifest: PanelManifest;
1402
1402
 
1403
1403
  /**
1404
- * The Metrics panel view — tiles, deltas, sparklines, threshold tone.
1404
+ * The Metrics panel AS A DECLARATION — the twelfth declared block: KPI tiles over a data-core result.
1405
1405
  *
1406
- * Composes `@xenosystem/components/chrome` (`StatTile`, `Badge`, `SegmentedControl`, `Sparkline`); the
1407
- * host must ensure `@xenosystem/workbench/primitives.css` is present. Nothing here is a local re-cut —
1408
- * the sparkline moved into the primitives so there is exactly one.
1409
- *
1410
- * @module
1406
+ * Everything drawn is data: the range control and partial badge in the toolbar (only when ranges
1407
+ * exist), the error and empty states, a `TileGrid` of `StatTile`s — each with its level badge, its
1408
+ * display value (an em dash for a partial null, never a zero), a `Delta` toned by the metric's
1409
+ * direction, the partial note, the `Sparkline` — and the status bar. A tile activates as a real
1410
+ * button (`StatTile.onActivate`). No runtime-bound unit.
1411
1411
  */
1412
1412
 
1413
- /** Props for {@link MetricsPanelView}. */
1414
- interface MetricsPanelViewProps {
1415
- controller: MetricsController;
1413
+ interface MetricsViewTile {
1414
+ id: string;
1415
+ label: string;
1416
+ title?: string;
1417
+ value: string;
1418
+ level: string;
1419
+ hasLevel: boolean;
1420
+ tone: 'error' | 'warning';
1421
+ hasDelta: boolean;
1422
+ delta: number;
1423
+ deltaTone: 'good' | 'bad' | 'neutral';
1424
+ partial: boolean;
1425
+ hasSpark: boolean;
1426
+ spark: number[];
1427
+ sparkLabel: string;
1428
+ }
1429
+ interface MetricsViewModel {
1430
+ hasRanges: boolean;
1431
+ ranges: {
1432
+ value: string;
1433
+ label: string;
1434
+ }[];
1435
+ rangeId: string;
1436
+ partial: boolean;
1437
+ partialHint: string;
1438
+ errorMessage?: string;
1439
+ errored: boolean;
1440
+ empty: boolean;
1441
+ emptyHint: string;
1442
+ ready: boolean;
1443
+ layout: 'grid' | 'row' | 'list';
1444
+ columns: number;
1445
+ tiles: MetricsViewTile[];
1446
+ countLabel: string;
1447
+ partialLabel?: string;
1448
+ }
1449
+ type MetricsUiIntent = {
1450
+ kind: 'range';
1451
+ rangeId: string;
1452
+ } | {
1453
+ kind: 'activate';
1454
+ metricId: string;
1455
+ };
1456
+ interface MetricsViewOptions {
1416
1457
  layout?: 'grid' | 'row' | 'list';
1417
1458
  columns?: number;
1418
1459
  sparkline?: boolean;
@@ -1420,8 +1461,33 @@ interface MetricsPanelViewProps {
1420
1461
  emptyHint?: string;
1421
1462
  partialHint?: string;
1422
1463
  }
1464
+ /** Derive the view from the live controller — the runtime calls this on every draw. */
1465
+ declare function metricsViewState(c: MetricsController, options?: MetricsViewOptions): MetricsViewModel;
1466
+ declare function applyMetricsUi(c: MetricsController, intent: MetricsUiIntent): void;
1467
+ declare const metricsViewManifest: PanelManifest;
1468
+ declare const BEHAVIOURS$1: {
1469
+ 'data/metricsPanelView': (inputs: Record<string, unknown>) => MetricsViewModel;
1470
+ };
1471
+ declare const METRICS_RUNTIME_UNITS: readonly [];
1472
+ declare const METRICS_DECLARATION: BlockDeclaration;
1473
+
1474
+ /**
1475
+ * The Metrics panel view — the CODE VIEW of `METRICS_DECLARATION`, drawing the same
1476
+ * `MetricsViewModel` byte-identical (the equivalence suite holds the two together). No runtime-bound
1477
+ * unit; every intent goes through `applyMetricsUi`.
1478
+ *
1479
+ * Composes `@xenosystem/components/chrome`; the host must ensure `@xenosystem/workbench/primitives.css` is
1480
+ * present.
1481
+ *
1482
+ * @module
1483
+ */
1484
+
1485
+ /** Props for {@link MetricsPanelView}. */
1486
+ interface MetricsPanelViewProps extends MetricsViewOptions {
1487
+ controller: MetricsController;
1488
+ }
1423
1489
  /** The Metrics panel view. */
1424
- declare function MetricsPanelView({ controller, layout, columns, sparkline, showDelta, emptyHint, partialHint, }: MetricsPanelViewProps): ReactNode;
1490
+ declare function MetricsPanelView({ controller, ...options }: MetricsPanelViewProps): ReactNode;
1425
1491
 
1426
1492
  /**
1427
1493
  * The `xeno.core.fields` contract — the query AUTHOR.
@@ -3381,4 +3447,4 @@ interface ConnectorsPanelViewProps {
3381
3447
  /** The Connectors panel view. */
3382
3448
  declare function ConnectorsPanelView({ controller, emptyHint, }: ConnectorsPanelViewProps): ReactNode;
3383
3449
 
3384
- export { AGENT_HIDDEN_COMMANDS, ALL_AGGREGATES, ALL_CHART_TYPES, type BuildChartOptions, type BuildSelectOptions, type BuildSelectResult, CHART_EMPTY_FILL, CHART_PALETTE_STEPS, CHART_PANEL_ID, CONNECTORS_PANEL_ID, type CellAddress, ChartController, type ChartControllerOptions, type ChartHostBridge, type ChartPanelState, ChartPanelView, type ChartPanelViewProps, type ChartRenderContext, type ChartRenderInput, type ChartRenderOptions, type ChartRenderer, type ChartViewState, type ColumnLayout, type ColumnWindow, ConnectorExecuteInput, ConnectorExecuteOutput, ConnectorTransport, ConnectorsController, type ConnectorsControllerOptions, type ConnectorsHostBridge, ConnectorsPanelState, ConnectorsPanelView, type ConnectorsPanelViewProps, type ConnectorsRenderContext, ConnectorsViewState, type CreateChartPanelOptions, type CreateConnectorExecutorOptions, type CreateConnectorsPanelOptions, type CreateFieldsPanelOptions, type CreateMetricsPanelOptions, type CreateTablePanelOptions, type CredentialDraft, type CredentialErrors, DEFAULT_COLUMN_WIDTH, DEFAULT_PAGE_SIZE, DEFAULT_RANGES, type DeltaDirection, EMPTY_LAYOUT, EXPIRY_SKEW_MS, type ExecuteError, BEHAVIOURS as FIELDS_BEHAVIOURS, FIELDS_DECLARATION, FIELDS_PANEL_ID, FIELDS_RUNTIME_UNITS, FieldsController, type FieldsControllerOptions, type FieldsHostBridge, type FieldsPanelState, FieldsPanelView, type FieldsPanelViewProps, type FieldsRenderContext, type FieldsUiIntent, type FieldsViewColumn, type FieldsViewEntry, type FieldsViewFilter, type FieldsViewModel, type FieldsViewOptions, type FieldsViewShelf, type FieldsViewState, type HostSqlResolver, IMPLEMENTED_VIEW_MODES, type LoopbackRequest, type LoopbackVerdict, METRICS_PANEL_ID, MIN_COLUMN_WIDTH, MONO_FILL_PALETTE, MONO_PALETTE, MetricsController, type MetricsControllerOptions, type MetricsHostBridge, type MetricsPanelState, MetricsPanelView, type MetricsPanelViewProps, type MetricsRenderContext, type MetricsViewState, type NumericConstraints, type OAuthStateRecord, type OAuthStateStore, type OAuthStateStoreOptions, type ParseCsvOptions, type ParseResult, type ParsedCsv, type PkcePair, PushdownSplit, type RefreshCoordinator, type ResolvedColumn, SHELF_PRESETS, type StoredOAuthToken, SubstrateFacilities, TABLE_PANEL_ID, TableController, type TableControllerOptions, type TableHostBridge, type TablePanelState, TablePanelView, type TablePanelViewProps, type TableRenderContext, type TableViewMode, type TableViewState, type TokenEndpointResponse, type VirtualWindow, type XenoAlertLevel, type XenoCalculatedFieldRequest, type XenoCellEdit, type XenoChartData, type XenoChartDrillDown, type XenoChartEncoding, type XenoChartExportRequest, type XenoChartHighlight, type XenoChartSeries, type XenoChartType, XenoConnection, XenoConnectionStatus, XenoConnectorFetch, XenoConnectorFileReader, XenoConnectorQueryRequest, XenoCredentialField, XenoCredentialFormSpec, XenoCredentialResult, type XenoFieldStat, type XenoMetricAlert, type XenoMetricRange, type XenoMetricSpec, type XenoMetricThreshold, type XenoMetricValue, XenoResolverErrorCode, XenoRestPaging, type XenoRowActivate, type XenoShelfEntry, type XenoShelfSpec, XenoSqlEngine, applyFieldsUi, applyPrecision, base64Url, breachSideOf, buildChartData, buildRestUrl, buildSelect, chartManifest, chartPanel, clamp, classifyHttpStatus, coerceCsvValues, columnIndexAt, columnsOf, compileForHost, computeColumnWindow, computeWindow, connectorsManifest, connectorsPanel, constraintsOfColumn, createChartPanel, createConnectorExecutor, createConnectorsPanel, createFieldsPanel, createMetricsPanel, createOAuthStateStore, createPkcePair, createRefreshCoordinator, createTablePanel, credentialSpecProblem, defaultAggregateFor, defaultEncoding, deltaToneOf, emptyFilterGroup, entityOf, escapeLikePattern, executeCsvFile, executeDuckDb, executeGraphql, executeJsonFile, executeRest, executeSql, extractJsonPath, extractRows, fieldsManifest, fieldsPanel, fieldsViewManifest, fieldsViewState, firstGraphqlError, frozenWidth, getChartRenderer, isCategorical, isFieldVisible, isFilled, isLeafFilter, isLoopbackHost, isSafeTableName, mergeRefreshResponse, metricsManifest, metricsPanel, moveCell, moveColumn, needsRefresh, nextPageToken, normalizeLayout, normalizeNumeric, offerableAggregates, offerableFilterOps, parseCsv, parseJsonBody, parseJsonPath, parseLinkHeader, parseNumeric, pruneHiddenValues, queriesEqual, quoteIdent, quoteLiteral, redirectUriFor, renderFilterGroup, resolveChartColors, resolveColumns, rowsForMark, scrollLeftToReveal, scrollTopToReveal, setChartRenderer, setColumnVisible, setColumnWidth, setFrozenCount, sniffDelimiter, suggestedShelfFor, tableManifest, tablePanel, toChartJsConfig, toExecuteError, totalWidth, uniqueTableName, unsupportedMessage, validateCredentialDraft, validateEncoding, validateLoopbackRequest, visibleFields };
3450
+ export { AGENT_HIDDEN_COMMANDS, ALL_AGGREGATES, ALL_CHART_TYPES, type BuildChartOptions, type BuildSelectOptions, type BuildSelectResult, CHART_EMPTY_FILL, CHART_PALETTE_STEPS, CHART_PANEL_ID, CONNECTORS_PANEL_ID, type CellAddress, ChartController, type ChartControllerOptions, type ChartHostBridge, type ChartPanelState, ChartPanelView, type ChartPanelViewProps, type ChartRenderContext, type ChartRenderInput, type ChartRenderOptions, type ChartRenderer, type ChartViewState, type ColumnLayout, type ColumnWindow, ConnectorExecuteInput, ConnectorExecuteOutput, ConnectorTransport, ConnectorsController, type ConnectorsControllerOptions, type ConnectorsHostBridge, ConnectorsPanelState, ConnectorsPanelView, type ConnectorsPanelViewProps, type ConnectorsRenderContext, ConnectorsViewState, type CreateChartPanelOptions, type CreateConnectorExecutorOptions, type CreateConnectorsPanelOptions, type CreateFieldsPanelOptions, type CreateMetricsPanelOptions, type CreateTablePanelOptions, type CredentialDraft, type CredentialErrors, DEFAULT_COLUMN_WIDTH, DEFAULT_PAGE_SIZE, DEFAULT_RANGES, type DeltaDirection, EMPTY_LAYOUT, EXPIRY_SKEW_MS, type ExecuteError, BEHAVIOURS as FIELDS_BEHAVIOURS, FIELDS_DECLARATION, FIELDS_PANEL_ID, FIELDS_RUNTIME_UNITS, FieldsController, type FieldsControllerOptions, type FieldsHostBridge, type FieldsPanelState, FieldsPanelView, type FieldsPanelViewProps, type FieldsRenderContext, type FieldsUiIntent, type FieldsViewColumn, type FieldsViewEntry, type FieldsViewFilter, type FieldsViewModel, type FieldsViewOptions, type FieldsViewShelf, type FieldsViewState, type HostSqlResolver, IMPLEMENTED_VIEW_MODES, type LoopbackRequest, type LoopbackVerdict, BEHAVIOURS$1 as METRICS_BEHAVIOURS, METRICS_DECLARATION, METRICS_PANEL_ID, METRICS_RUNTIME_UNITS, MIN_COLUMN_WIDTH, MONO_FILL_PALETTE, MONO_PALETTE, MetricsController, type MetricsControllerOptions, type MetricsHostBridge, type MetricsPanelState, MetricsPanelView, type MetricsPanelViewProps, type MetricsRenderContext, type MetricsUiIntent, type MetricsViewModel, type MetricsViewOptions, type MetricsViewState, type MetricsViewTile, type NumericConstraints, type OAuthStateRecord, type OAuthStateStore, type OAuthStateStoreOptions, type ParseCsvOptions, type ParseResult, type ParsedCsv, type PkcePair, PushdownSplit, type RefreshCoordinator, type ResolvedColumn, SHELF_PRESETS, type StoredOAuthToken, SubstrateFacilities, TABLE_PANEL_ID, TableController, type TableControllerOptions, type TableHostBridge, type TablePanelState, TablePanelView, type TablePanelViewProps, type TableRenderContext, type TableViewMode, type TableViewState, type TokenEndpointResponse, type VirtualWindow, type XenoAlertLevel, type XenoCalculatedFieldRequest, type XenoCellEdit, type XenoChartData, type XenoChartDrillDown, type XenoChartEncoding, type XenoChartExportRequest, type XenoChartHighlight, type XenoChartSeries, type XenoChartType, XenoConnection, XenoConnectionStatus, XenoConnectorFetch, XenoConnectorFileReader, XenoConnectorQueryRequest, XenoCredentialField, XenoCredentialFormSpec, XenoCredentialResult, type XenoFieldStat, type XenoMetricAlert, type XenoMetricRange, type XenoMetricSpec, type XenoMetricThreshold, type XenoMetricValue, XenoResolverErrorCode, XenoRestPaging, type XenoRowActivate, type XenoShelfEntry, type XenoShelfSpec, XenoSqlEngine, applyFieldsUi, applyMetricsUi, applyPrecision, base64Url, breachSideOf, buildChartData, buildRestUrl, buildSelect, chartManifest, chartPanel, clamp, classifyHttpStatus, coerceCsvValues, columnIndexAt, columnsOf, compileForHost, computeColumnWindow, computeWindow, connectorsManifest, connectorsPanel, constraintsOfColumn, createChartPanel, createConnectorExecutor, createConnectorsPanel, createFieldsPanel, createMetricsPanel, createOAuthStateStore, createPkcePair, createRefreshCoordinator, createTablePanel, credentialSpecProblem, defaultAggregateFor, defaultEncoding, deltaToneOf, emptyFilterGroup, entityOf, escapeLikePattern, executeCsvFile, executeDuckDb, executeGraphql, executeJsonFile, executeRest, executeSql, extractJsonPath, extractRows, fieldsManifest, fieldsPanel, fieldsViewManifest, fieldsViewState, firstGraphqlError, frozenWidth, getChartRenderer, isCategorical, isFieldVisible, isFilled, isLeafFilter, isLoopbackHost, isSafeTableName, mergeRefreshResponse, metricsManifest, metricsPanel, metricsViewManifest, metricsViewState, moveCell, moveColumn, needsRefresh, nextPageToken, normalizeLayout, normalizeNumeric, offerableAggregates, offerableFilterOps, parseCsv, parseJsonBody, parseJsonPath, parseLinkHeader, parseNumeric, pruneHiddenValues, queriesEqual, quoteIdent, quoteLiteral, redirectUriFor, renderFilterGroup, resolveChartColors, resolveColumns, rowsForMark, scrollLeftToReveal, scrollTopToReveal, setChartRenderer, setColumnVisible, setColumnWidth, setFrozenCount, sniffDelimiter, suggestedShelfFor, tableManifest, tablePanel, toChartJsConfig, toExecuteError, totalWidth, uniqueTableName, unsupportedMessage, validateCredentialDraft, validateEncoding, validateLoopbackRequest, visibleFields };