react-semaphor 0.1.608 → 0.1.610

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 (67) hide show
  1. package/dist/assistant-context/index.js +1 -1
  2. package/dist/brand-studio/index.js +2 -2
  3. package/dist/briefings/index.js +1 -1
  4. package/dist/chunks/appearance-provider-CxsEFvNA.js +703 -0
  5. package/dist/chunks/{assistant-chat-x3NCrm5n.js → assistant-chat-BqdXuU42.js} +5 -5
  6. package/dist/chunks/{bookmark-impact-xCmo8x3V.js → bookmark-impact-BAYpeKb-.js} +1 -1
  7. package/dist/chunks/{bookmark-state-BmbBu1th.js → bookmark-state-B3lDH0E_.js} +1 -1
  8. package/dist/chunks/{brand-3m_qSMyC.js → brand-9AazkIHH.js} +1 -1
  9. package/dist/chunks/{card-filter-builder-CM3SZ4kO.js → card-filter-builder-CpSD-8yA.js} +3 -3
  10. package/dist/chunks/{check-input-C7S2sNzB.js → check-input-D36evEN2.js} +1 -1
  11. package/dist/chunks/{currency-presentation-binding-s4PlA3Wu.js → currency-presentation-binding-CUh82q48.js} +1 -1
  12. package/dist/chunks/{custom-visual-inputs-CUtxCe4T.js → custom-visual-inputs-obG5lDlW.js} +1 -1
  13. package/dist/chunks/{custom-visual-write-CH-k-4HE.js → custom-visual-write-fOcTV3dl.js} +1 -1
  14. package/dist/chunks/{dashboard-BwuurlUI.js → dashboard-BVYXrYaU.js} +1 -1
  15. package/dist/chunks/{dashboard-briefing-launcher-CX7mCnPi.js → dashboard-briefing-launcher-CVjONGRj.js} +6 -6
  16. package/dist/chunks/{dashboard-controls-Bwjy9G1i.js → dashboard-controls-Cca_ra4d.js} +5 -5
  17. package/dist/chunks/{dashboard-json-B9lK28i0.js → dashboard-json-CUHyo-if.js} +1 -1
  18. package/dist/chunks/{dashboard-temporal-snapshot-CcndP6CF.js → dashboard-temporal-snapshot-DyRl61Yv.js} +1 -1
  19. package/dist/chunks/dates-Cym78NYg.js +1 -0
  20. package/dist/chunks/{edit-dashboard-visual-BF3mfrWf.js → edit-dashboard-visual-DRLguKmV.js} +3 -3
  21. package/dist/chunks/filter-reach-preview-IFwTq7Hh.js +1 -0
  22. package/dist/chunks/{kpi-trend-rule-DDbguInc.js → kpi-trend-rule-DSVBCJDV.js} +1 -1
  23. package/dist/chunks/{layout-grid-Bx0jBVXj.js → layout-grid-Ctnv2-au.js} +1 -1
  24. package/dist/chunks/{metric-formatting-DILSVxLq.js → metric-formatting-BhmZiuD8.js} +1 -1
  25. package/dist/chunks/{palette-CZJ4ZCY9.js → palette-Bg_6xero.js} +1 -1
  26. package/dist/chunks/{report-preferences-dialog-EQNoTych.js → report-preferences-dialog-DQNwImoN.js} +1 -1
  27. package/dist/chunks/resolve-dashboard-input-context-Djm2WgEF.js +8 -0
  28. package/dist/chunks/{sandbox-host-WJXxpvz7.js → sandbox-host-BnadJPB9.js} +1 -1
  29. package/dist/chunks/{saved-dashboard-context-DQlA4Mg0.js → saved-dashboard-context-EwdvXIE6.js} +1 -1
  30. package/dist/chunks/semaphor-ready-indicator-BJR23T8j.js +532 -0
  31. package/dist/chunks/{slider-C4jUvJtd.js → slider-DD5nxK4N.js} +5 -5
  32. package/dist/chunks/stored-dashboard--6xPxYpX.js +1 -0
  33. package/dist/chunks/{table-cell-text-DFHUGeG6.js → table-cell-text-C5J5E_Am.js} +1 -1
  34. package/dist/chunks/variable-draft-C8xXjy0M.js +1 -0
  35. package/dist/dashboard/index.js +1 -1
  36. package/dist/dashboard-authoring/index.js +1 -1
  37. package/dist/extensions/index.js +1 -1
  38. package/dist/index.js +1 -1
  39. package/dist/style.css +1 -1
  40. package/dist/surfboard/index.js +1 -1
  41. package/dist/types/briefings/index.d.ts +1 -1
  42. package/dist/types/briefings/run-failures.d.ts +67 -0
  43. package/dist/types/components/visual/data-table/column-display/link-fields.d.ts +29 -0
  44. package/dist/types/components/visual/data-table/types/data-table.d.ts +6 -1
  45. package/dist/types/index.js +1 -1
  46. package/dist/types/lib/dashboard-viewer/table-view.d.ts +6 -1
  47. package/dist/types/lib/types/briefing-types.d.ts +4 -0
  48. package/dist/types/lib/types/explorer-types.d.ts +12 -0
  49. package/dist/types/shared/dashboard-authoring/card-settings/column-display.d.ts +0 -2
  50. package/dist/types/shared/dashboard-authoring/card-sort-comparison.d.ts +13 -0
  51. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
  52. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +12 -0
  53. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
  54. package/dist/types/shared/dashboard-authoring/sheet-kinds.d.ts +7 -0
  55. package/dist/types/shared/dashboard-authoring/variable-draft.d.ts +1 -0
  56. package/dist/types/shared/dashboard-viewer/table-settings.d.ts +8 -0
  57. package/dist/types/shared/usage-events/details.d.ts +2 -2
  58. package/dist/types/shared/usage-events/envelope.d.ts +2 -2
  59. package/package.json +7 -5
  60. package/dist/chunks/appearance-provider-BBYTKSjL.js +0 -613
  61. package/dist/chunks/filter-reach-preview-DSH_k8AJ.js +0 -1
  62. package/dist/chunks/resolve-dashboard-input-context-B5yUS9ZM.js +0 -8
  63. package/dist/chunks/semaphor-ready-indicator-Cq3C2SNo.js +0 -622
  64. package/dist/chunks/set-wWdhgHSh.js +0 -1
  65. package/dist/chunks/stored-dashboard-1x0q2cNx.js +0 -1
  66. package/dist/chunks/variable-draft-CwX-b6Fs.js +0 -1
  67. package/dist/types/briefings/run-outcomes.d.ts +0 -6
@@ -1 +1 @@
1
- import{a,R as s,D as o}from"../chunks/report-preferences-dialog-EQNoTych.js";import{C as f,E as D}from"../chunks/bookmark-state-BmbBu1th.js";export{f as CONTROL_CARD_DEFAULT_VALUE,a as DisplayFormatPreferencesFields,D as EMPTY_SELECTION,s as ReportPreferencesDialog,o as Surfboard};
1
+ import{a,R as s,D as o}from"../chunks/report-preferences-dialog-DQNwImoN.js";import{C as f,E as D}from"../chunks/bookmark-state-B3lDH0E_.js";export{f as CONTROL_CARD_DEFAULT_VALUE,a as DisplayFormatPreferencesFields,D as EMPTY_SELECTION,s as ReportPreferencesDialog,o as Surfboard};
@@ -7,7 +7,7 @@ export declare const BRIEFING_KIND: "BRIEFING";
7
7
  export { DEFAULT_BRIEFING_SCHEDULE, briefingScheduleMonths, briefingScheduleDayOccurs, briefingScheduleShortMonths, buildBriefingScheduleExpr, canonicalBriefingMonthDays, describeBriefingSchedule, isValidBriefingTimezone, nextBriefingScheduleDates, parseBriefingScheduleExpr, type BriefingScheduleFrequency, type BriefingScheduleMonthDay, type BriefingScheduleMonthInterval, type BriefingScheduleMonthlyOn, type BriefingScheduleOrdinal, type BriefingScheduleViewModel, } from './schedule.js';
8
8
  export { briefingAttachmentFileTraits, briefingAttachmentFormatLabel, briefingAttachmentNeedsExportJob, briefingAttachmentProduction, completeBriefingCardAttachment, completeBriefingCardAttachmentSettings, readBriefingCardFacts, type BriefingCardFacts, type BriefingAttachmentFileTraits, type BriefingAttachmentProduction, getBriefingCardAttachmentCapability, getBriefingCardAttachmentFormats, getDefaultBriefingCardAttachmentFormat, isBriefingTableExportCardType, type BriefingCardAttachmentCapability, } from './attachments.js';
9
9
  export { BRIEFING_ATTACHMENT_OMISSION_CODES, isBriefingAttachmentOmissionCode, readBriefingOmittedAttachments, type BriefingAttachmentOmissionCode, type BriefingOmittedAttachment, } from './attachment-outcomes.js';
10
- export { BRIEFING_RUN_CANCELLED_ERROR } from './run-outcomes.js';
10
+ export { BRIEFING_RUN_FAILURE_CODES, CACHE_REFRESH_RUN_FAILURE_CODES, DELIVERY_FAILURE_CODES, EXPORT_RUN_FAILURE_CODES, RUN_FAILURE_DETAIL_MAX_LENGTH, isDeliveryFailureCode, isRunFailureCode, readDeliveryFailure, readRunFailure, runFailureDetail, type BriefingRunFailureCode, type CacheRefreshRunFailureCode, type DeliveryFailure, type DeliveryFailureCode, type ExportRunFailureCode, type RunFailure, type RunFailureCode, type RunFailureView, } from './run-failures.js';
11
11
  export { BRIEFING_DELIVERY_OUTCOME_STATUSES, briefingDeliveryChannelOutcome, readBriefingDeliveryOutcome, type BriefingChannelDeliveryReport, type BriefingDeliveryChannelOutcome, type BriefingDeliveryOutcome, type BriefingDeliveryOutcomeChannel, type BriefingDeliveryOutcomeStatus, } from './delivery-outcome.js';
12
12
  export { canCreateBriefingForUser, type BriefingUiUser } from './capabilities.js';
13
13
  export { getBriefingCreationIntents, type BriefingAuthorIntent, } from './creation.js';
@@ -0,0 +1,67 @@
1
+ /** A report (Briefing) run failed: the report was not sent (catalog A). */
2
+ export declare const BRIEFING_RUN_FAILURE_CODES: readonly ["cancelled", "deleted", "timed_out", "access_lost", "analysis_turned_off", "slack_not_available", "attachment_not_available", "setup_incomplete", "attachments_failed", "instructions_unclear", "instructions_too_large", "no_matching_data", "analysis_failed", "not_delivered", "partly_delivered", "no_recipients", "unexpected"];
3
+ export type BriefingRunFailureCode = (typeof BRIEFING_RUN_FAILURE_CODES)[number];
4
+ /** A background export run failed or was refused at start (catalog B). */
5
+ export declare const EXPORT_RUN_FAILURE_CODES: readonly ["deadline", "too_large", "access_lost", "data_changed", "query_failed", "definition_incomplete", "excel_column_limit", "excel_row_limit", "excel_size_limit", "cancelled", "refused_too_large", "refused_count_unavailable", "refused_count_unsupported", "refused_no_rows", "unexpected"];
6
+ export type ExportRunFailureCode = (typeof EXPORT_RUN_FAILURE_CODES)[number];
7
+ /** A cache refresh run failed: only the shared codes (RF-D14). */
8
+ export declare const CACHE_REFRESH_RUN_FAILURE_CODES: readonly ["cancelled", "timed_out", "unexpected"];
9
+ export type CacheRefreshRunFailureCode = (typeof CACHE_REFRESH_RUN_FAILURE_CODES)[number];
10
+ export type RunFailureCode = BriefingRunFailureCode | ExportRunFailureCode | CacheRefreshRunFailureCode;
11
+ export declare function isRunFailureCode(value: unknown): value is RunFailureCode;
12
+ /**
13
+ * What a failed run stores (RF-INV-1): the code, its catalog line and the
14
+ * actual error (null when there was none: a cancel, an expiry, a refusal).
15
+ * Built only by the app's catalog builders, so a sink can't take a string.
16
+ */
17
+ export type RunFailure = {
18
+ readonly code: RunFailureCode;
19
+ readonly message: string;
20
+ readonly detail: string | null;
21
+ };
22
+ /**
23
+ * A failure as readers receive it (RF-D8): the code and the message, and the
24
+ * actual error as `detail` only when the server sends it to an organization
25
+ * Admin (RF-D10).
26
+ */
27
+ export type RunFailureView = {
28
+ code: RunFailureCode;
29
+ message: string;
30
+ detail?: string | null;
31
+ };
32
+ /**
33
+ * A run's failure from its stored row, or null when it didn't fail or was
34
+ * stored before codes existed (RF-D6: readers then show its `error` as before).
35
+ */
36
+ export declare function readRunFailure(run: {
37
+ status: string;
38
+ failureCode?: string | null;
39
+ error?: string | null;
40
+ }): RunFailureView | null;
41
+ /** A recipient wasn't reached (catalog C): one delivery attempt's failure. */
42
+ export declare const DELIVERY_FAILURE_CODES: readonly ["email_not_set_up", "email_failed", "slack_not_in_channel", "slack_channel_not_found", "slack_channel_archived", "slack_disconnected", "slack_missing_permission", "slack_failed"];
43
+ export type DeliveryFailureCode = (typeof DELIVERY_FAILURE_CODES)[number];
44
+ export declare function isDeliveryFailureCode(value: unknown): value is DeliveryFailureCode;
45
+ /** What a failed delivery attempt stores: as a run failure, from catalog C. */
46
+ export type DeliveryFailure = {
47
+ readonly code: DeliveryFailureCode;
48
+ readonly message: string;
49
+ readonly detail: string | null;
50
+ };
51
+ /** The public part of an attempt's failure, or null when it didn't fail or was stored before codes. */
52
+ export declare function readDeliveryFailure(attempt: {
53
+ status: string;
54
+ failureCode?: string | null;
55
+ error?: string | null;
56
+ }): {
57
+ code: DeliveryFailureCode;
58
+ message: string;
59
+ } | null;
60
+ /** The longest detail stored; the rest is cut (RF-D2). */
61
+ export declare const RUN_FAILURE_DETAIL_MAX_LENGTH = 4000;
62
+ /**
63
+ * The actual error's text, verbatim (RF-INV-6): an Error's message, a string
64
+ * as it is, anything else as JSON. Cut to 4,000 characters, never redacted or
65
+ * reworded. Null when there is no underlying error.
66
+ */
67
+ export declare function runFailureDetail(cause: unknown): string | null;
@@ -0,0 +1,29 @@
1
+ import { TCard } from '../../../../lib/types/common-types.js';
2
+ import { TableViewColumn } from '../../../../lib/dashboard-viewer/table-view.js';
3
+ /** A column of the table's rows a link can use, by the header the table shows (table link fields LF-D4). */
4
+ export type LinkFieldOption = {
5
+ /** The result key the row holds it under: what `{key}` names. */
6
+ key: string;
7
+ label: string;
8
+ hidden: boolean;
9
+ };
10
+ /** The table's columns a link can use: every base and pivot column, hidden ones included, by header; a comparison's "Δ" is not a key. */
11
+ export declare function linkFieldOptions(columns: readonly Pick<TableViewColumn, 'outputKey' | 'label' | 'visible' | 'part'>[]): LinkFieldOption[];
12
+ /** Where a link's key field goes: a Table's Group by, a Detail table's Columns; never a measure (table link fields LF-D5). */
13
+ export type LinkFieldZone = 'groupBy' | 'detailColumns';
14
+ export type AddedLinkField = {
15
+ /** The result key the rows hold it under. */
16
+ key: string;
17
+ label: string;
18
+ /** Added to a Table's Group by, so rows now group by it too (LF-D6). */
19
+ groupsRows: boolean;
20
+ };
21
+ /** The shelf a config Table or Detail table takes a link's key field on; none for a SQL card or any other type. */
22
+ export declare function linkFieldPickerZone(card: Pick<TCard, 'type' | 'sql' | 'python'> | undefined): LinkFieldZone | undefined;
23
+ /** The zone, only for the card open in the card editor, from inside its preview (LF-INV-4). */
24
+ export declare function useLinkFieldPickerZone(cardId: string | undefined): LinkFieldZone | undefined;
25
+ /**
26
+ * The result key of the column a placement added: the named column whose
27
+ * field id the card didn't have before, read through the one column naming.
28
+ */
29
+ export declare function addedColumnKey(before: TCard, after: TCard): string | undefined;
@@ -250,7 +250,12 @@ export interface DataTableColumnSettingsProps {
250
250
  onResetAll: () => void;
251
251
  open: boolean;
252
252
  onOpenChange: (open: boolean) => void;
253
- availableColumns?: string[];
253
+ /** Every data column of the table, hidden ones included, for a Link's Insert field and label (table link fields LF-D4). */
254
+ linkFields?: readonly import('../column-display/link-fields.js').LinkFieldOption[];
255
+ /** The first loaded rows, for a Link's preview (LF-D9). */
256
+ previewRows?: readonly Record<string, unknown>[];
257
+ /** The table's card id: in the card editor, a Link can add a dataset field as a hidden column (LF-D5). */
258
+ cardId?: string;
254
259
  /** Whether this is a raw SQL card (bypasses timezone-aware query pipeline) */
255
260
  isSqlCard?: boolean;
256
261
  /** Sparse authored bytes before default hydration. */
@@ -1 +1 @@
1
- import{B as t,z as r,C as l,E as o,V as i,j as n,c as d,g as m,f as u,b as c,e as E,d as C,a as T,y as p,x as D,o as A,h as I,q as _,w as F,v as S,m as b,n as L,l as f,p as N,k as y,s as R,u as h,i as g,r as x,t as M}from"../chunks/bookmark-state-BmbBu1th.js";import{C as V,D as w,L as z,d as U,g as k,e as B,h as K,f as v,c as Y,a as q,i as G,b as P,n as Q,s as W}from"../chunks/validators-U8IL8djK.js";import{D as J}from"../chunks/token-types-BM0mpZce.js";import{r as H,a as Z}from"../chunks/pivot-result-identity-DRhVJMsF.js";import{D as ee}from"../chunks/report-runtime-context-CkxgMKr6.js";const e=["concatenate","conditional-category","date-part","date-difference","null-to-zero","safe-ratio","nested-conditional","membership-test","uppercase","lowercase","trim-whitespace","replace-text","first-characters","character-count","starts-with","number-to-text","start-of-month","start-of-quarter","start-of-year","year-number","add-days","round-number","round-down","round-up","absolute-value","cap-maximum","floor-minimum","fill-blanks","null-if-zero","is-blank"];export{t as BOOKMARK_STATE_VERSION,r as BOOKMARK_VISIBILITIES,V as CALCULATED_FIELD_ENTITY_MARKER,e as CALCULATED_FIELD_TEMPLATE_IDS,l as CONTROL_CARD_DEFAULT_VALUE,w as DATE_FORMAT_VALUES,ee as DEFAULT_CALENDAR_CONTEXT,J as DEFAULT_SEMANTIC_DOMAIN_ACCESS,o as EMPTY_SELECTION,z as LEGACY_CALCULATED_FIELD_ENTITY_MARKER,i as VIEWER_LIMITS,n as VIEWER_TABLE_SETTINGS_VERSION,d as collectDatasetNamesFromExplorerField,m as collectDatasetNamesFromFilterGroup,u as collectExecutionDatasetNamesFromExplorerField,c as collectPreferredDatasetNamesFromExplorerField,E as collectQualifiedDatasetNamesFromExplorerField,C as datasetRefFromSource,T as dependencyDisplayIdentity,U as getCalculatedFieldComputeStage,p as getCustomizableTableCardIds,k as getFieldRuntimeColumnName,D as getSortableTableCardIds,B as hasCalculatedFieldMarker,K as hasCalculatedFormulaInputs,A as hasColumnCustomization,v as hasSyntheticCalculatedFieldOwner,I as humanizeDatasetName,Y as inspectCalculatedField,q as isCalculatedDimension,G as isCalculatedMetric,P as isDerivedField,_ as isEmptyViewerTableSettings,F as isTableCardCustomizable,S as isTableCardSortable,b as measureJsonBytes,Q as normalizeCalculatedFieldRepresentation,L as normalizeTableColumnOrder,f as normalizeViewerTableSettings,N as parseBookmarkState,y as parseTableColumnId,R as parseViewerTableSettings,h as parseViewerTableSettingsMap,g as readBookmarkState,x as resolveFieldDatasetDependencies,H as resolveQueryColumnKeyMapEntry,Z as resolveUniqueQueryColumnKeyMapEntry,W as shouldDropInheritedCalculationAggregate,M as toTableColumnId};
1
+ import{B as s,A as r,C as l,E as o,V as i,j as n,c as d,g as m,f as u,b as E,e as c,d as C,a as T,z as p,y as A,q as D,h as I,s as _,x as F,w as S,m as b,n as L,o as f,p as y,k as N,u as R,v as h,i as g,r as x,l as M,t as O}from"../chunks/bookmark-state-B3lDH0E_.js";import{C as w,D as z,L as K,d as U,g as k,e as B,h as v,f as Y,c as q,a as G,i as P,b as Q,n as W,s as j}from"../chunks/validators-U8IL8djK.js";import{D as X}from"../chunks/token-types-BM0mpZce.js";import{r as Z,a as $}from"../chunks/pivot-result-identity-DRhVJMsF.js";import{D as ae}from"../chunks/report-runtime-context-CkxgMKr6.js";const e=["concatenate","conditional-category","date-part","date-difference","null-to-zero","safe-ratio","nested-conditional","membership-test","uppercase","lowercase","trim-whitespace","replace-text","first-characters","character-count","starts-with","number-to-text","start-of-month","start-of-quarter","start-of-year","year-number","add-days","round-number","round-down","round-up","absolute-value","cap-maximum","floor-minimum","fill-blanks","null-if-zero","is-blank"];export{s as BOOKMARK_STATE_VERSION,r as BOOKMARK_VISIBILITIES,w as CALCULATED_FIELD_ENTITY_MARKER,e as CALCULATED_FIELD_TEMPLATE_IDS,l as CONTROL_CARD_DEFAULT_VALUE,z as DATE_FORMAT_VALUES,ae as DEFAULT_CALENDAR_CONTEXT,X as DEFAULT_SEMANTIC_DOMAIN_ACCESS,o as EMPTY_SELECTION,K as LEGACY_CALCULATED_FIELD_ENTITY_MARKER,i as VIEWER_LIMITS,n as VIEWER_TABLE_SETTINGS_VERSION,d as collectDatasetNamesFromExplorerField,m as collectDatasetNamesFromFilterGroup,u as collectExecutionDatasetNamesFromExplorerField,E as collectPreferredDatasetNamesFromExplorerField,c as collectQualifiedDatasetNamesFromExplorerField,C as datasetRefFromSource,T as dependencyDisplayIdentity,U as getCalculatedFieldComputeStage,p as getCustomizableTableCardIds,k as getFieldRuntimeColumnName,A as getSortableTableCardIds,B as hasCalculatedFieldMarker,v as hasCalculatedFormulaInputs,D as hasColumnCustomization,Y as hasSyntheticCalculatedFieldOwner,I as humanizeDatasetName,q as inspectCalculatedField,G as isCalculatedDimension,P as isCalculatedMetric,Q as isDerivedField,_ as isEmptyViewerTableSettings,F as isTableCardCustomizable,S as isTableCardSortable,b as measureJsonBytes,W as normalizeCalculatedFieldRepresentation,L as normalizeTableColumnOrder,f as normalizeViewerTableSettings,y as parseBookmarkState,N as parseTableColumnId,R as parseViewerTableSettings,h as parseViewerTableSettingsMap,g as readBookmarkState,x as resolveFieldDatasetDependencies,Z as resolveQueryColumnKeyMapEntry,$ as resolveUniqueQueryColumnKeyMapEntry,j as shouldDropInheritedCalculationAggregate,M as tableSortEntryKey,O as toTableColumnId};
@@ -1,5 +1,5 @@
1
1
  import { TCard } from '../types/common-types.js';
2
- import { CardConfig, DetailField, GroupByField, MetricField, QueryColumnKeyMap } from '../types/explorer-types.js';
2
+ import { CardConfig, ComparisonSortPart, DetailField, GroupByField, MetricField, QueryColumnKeyMap } from '../types/explorer-types.js';
3
3
  import { ComparisonMetadataMap } from '../types/query-types.js';
4
4
  import { SemaphorResultColumn } from '../../shared/analytics-protocol/index.js';
5
5
  import { TableColumnId, ViewerTableSettings } from '../../shared/dashboard-viewer/table-settings.js';
@@ -63,6 +63,11 @@ export type TableViewColumn = {
63
63
  readonly pinned: boolean;
64
64
  /** Can be pinned (PIN-2): an addressable base column; in a pivoted table, a row dimension only. */
65
65
  readonly pinnable: boolean;
66
+ /**
67
+ * A measure's "Δ" column in a table sorted in the query: the part a click
68
+ * sorts by, the number the cell shows first (table comparison sort TCS-D2).
69
+ */
70
+ readonly comparisonSortPart?: ComparisonSortPart;
66
71
  };
67
72
  /** A base column with an id: the columns a viewer's sort and widths address. */
68
73
  export declare function isAddressableBaseColumn(column: Pick<TableViewColumn, 'part' | 'columnId'>): column is Pick<TableViewColumn, 'part'> & {
@@ -1,3 +1,4 @@
1
+ import { RunFailureView } from '../../briefings/run-failures.js';
1
2
  import { BriefingAttachment, BriefingBody, BriefingChannelConfig, BriefingDeliveryConfig, BriefingKind, BriefingLimits, BriefingPresentation, BriefingSource, BriefingStatus, CreateBriefingRequest } from '../../briefings.js';
2
3
  export type { BriefingAttachment, BriefingAttachmentFormat, BriefingAttachmentSettings, BriefingBody, BriefingDeliveryChannel, BriefingDeliveryConfig, BriefingJobConfig, BriefingKind, BriefingLimits, BriefingPresentation, BriefingRecipient, BriefingSource, BriefingStatus, CreateBriefingRequest, } from '../../briefings.js';
3
4
  export type BriefingRunStatus = 'QUEUED' | 'RUNNING' | 'SUCCESS' | 'FAILED';
@@ -28,7 +29,10 @@ export interface BriefingRun {
28
29
  scheduledFor: string;
29
30
  startedAt?: string | null;
30
31
  completedAt?: string | null;
32
+ /** The customer message of a failed run (the same text as `failure.message`). */
31
33
  error?: string | null;
34
+ /** Why a failed run failed (run-failure-messages RF-D8); null otherwise, and for runs stored before codes. */
35
+ failure?: RunFailureView | null;
32
36
  requestId?: string | null;
33
37
  attempt: number;
34
38
  progress?: BriefingRunProgress | null;
@@ -401,9 +401,21 @@ export declare function hasCalculatedFieldMarker(field: Pick<Field, 'entityName'
401
401
  * the historical `calculated_fields` namespace.
402
402
  */
403
403
  export declare function hasSyntheticCalculatedFieldOwner(field: Partial<Pick<Field, 'entityName' | 'entityId' | 'qualifiedEntityName'>> | null | undefined): boolean;
404
+ /**
405
+ * Which output of a compared measure a sort ranks by (table comparison sort
406
+ * TCS-D1): `change` is current − previous, `percentChange` that change over
407
+ * |previous|, with `evaluateMetricComparison`'s arithmetic.
408
+ */
409
+ export type ComparisonSortPart = 'change' | 'percentChange';
404
410
  export interface SortByField extends Field {
405
411
  role: 'sortby';
406
412
  direction: 'asc' | 'desc';
413
+ /**
414
+ * Sorts by the measure's comparison instead of its value: the "Δ" column.
415
+ * Absent means the value, as every sort before it. A run without a
416
+ * comparison for the measure sorts by its value (TCS-D6).
417
+ */
418
+ comparisonPart?: ComparisonSortPart;
407
419
  }
408
420
  /**
409
421
  * Persisted authoring intent for the order of generated pivot-member columns.
@@ -34,8 +34,6 @@ export declare function readColumnDisplay(entry: PersistedColumnSettings | undef
34
34
  export declare function writeColumnDisplayEntry(entry: PersistedColumnSettings | undefined, display: ColumnDisplayInput | null): PersistedColumnSettings;
35
35
  /** The card with a column's Display as written, by the column's result key. */
36
36
  export declare function writeColumnDisplay<T extends Pick<TCard, 'preferences'>>(card: T, resultKey: string, display: ColumnDisplayInput | null): T;
37
- /** A Link address's `{placeholders}`, other than `{value}`. */
38
- export declare function linkAddressColumns(address: string): string[];
39
37
  /** How a Display as reads back (SPEC §2.7): "as monospace, up to 3 lines". */
40
38
  export declare function columnDisplayWords(display: ColumnDisplayInput | null): string;
41
39
  /**
@@ -0,0 +1,13 @@
1
+ import { TCard } from '../../lib/types/common-types.js';
2
+ import { ComparisonSortPart, SortByField } from '../../lib/types/explorer-types.js';
3
+ /**
4
+ * Whether a card's sort entry can rank its rows by a measure's change
5
+ * (table comparison sort TCS-D2, TCS-D7): a config Table that isn't pivoted,
6
+ * sorting by a measure whose comparison isn't off (`measureComparisonStateOn`). A measure without
7
+ * its own comparison follows the Date filter's; a run without one sorts by
8
+ * the value (TCS-D6). The one rule the editor's sort pill and the MCP's card
9
+ * order both apply.
10
+ */
11
+ export declare function sortCanRankByChange(card: Pick<TCard, 'type' | 'config' | 'sql' | 'preferences'>, sort: SortByField): boolean;
12
+ /** A sort's words for its part: "Change in Revenue", "% change in Revenue". */
13
+ export declare function comparisonSortLabel(part: ComparisonSortPart, measureLabel: string): string;
@@ -278,6 +278,7 @@ export declare const COLUMN_KEY_CLASSES: {
278
278
  };
279
279
  sort: {
280
280
  readonly direction: "query";
281
+ readonly comparisonPart: "query";
281
282
  readonly id: "presentation";
282
283
  readonly name: "query";
283
284
  readonly label: "presentation";
@@ -1255,6 +1255,7 @@ export declare const metricCardQuerySchema: z.ZodObject<{
1255
1255
  aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
1256
1256
  }>]>;
1257
1257
  direction: z.ZodEnum<["asc", "desc"]>;
1258
+ part: z.ZodOptional<z.ZodEnum<["change", "percentChange"]>>;
1258
1259
  }, "strict", z.ZodTypeAny, {
1259
1260
  field: string | {
1260
1261
  name: string;
@@ -1272,6 +1273,7 @@ export declare const metricCardQuerySchema: z.ZodObject<{
1272
1273
  aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
1273
1274
  };
1274
1275
  direction: "asc" | "desc";
1276
+ part?: "change" | "percentChange" | undefined;
1275
1277
  }, {
1276
1278
  field: string | {
1277
1279
  name: string;
@@ -1289,6 +1291,7 @@ export declare const metricCardQuerySchema: z.ZodObject<{
1289
1291
  aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
1290
1292
  };
1291
1293
  direction: "asc" | "desc";
1294
+ part?: "change" | "percentChange" | undefined;
1292
1295
  }>>;
1293
1296
  limit: z.ZodOptional<z.ZodNumber>;
1294
1297
  }, "strict", z.ZodTypeAny, {
@@ -1471,6 +1474,7 @@ export declare const metricCardQuerySchema: z.ZodObject<{
1471
1474
  aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
1472
1475
  };
1473
1476
  direction: "asc" | "desc";
1477
+ part?: "change" | "percentChange" | undefined;
1474
1478
  } | undefined;
1475
1479
  dateField?: string | {
1476
1480
  name: string;
@@ -1681,6 +1685,7 @@ export declare const metricCardQuerySchema: z.ZodObject<{
1681
1685
  aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
1682
1686
  };
1683
1687
  direction: "asc" | "desc";
1688
+ part?: "change" | "percentChange" | undefined;
1684
1689
  } | undefined;
1685
1690
  dateField?: string | {
1686
1691
  name: string;
@@ -2756,6 +2761,7 @@ declare const cardQueryPatchObject: z.ZodObject<{
2756
2761
  aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
2757
2762
  }>]>;
2758
2763
  direction: z.ZodEnum<["asc", "desc"]>;
2764
+ part: z.ZodOptional<z.ZodEnum<["change", "percentChange"]>>;
2759
2765
  }, "strict", z.ZodTypeAny, {
2760
2766
  field: string | {
2761
2767
  name: string;
@@ -2773,6 +2779,7 @@ declare const cardQueryPatchObject: z.ZodObject<{
2773
2779
  aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
2774
2780
  };
2775
2781
  direction: "asc" | "desc";
2782
+ part?: "change" | "percentChange" | undefined;
2776
2783
  }, {
2777
2784
  field: string | {
2778
2785
  name: string;
@@ -2790,6 +2797,7 @@ declare const cardQueryPatchObject: z.ZodObject<{
2790
2797
  aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
2791
2798
  };
2792
2799
  direction: "asc" | "desc";
2800
+ part?: "change" | "percentChange" | undefined;
2793
2801
  }>>>;
2794
2802
  limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2795
2803
  connectionId: z.ZodOptional<z.ZodString>;
@@ -2990,6 +2998,7 @@ declare const cardQueryPatchObject: z.ZodObject<{
2990
2998
  aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
2991
2999
  };
2992
3000
  direction: "asc" | "desc";
3001
+ part?: "change" | "percentChange" | undefined;
2993
3002
  } | null | undefined;
2994
3003
  dateField?: string | {
2995
3004
  name: string;
@@ -3216,6 +3225,7 @@ declare const cardQueryPatchObject: z.ZodObject<{
3216
3225
  aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
3217
3226
  };
3218
3227
  direction: "asc" | "desc";
3228
+ part?: "change" | "percentChange" | undefined;
3219
3229
  } | null | undefined;
3220
3230
  dateField?: string | {
3221
3231
  name: string;
@@ -4703,6 +4713,7 @@ export declare const dashboardChangeSchema: z.ZodDiscriminatedUnion<"op", [z.Zod
4703
4713
  aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
4704
4714
  };
4705
4715
  direction: "asc" | "desc";
4716
+ part?: "change" | "percentChange" | undefined;
4706
4717
  } | null | undefined;
4707
4718
  dateField?: string | {
4708
4719
  name: string;
@@ -5042,6 +5053,7 @@ export declare const dashboardChangeSchema: z.ZodDiscriminatedUnion<"op", [z.Zod
5042
5053
  aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
5043
5054
  };
5044
5055
  direction: "asc" | "desc";
5056
+ part?: "change" | "percentChange" | undefined;
5045
5057
  } | null | undefined;
5046
5058
  dateField?: string | {
5047
5059
  name: string;
@@ -1,4 +1,5 @@
1
1
  export * from './comparison-document-migration.js';
2
+ export * from './card-sort-comparison.js';
2
3
  export * from './temporal-result-owner.js';
3
4
  export * from './automatic-grain.js';
4
5
  export * from './detail-date-presentation.js';
@@ -23,6 +23,13 @@ export declare function tableSheetCard(sheet: TSheet): {
23
23
  frame: TFrame;
24
24
  card: TCard;
25
25
  } | undefined;
26
+ /**
27
+ * Whether the card is a Table sheet's table. Such a card is never a click-to-filter
28
+ * source, whatever its own setting or the dashboard default says (TS-D38): a click
29
+ * filters only the cards on its own sheet, and a Table sheet holds no other card.
30
+ * Walks only Table sheets, so a grid dashboard pays one kind check per sheet.
31
+ */
32
+ export declare function isTableSheetCardId(dashboard: Pick<TDashboard, 'sheets'> | null | undefined, cardId: string): boolean;
26
33
  export type SheetShapeIssueCode = 'table_sheet_no_card' | 'table_sheet_extra_card' | 'table_sheet_card_type' | 'table_sheet_layout';
27
34
  export type SheetShapeIssue = {
28
35
  code: SheetShapeIssueCode;
@@ -110,6 +110,7 @@ export declare const SHELF_FIELD_KEYS: {
110
110
  readonly semanticComparisonPolarity: "shelf";
111
111
  readonly parameters: "shelf";
112
112
  readonly direction: "shelf";
113
+ readonly comparisonPart: "shelf";
113
114
  readonly grainMode: "shelf";
114
115
  };
115
116
  /** The dialog's draft for a saved variable. */
@@ -1,4 +1,5 @@
1
1
  import { TCard, TDashboard } from '../../lib/types/common-types.js';
2
+ import { ComparisonSortPart } from '../../lib/types/explorer-types.js';
2
3
  export declare const VIEWER_LIMITS: {
3
4
  readonly bookmarksPerViewerPerDashboard: 20;
4
5
  readonly bookmarkNameMaxChars: 100;
@@ -44,7 +45,14 @@ export declare function parseTableColumnId(value: string): TableColumnIdentity |
44
45
  export type TableSortEntry = {
45
46
  readonly columnId: TableColumnId;
46
47
  readonly direction: 'asc' | 'desc';
48
+ /**
49
+ * A measure sorted by its comparison, its "Δ" column (table comparison
50
+ * sort TCS-D1): the measure's id with the part. Absent: the column's value.
51
+ */
52
+ readonly comparisonPart?: ComparisonSortPart;
47
53
  };
54
+ /** One sort per column and part: a measure can sort by its value and by its change. */
55
+ export declare function tableSortEntryKey(entry: Pick<TableSortEntry, 'columnId' | 'comparisonPart'>): string;
48
56
  /**
49
57
  * One viewer's choices for one table card. Sparse and normalized: a field that
50
58
  * is empty or equals the author's is omitted, and settings equal to the
@@ -273,7 +273,7 @@ export declare const exportCompletedDetailsSchema: z.ZodObject<{
273
273
  mechanism: "rendered" | "job" | "matrix_direct";
274
274
  scope?: "card" | "dashboard" | "visual" | undefined;
275
275
  rows?: number | undefined;
276
- stage?: "create" | "acquire" | "deadline" | "render" | undefined;
276
+ stage?: "create" | "deadline" | "acquire" | "render" | undefined;
277
277
  chunks?: number | undefined;
278
278
  bytes?: number | undefined;
279
279
  export_id?: string | undefined;
@@ -282,7 +282,7 @@ export declare const exportCompletedDetailsSchema: z.ZodObject<{
282
282
  mechanism: "rendered" | "job" | "matrix_direct";
283
283
  scope?: "card" | "dashboard" | "visual" | undefined;
284
284
  rows?: number | undefined;
285
- stage?: "create" | "acquire" | "deadline" | "render" | undefined;
285
+ stage?: "create" | "deadline" | "acquire" | "render" | undefined;
286
286
  chunks?: number | undefined;
287
287
  bytes?: number | undefined;
288
288
  export_id?: string | undefined;
@@ -91,9 +91,9 @@ export declare const usageEventEnvelopeSchema: z.ZodObject<{
91
91
  message: string;
92
92
  } | null;
93
93
  surface: "api" | "embed" | "console" | "mcp" | "public_link" | "scheduler" | "pdf_renderer";
94
- category: "runtime" | "usage" | "delivery" | "agent";
95
94
  card_id: string | null;
96
95
  sheet_id: string | null;
96
+ category: "runtime" | "usage" | "delivery" | "agent";
97
97
  connection_id: string | null;
98
98
  outcome: "cancelled" | "failed" | "timed_out" | "succeeded" | null;
99
99
  domain_id: string | null;
@@ -120,9 +120,9 @@ export declare const usageEventEnvelopeSchema: z.ZodObject<{
120
120
  message: string;
121
121
  } | null;
122
122
  surface: "api" | "embed" | "console" | "mcp" | "public_link" | "scheduler" | "pdf_renderer";
123
- category: "runtime" | "usage" | "delivery" | "agent";
124
123
  card_id: string | null;
125
124
  sheet_id: string | null;
125
+ category: "runtime" | "usage" | "delivery" | "agent";
126
126
  connection_id: string | null;
127
127
  outcome: "cancelled" | "failed" | "timed_out" | "succeeded" | null;
128
128
  domain_id: string | null;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.608",
8
+ "version": "0.1.610",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -120,9 +120,9 @@
120
120
  "dev": "vite",
121
121
  "build": "node scripts/build.mjs",
122
122
  "build:frame-formatter": "node scripts/build-frame-formatter.mjs",
123
- "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
124
- "lint:regressions": "node scripts/lint-regressions.mjs",
125
- "check:guards": "node scripts/card-config-consumers.mjs && node scripts/components-entry-imports.mjs && node scripts/types-entry-imports.mjs && node scripts/card-query-assembly-imports.mjs && node scripts/matrix-conversion-imports.mjs && node scripts/legacy-table-type-references.mjs && node scripts/assistant-chat-imports.mjs && node scripts/filter-model-reads.mjs && node scripts/kpi-figure-reads.mjs && node scripts/layout-engine.mjs && node scripts/text-variable-refs.mjs && node scripts/data-variable-derivation.mjs && node scripts/variable-name-allocation.mjs && node scripts/unreached-modules.mjs && node scripts/dashboard-style-reads.mjs && node scripts/host-color-variables.mjs && node scripts/table-surface-literals.mjs && node scripts/comparison-words.mjs && node scripts/editor-control-sizes.mjs",
123
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --cache --cache-location node_modules/.cache/eslint/",
124
+ "lint:regressions": "node ../semaphor-app/scripts/gate/lint-new.mjs --ext=.ts,.tsx,.mjs --all",
125
+ "check:guards": "node scripts/check-guards.mjs",
126
126
  "preview": "vite preview",
127
127
  "test": "vitest run",
128
128
  "test:changed": "vitest run --changed",
@@ -148,7 +148,9 @@
148
148
  "link:check": "./scripts/link-helper.sh check",
149
149
  "link:create": "./scripts/link-helper.sh link",
150
150
  "link:remove": "./scripts/link-helper.sh unlink",
151
- "link:restore": "./scripts/link-helper.sh restore"
151
+ "link:restore": "./scripts/link-helper.sh restore",
152
+ "typecheck": "tsc --noEmit --incremental --tsBuildInfoFile node_modules/.cache/tsc/tsbuildinfo",
153
+ "gate": "node ../semaphor-app/scripts/gate/run.mjs"
152
154
  },
153
155
  "dependencies": {
154
156
  "@ai-sdk/react": "^4.0.140",