react-semaphor 0.1.610 → 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 (108) 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-BqdXuU42.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-BAYpeKb-.js → bookmark-impact-DnhE262D.js} +1 -1
  10. package/dist/chunks/{bookmark-state-B3lDH0E_.js → bookmark-state-CrJDZi3y.js} +1 -1
  11. package/dist/chunks/{brand-9AazkIHH.js → brand-BjIkbHgw.js} +1 -1
  12. package/dist/chunks/{card-filter-builder-CpSD-8yA.js → card-filter-builder-9xCSYFNv.js} +2 -2
  13. package/dist/chunks/{check-input-D36evEN2.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-obG5lDlW.js → custom-visual-inputs-C2BRX8l_.js} +1 -1
  17. package/dist/chunks/{custom-visual-write-fOcTV3dl.js → custom-visual-write-CYA-Y9YF.js} +1 -1
  18. package/dist/chunks/{dashboard-BVYXrYaU.js → dashboard-DEsWObFS.js} +1 -1
  19. package/dist/chunks/{dashboard-briefing-launcher-CVjONGRj.js → dashboard-briefing-launcher-PzvxJm1T.js} +7 -7
  20. package/dist/chunks/{dashboard-controls-Cca_ra4d.js → dashboard-controls-DPVMjbpG.js} +2 -2
  21. package/dist/chunks/{dashboard-json-CUHyo-if.js → dashboard-json-CWJ6drfv.js} +1 -1
  22. package/dist/chunks/{dashboard-temporal-snapshot-DyRl61Yv.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-DSVBCJDV.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-BhmZiuD8.js → metric-formatting-BF1b9EEC.js} +1 -1
  33. package/dist/chunks/numeric-range-options-B_EcRH8C.js +1 -0
  34. package/dist/chunks/{palette-Bg_6xero.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-BnadJPB9.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-DD5nxK4N.js → slider-BuDy7URL.js} +1 -1
  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-C8xXjy0M.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/components/surfboard/index.d.ts +1 -0
  62. package/dist/types/components/surfboard/preferences/work-day-toggles.d.ts +16 -0
  63. package/dist/types/components/ui-custom/date-range-presets.d.ts +4 -1
  64. package/dist/types/index.js +1 -1
  65. package/dist/types/lib/stores/dashboard-store.d.ts +2 -0
  66. package/dist/types/shared/analytics-protocol/comparison-choices.d.ts +7 -0
  67. package/dist/types/shared/analytics-protocol/comparison-placement.d.ts +2 -0
  68. package/dist/types/shared/analytics-protocol/relative-date/index.d.ts +1 -1
  69. package/dist/types/shared/analytics-protocol/relative-date/presets.d.ts +1 -1
  70. package/dist/types/shared/analytics-protocol/relative-date/resolve.d.ts +4 -2
  71. package/dist/types/shared/analytics-protocol/relative-date/schemas.d.ts +7 -0
  72. package/dist/types/shared/analytics-protocol/relative-date/traits.d.ts +2 -1
  73. package/dist/types/shared/analytics-protocol/relative-date/window.d.ts +9 -1
  74. package/dist/types/shared/dashboard-authoring/card-data-source/data-source-selection.d.ts +11 -0
  75. package/dist/types/shared/dashboard-authoring/card-data-source/index.d.ts +1 -0
  76. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +16 -0
  77. package/dist/types/shared/dashboard-authoring/filter-model/filter-values.d.ts +10 -0
  78. package/dist/types/shared/dashboard-authoring/frame-cards.d.ts +29 -0
  79. package/dist/types/shared/dashboard-authoring/operations/card-operations.d.ts +13 -10
  80. package/dist/types/shared/dashboard-authoring/operations/operation-sentences.d.ts +18 -0
  81. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +16 -1
  82. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +12 -1
  83. package/dist/types/shared/dashboard-authoring/table-sheet-shape.d.ts +53 -3
  84. package/dist/types/shared/dashboard-viewer/table-column-move.d.ts +7 -0
  85. package/dist/types/shared/extensions/saved-refs.d.ts +1 -15
  86. package/dist/types/shared/report-runtime-context/index.d.ts +1 -0
  87. package/dist/types/shared/report-runtime-context/report-runtime-context.d.ts +22 -1
  88. package/dist/types/shared/report-runtime-context/work-days.d.ts +31 -0
  89. package/dist/types/shared/temporal/calendar-periods.d.ts +1 -1
  90. package/package.json +1 -1
  91. package/dist/chunks/appearance-provider-CxsEFvNA.js +0 -703
  92. package/dist/chunks/currency-presentation-binding-CUh82q48.js +0 -1
  93. package/dist/chunks/dates-Cym78NYg.js +0 -1
  94. package/dist/chunks/edit-dashboard-visual-DRLguKmV.js +0 -103
  95. package/dist/chunks/filter-reach-preview-IFwTq7Hh.js +0 -1
  96. package/dist/chunks/layout-grid-Ctnv2-au.js +0 -6
  97. package/dist/chunks/matrix-analytical-definition-jn075ooo.js +0 -1
  98. package/dist/chunks/matrix-operation-contract-DceN49RX.js +0 -1
  99. package/dist/chunks/numeric-range-options-Drc1EZ6H.js +0 -1
  100. package/dist/chunks/pivot-result-contract-expectations-D_ane7I2.js +0 -1
  101. package/dist/chunks/report-preferences-dialog-DQNwImoN.js +0 -1
  102. package/dist/chunks/report-runtime-context-CkxgMKr6.js +0 -1
  103. package/dist/chunks/resolve-dashboard-input-context-Djm2WgEF.js +0 -8
  104. package/dist/chunks/saved-dashboard-context-EwdvXIE6.js +0 -1
  105. package/dist/chunks/semaphor-ready-indicator-BJR23T8j.js +0 -532
  106. package/dist/chunks/stored-dashboard--6xPxYpX.js +0 -1
  107. package/dist/chunks/table-cell-text-C5J5E_Am.js +0 -1
  108. package/dist/chunks/validators-U8IL8djK.js +0 -1
@@ -1 +1 @@
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};
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};
@@ -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
@@ -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-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
+ 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). */
@@ -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';
@@ -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). */
@@ -1,6 +1,9 @@
1
1
  import { TCard } from '../../lib/types/common-types.js';
2
2
  import { Field, GroupByField, PivotByField, AggregateFunction } from '../../lib/types/explorer-types.js';
3
+ import { FieldPlacementOutcome } from '../../lib/utils/field-placement.js';
3
4
  import { FieldAvailabilityContext } from '../../lib/utils/field-availability-context.js';
5
+ import { TableColumnId } from '../dashboard-viewer/table-settings.js';
6
+ import { CardColumnRef } from './conditional-formatting/types.js';
4
7
  /**
5
8
  * A Table sheet's table as a shape (table sheets TS-D30): every row, one row
6
9
  * per group (Flat) or levels that open and close (Collapsible). The author
@@ -71,8 +74,9 @@ export declare function unspreadAcross(card: TCard, across: ColumnRef, ctx: Shap
71
74
  * Columns pane's grip. A Collapsible table moves the Matrix level as its Axis
72
75
  * menu does (`moveMatrixLevel`); a Flat one reorders its Group by or pivot
73
76
  * fields. Nothing else changes, so a level keeps its grain, sort and label.
77
+ * Values move among the values (`reorderValues`), whatever the table's shape.
74
78
  */
75
- export declare function reorderShape(card: TCard, lane: 'levels' | 'across', ref: ColumnRef, before: ColumnRef | undefined, ctx: ShapeContext): ShapeChange;
79
+ export declare function reorderShape(card: TCard, lane: 'levels' | 'across' | 'values', ref: ColumnRef, before: ColumnRef | undefined, ctx: ShapeContext): ShapeChange;
76
80
  /**
77
81
  * Show a summary Flat (one row per group, paged by row) or Collapsible
78
82
  * (levels, paged by level); Collapsible needs a level.
@@ -92,15 +96,43 @@ export type ShapeMeasure = {
92
96
  label: string;
93
97
  aggregate?: string;
94
98
  dataType?: string;
99
+ /** What a highlight rule on it points at: a Flat table's field, a Collapsible table's Matrix measure. */
100
+ columnRef: CardColumnRef;
101
+ /** A Flat table's column (its visibility and pin live there); none on a Collapsible table. */
102
+ columnId?: TableColumnId;
103
+ pinned?: boolean;
95
104
  };
96
- /** The table's measures as the sheet lists them, whatever card type holds them. */
97
- export declare function readMeasures(card: TCard): ShapeMeasure[];
105
+ /**
106
+ * The table's values as the sheet lists them, whatever card type holds them,
107
+ * in the order the table draws them: a Collapsible table's Matrix order, a
108
+ * Flat table's drawn column order (`drawnTableColumnOrder`: the stored order
109
+ * over its fields, pinned first). A Collapsible value is named as the Matrix
110
+ * names it (an author's rename included) and, with the catalog, names its
111
+ * dataset (the Matrix resolver), so two datasets' fields of one name stay two
112
+ * values. A calculated value has no aggregate of its own.
113
+ */
114
+ export declare function readMeasures(card: TCard, catalog?: readonly Field[]): ShapeMeasure[];
115
+ /**
116
+ * Where a value moved to the gap before `to` (`values.length` for last) lands
117
+ * among its own pin group: after the group neighbour just before the gap, or
118
+ * before the one just after it. Undefined when the gap is outside the group, so
119
+ * the move draws nothing different. The Values lane's mark asks the same.
120
+ */
121
+ export declare function valueAnchor(values: readonly Pick<ShapeMeasure, 'ref' | 'pinned'>[], from: number, to: number): {
122
+ side: "after";
123
+ value: Pick<ShapeMeasure, "pinned" | "ref">;
124
+ } | {
125
+ side: "before";
126
+ value: Pick<ShapeMeasure, "pinned" | "ref">;
127
+ } | undefined;
98
128
  /** A level or a spread field as the sheet lists it: how to name it, and how to remove it. */
99
129
  export type ShapeItem = {
100
130
  readonly ref: ColumnRef;
101
131
  readonly label: string;
102
132
  readonly grain?: string;
103
133
  readonly dataType?: string;
134
+ /** A Flat level's column (its visibility lives there). */
135
+ readonly columnId?: TableColumnId;
104
136
  };
105
137
  /** The table's levels (rows) and spread fields (across), whatever card type holds them. */
106
138
  export declare function readShape(card: TCard,
@@ -110,6 +142,8 @@ catalog?: readonly Field[]): {
110
142
  levels: ShapeItem[];
111
143
  across: ShapeItem[];
112
144
  };
145
+ /** The columns of a table that shows every row, as the sheet lists them (its bar counts them, its pane marks them). */
146
+ export declare function readColumns(card: TCard): ShapeItem[];
113
147
  /** A column's field by its id: a column showing every row, a level, a spread field or a measure. */
114
148
  export declare function shapeField(card: TCard, id: string | undefined): Field | undefined;
115
149
  /** The grains a date groups or spreads at on a Table sheet: never by day (TS-D33). */
@@ -146,3 +180,19 @@ export declare function matrixColumnField(card: TCard, id: string): {
146
180
  } | undefined;
147
181
  /** A new Table sheet's table: every row, nothing placed yet (TS-D36). */
148
182
  export declare function everyRowCard(card: TCard): TCard;
183
+ /**
184
+ * Clear fields on a Table sheet (TS-D44): the table back to how a new sheet's
185
+ * starts (`everyRowCard`), whatever its shape was. A Collapsible table leaves
186
+ * its Matrix through the type change first (`asFlat`), so the filters and
187
+ * joins it keeps inside the Matrix stay the table's; then the editor's shelf
188
+ * reset (`clearedCardShelves`) empties every placement and the total row goes
189
+ * off (`writeTableTotals`), as a new sheet's is. Its data, joins and filters stay.
190
+ */
191
+ export declare function clearTableSheet(card: TCard, ctx: ShapeContext): ShapeChange;
192
+ /**
193
+ * The new value a placement would add, by name: the editor's own dry run of
194
+ * the drop (`previewFieldPlacement`, every naming step included: its
195
+ * aggregate, a repeat, a related dataset's folder) read through `readMeasures`
196
+ * on the card it would make. The bar's drop preview shows exactly this.
197
+ */
198
+ export declare function addedValueLabel(card: TCard, outcome: FieldPlacementOutcome | undefined): string | undefined;
@@ -20,6 +20,13 @@ import { TableColumnId } from './table-settings.js';
20
20
  * with it and the writer normalizes a stored order with it.
21
21
  */
22
22
  export declare function arrangeByOrder<T>(items: readonly T[], idOf: (item: T) => TableColumnId | undefined, order: readonly TableColumnId[]): T[];
23
+ /**
24
+ * Whether a column can be held at the table's left edge (PIN-2): any column,
25
+ * but in a pivoted table only a row dimension (a measure repeats per pivot
26
+ * value, so it can't be pinned). The table view and a Table sheet's Values
27
+ * lane read pins through this one rule.
28
+ */
29
+ export declare function canPinTableColumn(columnId: TableColumnId, pivoted: boolean): boolean;
23
30
  /** True when no dimension follows a measure in a pivoted table; always true without pivots. */
24
31
  export declare function orderKeepsPivotRule(order: readonly TableColumnId[], pivoted: boolean): boolean;
25
32
  /**
@@ -1,4 +1,4 @@
1
- import { TCard, TDashboard } from '../../lib/types/common-types.js';
1
+ import { TDashboard } from '../../lib/types/common-types.js';
2
2
  /** What a save made of one card's draft (EXT-D3): the version it now names. */
3
3
  export type SavedCustomVisual = {
4
4
  cardId: string;
@@ -17,17 +17,3 @@ export declare function withSavedCustomVisuals<T extends Pick<TDashboard, 'sheet
17
17
  saved: readonly SavedCustomVisual[];
18
18
  sent?: Pick<TDashboard, 'sheets'>;
19
19
  }): T;
20
- /**
21
- * A frame as Copy puts it on the clipboard (review P5A-03): each saved
22
- * visual becomes a draft of its HTML, and an unsaved edit keeps its draft
23
- * without the visual it edits, each keeping its slots and settings, so the
24
- * paste works on any dashboard. There it is that dashboard's own new visual,
25
- * saved and checked like any new code (CV2-D10: a visual belongs to one
26
- * dashboard). `load` reads a version's HTML; a failure is the caller's.
27
- */
28
- export declare function withCustomVisualDrafts<F extends {
29
- cards: TCard[];
30
- }>(frame: F, load: (ref: {
31
- extensionId: string;
32
- version: number;
33
- }) => Promise<string>): Promise<F>;
@@ -1,2 +1,3 @@
1
1
  export * from './calendar-validation.js';
2
2
  export * from './report-runtime-context.js';
3
+ export * from './work-days.js';
@@ -1,4 +1,5 @@
1
1
  import { ReportPreferenceSource, ResolvedValueFormatPreferenceSources, ResolvedValueFormatPreferences } from '../value-format-preferences/index.js';
2
+ import { WorkDays } from './work-days.js';
2
3
  export type WeekStart = 0 | 1 | 2 | 3 | 4 | 5 | 6;
3
4
  export type MonthAlignedFiscalCalendar = {
4
5
  kind: 'month_aligned';
@@ -11,19 +12,33 @@ export type CalendarContext = {
11
12
  iso: string;
12
13
  };
13
14
  fiscalCalendar?: MonthAlignedFiscalCalendar;
15
+ /** Absent reads as `DEFAULT_WORK_DAYS`; read it with `calendarWorkDays`. */
16
+ workDays?: WorkDays;
14
17
  };
15
18
  export declare const DEFAULT_CALENDAR_CONTEXT: CalendarContext;
19
+ /**
20
+ * The instant a report calendar's relative dates are measured from: its
21
+ * pinned anchor, else the clock. The one reading of `anchor` in the browser,
22
+ * so a preview, a quick choice and a drill resolve the day the server does.
23
+ */
24
+ export declare function calendarNow(calendar: {
25
+ anchor?: CalendarContext['anchor'];
26
+ } | null | undefined): Date;
16
27
  export type CalendarPreferences = {
17
28
  tz?: string;
18
29
  weekStart?: WeekStart;
30
+ /** The days the business works (previous business day plan, BD-D5, BD-D8). */
31
+ workDays?: WorkDays;
19
32
  };
20
33
  export type ResolvedCalendarPreferences = {
21
34
  tz: string;
22
35
  weekStart: WeekStart;
36
+ workDays: WorkDays;
23
37
  };
24
38
  export type ResolvedCalendarPreferenceSources = {
25
39
  tz: ReportPreferenceSource;
26
40
  weekStart: ReportPreferenceSource;
41
+ workDays: ReportPreferenceSource;
27
42
  };
28
43
  export type CalendarPreferencesResponse = {
29
44
  stored: CalendarPreferences | null;
@@ -43,7 +58,7 @@ export type ReportRuntimeContext = {
43
58
  };
44
59
  export type ReportRuntimeContextValidationIssue = {
45
60
  path: string;
46
- code: 'invalid_type' | 'unknown_property' | 'invalid_timezone' | 'invalid_week_start' | 'invalid_anchor' | 'invalid_fiscal_calendar' | 'invalid_value_format' | 'invalid_preference_source';
61
+ code: 'invalid_type' | 'unknown_property' | 'invalid_timezone' | 'invalid_week_start' | 'invalid_work_days' | 'invalid_anchor' | 'invalid_fiscal_calendar' | 'invalid_value_format' | 'invalid_preference_source';
47
62
  message: string;
48
63
  };
49
64
  export type ReportRuntimeContextParseResult<T> = {
@@ -53,6 +68,12 @@ export type ReportRuntimeContextParseResult<T> = {
53
68
  ok: false;
54
69
  issues: ReportRuntimeContextValidationIssue[];
55
70
  };
71
+ /**
72
+ * Working days as stored or sent (BD-D5): one to seven different weekdays,
73
+ * 0 to 6, returned sorted. An empty list, a duplicate or any other value is
74
+ * refused, never repaired.
75
+ */
76
+ export declare function parseWorkDays(input: unknown, path?: string): ReportRuntimeContextParseResult<WorkDays>;
56
77
  export declare function parseCalendarContext(input: unknown): ReportRuntimeContextParseResult<CalendarContext>;
57
78
  export declare function parseCalendarPreferencesResponse(input: unknown): ReportRuntimeContextParseResult<CalendarPreferencesResponse>;
58
79
  export declare function parseReportRuntimeContext(input: unknown): ReportRuntimeContextParseResult<ReportRuntimeContext>;