react-semaphor 0.1.609 → 0.1.611

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 (119) hide show
  1. package/dist/.gate-build-input +1 -0
  2. package/dist/analytics-protocol/index.js +1 -1
  3. package/dist/assistant-context/index.js +1 -1
  4. package/dist/brand-studio/index.js +2 -2
  5. package/dist/briefings/index.js +1 -1
  6. package/dist/chunks/appearance-provider-nxBjHmOo.js +708 -0
  7. package/dist/chunks/{assistant-chat-DAmFZEnD.js → assistant-chat-DGaSGyx_.js} +13 -13
  8. package/dist/chunks/{attachment-filter-line-ClTS4GvQ.js → attachment-filter-line-CVkfzZF9.js} +1 -1
  9. package/dist/chunks/{bookmark-impact-BEVaXjug.js → bookmark-impact-DnhE262D.js} +1 -1
  10. package/dist/chunks/{bookmark-state-DnkzIsyw.js → bookmark-state-CrJDZi3y.js} +1 -1
  11. package/dist/chunks/{brand-BjC1mPjw.js → brand-BjIkbHgw.js} +1 -1
  12. package/dist/chunks/card-filter-builder-9xCSYFNv.js +11 -0
  13. package/dist/chunks/{check-input-qgwboKei.js → check-input-DmKJoLY-.js} +1 -1
  14. package/dist/chunks/{comparison-window-caption-WzGsqv4n.js → comparison-window-caption-DImvKgCt.js} +1 -1
  15. package/dist/chunks/currency-presentation-binding-DCHJ2sRD.js +1 -0
  16. package/dist/chunks/{custom-visual-inputs-CoAs_73N.js → custom-visual-inputs-C2BRX8l_.js} +1 -1
  17. package/dist/chunks/{custom-visual-write-BWApKrHe.js → custom-visual-write-CYA-Y9YF.js} +1 -1
  18. package/dist/chunks/{dashboard-DbBgEesz.js → dashboard-DEsWObFS.js} +1 -1
  19. package/dist/chunks/dashboard-briefing-launcher-PzvxJm1T.js +42 -0
  20. package/dist/chunks/{dashboard-controls-CyQg_GC1.js → dashboard-controls-DPVMjbpG.js} +5 -5
  21. package/dist/chunks/{dashboard-json-ZSAQQkcR.js → dashboard-json-CWJ6drfv.js} +1 -1
  22. package/dist/chunks/{dashboard-temporal-snapshot-BSTfqT29.js → dashboard-temporal-snapshot-C2y8qWoK.js} +1 -1
  23. package/dist/chunks/dates-ByeRG2Tz.js +1 -0
  24. package/dist/chunks/edit-dashboard-visual-BxwhXWe2.js +103 -0
  25. package/dist/chunks/{filter-line-W-qQAjke.js → filter-line-BpaHAj8x.js} +1 -1
  26. package/dist/chunks/filter-reach-preview-C9WDhZaV.js +1 -0
  27. package/dist/chunks/{filter-value-text-DQwYZHz0.js → filter-value-text-vD4CXg9H.js} +1 -1
  28. package/dist/chunks/{kpi-trend-rule-B4ebKzNj.js → kpi-trend-rule-H3cLKxwe.js} +1 -1
  29. package/dist/chunks/matrix-analytical-definition-B6Auo_Up.js +1 -0
  30. package/dist/chunks/{matrix-member-presentation-Chz6uGYz.js → matrix-member-presentation-B6wzUGA9.js} +1 -1
  31. package/dist/chunks/matrix-operation-contract-1dtkh4UB.js +1 -0
  32. package/dist/chunks/{metric-formatting-toJrRqu4.js → metric-formatting-BF1b9EEC.js} +1 -1
  33. package/dist/chunks/numeric-range-options-B_EcRH8C.js +1 -0
  34. package/dist/chunks/{palette-DpLPXjUd.js → palette-DLYro9VS.js} +1 -1
  35. package/dist/chunks/pivot-result-contract-expectations-Bl55bAD9.js +1 -0
  36. package/dist/chunks/{pivot-result-identity-DRhVJMsF.js → pivot-result-identity-CAP9xTVF.js} +1 -1
  37. package/dist/chunks/{raw-temporal-value-B4Md6Xfb.js → raw-temporal-value-DqmEQqi9.js} +1 -1
  38. package/dist/chunks/report-preferences-dialog-CV0NMmo0.js +1 -0
  39. package/dist/chunks/report-runtime-context-DUyoI64N.js +1 -0
  40. package/dist/chunks/resolve-dashboard-input-context-D3lfJtPf.js +8 -0
  41. package/dist/chunks/{sandbox-host-BqcLSoTV.js → sandbox-host-DTsb-07w.js} +1 -1
  42. package/dist/chunks/saved-dashboard-context-pT-jLe_M.js +1 -0
  43. package/dist/chunks/{selection-filter-compiler-BxtEEB6Z.js → selection-filter-compiler-D2O1G8aM.js} +1 -1
  44. package/dist/chunks/semaphor-ready-indicator-X4VBj9J1.js +542 -0
  45. package/dist/chunks/{slider-C2nbml5r.js → slider-BuDy7URL.js} +5 -5
  46. package/dist/chunks/stored-dashboard-CtbTHA6d.js +1 -0
  47. package/dist/chunks/table-cell-text-CcdZI7W5.js +1 -0
  48. package/dist/chunks/{table-export-sheet-CthBUHu4.js → table-export-sheet-CR05ORx7.js} +1 -1
  49. package/dist/chunks/{token-types-BM0mpZce.js → token-types-DapH4m_I.js} +1 -1
  50. package/dist/chunks/validators-D6oX9c_4.js +1 -0
  51. package/dist/chunks/{variable-draft-DAVLIY3l.js → variable-draft-BugdJvFc.js} +1 -1
  52. package/dist/chunks/work-days-BbCJDTJK.js +1 -0
  53. package/dist/dashboard/index.js +1 -1
  54. package/dist/dashboard-authoring/index.js +1 -1
  55. package/dist/extensions/index.js +1 -1
  56. package/dist/format-utils/index.js +1 -1
  57. package/dist/index.js +1 -1
  58. package/dist/report-runtime-context/index.js +1 -1
  59. package/dist/style.css +1 -1
  60. package/dist/surfboard/index.js +1 -1
  61. package/dist/types/briefings/index.d.ts +1 -1
  62. package/dist/types/briefings/run-failures.d.ts +67 -0
  63. package/dist/types/components/surfboard/index.d.ts +1 -0
  64. package/dist/types/components/surfboard/preferences/work-day-toggles.d.ts +16 -0
  65. package/dist/types/components/ui-custom/date-range-presets.d.ts +4 -1
  66. package/dist/types/components/visual/data-table/column-display/link-fields.d.ts +29 -0
  67. package/dist/types/components/visual/data-table/types/data-table.d.ts +6 -1
  68. package/dist/types/index.js +1 -1
  69. package/dist/types/lib/stores/dashboard-store.d.ts +2 -0
  70. package/dist/types/lib/types/briefing-types.d.ts +4 -0
  71. package/dist/types/shared/analytics-protocol/comparison-choices.d.ts +7 -0
  72. package/dist/types/shared/analytics-protocol/comparison-placement.d.ts +2 -0
  73. package/dist/types/shared/analytics-protocol/relative-date/index.d.ts +1 -1
  74. package/dist/types/shared/analytics-protocol/relative-date/presets.d.ts +1 -1
  75. package/dist/types/shared/analytics-protocol/relative-date/resolve.d.ts +4 -2
  76. package/dist/types/shared/analytics-protocol/relative-date/schemas.d.ts +7 -0
  77. package/dist/types/shared/analytics-protocol/relative-date/traits.d.ts +2 -1
  78. package/dist/types/shared/analytics-protocol/relative-date/window.d.ts +9 -1
  79. package/dist/types/shared/dashboard-authoring/card-data-source/data-source-selection.d.ts +11 -0
  80. package/dist/types/shared/dashboard-authoring/card-data-source/index.d.ts +1 -0
  81. package/dist/types/shared/dashboard-authoring/card-settings/column-display.d.ts +0 -2
  82. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +16 -0
  83. package/dist/types/shared/dashboard-authoring/filter-model/filter-values.d.ts +10 -0
  84. package/dist/types/shared/dashboard-authoring/frame-cards.d.ts +29 -0
  85. package/dist/types/shared/dashboard-authoring/operations/card-operations.d.ts +13 -10
  86. package/dist/types/shared/dashboard-authoring/operations/operation-sentences.d.ts +18 -0
  87. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +16 -1
  88. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +12 -1
  89. package/dist/types/shared/dashboard-authoring/sheet-kinds.d.ts +7 -0
  90. package/dist/types/shared/dashboard-authoring/table-sheet-shape.d.ts +53 -3
  91. package/dist/types/shared/dashboard-viewer/table-column-move.d.ts +7 -0
  92. package/dist/types/shared/extensions/saved-refs.d.ts +1 -15
  93. package/dist/types/shared/report-runtime-context/index.d.ts +1 -0
  94. package/dist/types/shared/report-runtime-context/report-runtime-context.d.ts +22 -1
  95. package/dist/types/shared/report-runtime-context/work-days.d.ts +31 -0
  96. package/dist/types/shared/temporal/calendar-periods.d.ts +1 -1
  97. package/dist/types/shared/usage-events/details.d.ts +2 -2
  98. package/package.json +7 -5
  99. package/dist/chunks/appearance-provider-BW022_Qu.js +0 -613
  100. package/dist/chunks/card-filter-builder-BGIVEHmJ.js +0 -11
  101. package/dist/chunks/currency-presentation-binding-ClrH_6Tq.js +0 -1
  102. package/dist/chunks/dashboard-briefing-launcher-DadG4ES9.js +0 -42
  103. package/dist/chunks/edit-dashboard-visual-DIF1fllI.js +0 -103
  104. package/dist/chunks/filter-reach-preview-CfbwaLf4.js +0 -1
  105. package/dist/chunks/layout-grid-Cs350bW-.js +0 -6
  106. package/dist/chunks/matrix-analytical-definition-jn075ooo.js +0 -1
  107. package/dist/chunks/matrix-operation-contract-DceN49RX.js +0 -1
  108. package/dist/chunks/numeric-range-options-Drc1EZ6H.js +0 -1
  109. package/dist/chunks/pivot-result-contract-expectations-D_ane7I2.js +0 -1
  110. package/dist/chunks/report-preferences-dialog-DEfUYExu.js +0 -1
  111. package/dist/chunks/report-runtime-context-CkxgMKr6.js +0 -1
  112. package/dist/chunks/resolve-dashboard-input-context-Dm4PD8Gx.js +0 -8
  113. package/dist/chunks/saved-dashboard-context-GjEJuDjj.js +0 -1
  114. package/dist/chunks/semaphor-ready-indicator-BViyPq5k.js +0 -622
  115. package/dist/chunks/set-q-2M4nis.js +0 -1
  116. package/dist/chunks/stored-dashboard-CTwrNvBy.js +0 -1
  117. package/dist/chunks/table-cell-text-DJe6I1G3.js +0 -1
  118. package/dist/chunks/validators-U8IL8djK.js +0 -1
  119. 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-DEfUYExu.js";import{C as f,E as D}from"../chunks/bookmark-state-DnkzIsyw.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,W as D}from"../chunks/report-preferences-dialog-CV0NMmo0.js";import{C as f,E as T}from"../chunks/bookmark-state-CrJDZi3y.js";export{f as CONTROL_CARD_DEFAULT_VALUE,a as DisplayFormatPreferencesFields,T as EMPTY_SELECTION,s as ReportPreferencesDialog,o as Surfboard,D as WorkDayToggles};
@@ -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;
@@ -3,3 +3,4 @@ export * from '../../lib/types/common-types.js';
3
3
  export { Surfboard };
4
4
  export { ReportPreferencesDialog } from './preferences/report-preferences-dialog.js';
5
5
  export { DisplayFormatPreferencesFields, type DisplayFormatPreferencesFieldsProps, } from './preferences/display-format-preferences-fields.js';
6
+ export { WorkDayToggles, type WorkDayTogglesProps } from './preferences/work-day-toggles.js';
@@ -0,0 +1,16 @@
1
+ import { WeekStart, WorkDays } from '../../../shared/report-runtime-context/index.js';
2
+ export interface WorkDayTogglesProps {
3
+ /** The days the business works, 0 Sunday to 6 Saturday. */
4
+ workDays: WorkDays;
5
+ /** Orders the toggles; it never moves the working days. */
6
+ weekStart: WeekStart;
7
+ disabled?: boolean;
8
+ onChange: (workDays: WorkDays) => void;
9
+ }
10
+ /**
11
+ * Working days as seven toggles in week-start order (previous business day
12
+ * plan, BD-D9): the one control for the Calendar tab and the admin
13
+ * organization and tenant settings. The order, the toggle and the rule that
14
+ * the last working day stays on are the calendar contract's.
15
+ */
16
+ export declare function WorkDayToggles({ workDays, weekStart, disabled, onChange }: WorkDayTogglesProps): import("react").JSX.Element;
@@ -2,8 +2,9 @@ import { DefaultDateFilter, FixedDayDefaultDateFilter, FixedMonthDefaultDateFilt
2
2
  import { WeekStart } from '../../lib/types/token-types.js';
3
3
  import { CalendarContext } from '../../shared/report-runtime-context/index.js';
4
4
  import { ComparisonWindowShape } from '../../shared/analytics-protocol/comparison-choices.js';
5
+ import { RelativeDatePresetId } from '../../shared/analytics-protocol/relative-date/index.js';
5
6
  /** Calendar inputs for defaults, including reproducible and fiscal reports. */
6
- export type DefaultDateCalendar = Pick<CalendarContext, 'tz' | 'weekStart'> & Partial<Pick<CalendarContext, 'anchor' | 'fiscalCalendar'>>;
7
+ export type DefaultDateCalendar = Pick<CalendarContext, 'tz' | 'weekStart'> & Partial<Pick<CalendarContext, 'anchor' | 'fiscalCalendar' | 'workDays'>>;
7
8
  export declare const isFixedMonthDefaultDateFilter: (value: unknown) => value is FixedMonthDefaultDateFilter;
8
9
  export declare const isFixedDayDefaultDateFilter: (value: unknown) => value is FixedDayDefaultDateFilter;
9
10
  /**
@@ -12,6 +13,8 @@ export declare const isFixedDayDefaultDateFilter: (value: unknown) => value is F
12
13
  * both produce the identical day window.
13
14
  */
14
15
  export declare function resolveCalendarDayRange(date: string, timezone: string): [Date, Date];
16
+ /** The Day Picker's relative quick choices, in the owner's order: each is exactly one calendar day. */
17
+ export declare const DAY_PICKER_PRESET_IDS: readonly RelativeDatePresetId[];
15
18
  /**
16
19
  * True when a default resolves to exactly one calendar day, making it a
17
20
  * valid default for Day Picker (`dateSelectionMode: 'day'`) filters. Day
@@ -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 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-DnkzIsyw.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
+ 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-CrJDZi3y.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-D6oX9c_4.js";import{D as X}from"../chunks/token-types-DapH4m_I.js";import{r as Z,a as $}from"../chunks/pivot-result-identity-CAP9xTVF.js";import{D as ae}from"../chunks/report-runtime-context-DUyoI64N.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};
@@ -543,6 +543,8 @@ type Actions = {
543
543
  updateFrameCard?: (sheetId: string, frameId: string, card: TCard) => void;
544
544
  updateCurrentDashboardCard: (card: TCard) => void;
545
545
  removeFrame: (sheetId: string, frameId: string) => void;
546
+ /** Moves a card's tile, every tab with it, to the end of another dashboard sheet (card copy and move CM-D1); a refusal says why. */
547
+ moveFrameToSheet: (frameId: string, toSheetId: string) => AddFrameResult;
546
548
  removeCard: (sheetId: string, card: TCard) => void;
547
549
  setIsDashboardEditing: (editing: boolean) => void;
548
550
  /** The toolbar's Save succeeded: the edit session's changes are saved (LC-D14). */
@@ -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;
@@ -20,6 +20,13 @@ export type ComparisonWindowShape = {
20
20
  * judged on it, so a step that fits in a short month is never refused.
21
21
  */
22
22
  fewestDays?: number;
23
+ /**
24
+ * What its previous period is called when that is not the period before it
25
+ * on the calendar: the previous business day's is the working day before it
26
+ * (previous business day plan, BD-D6), so "Previous business day", never
27
+ * "Previous day".
28
+ */
29
+ previousName?: string;
23
30
  };
24
31
  /**
25
32
  * What a surface has for the window a comparison applies to (compare-with
@@ -27,4 +27,6 @@ export declare function placeComparisonWindow(input: {
27
27
  basis: DateWindowBasis;
28
28
  weekStart: 0 | 1 | 2 | 3 | 4 | 5 | 6;
29
29
  fiscalCalendar?: TemporalCalendar['fiscalCalendar'];
30
+ /** The calendar's working days, for the previous business day's span back (BD-D6). */
31
+ workDays?: TemporalCalendar['workDays'];
30
32
  }): ComparisonWindowPlacementResult;
@@ -1,4 +1,4 @@
1
- export { allowsRelativeDate, relativeDateConditionValues, relativeDateEdge, explainRelativeDateInput, readRelativeDate, type DateUnit, type ReadRelativeDateOptions, type RelativeDateProblem, type RelativeDateAnchor, type RelativeDateModeShape, type RelativeDateOperator, type RelativeDateUnit, type RelativeDateWindow, type RelativeDateWindowInput, type RelativeMonthDayWindowInput, type RelativePeriodsWindowInput, type RelativeRollingWindowInput, type StoredRelativeDate, type SubDayDateUnit, } from './window.js';
1
+ export { allowsRelativeDate, relativeDateConditionValues, relativeDateEdge, explainRelativeDateInput, readRelativeDate, type DateUnit, type ReadRelativeDateOptions, type RelativeDateProblem, type RelativeDateAnchor, type RelativeDateModeShape, type RelativeDateOperator, type RelativeDateUnit, type RelativeDateWindow, type RelativeDateWindowInput, type RelativeMonthDayWindowInput, type RelativePreviousWorkDayWindowInput, type RelativePeriodsWindowInput, type RelativeRollingWindowInput, type StoredRelativeDate, type SubDayDateUnit, } from './window.js';
2
2
  export { RelativeDateUsageError, resolveRelativeDate, type RelativeDateInstants, type RelativeDateResolveOptions, type ResolvedRelativeDate, } from './resolve.js';
3
3
  export { describeRelativeDate, relativeDatesEqual, type RelativeDateDescription, } from './describe.js';
4
4
  export { relativeDateTraits, type RelativeDateTraits } from './traits.js';
@@ -1,6 +1,6 @@
1
1
  import { RelativeDateWindow } from './window.js';
2
2
  export type RelativeDatePresetCategory = 'time' | 'day' | 'week' | 'month' | 'quarter' | 'year';
3
- export type RelativeDatePresetId = 'last_30_minutes' | 'last_1_hour' | 'last_4_hours' | 'last_12_hours' | 'last_24_hours' | 'today' | 'yesterday' | 'first_day_of_month' | 'last_day_of_month' | 'last_7_days' | 'last_30_days' | 'last_90_days' | 'this_week' | 'last_week' | 'last_2_weeks' | 'this_month' | 'last_month' | 'last_3_months' | 'last_6_months' | 'last_9_months' | 'last_12_months' | 'this_quarter' | 'last_quarter' | 'last_4_quarters' | 'this_year' | 'last_year' | 'year_to_last_completed_month';
3
+ export type RelativeDatePresetId = 'last_30_minutes' | 'last_1_hour' | 'last_4_hours' | 'last_12_hours' | 'last_24_hours' | 'today' | 'yesterday' | 'previous_business_day' | 'first_day_of_month' | 'last_day_of_month' | 'last_7_days' | 'last_30_days' | 'last_90_days' | 'this_week' | 'last_week' | 'last_2_weeks' | 'this_month' | 'last_month' | 'last_3_months' | 'last_6_months' | 'last_9_months' | 'last_12_months' | 'this_quarter' | 'last_quarter' | 'last_4_quarters' | 'this_year' | 'last_year' | 'year_to_last_completed_month';
4
4
  export type RelativeDatePreset = {
5
5
  id: RelativeDatePresetId;
6
6
  label: string;
@@ -7,7 +7,7 @@ export type ResolvedRelativeDate = {
7
7
  };
8
8
  /** What resolution needs besides the window. */
9
9
  export type RelativeDateInstants = {
10
- /** The report calendar: time zone, week start, fiscal year. */
10
+ /** The report calendar: time zone, week start, fiscal year, working days. */
11
11
  calendar: TemporalCalendar;
12
12
  /** The run instant: the clock, or a pinned instant for reproducible runs. */
13
13
  now: Date;
@@ -37,7 +37,9 @@ export declare class RelativeDateUsageError extends Error {
37
37
  * the anchor itself;
38
38
  * - `rolling`: back from the anchor by `n` units (minutes and hours count
39
39
  * elapsed time; days and longer, the same wall-clock time `n` units earlier);
40
- * - `monthDay`: the first or last day of the month containing `now`.
40
+ * - `monthDay`: the first or last day of the month containing `now`;
41
+ * - `previousWorkDay`: the latest day before the one containing `now` whose
42
+ * weekday the calendar works (BD-D2); a run on a day off still looks back.
41
43
  * The anchor is `now`; the data anchor for a window anchored at the latest
42
44
  * data, when the caller passes one; or the last millisecond before the
43
45
  * `lastComplete` period containing `now`. Weeks start on the calendar's week
@@ -71,6 +71,13 @@ export declare const relativeDateWindowShapes: {
71
71
  day: "last" | "first";
72
72
  kind: "monthDay";
73
73
  }>;
74
+ readonly previousWorkDay: z.ZodObject<{
75
+ kind: z.ZodLiteral<"previousWorkDay">;
76
+ }, "strict", z.ZodTypeAny, {
77
+ kind: "previousWorkDay";
78
+ }, {
79
+ kind: "previousWorkDay";
80
+ }>;
74
81
  };
75
82
  /** Canonical window inputs only, strict, with the authoring limits. */
76
83
  export declare const relativeDateWindowSchema: z.ZodType<RelativeDateWindow, z.ZodTypeDef, RelativeDateWindowInput>;
@@ -13,7 +13,8 @@ export type RelativeDateTraits = {
13
13
  };
14
14
  /**
15
15
  * Its previous-period comparison comes from `resolveRelativeDate(..., { spansBack })`
16
- * (SPEC 3.3): anchored at the end of the last complete period.
16
+ * (SPEC 3.3): anchored at the end of the last complete period, or the
17
+ * previous business day, whose span back is the working day before it (BD-D6).
17
18
  */
18
19
  comparesBySpan: boolean;
19
20
  /**
@@ -35,8 +35,16 @@ export type RelativeMonthDayWindowInput = {
35
35
  kind: 'monthDay';
36
36
  day: 'first' | 'last';
37
37
  };
38
+ /**
39
+ * The latest day before the one containing the run instant whose weekday the
40
+ * calendar works (previous business day plan, BD-D2, BD-D4). No fields: the
41
+ * working days are the calendar's.
42
+ */
43
+ export type RelativePreviousWorkDayWindowInput = {
44
+ kind: 'previousWorkDay';
45
+ };
38
46
  /** A window as a writer builds it, or as it is stored. Not yet checked. */
39
- export type RelativeDateWindowInput = RelativePeriodsWindowInput | RelativeRollingWindowInput | RelativeMonthDayWindowInput;
47
+ export type RelativeDateWindowInput = RelativePeriodsWindowInput | RelativeRollingWindowInput | RelativeMonthDayWindowInput | RelativePreviousWorkDayWindowInput;
40
48
  declare const checked: unique symbol;
41
49
  /**
42
50
  * A window that passed `readRelativeDate`: valid and canonical. The brand is
@@ -0,0 +1,11 @@
1
+ import { DataSource, SelectedEntities } from '../../../lib/types/explorer-types.js';
2
+ type SelectionMode = DataSource['mode'];
3
+ /** The mode a selection reads in: datasets are semantic, files and URLs their own, tables a database's. */
4
+ export declare function selectionDataSourceMode(entities: SelectedEntities | undefined): SelectionMode | undefined;
5
+ /**
6
+ * `current` with `entities` chosen: the mode they read in, the first one's
7
+ * connection, and the one domain the datasets name (else the current one). An
8
+ * empty choice clears the entities and keeps the current mode.
9
+ */
10
+ export declare function dataSourceForSelection(current: DataSource | undefined, entities: SelectedEntities): DataSource;
11
+ export {};
@@ -5,3 +5,4 @@ export * from './card-joins.js';
5
5
  export * from './card-prune.js';
6
6
  export * from './filter-field-folders.js';
7
7
  export * from './filter-field-catalog.js';
8
+ export * from './data-source-selection.js';
@@ -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
  /**
@@ -4832,6 +4832,8 @@ export declare const dashboardChangeSchema: z.ZodDiscriminatedUnion<"op", [z.Zod
4832
4832
  }>>;
4833
4833
  customVisual: z.ZodOptional<z.ZodTypeAny>;
4834
4834
  columns: z.ZodOptional<z.ZodTypeAny>;
4835
+ /** Moves the card's tile, with its tabs, to the end of this sheet (card copy and move CM-D1). */
4836
+ sheetId: z.ZodOptional<z.ZodString>;
4835
4837
  }, "strict", z.ZodTypeAny, {
4836
4838
  cardId: string;
4837
4839
  op: "card.update";
@@ -5085,6 +5087,7 @@ export declare const dashboardChangeSchema: z.ZodDiscriminatedUnion<"op", [z.Zod
5085
5087
  } | undefined;
5086
5088
  })[] | null | undefined;
5087
5089
  } | undefined;
5090
+ sheetId?: string | undefined;
5088
5091
  }, {
5089
5092
  cardId: string;
5090
5093
  op: "card.update";
@@ -5111,6 +5114,19 @@ export declare const dashboardChangeSchema: z.ZodDiscriminatedUnion<"op", [z.Zod
5111
5114
  title?: string | undefined;
5112
5115
  customVisual?: any;
5113
5116
  query?: unknown;
5117
+ sheetId?: string | undefined;
5118
+ }>, z.ZodObject<{
5119
+ op: z.ZodLiteral<"card.copy">;
5120
+ cardId: z.ZodString;
5121
+ sheetId: z.ZodOptional<z.ZodString>;
5122
+ }, "strict", z.ZodTypeAny, {
5123
+ cardId: string;
5124
+ op: "card.copy";
5125
+ sheetId?: string | undefined;
5126
+ }, {
5127
+ cardId: string;
5128
+ op: "card.copy";
5129
+ sheetId?: string | undefined;
5114
5130
  }>, z.ZodObject<{
5115
5131
  op: z.ZodLiteral<"card.remove">;
5116
5132
  cardId: z.ZodString;
@@ -13,6 +13,16 @@ export type HostFilterValue = TFilterValue | {
13
13
  readonly filterId: string;
14
14
  readonly values: string[] | number[];
15
15
  };
16
+ /**
17
+ * A picked relative date at the report calendar now in effect: its values
18
+ * become that calendar's window, by the rule hydration uses, so the picker
19
+ * and the PDF filter line show the day the query runs after a calendar
20
+ * preference changes (previous business day review R-11). Anything else is
21
+ * returned as it is.
22
+ */
23
+ export declare function relativeDateValueAt(filterValue: TFilterValue, calendar: CalendarContext | null | undefined): TFilterValue;
24
+ /** `relativeDateValueAt` over every set filter slot in every scope; changes the values in place (an Immer draft). */
25
+ export declare function refreshRelativeDateInputValues(inputValues: DashboardInputValues, calendar: CalendarContext | null | undefined): void;
16
26
  /**
17
27
  * A host value as a filter value of this definition (today's hydration rule).
18
28
  * The short embed form names no operation: it takes the filter's own, so the
@@ -0,0 +1,29 @@
1
+ import { TCard, TDashboard, TFrame, TSheet } from '../../lib/types/common-types.js';
2
+ export type FrameCardLocation = {
3
+ sheetIndex: number;
4
+ frameIndex: number;
5
+ cardIndex: number;
6
+ sheet: TSheet;
7
+ frame: TFrame;
8
+ card: TCard;
9
+ };
10
+ /**
11
+ * A card in a frame on a grid sheet, with its tile and sheet. Document-section
12
+ * cards are not frame cards. The one card locator for dashboard operations,
13
+ * MCP changes and card copy and move.
14
+ */
15
+ export declare function locateFrameCard(dashboard: Pick<TDashboard, 'sheets'>, cardId: string): FrameCardLocation | undefined;
16
+ /**
17
+ * A frame without one of its cards, as closing a tab leaves it: the first
18
+ * remaining card becomes active, whichever was active before. Closing the
19
+ * editor's open tab and MCP dashboard editing's `card.remove` both take it
20
+ * from here (ledger R-28), so the two can't drift apart. Closing another tab
21
+ * in the editor keeps the open tab (editor modes across tabs EM-8).
22
+ */
23
+ export declare function withoutFrameCard<F extends Pick<TFrame, 'cards' | 'activeCardId'>>(frame: F, cardId: string): F;
24
+ /**
25
+ * A frame's card ids as its tabs read: the shown card first, then the rest
26
+ * in their order. The outline prints a tile this way, and `layout.tabs` sent
27
+ * back in this order changes nothing (building a report BR-INV-2).
28
+ */
29
+ export declare function frameCardIdsShownFirst(frame: Pick<TFrame, 'cards' | 'activeCardId'>): string[];
@@ -1,6 +1,7 @@
1
1
  import { Immer } from 'immer';
2
2
  import { TCard, TDashboard, TFrame, TSheet } from '../../../lib/types/common-types.js';
3
3
  import { SheetLayoutChange } from '../../layouts/index.js';
4
+ import { FrameCardLocation } from '../frame-cards.js';
4
5
  import { SentenceClause } from './operation-sentences.js';
5
6
  import { CardUpdate, CreatedEntity, DashboardOperation, DashboardRuntimeEffect, OperationFailureCode } from './operation-types.js';
6
7
  /**
@@ -32,21 +33,23 @@ export type OperationOutcome = {
32
33
  */
33
34
  detached?: boolean;
34
35
  };
35
- export type FrameCardLocation = {
36
- sheetIndex: number;
37
- frameIndex: number;
38
- cardIndex: number;
39
- sheet: TSheet;
40
- frame: TFrame;
41
- card: TCard;
42
- };
43
- /** A card in a frame on a grid sheet. Document-section cards are not frame cards. */
44
- export declare function locateFrameCard(dashboard: TDashboard, cardId: string): FrameCardLocation | undefined;
36
+ export { locateFrameCard, type FrameCardLocation } from '../frame-cards.js';
45
37
  export declare const sheetName: (sheet: TSheet | undefined) => string;
46
38
  export declare function requireCard(dashboard: TDashboard, cardId: string): FrameCardLocation;
47
39
  export declare function addCard(dashboard: TDashboard, operation: Extract<DashboardOperation, {
48
40
  op: 'card.add';
49
41
  }>): OperationOutcome;
42
+ /**
43
+ * The tile holding the card, with every tab, to another dashboard sheet (card
44
+ * copy and move CM-D1). Its ids stay, so filter mappings, pinned filters,
45
+ * defaults and click to filter settings that name its cards still do; a click
46
+ * filters cards on its own sheet only, so links to cards it left stop applying
47
+ * until it comes back. It leaves its sheet's layout as Delete does and lands
48
+ * by `sheetCopyPlacement` (CM-D2).
49
+ */
50
+ export declare function moveCard(dashboard: TDashboard, operation: Extract<DashboardOperation, {
51
+ op: 'card.move';
52
+ }>): OperationOutcome;
50
53
  /** What an added card shows: a query card's query, a text card's first words (building a report SPEC §4.2). */
51
54
  export declare function describeAdded(card: TCard, dashboard: TDashboard): string | undefined;
52
55
  /**
@@ -31,6 +31,24 @@ export declare const clauses: {
31
31
  added(title: string | undefined, typeName: string, sheet: string, detail?: string, place?: string): SentenceClause;
32
32
  /** Arrange (responsive layouts SPEC §6.5). */
33
33
  arranged(sheet: string, keepOrder: boolean, empty: boolean): SentenceClause;
34
+ /**
35
+ * A tile moved to another sheet (card copy and move CM-D1): its other tabs
36
+ * by name, and the dashboard filters that stop reaching it there (CM-D4).
37
+ */
38
+ moved(title: string | undefined, input: {
39
+ tabs: readonly string[];
40
+ from: string;
41
+ to: string;
42
+ filtersNotReaching: readonly string[];
43
+ }): SentenceClause;
44
+ /** A tile copied: beside the card on its own sheet, as Duplicate; else to the end of another sheet (CM-D1, CM-D2). */
45
+ copied(title: string | undefined, input: {
46
+ tabs: readonly string[];
47
+ sheet: string;
48
+ sameSheet: boolean;
49
+ copyTitle: string | undefined;
50
+ filtersNotReaching: readonly string[];
51
+ }): SentenceClause;
34
52
  removed(title: string | undefined, sheet: string): SentenceClause;
35
53
  renamed(previous: string | undefined, next: string): SentenceClause;
36
54
  described(title: string | undefined, removed: boolean): SentenceClause;
@@ -102,10 +102,23 @@ export type DashboardOperation = ({
102
102
  frame: TFrame;
103
103
  /** By intent; absent: placed by kind (responsive layouts SPEC §4.2). */
104
104
  placement?: FramePlacement;
105
+ /** The card this frame copies (Duplicate, Copy to sheet, card.copy): its sentence says "copies" (card copy and move CM-D1). */
106
+ copiedFrom?: string;
105
107
  } | {
106
108
  op: 'card.update';
107
109
  cardId: string;
108
110
  update: CardUpdate;
111
+ }
112
+ /**
113
+ * The tile holding the card, every tab with it, to another dashboard sheet
114
+ * (card copy and move CM-D1). Its ids, links and filter settings stay; it
115
+ * lands by `placement`, else at the end at its width (`sheetCopyPlacement`).
116
+ */
117
+ | {
118
+ op: 'card.move';
119
+ cardId: string;
120
+ sheetId: string;
121
+ placement?: FramePlacement;
109
122
  } | {
110
123
  op: 'card.remove';
111
124
  cardId: string;
@@ -290,7 +303,9 @@ export type OperationFailureCode = 'sheet_not_found'
290
303
  /** A document sheet places cards through its document, not its grid. */
291
304
  | 'sheet_not_a_grid'
292
305
  /** A Table sheet would break its one-card shape (table sheets SH-1..SH-4, `checkSheetShapes`). */
293
- | SheetShapeIssueCode | 'frame_id_taken' | 'frame_not_found' | 'card_not_found' | 'filter_not_found' | 'filter_id_taken'
306
+ | SheetShapeIssueCode | 'frame_id_taken' | 'frame_not_found' | 'card_not_found'
307
+ /** card.move to the sheet the card is on (card copy and move CM-D1). */
308
+ | 'card_already_on_sheet' | 'filter_not_found' | 'filter_id_taken'
294
309
  /** The filter settings or mapping fail the input contract; `details.issues` has the core's issues. */
295
310
  | 'filter_invalid'
296
311
  /** A requery part compiled for another type than the card's. */
@@ -10,7 +10,7 @@ import { CardSettingsView } from '../card-settings/views.js';
10
10
  import { NotEditableReason, OutlineCardSource } from '../changes/read-card-query.js';
11
11
  import { CardQuery, MatrixColumns } from '../changes/dashboard-change.js';
12
12
  import { OutlineFilter, OutlinePinnedFilter } from './outline-filters.js';
13
- import { CalendarContext } from '../../report-runtime-context/index.js';
13
+ import { CalendarContext, WorkDays } from '../../report-runtime-context/index.js';
14
14
  import { AgentTimeWindowRefusal } from '../../analytics-protocol/agent-time-window.js';
15
15
  import { AppearanceSpec } from '../../../lib/appearance/types.js';
16
16
  import { DashboardStyleEdit, DashboardStyleReading } from '../dashboard-style/index.js';
@@ -194,6 +194,10 @@ export type OutlineCalculatedField = {
194
194
  /** Card ids and dashboard filter ids whose columns copy it. */
195
195
  usedBy: string[];
196
196
  };
197
+ /** The report calendar as the outline reads it back (BD-D10). */
198
+ export type OutlineCalendar = Pick<CalendarContext, 'tz' | 'weekStart'> & {
199
+ workDays: WorkDays;
200
+ };
197
201
  export type DashboardOutline = {
198
202
  dashboardId: string;
199
203
  title: string;
@@ -215,6 +219,13 @@ export type DashboardOutline = {
215
219
  variables: OutlineVariable[];
216
220
  /** What `dashboard.style` sets, read back in its words, and what the dashboard shows. */
217
221
  style: OutlineStyle;
222
+ /**
223
+ * The report calendar dates are read in, when the viewer has one: its time
224
+ * zone, first day of the week and working days, so an agent can say which
225
+ * day Previous business day picks (previous business day plan, BD-D10). A
226
+ * person's or an admin's setting: no change sets it.
227
+ */
228
+ calendar?: OutlineCalendar;
218
229
  /** The dashboard's own calculated fields, in the words `calculation.add` takes (calculated fields one core MC-INV-3). */
219
230
  calculatedFields?: OutlineCalculatedField[];
220
231
  /** In the editor's words: what the dashboard holds that no change can state (the parity backlog, DV-D13). */
@@ -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;