react-semaphor 0.1.516 → 0.1.517

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 (77) hide show
  1. package/dist/brand-studio/index.cjs +1 -1
  2. package/dist/brand-studio/index.js +2 -2
  3. package/dist/briefings/index.cjs +1 -1
  4. package/dist/briefings/index.js +3 -3
  5. package/dist/chunks/{calculated-field-identity-DzJBs2J8.js → calculated-field-identity-Dy_WpDdo.js} +1 -1
  6. package/dist/chunks/{card-config-utils-Cxnq2R6z.js → card-config-utils-CAyjC5Tp.js} +2 -2
  7. package/dist/chunks/{dashboard-briefing-launcher-BCEHJ_eD.js → dashboard-briefing-launcher-D5HGRwtb.js} +7 -7
  8. package/dist/chunks/{dashboard-briefing-launcher-CjZ4aE34.cjs → dashboard-briefing-launcher-RpT4b0d5.cjs} +1 -1
  9. package/dist/chunks/{dashboard-controls-DFfit5KH.js → dashboard-controls-C0Aw74JP.js} +9 -9
  10. package/dist/chunks/{dashboard-controls-f9aJ70Zu.cjs → dashboard-controls-DidqEx0U.cjs} +1 -1
  11. package/dist/chunks/{dashboard-json-DVtcA02f.js → dashboard-json-B5LLO49G.js} +5 -5
  12. package/dist/chunks/{dashboard-json-deqQC-UR.cjs → dashboard-json-rY4lTftA.cjs} +1 -1
  13. package/dist/chunks/{edit-dashboard-visual-lJ6rDH3w.js → edit-dashboard-visual-D3TrgFMg.js} +364 -361
  14. package/dist/chunks/{edit-dashboard-visual-DK6lSC_p.cjs → edit-dashboard-visual-NABO8NBr.cjs} +3 -3
  15. package/dist/chunks/{editor-action-buttons-Bnxxa439.js → editor-action-buttons-BfWg6DdZ.js} +4 -4
  16. package/dist/chunks/{editor-action-buttons-CmDaQbPN.cjs → editor-action-buttons-xQ5aj-0q.cjs} +1 -1
  17. package/dist/chunks/{field-aggregations-Dl2A3rbV.js → field-aggregations-BQjogiI1.js} +1 -1
  18. package/dist/chunks/{index-ylOpKRDu.js → index-B0KwXM6P.js} +117 -116
  19. package/dist/chunks/index-CapO5Uw9.cjs +4 -0
  20. package/dist/chunks/{index-UNKSfi7s.cjs → index-Dgv9vzT0.cjs} +230 -230
  21. package/dist/chunks/{index-BVVl2JDK.js → index-DqTelnri.js} +27499 -27198
  22. package/dist/chunks/{matrix-control-sources-KbZe1gj_.js → matrix-control-sources-B1K7x0SL.js} +2 -2
  23. package/dist/chunks/matrix-formatter-Qk8xsR05.cjs +1 -0
  24. package/dist/chunks/{matrix-formatter-CCXNRt3s.js → matrix-formatter-WBgtebUT.js} +8 -8
  25. package/dist/chunks/numeric-presentation-VhMUHfrJ.js +537 -0
  26. package/dist/chunks/numeric-presentation-mY6wJMdB.cjs +1 -0
  27. package/dist/chunks/{pivot-header-presentation-BSZhB1g-.js → pivot-header-presentation-CGtudHo7.js} +4 -4
  28. package/dist/chunks/{pivot-header-presentation-EoUS5ze5.cjs → pivot-header-presentation-DV2aBB6p.cjs} +2 -2
  29. package/dist/chunks/{pivot-result-lifecycle-kRhiJkzg.js → pivot-result-lifecycle-BFO354lk.js} +7 -7
  30. package/dist/chunks/pivot-result-lifecycle-OXAgoIYm.cjs +1 -0
  31. package/dist/chunks/raw-temporal-7bFbXd2a.js +930 -0
  32. package/dist/chunks/raw-temporal-CYdOOyR5.cjs +1 -0
  33. package/dist/chunks/{report-preferences-dialog-CHXPEl7v.js → report-preferences-dialog-BzxqfcF8.js} +3 -3
  34. package/dist/chunks/{report-preferences-dialog-Cto0vDwI.cjs → report-preferences-dialog-DLnhOXXg.cjs} +1 -1
  35. package/dist/chunks/{semantic-format-DwqGYx4V.js → semantic-format-Baqp8kD_.js} +1 -1
  36. package/dist/chunks/semantic-format-Bd7HmLG_.cjs +1 -0
  37. package/dist/chunks/{switch-DNbWXEOP.cjs → switch-C0520nRt.cjs} +24 -24
  38. package/dist/chunks/{switch-DNv-hVmt.js → switch-evlnTA4t.js} +3180 -3092
  39. package/dist/chunks/{temporal-bucket-DlFuhCnT.js → temporal-bucket-PcLFSYWX.js} +6 -6
  40. package/dist/chunks/temporal-input-presentation-2RJrvmYL.js +222 -0
  41. package/dist/chunks/temporal-input-presentation-BIOSVWCL.cjs +1 -0
  42. package/dist/dashboard/index.cjs +1 -1
  43. package/dist/dashboard/index.js +1 -1
  44. package/dist/dashboard-authoring/index.js +6 -6
  45. package/dist/data-app-builder/index.cjs +1 -1
  46. package/dist/data-app-builder/index.js +2 -2
  47. package/dist/data-app-sdk/index.cjs +1 -1
  48. package/dist/data-app-sdk/index.js +1 -1
  49. package/dist/format-utils/index.cjs +3 -3
  50. package/dist/format-utils/index.js +77 -73
  51. package/dist/index.cjs +1 -1
  52. package/dist/index.js +10 -10
  53. package/dist/style.css +1 -1
  54. package/dist/surfboard/index.cjs +1 -1
  55. package/dist/surfboard/index.js +2 -2
  56. package/dist/types/components/editor/editor-main/dashboard-variable-node.d.ts +7 -3
  57. package/dist/types/components/editor/editor-main/text-card-rich-editor.d.ts +4 -1
  58. package/dist/types/lib/charts/chart-availability.d.ts +6 -0
  59. package/dist/types/lib/dashboard-inputs/dashboard-input-display.d.ts +11 -0
  60. package/dist/types/lib/dashboard-inputs/dashboard-input-text.d.ts +2 -1
  61. package/dist/types/lib/dashboard-inputs/text-card-rich-content.d.ts +3 -2
  62. package/dist/types/lib/dashboard-inputs/text-variable-options.d.ts +5 -4
  63. package/dist/types/lib/document/document-variables.d.ts +8 -4
  64. package/dist/types/lib/text-variables/temporal-input-text.d.ts +28 -0
  65. package/dist/types/lib/text-variables/text-variable-types.d.ts +17 -1
  66. package/dist/types/lib/types/common-types.d.ts +11 -1
  67. package/dist/types/shared/format-utils/index.d.ts +1 -0
  68. package/dist/types/shared/format-utils/temporal-input-presentation.d.ts +46 -0
  69. package/package.json +1 -1
  70. package/dist/chunks/index-C8w91oj4.js +0 -328
  71. package/dist/chunks/index-Cw2ypaFl.cjs +0 -1
  72. package/dist/chunks/index-DfqMtR9S.cjs +0 -4
  73. package/dist/chunks/matrix-formatter-BJTO8ky9.cjs +0 -1
  74. package/dist/chunks/pivot-result-lifecycle-gl9cBfB-.cjs +0 -1
  75. package/dist/chunks/raw-temporal-BqOfk-xN.js +0 -1137
  76. package/dist/chunks/raw-temporal-eJXecCyJ.cjs +0 -1
  77. package/dist/chunks/semantic-format-mVI32OJH.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-UNKSfi7s.cjs"),r=require("../chunks/common-types-nBuCd3u2.cjs"),o=require("../chunks/report-preferences-dialog-Cto0vDwI.cjs");exports.DisplayFormatPreferencesFields=e.DisplayFormatPreferencesFields;exports.Surfboard=e.DashboardPlus;exports.CONTROL_CARD_DEFAULT_VALUE=r.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;exports.ReportPreferencesDialog=o.ReportPreferencesDialog;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-Dgv9vzT0.cjs"),r=require("../chunks/common-types-nBuCd3u2.cjs"),o=require("../chunks/report-preferences-dialog-DLnhOXXg.cjs");exports.DisplayFormatPreferencesFields=e.DisplayFormatPreferencesFields;exports.Surfboard=e.DashboardPlus;exports.CONTROL_CARD_DEFAULT_VALUE=r.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;exports.ReportPreferencesDialog=o.ReportPreferencesDialog;
@@ -1,6 +1,6 @@
1
- import { b as a, a as o } from "../chunks/index-BVVl2JDK.js";
1
+ import { b as a, a as o } from "../chunks/index-DqTelnri.js";
2
2
  import { C as f, E } from "../chunks/common-types-C6cAQgyh.js";
3
- import { R as t } from "../chunks/report-preferences-dialog-CHXPEl7v.js";
3
+ import { R as t } from "../chunks/report-preferences-dialog-BzxqfcF8.js";
4
4
  export {
5
5
  f as CONTROL_CARD_DEFAULT_VALUE,
6
6
  a as DisplayFormatPreferencesFields,
@@ -1,10 +1,11 @@
1
1
  import { TextNode, DOMConversionMap, DOMExportOutput, EditorConfig, LexicalNode, NodeKey, SerializedTextNode } from 'lexical';
2
- import { DashboardInputVariableRef } from '../../../lib/types/common-types.js';
2
+ import { DashboardInputVariableRef, TextVariablePresentation } from '../../../lib/types/common-types.js';
3
3
  import { TextVariableChipFace } from '../../../lib/text-variables/text-variable-types.js';
4
4
  export type SerializedDashboardVariableNode = SerializedTextNode & {
5
5
  ref: DashboardInputVariableRef;
6
6
  face?: TextVariableChipFace;
7
7
  token?: string;
8
+ presentation?: TextVariablePresentation;
8
9
  type: 'dashboard-variable';
9
10
  version: 1;
10
11
  };
@@ -13,14 +14,17 @@ export declare class DashboardVariableNode extends TextNode {
13
14
  __face: TextVariableChipFace;
14
15
  /** `name.part`, for copying the variable as a typed token. */
15
16
  __token: string;
17
+ /** How it shows its input's value (a date format); stored beside `ref`. */
18
+ __presentation: TextVariablePresentation | undefined;
16
19
  static getType(): string;
17
20
  static clone(node: DashboardVariableNode): DashboardVariableNode;
18
21
  static importJSON(serializedNode: SerializedDashboardVariableNode): DashboardVariableNode;
19
22
  static importDOM(): DOMConversionMap | null;
20
- constructor(ref: DashboardInputVariableRef, face: TextVariableChipFace, token: string, key?: NodeKey);
23
+ constructor(ref: DashboardInputVariableRef, face: TextVariableChipFace, token: string, presentation?: TextVariablePresentation, key?: NodeKey);
21
24
  getRef(): DashboardInputVariableRef;
22
25
  getFace(): TextVariableChipFace;
23
26
  getToken(): string;
27
+ getPresentation(): TextVariablePresentation | undefined;
24
28
  /** Renames the chip when its input changes (its reference stays). */
25
29
  setFace(face: TextVariableChipFace, token: string): this;
26
30
  createDOM(_config: EditorConfig): HTMLElement;
@@ -31,5 +35,5 @@ export declare class DashboardVariableNode extends TextNode {
31
35
  canInsertTextBefore(): false;
32
36
  canInsertTextAfter(): false;
33
37
  }
34
- export declare function $createDashboardVariableNode(ref: DashboardInputVariableRef, face: TextVariableChipFace, token: string): DashboardVariableNode;
38
+ export declare function $createDashboardVariableNode(ref: DashboardInputVariableRef, face: TextVariableChipFace, token: string, presentation?: TextVariablePresentation): DashboardVariableNode;
35
39
  export declare function $isDashboardVariableNode(node: LexicalNode | null | undefined): node is DashboardVariableNode;
@@ -1,10 +1,13 @@
1
1
  import { ResolvedDashboardInputContext, TextCardRichContent } from '../../../lib/types/common-types.js';
2
+ import { DashboardTextRenderContext } from '../../../lib/dashboard-inputs/dashboard-input-display.js';
3
+ /** The inputs a text visual's chips name, with the viewer's date preferences. */
4
+ type TextCardEditorInputContext = Pick<ResolvedDashboardInputContext, 'variablesById' | 'variablesByName' | 'resolvedInputs'> & Pick<DashboardTextRenderContext, 'presentation'>;
2
5
  type TextCardRichEditorProps = {
3
6
  /** Initial content. Falsy ⇒ start with a single empty paragraph. */
4
7
  content: TextCardRichContent | undefined;
5
8
  /** Dashboard input context — drives the Insert Variable popover and
6
9
  * the chip label for already-inserted variables. */
7
- dashboardInputContext?: Pick<ResolvedDashboardInputContext, 'variablesById' | 'variablesByName' | 'resolvedInputs'>;
10
+ dashboardInputContext?: TextCardEditorInputContext;
8
11
  /** Fired whenever the editor content changes (debounced upstream). */
9
12
  onChange: (content: TextCardRichContent) => void;
10
13
  /** Visual disable — useful for previews / printing. */
@@ -5,3 +5,9 @@ export declare function isChartTypeAvailableForEditorMode(chartType: TChartType
5
5
  export declare function isChartTypeAvailableForCompactPicker(chartType: TChartType | string, input: {
6
6
  isDevMode: boolean;
7
7
  }): boolean;
8
+ /**
9
+ * Chart types that switch the visual editor to SQL when picked. Text keeps
10
+ * the author's mode: static text runs no query, and dynamic text can come
11
+ * from SQL or drag and drop alike.
12
+ */
13
+ export declare function selectingChartTypeForcesSqlMode(chartType: TChartType | string): boolean;
@@ -0,0 +1,11 @@
1
+ import { DashboardInputExportKey, ResolvedDashboardInput, ResolvedDashboardInputContext, TextVariablePresentation } from '../types/common-types.js';
2
+ import { TemporalTextPresentationContext } from '../text-variables/temporal-input-text.js';
3
+ /** What text visual rendering resolves variables against. */
4
+ export type DashboardTextRenderContext = Pick<ResolvedDashboardInputContext, 'variablesById' | 'variablesByName'> & {
5
+ /** The viewer's Report preferences and Calendar; defaults when absent. */
6
+ presentation?: TemporalTextPresentationContext;
7
+ };
8
+ /** A date filter or a date control: its value can be formatted as a date. */
9
+ export declare function isTemporalDashboardInput(input: ResolvedDashboardInput): boolean;
10
+ /** One part of an input as text, with the variable's stored presentation. */
11
+ export declare function getDashboardInputText(input: ResolvedDashboardInput, exportKey: DashboardInputExportKey, context: Pick<DashboardTextRenderContext, 'presentation'>, stored?: TextVariablePresentation): string;
@@ -1,10 +1,11 @@
1
1
  import { DashboardInputTextContent, ResolvedDashboardInputContext } from '../types/common-types.js';
2
+ import { DashboardTextRenderContext } from './dashboard-input-display.js';
2
3
  export type ParsedDashboardInputTextContent = {
3
4
  content: DashboardInputTextContent;
4
5
  unresolvedTokens: string[];
5
6
  };
6
7
  export declare function parseDashboardInputTextContent(value: string, context: Pick<ResolvedDashboardInputContext, 'variablesByName'>): ParsedDashboardInputTextContent;
7
- export declare function renderDashboardInputTextContent(content: DashboardInputTextContent | undefined, context: Pick<ResolvedDashboardInputContext, 'variablesById' | 'variablesByName'>): string;
8
+ export declare function renderDashboardInputTextContent(content: DashboardInputTextContent | undefined, context: DashboardTextRenderContext): string;
8
9
  export declare function dashboardInputTextContentToEditableText(content: DashboardInputTextContent | undefined, context: Pick<ResolvedDashboardInputContext, 'variablesById' | 'variablesByName'>): string;
9
10
  export declare function hasDashboardInputVariableToken(value: string): boolean;
10
11
  export declare function htmlToDashboardInputText(value: string): string;
@@ -1,5 +1,6 @@
1
- import { ResolvedDashboardInputContext, TextCardRichContent } from '../types/common-types.js';
1
+ import { TextCardRichContent } from '../types/common-types.js';
2
+ import { DashboardTextRenderContext } from './dashboard-input-display.js';
2
3
  export declare function createEmptyRichContent(): TextCardRichContent;
3
4
  export declare function isTextCardRichContent(value: unknown): value is TextCardRichContent;
4
- export declare function renderRichContentToHtml(content: TextCardRichContent | undefined, context: Pick<ResolvedDashboardInputContext, 'variablesById' | 'variablesByName'>): string;
5
+ export declare function renderRichContentToHtml(content: TextCardRichContent | undefined, context: DashboardTextRenderContext): string;
5
6
  export declare function extractPlainTextFromRichContent(content: TextCardRichContent | undefined): string;
@@ -1,15 +1,16 @@
1
- import { DashboardInputVariableRef, ResolvedDashboardInputContext } from '../types/common-types.js';
1
+ import { DashboardInputVariableRef, ResolvedDashboardInputContext, TextVariablePresentation } from '../types/common-types.js';
2
2
  import { TextVariableChipFace, TextVariableOption, TextVariableSelection } from '../text-variables/text-variable-types.js';
3
+ import { DashboardTextRenderContext } from './dashboard-input-display.js';
3
4
  /** What resolves a reference to its input. */
4
5
  type DashboardVariableLookup = Pick<ResolvedDashboardInputContext, 'variablesById' | 'variablesByName'>;
5
6
  /** The dashboard inputs a text visual can show, each part with its value now. */
6
- export declare function getDashboardTextVariableOptions(context?: Pick<ResolvedDashboardInputContext, 'resolvedInputs'>): TextVariableOption[];
7
+ export declare function getDashboardTextVariableOptions(context?: Pick<ResolvedDashboardInputContext, 'resolvedInputs'> & Pick<DashboardTextRenderContext, 'presentation'>): TextVariableOption[];
7
8
  /** What a reference shows, as the picker names it; undefined when missing. */
8
- export declare function getDashboardVariableSelection(ref: DashboardInputVariableRef, context?: DashboardVariableLookup): TextVariableSelection | undefined;
9
+ export declare function getDashboardVariableSelection(ref: DashboardInputVariableRef, context?: DashboardVariableLookup, presentation?: TextVariablePresentation): TextVariableSelection | undefined;
9
10
  /** The reference a picker selection stands for. */
10
11
  export declare function getDashboardVariableRefFromSelection(selection: TextVariableSelection): DashboardInputVariableRef;
11
12
  /** How a reference reads as a chip: the input's name, or Missing input. */
12
- export declare function getDashboardVariableChipFace(ref: DashboardInputVariableRef, context?: DashboardVariableLookup): TextVariableChipFace;
13
+ export declare function getDashboardVariableChipFace(ref: DashboardInputVariableRef, context?: DashboardVariableLookup, presentation?: TextVariablePresentation): TextVariableChipFace;
13
14
  /** `name.part`, for copying a variable as a typed token. */
14
15
  export declare function getDashboardVariableToken(ref: DashboardInputVariableRef, context?: DashboardVariableLookup): string;
15
16
  export {};
@@ -1,6 +1,7 @@
1
1
  import { TFilterValue } from '../../components/surfboard/filter/types.js';
2
- import { ControlOption, DocumentInputDefinition, DocumentTextInlineFormat, DocumentTextContent, DocumentVariableRef, ResolvedDocumentInput } from '../types/common-types.js';
2
+ import { ControlOption, DocumentInputDefinition, DocumentTextInlineFormat, DocumentTextContent, DocumentVariableRef, ResolvedDocumentInput, TextVariablePresentation } from '../types/common-types.js';
3
3
  import { TextVariableChipFace, TextVariableOption, TextVariableSelection } from '../text-variables/text-variable-types.js';
4
+ import { TemporalTextPresentationContext } from '../text-variables/temporal-input-text.js';
4
5
  export type DocumentTextRenderContext = {
5
6
  inputs: DocumentInputDefinition[];
6
7
  resolvedInputsById: Record<string, ResolvedDocumentInput>;
@@ -11,6 +12,8 @@ export type DocumentTextRenderContext = {
11
12
  };
12
13
  timezone?: string;
13
14
  generatedAtFormat?: string;
15
+ /** The viewer's Report preferences and Calendar, for date inputs. */
16
+ presentation?: TemporalTextPresentationContext;
14
17
  };
15
18
  export type ParsedDocumentTextContent = {
16
19
  content: DocumentTextContent;
@@ -42,11 +45,11 @@ export declare function parseDocumentTextContentWithSource(value: string, inputs
42
45
  export declare function appendDocumentVariable(content: DocumentTextContent | undefined, ref: DocumentVariableRef): DocumentTextContent;
43
46
  export declare function getDocumentVariableLabel(ref: DocumentVariableRef, inputs: DocumentInputDefinition[]): string;
44
47
  /** What a reference shows, as the picker names it. */
45
- export declare function getDocumentVariableSelection(ref: DocumentVariableRef): TextVariableSelection;
48
+ export declare function getDocumentVariableSelection(ref: DocumentVariableRef, inputs?: DocumentInputDefinition[], presentation?: TextVariablePresentation): TextVariableSelection;
46
49
  /** The reference a picker selection stands for. */
47
50
  export declare function getDocumentVariableRefFromSelection(selection: TextVariableSelection): DocumentVariableRef;
48
51
  /** How a reference reads as a chip: the input's name, or Missing input. */
49
- export declare function getDocumentVariableChipFace(ref: DocumentVariableRef, inputs: DocumentInputDefinition[]): TextVariableChipFace;
52
+ export declare function getDocumentVariableChipFace(ref: DocumentVariableRef, inputs: DocumentInputDefinition[], presentation?: TextVariablePresentation): TextVariableChipFace;
50
53
  /**
51
54
  * The inputs and report values a Document text can show, each part with what
52
55
  * it holds now when `context` is given.
@@ -78,7 +81,7 @@ export declare function getDocumentInputTextUsage(document: {
78
81
  footer: boolean;
79
82
  textSections: number;
80
83
  };
81
- export declare function buildDocumentTextRenderContext({ inputs, filterValuesByInputId, controlValuesByInputId, controlOptionsByInputId, generatedAt, timezone, generatedAtFormat, pageNumber, pageCount, }: {
84
+ export declare function buildDocumentTextRenderContext({ inputs, filterValuesByInputId, controlValuesByInputId, controlOptionsByInputId, generatedAt, timezone, generatedAtFormat, presentation: providedPresentation, pageNumber, pageCount, }: {
82
85
  inputs: DocumentInputDefinition[];
83
86
  filterValuesByInputId: Record<string, TFilterValue | undefined>;
84
87
  controlValuesByInputId: Record<string, unknown>;
@@ -86,6 +89,7 @@ export declare function buildDocumentTextRenderContext({ inputs, filterValuesByI
86
89
  generatedAt: string;
87
90
  timezone?: string;
88
91
  generatedAtFormat?: string;
92
+ presentation?: TemporalTextPresentationContext;
89
93
  pageNumber?: number;
90
94
  pageCount?: number;
91
95
  }): DocumentTextRenderContext;
@@ -0,0 +1,28 @@
1
+ import { TFilterValue } from '../../components/surfboard/filter/types.js';
2
+ import { TemporalInputCalendar, TemporalInputPart, TemporalInputPresentation, TemporalInputValue } from '../../shared/format-utils/temporal-input-presentation.js';
3
+ import { ResolvedTemporalValueFormatPreferences } from '../../shared/value-format-preferences/index.js';
4
+ /** The viewer's temporal preferences and Calendar, for formatting inputs. */
5
+ export type TemporalTextPresentationContext = {
6
+ preferences: ResolvedTemporalValueFormatPreferences;
7
+ calendar: TemporalInputCalendar;
8
+ };
9
+ export declare function getTemporalTextPresentationContext(input: {
10
+ preferences?: ResolvedTemporalValueFormatPreferences | null;
11
+ calendar?: TemporalInputCalendar | null;
12
+ }): TemporalTextPresentationContext;
13
+ /** A date filter's current value as a temporal input value. */
14
+ export declare function getTemporalValueFromFilter(filterValue: TFilterValue | undefined): TemporalInputValue | undefined;
15
+ /** A date control's current value (one date) as a temporal input value. */
16
+ export declare function getTemporalValueFromControl(value: unknown): TemporalInputValue | undefined;
17
+ /** Which bound an input part shows. */
18
+ export declare function getTemporalInputPart(exportKey: string): TemporalInputPart;
19
+ /** A stored presentation, dropping (and reporting once) an invalid one. */
20
+ export declare function readTextVariablePresentation(stored: unknown): TemporalInputPresentation | undefined;
21
+ /** A date input's value as text; empty when it has no value. */
22
+ export declare function formatTemporalInputText({ inputId, value, exportKey, presentation, context, }: {
23
+ inputId: string;
24
+ value: TemporalInputValue | undefined;
25
+ exportKey: string;
26
+ presentation?: TemporalInputPresentation;
27
+ context: TemporalTextPresentationContext;
28
+ }): string;
@@ -1,3 +1,4 @@
1
+ import { TemporalInputPresentation } from '../../shared/format-utils/temporal-input-presentation.js';
1
2
  /** What kind of value a variable holds; picks the chip's icon. */
2
3
  export type TextVariableKind = 'filter' | 'date' | 'control' | 'report';
3
4
  /** How one variable reference reads as a chip. */
@@ -23,13 +24,28 @@ export type TextVariableOption = {
23
24
  kind: TextVariableKind;
24
25
  parts: TextVariablePart[];
25
26
  defaultPart: string;
27
+ /** A date input: its value can be shown in a chosen format (Plan 08). */
28
+ temporal?: {
29
+ /** What `part` prints now in `presentation` (automatic when omitted). */
30
+ preview: (part: string, presentation?: TemporalInputPresentation) => string;
31
+ /** The selection has a period name now ("Today"). */
32
+ hasPeriodName: boolean;
33
+ };
26
34
  };
27
- /** What a chip shows: an option and one of its parts. */
35
+ /** What a chip shows: an option, one of its parts, and a date format. */
28
36
  export type TextVariableSelection = {
29
37
  optionId: string;
30
38
  part: string;
39
+ /** A date input's pinned format; omission means automatic. */
40
+ temporal?: TemporalInputPresentation;
31
41
  };
32
42
  export declare const TEXT_VARIABLE_PART_LABELS: Record<string, string>;
43
+ /** A date part's label: the whole value reads as its dates. */
44
+ export declare const TEMPORAL_TEXT_VARIABLE_PART_LABELS: Record<string, string>;
45
+ /** A pinned date format, as the chip's suffix names it. */
46
+ export declare function temporalFormatLabel(presentation: TemporalInputPresentation | undefined): string | undefined;
47
+ /** The chip's suffix: a non-default part, then a pinned format. */
48
+ export declare function chipPartLabel(partLabel: string | undefined, presentation?: TemporalInputPresentation): string | undefined;
33
49
  /** The picker's groups, in order. */
34
50
  export declare function textVariableGroup(kind: TextVariableKind): "Filters" | "Controls" | "Report";
35
51
  /**
@@ -15,7 +15,7 @@ import { DashboardAIContext } from './assistant-types.js';
15
15
  import { CardInteractionConfig, InteractionTargetOverride } from './interaction-types.js';
16
16
  import { SemanticExecutionPayload } from './semantic-runtime-types.js';
17
17
  import { ReportRuntimeContext } from '../../shared/report-runtime-context/index.js';
18
- import { PresentationExecutionSnapshot } from '../../shared/format-utils/index.js';
18
+ import { PresentationExecutionSnapshot, TemporalInputPresentation } from '../../shared/format-utils/index.js';
19
19
  import { JSX } from 'react';
20
20
  export type { DashboardFilterApplication, DashboardFilterBoundCardApplication, DashboardFilterCardApplication, DashboardFilterExcludedCardApplication, DashboardFilterTarget, DashboardFilterTargetField, DashboardFilterTargetSource, DashboardFilterOptionSource, } from '../../shared/dashboard-authoring/dashboard-filter-mapping-types.js';
21
21
  export type { ClickToFilterCardMapping, ClickToFilterFieldsRule, ClickToFilterMatrixSources, ClickToFilterSettings, LinkedClickToFilterOverrides, } from '../../shared/dashboard-authoring/click-to-filter-settings.js';
@@ -1185,6 +1185,13 @@ export type TextCardInlineFormat = {
1185
1185
  bold?: boolean;
1186
1186
  italic?: boolean;
1187
1187
  };
1188
+ /**
1189
+ * How a variable in text shows its input's value (Plan 08). Sparse: omission
1190
+ * means automatic (the viewer's Report preferences).
1191
+ */
1192
+ export type TextVariablePresentation = {
1193
+ temporal?: TemporalInputPresentation;
1194
+ };
1188
1195
  export type TextCardRichInline = {
1189
1196
  type: 'text';
1190
1197
  value: string;
@@ -1193,6 +1200,7 @@ export type TextCardRichInline = {
1193
1200
  type: 'variable';
1194
1201
  ref: DashboardInputVariableRef;
1195
1202
  format?: TextCardInlineFormat;
1203
+ presentation?: TextVariablePresentation;
1196
1204
  } | {
1197
1205
  type: 'link';
1198
1206
  url: string;
@@ -1204,6 +1212,7 @@ export type TextCardRichInline = {
1204
1212
  type: 'variable';
1205
1213
  ref: DashboardInputVariableRef;
1206
1214
  format?: TextCardInlineFormat;
1215
+ presentation?: TextVariablePresentation;
1207
1216
  }>;
1208
1217
  };
1209
1218
  export type TextCardRichBlock = {
@@ -1415,6 +1424,7 @@ export type DocumentTextNode = {
1415
1424
  type: 'variable';
1416
1425
  ref: DocumentVariableRef;
1417
1426
  format?: DocumentTextInlineFormat;
1427
+ presentation?: TextVariablePresentation;
1418
1428
  };
1419
1429
  export type DocumentVariableRef = {
1420
1430
  source: 'input';
@@ -28,6 +28,7 @@ export * from './presentation-execution.js';
28
28
  export * from './temporal-bucket-format-policy.js';
29
29
  export * from './temporal-bucket.js';
30
30
  export * from './raw-temporal.js';
31
+ export * from './temporal-input-presentation.js';
31
32
  export * from './flat-table-export-totals.js';
32
33
  export * from './aggregate-table-row-presentation.js';
33
34
  export { PDF_GROUP_CONTINUATION_CLASS } from './grouped-table-presentation.js';
@@ -0,0 +1,46 @@
1
+ import { CalendarContext } from '../report-runtime-context/report-runtime-context.js';
2
+ import { LocaleStyle, ResolvedTemporalValueFormatPreferences } from '../value-format-preferences/index.js';
3
+ export type TemporalInputPrecision = 'day' | 'minute';
4
+ /** One resolved date-input value. Bounds are canonical, never labels. */
5
+ export type TemporalInputValue = {
6
+ bounds: readonly [string] | readonly [string, string];
7
+ precision: TemporalInputPrecision;
8
+ /** The selection's period name ("Today"), for a relative selection. */
9
+ periodLabel?: string;
10
+ };
11
+ export type TemporalInputPart = 'range' | 'start' | 'end';
12
+ /** Authored per-variable presentation. Omission means automatic. */
13
+ export type TemporalInputPresentation = {
14
+ mode: 'style';
15
+ dateStyle: LocaleStyle;
16
+ } | {
17
+ mode: 'pattern';
18
+ dialect: 'semaphor_tokens';
19
+ pattern: string;
20
+ } | {
21
+ mode: 'period_label';
22
+ };
23
+ export type TemporalInputFormatResult = {
24
+ ok: true;
25
+ text: string;
26
+ } | {
27
+ ok: false;
28
+ /** The original canonical text, preserved. */
29
+ text: string;
30
+ diagnostic: {
31
+ code: 'invalid_temporal_input_value';
32
+ message: string;
33
+ };
34
+ };
35
+ export type TemporalInputCalendar = Pick<CalendarContext, 'tz'> & Partial<Pick<CalendarContext, 'weekStart' | 'fiscalCalendar'>>;
36
+ /** A stored presentation, or undefined when absent or invalid. */
37
+ export declare function parseTemporalInputPresentation(input: unknown): TemporalInputPresentation | undefined;
38
+ /** Why a custom pattern cannot be used, or null when it can. */
39
+ export declare function validateTemporalInputPattern(pattern: string): string | null;
40
+ export declare function formatTemporalInputValue(input: {
41
+ value: TemporalInputValue;
42
+ part: TemporalInputPart;
43
+ presentation?: TemporalInputPresentation;
44
+ preferences: ResolvedTemporalValueFormatPreferences;
45
+ calendar: TemporalInputCalendar;
46
+ }): TemporalInputFormatResult;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.516",
8
+ "version": "0.1.517",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",