react-semaphor 0.1.604 → 0.1.606

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 (151) hide show
  1. package/dist/analytics-protocol/index.js +1 -1
  2. package/dist/appearance/index.js +1 -1
  3. package/dist/appearance-runtime/index.js +1 -1
  4. package/dist/assistant-context/index.js +1 -1
  5. package/dist/assistant-protocol/index.js +1 -1
  6. package/dist/brand-studio/index.js +3 -8
  7. package/dist/briefings/index.js +1 -1
  8. package/dist/chunks/{add-to-dashboard-DeHEBEqG.js → add-to-dashboard-CEmZUf9o.js} +1 -1
  9. package/dist/chunks/{analytics-base-schemas-BREc5WGv.js → analytics-base-schemas-DMFrDqn_.js} +1 -1
  10. package/dist/chunks/appearance-provider-fIhJSX6y.js +613 -0
  11. package/dist/chunks/appearance-runtime-provider-Bx8H-moR.js +1 -0
  12. package/dist/chunks/{assistant-chat-CjYrwVDa.js → assistant-chat-SBKSrrEA.js} +19 -24
  13. package/dist/chunks/attachment-filter-line-C_zHMhGh.js +1 -0
  14. package/dist/chunks/{bookmark-impact-C89zBLq3.js → bookmark-impact-BW30cm5E.js} +1 -1
  15. package/dist/chunks/bookmark-state-DScd31KT.js +1 -0
  16. package/dist/chunks/brand-CL5xDiFH.js +1 -0
  17. package/dist/chunks/card-filter-builder-CzScSOQY.js +11 -0
  18. package/dist/chunks/comparison-window-caption-tguyN24S.js +1 -0
  19. package/dist/chunks/{context-ALdccLHw.js → context-CntvtZwC.js} +1 -1
  20. package/dist/chunks/dashboard-Cyhj9EOl.js +1 -0
  21. package/dist/chunks/dashboard-briefing-launcher-CyOFddmD.js +42 -0
  22. package/dist/chunks/dashboard-controls-DpADfhr0.js +42 -0
  23. package/dist/chunks/dashboard-json-4xMChR2q.js +1 -0
  24. package/dist/chunks/dashboard-temporal-snapshot-w3SMiPKj.js +1 -0
  25. package/dist/chunks/edit-dashboard-visual-DlvY7au4.js +73 -0
  26. package/dist/chunks/filter-line-WwUV5JzN.js +1 -0
  27. package/dist/chunks/filter-reach-preview-DAEIyrEG.js +1 -0
  28. package/dist/chunks/filter-value-text-DqTHe_vu.js +1 -0
  29. package/dist/chunks/{index-BE1DfxNs.js → index-bkP6SnYu.js} +1 -1
  30. package/dist/chunks/kpi-trend-rule-N1Xkwe_u.js +1 -0
  31. package/dist/chunks/{layout-grid-BWtlgw0T.js → layout-grid-Dtsioq4h.js} +1 -1
  32. package/dist/chunks/matrix-analytical-definition-5T-2euHZ.js +1 -0
  33. package/dist/chunks/matrix-member-presentation-vVAv-aqg.js +1 -0
  34. package/dist/chunks/matrix-operation-contract-CWvcEsQ0.js +1 -0
  35. package/dist/chunks/numeric-range-options-C8tr-Bls.js +1 -0
  36. package/dist/chunks/{palette-BzC-CGOc.js → palette-565cA0nh.js} +1 -1
  37. package/dist/chunks/pivot-result-contract-expectations-BNWhS8mv.js +1 -0
  38. package/dist/chunks/pivot-result-identity-B0eWVMXg.js +1 -0
  39. package/dist/chunks/{raw-temporal-value-DeyEhL0S.js → raw-temporal-value-BHQ-ldpW.js} +1 -1
  40. package/dist/chunks/report-preferences-dialog-B2ZGPS9t.js +1 -0
  41. package/dist/chunks/{report-runtime-context-BWzIHCKK.js → report-runtime-context-Cd1b5pku.js} +1 -1
  42. package/dist/chunks/resolve-dashboard-input-context-SlAAe4GF.js +8 -0
  43. package/dist/chunks/resolver-CjsW8Rz0.js +1 -0
  44. package/dist/chunks/saved-dashboard-context-Bc2SVDr-.js +1 -0
  45. package/dist/chunks/schema-O1Y3WTGF.js +4 -0
  46. package/dist/chunks/{selection-filter-compiler-CCoCD25M.js → selection-filter-compiler-kYsRugss.js} +1 -1
  47. package/dist/chunks/semaphor-ready-indicator-Bj-cjkz-.js +612 -0
  48. package/dist/chunks/set-CACXVM2A.js +1 -0
  49. package/dist/chunks/slider-CWze9OEM.js +4 -0
  50. package/dist/chunks/stored-dashboard-CcNdU-mG.js +1 -0
  51. package/dist/chunks/{table-export-sheet-rC5pKmXg.js → table-export-sheet-xaczzWZF.js} +1 -1
  52. package/dist/chunks/{token-types-Bj9iMy0w.js → token-types-1vzMWjI-.js} +1 -1
  53. package/dist/chunks/{validators-CqV3Yka1.js → validators-Dg2kyF4_.js} +1 -1
  54. package/dist/chunks/{variable-draft-DJrfUyhv.js → variable-draft-CRbSYdB6.js} +1 -1
  55. package/dist/dashboard/index.js +1 -1
  56. package/dist/dashboard-authoring/index.js +1 -1
  57. package/dist/format-utils/index.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/report-runtime-context/index.js +1 -1
  60. package/dist/style.css +1 -1
  61. package/dist/surfboard/index.js +1 -1
  62. package/dist/types/brand-studio/brand-studio-draft.d.ts +45 -13
  63. package/dist/types/brand-studio/brand-studio-editor.d.ts +13 -2
  64. package/dist/types/components/index.d.ts +1 -0
  65. package/dist/types/components/visual/data-table/hooks/use-data-table-logic.d.ts +17 -6
  66. package/dist/types/components/visual/data-table/types/data-table.d.ts +52 -42
  67. package/dist/types/index.js +1 -1
  68. package/dist/types/lib/appearance/aliases.d.ts +3 -0
  69. package/dist/types/lib/appearance/index.d.ts +1 -0
  70. package/dist/types/lib/appearance/table-density.d.ts +18 -0
  71. package/dist/types/lib/appearance/types.d.ts +39 -1
  72. package/dist/types/lib/dashboard-viewer/column-header-actions.d.ts +100 -0
  73. package/dist/types/lib/dashboard-viewer/table-view-edit.d.ts +0 -27
  74. package/dist/types/lib/dashboard-viewer/table-view.d.ts +26 -2
  75. package/dist/types/lib/dashboard-viewer/use-table-view.d.ts +2 -0
  76. package/dist/types/lib/hooks/use-add-new-frame.d.ts +7 -0
  77. package/dist/types/lib/hooks/use-dashboard-card.d.ts +4 -0
  78. package/dist/types/lib/interactions/get-click-context-from-chartjs.d.ts +8 -0
  79. package/dist/types/lib/stores/dashboard-store.d.ts +14 -2
  80. package/dist/types/lib/stores/explorer-actions.d.ts +0 -4
  81. package/dist/types/lib/types/common-types.d.ts +1 -2
  82. package/dist/types/lib/utils/card-config-utils.d.ts +13 -0
  83. package/dist/types/lib/utils/field-placement.d.ts +17 -0
  84. package/dist/types/shared/analytics-protocol/analytics-refusal.d.ts +21 -1
  85. package/dist/types/shared/analytics-protocol/field-provenance.d.ts +7 -4
  86. package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-folders.d.ts +48 -0
  87. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +2 -8
  88. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
  89. package/dist/types/shared/dashboard-authoring/card-settings/column-display-values.d.ts +5 -0
  90. package/dist/types/shared/dashboard-authoring/card-settings/column-display.d.ts +52 -0
  91. package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +1 -0
  92. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +9 -0
  93. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +4 -0
  94. package/dist/types/shared/dashboard-authoring/card-settings/table-viewer-switches.d.ts +15 -0
  95. package/dist/types/shared/dashboard-authoring/card-settings/views.d.ts +5 -0
  96. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +6 -0
  97. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +132 -3
  98. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +3 -1
  99. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
  100. package/dist/types/shared/dashboard-authoring/conditional-formatting/store.d.ts +10 -1
  101. package/dist/types/shared/dashboard-authoring/field-aggregations.d.ts +9 -2
  102. package/dist/types/shared/dashboard-authoring/field-folders/field-folders.d.ts +8 -7
  103. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
  104. package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +1 -1
  105. package/dist/types/shared/dashboard-authoring/measure-calculations/window-transforms.d.ts +2 -0
  106. package/dist/types/shared/dashboard-authoring/operations/card-operations.d.ts +2 -0
  107. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +7 -2
  108. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +6 -2
  109. package/dist/types/shared/dashboard-authoring/sheet-kinds.d.ts +36 -0
  110. package/dist/types/shared/dashboard-authoring/table-sheet-shape.d.ts +140 -0
  111. package/dist/types/shared/dashboard-viewer/table-column-move.d.ts +15 -0
  112. package/dist/types/shared/dashboard-viewer/table-settings.d.ts +8 -2
  113. package/dist/types/shared/format-utils/types/format-types.d.ts +1 -1
  114. package/dist/usage-events/index.js +1 -1
  115. package/package.json +2 -2
  116. package/dist/chunks/appearance-context-BqBZrijL.js +0 -1
  117. package/dist/chunks/appearance-runtime-provider-DmbCrOOG.js +0 -1
  118. package/dist/chunks/bookmark-state-69YYnRql.js +0 -1
  119. package/dist/chunks/brand-DCaZyRt6.js +0 -1
  120. package/dist/chunks/card-filter-builder-CTp6RAz1.js +0 -17
  121. package/dist/chunks/comparison-window-caption-C312mn3s.js +0 -1
  122. package/dist/chunks/dashboard-BX28ld6s.js +0 -1
  123. package/dist/chunks/dashboard-briefing-launcher-qo7GH4EO.js +0 -37
  124. package/dist/chunks/dashboard-controls-DhRjB7MA.js +0 -42
  125. package/dist/chunks/dashboard-json-9cHzhSjC.js +0 -1
  126. package/dist/chunks/dates-D-KP8G-z.js +0 -1
  127. package/dist/chunks/edit-DEAK0UZo.js +0 -1
  128. package/dist/chunks/edit-dashboard-visual-Duq_QkB_.js +0 -93
  129. package/dist/chunks/filter-line-CwQrqORc.js +0 -1
  130. package/dist/chunks/filter-reach-preview-gixPFlZj.js +0 -1
  131. package/dist/chunks/filter-value-text-B3tXakhd.js +0 -1
  132. package/dist/chunks/index-B-VF1ogs.js +0 -1
  133. package/dist/chunks/matrix-analytical-definition-CtFqWyCK.js +0 -1
  134. package/dist/chunks/matrix-member-presentation-Q0MCJ-YK.js +0 -1
  135. package/dist/chunks/matrix-operation-contract-D1RC1bfi.js +0 -1
  136. package/dist/chunks/metric-comparison-DEZYXROZ.js +0 -1
  137. package/dist/chunks/paintbrush-BjS3SbrH.js +0 -6
  138. package/dist/chunks/pickers-DuBrUht0.js +0 -1
  139. package/dist/chunks/pivot-result-contract-expectations-DTQAgr4n.js +0 -1
  140. package/dist/chunks/pivot-result-identity-DTNCB--h.js +0 -1
  141. package/dist/chunks/report-preferences-dialog-B_gUmCzG.js +0 -1
  142. package/dist/chunks/resolve-dashboard-input-context-B-TtRqxu.js +0 -8
  143. package/dist/chunks/resolver-AN9ChBfZ.js +0 -1
  144. package/dist/chunks/save-DdFUZcbi.js +0 -6
  145. package/dist/chunks/saved-dashboard-context-BAJ5tWiq.js +0 -1
  146. package/dist/chunks/schema-MC0cQSAb.js +0 -4
  147. package/dist/chunks/semaphor-ready-indicator-DzjorP3t.js +0 -999
  148. package/dist/chunks/set-DuJfGkbY.js +0 -1
  149. package/dist/chunks/shelf-drop-preview-context-BlLJ5RsT.js +0 -6
  150. package/dist/chunks/stored-dashboard-Ctcpkllg.js +0 -1
  151. package/dist/chunks/style-sheet-parts-BRGt9O05.js +0 -178
@@ -3549,10 +3549,83 @@ declare const filterValueSchema: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBool
3549
3549
  export declare const columnSettingsInputSchema: z.ZodObject<{
3550
3550
  label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3551
3551
  hidden: z.ZodOptional<z.ZodBoolean>;
3552
+ /** Held at the left edge of the table (table sheets TS-D9). */
3553
+ pinned: z.ZodOptional<z.ZodBoolean>;
3552
3554
  width: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
3553
3555
  format: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
3554
3556
  /** Which way is good, where the model is silent (reports by conversation RC-D3); null: the default. */
3555
3557
  polarity: z.ZodOptional<z.ZodNullable<z.ZodEnum<["higher_is_better", "lower_is_better", "neutral"]>>>;
3558
+ /**
3559
+ * Display as (table style TS-D20): how a table column shows its values. The
3560
+ * card settings owner checks it against the column (Status and Link for text
3561
+ * columns, a Link's address and the columns it names); null: automatic.
3562
+ */
3563
+ display: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<"as", [z.ZodObject<{
3564
+ as: z.ZodLiteral<"text">;
3565
+ }, "strict", z.ZodTypeAny, {
3566
+ as: "text";
3567
+ }, {
3568
+ as: "text";
3569
+ }>, z.ZodObject<{
3570
+ as: z.ZodLiteral<"monospace">;
3571
+ lines: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<5>, z.ZodLiteral<"all">]>>;
3572
+ }, "strict", z.ZodTypeAny, {
3573
+ as: "monospace";
3574
+ lines?: "all" | 2 | 5 | 3 | undefined;
3575
+ }, {
3576
+ as: "monospace";
3577
+ lines?: "all" | 2 | 5 | 3 | undefined;
3578
+ }>, z.ZodObject<{
3579
+ as: z.ZodLiteral<"status">;
3580
+ shape: z.ZodOptional<z.ZodEnum<["pill", "dot"]>>;
3581
+ colors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["green", "red", "amber", "blue", "grey"]>>>;
3582
+ }, "strict", z.ZodTypeAny, {
3583
+ as: "status";
3584
+ shape?: "pill" | "dot" | undefined;
3585
+ colors?: Record<string, "green" | "red" | "amber" | "blue" | "grey"> | undefined;
3586
+ }, {
3587
+ as: "status";
3588
+ shape?: "pill" | "dot" | undefined;
3589
+ colors?: Record<string, "green" | "red" | "amber" | "blue" | "grey"> | undefined;
3590
+ }>, z.ZodObject<{
3591
+ as: z.ZodLiteral<"link">;
3592
+ address: z.ZodString;
3593
+ label: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"value">, z.ZodObject<{
3594
+ text: z.ZodString;
3595
+ }, "strict", z.ZodTypeAny, {
3596
+ text: string;
3597
+ }, {
3598
+ text: string;
3599
+ }>, z.ZodObject<{
3600
+ column: z.ZodString;
3601
+ }, "strict", z.ZodTypeAny, {
3602
+ column: string;
3603
+ }, {
3604
+ column: string;
3605
+ }>]>>;
3606
+ icon: z.ZodOptional<z.ZodBoolean>;
3607
+ newTab: z.ZodOptional<z.ZodBoolean>;
3608
+ }, "strict", z.ZodTypeAny, {
3609
+ as: "link";
3610
+ address: string;
3611
+ label?: "value" | {
3612
+ text: string;
3613
+ } | {
3614
+ column: string;
3615
+ } | undefined;
3616
+ icon?: boolean | undefined;
3617
+ newTab?: boolean | undefined;
3618
+ }, {
3619
+ as: "link";
3620
+ address: string;
3621
+ label?: "value" | {
3622
+ text: string;
3623
+ } | {
3624
+ column: string;
3625
+ } | undefined;
3626
+ icon?: boolean | undefined;
3627
+ newTab?: boolean | undefined;
3628
+ }>]>>>;
3556
3629
  field: z.ZodOptional<z.ZodString>;
3557
3630
  role: z.ZodOptional<z.ZodString>;
3558
3631
  inherits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -3561,18 +3634,60 @@ export declare const columnSettingsInputSchema: z.ZodObject<{
3561
3634
  role?: string | undefined;
3562
3635
  field?: string | undefined;
3563
3636
  format?: Record<string, unknown> | null | undefined;
3637
+ pinned?: boolean | undefined;
3564
3638
  polarity?: "higher_is_better" | "lower_is_better" | "neutral" | null | undefined;
3565
3639
  width?: number | null | undefined;
3566
3640
  hidden?: boolean | undefined;
3641
+ display?: {
3642
+ as: "text";
3643
+ } | {
3644
+ as: "monospace";
3645
+ lines?: "all" | 2 | 5 | 3 | undefined;
3646
+ } | {
3647
+ as: "status";
3648
+ shape?: "pill" | "dot" | undefined;
3649
+ colors?: Record<string, "green" | "red" | "amber" | "blue" | "grey"> | undefined;
3650
+ } | {
3651
+ as: "link";
3652
+ address: string;
3653
+ label?: "value" | {
3654
+ text: string;
3655
+ } | {
3656
+ column: string;
3657
+ } | undefined;
3658
+ icon?: boolean | undefined;
3659
+ newTab?: boolean | undefined;
3660
+ } | null | undefined;
3567
3661
  inherits?: string[] | undefined;
3568
3662
  }, {
3569
3663
  label?: string | null | undefined;
3570
3664
  role?: string | undefined;
3571
3665
  field?: string | undefined;
3572
3666
  format?: Record<string, unknown> | null | undefined;
3667
+ pinned?: boolean | undefined;
3573
3668
  polarity?: "higher_is_better" | "lower_is_better" | "neutral" | null | undefined;
3574
3669
  width?: number | null | undefined;
3575
3670
  hidden?: boolean | undefined;
3671
+ display?: {
3672
+ as: "text";
3673
+ } | {
3674
+ as: "monospace";
3675
+ lines?: "all" | 2 | 5 | 3 | undefined;
3676
+ } | {
3677
+ as: "status";
3678
+ shape?: "pill" | "dot" | undefined;
3679
+ colors?: Record<string, "green" | "red" | "amber" | "blue" | "grey"> | undefined;
3680
+ } | {
3681
+ as: "link";
3682
+ address: string;
3683
+ label?: "value" | {
3684
+ text: string;
3685
+ } | {
3686
+ column: string;
3687
+ } | undefined;
3688
+ icon?: boolean | undefined;
3689
+ newTab?: boolean | undefined;
3690
+ } | null | undefined;
3576
3691
  inherits?: string[] | undefined;
3577
3692
  }>;
3578
3693
  /**
@@ -4072,17 +4187,24 @@ export declare const layoutArrangeSchema: z.ZodObject<{
4072
4187
  * added at the end, and a sheet's title. A sheet a proposal adds is named in
4073
4188
  * later changes by its handle, wherever a sheet id goes (S-3).
4074
4189
  */
4075
- export declare const sheetChangeSchemas: readonly [z.ZodObject<{
4190
+ export declare function sheetChangeSchemas(tableCard: z.ZodTypeAny): readonly [z.ZodObject<{
4076
4191
  op: z.ZodLiteral<"sheet.add">;
4077
4192
  handle: z.ZodOptional<z.ZodString>;
4078
4193
  title: z.ZodString;
4194
+ /** A Table sheet (table sheets TS-D14): one table that fills the tab, added with it. */
4195
+ kind: z.ZodOptional<z.ZodLiteral<"table">>;
4196
+ card: z.ZodOptional<z.ZodTypeAny>;
4079
4197
  }, "strict", z.ZodTypeAny, {
4080
4198
  title: string;
4081
4199
  op: "sheet.add";
4200
+ card?: any;
4201
+ kind?: "table" | undefined;
4082
4202
  handle?: string | undefined;
4083
4203
  }, {
4084
4204
  title: string;
4085
4205
  op: "sheet.add";
4206
+ card?: any;
4207
+ kind?: "table" | undefined;
4086
4208
  handle?: string | undefined;
4087
4209
  }>, z.ZodObject<{
4088
4210
  op: z.ZodLiteral<"sheet.update">;
@@ -4341,7 +4463,7 @@ export declare const dashboardChangeSchema: z.ZodDiscriminatedUnion<"op", [z.Zod
4341
4463
  position?: "top" | "end" | {
4342
4464
  after: string;
4343
4465
  } | undefined;
4344
- width?: "quarter" | "full" | "half" | "third" | undefined;
4466
+ width?: "full" | "quarter" | "half" | "third" | undefined;
4345
4467
  query?: any;
4346
4468
  handle?: string | undefined;
4347
4469
  sheetId?: string | undefined;
@@ -4371,7 +4493,7 @@ export declare const dashboardChangeSchema: z.ZodDiscriminatedUnion<"op", [z.Zod
4371
4493
  position?: "top" | "end" | {
4372
4494
  after: string;
4373
4495
  } | undefined;
4374
- width?: "quarter" | "full" | "half" | "third" | undefined;
4496
+ width?: "full" | "quarter" | "half" | "third" | undefined;
4375
4497
  query?: any;
4376
4498
  handle?: string | undefined;
4377
4499
  sheetId?: string | undefined;
@@ -5187,13 +5309,20 @@ export declare const dashboardChangeSchema: z.ZodDiscriminatedUnion<"op", [z.Zod
5187
5309
  op: z.ZodLiteral<"sheet.add">;
5188
5310
  handle: z.ZodOptional<z.ZodString>;
5189
5311
  title: z.ZodString;
5312
+ /** A Table sheet (table sheets TS-D14): one table that fills the tab, added with it. */
5313
+ kind: z.ZodOptional<z.ZodLiteral<"table">>;
5314
+ card: z.ZodOptional<z.ZodTypeAny>;
5190
5315
  }, "strict", z.ZodTypeAny, {
5191
5316
  title: string;
5192
5317
  op: "sheet.add";
5318
+ card?: any;
5319
+ kind?: "table" | undefined;
5193
5320
  handle?: string | undefined;
5194
5321
  }, {
5195
5322
  title: string;
5196
5323
  op: "sheet.add";
5324
+ card?: any;
5325
+ kind?: "table" | undefined;
5197
5326
  handle?: string | undefined;
5198
5327
  }>, z.ZodObject<{
5199
5328
  op: z.ZodLiteral<"sheet.update">;
@@ -1,6 +1,8 @@
1
1
  import { ProposedChange } from './dashboard-change.js';
2
2
  import { StyleRefusal } from '../dashboard-style/index.js';
3
- export type ChangeProblemCode = 'invalid_change' | 'invalid_change_target' | 'copy_required' | 'not_permitted' | 'dashboard_not_found' | 'card_not_found' | 'filter_not_found' | 'sheet_not_found' | 'sheet_required' | 'sheet_not_a_grid' | 'field_not_found'
3
+ export type ChangeProblemCode = 'invalid_change' | 'invalid_change_target' | 'copy_required' | 'not_permitted' | 'dashboard_not_found' | 'card_not_found' | 'filter_not_found' | 'sheet_not_found' | 'sheet_required' | 'sheet_not_a_grid'
4
+ /** A Table sheet holds one table (table sheets SH-1): no card is added to it, and its own card is not removed or made a chart. */
5
+ | 'sheet_holds_one_table' | 'table_sheet_no_card' | 'table_sheet_card_type' | 'table_sheet_extra_card' | 'table_sheet_layout' | 'field_not_found'
4
6
  /**
5
7
  * The card's datasets aren't joined by the domain's relationships, so the
6
8
  * card can't run (assistant joins and panel AJ-D4). Details name the base
@@ -1446,8 +1446,8 @@ export declare const conditionalRuleSchema: z.ZodObject<{
1446
1446
  italic?: boolean | undefined;
1447
1447
  fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
1448
1448
  backgroundColor?: string | undefined;
1449
- textDecoration?: "none" | "underline" | "line-through" | undefined;
1450
1449
  icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
1450
+ textDecoration?: "none" | "underline" | "line-through" | undefined;
1451
1451
  textColor?: string | undefined;
1452
1452
  }, {
1453
1453
  dataBar?: {
@@ -1457,8 +1457,8 @@ export declare const conditionalRuleSchema: z.ZodObject<{
1457
1457
  italic?: boolean | undefined;
1458
1458
  fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
1459
1459
  backgroundColor?: string | undefined;
1460
- textDecoration?: "none" | "underline" | "line-through" | undefined;
1461
1460
  icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
1461
+ textDecoration?: "none" | "underline" | "line-through" | undefined;
1462
1462
  textColor?: string | undefined;
1463
1463
  }>>;
1464
1464
  }, "strict", z.ZodTypeAny, {
@@ -1726,8 +1726,8 @@ export declare const conditionalRuleSchema: z.ZodObject<{
1726
1726
  italic?: boolean | undefined;
1727
1727
  fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
1728
1728
  backgroundColor?: string | undefined;
1729
- textDecoration?: "none" | "underline" | "line-through" | undefined;
1730
1729
  icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
1730
+ textDecoration?: "none" | "underline" | "line-through" | undefined;
1731
1731
  textColor?: string | undefined;
1732
1732
  } | undefined;
1733
1733
  enabled?: boolean | undefined;
@@ -1996,8 +1996,8 @@ export declare const conditionalRuleSchema: z.ZodObject<{
1996
1996
  italic?: boolean | undefined;
1997
1997
  fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
1998
1998
  backgroundColor?: string | undefined;
1999
- textDecoration?: "none" | "underline" | "line-through" | undefined;
2000
1999
  icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
2000
+ textDecoration?: "none" | "underline" | "line-through" | undefined;
2001
2001
  textColor?: string | undefined;
2002
2002
  } | undefined;
2003
2003
  enabled?: boolean | undefined;
@@ -3380,8 +3380,8 @@ export declare const cardConditionalFormattingSchema: z.ZodObject<{
3380
3380
  italic?: boolean | undefined;
3381
3381
  fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
3382
3382
  backgroundColor?: string | undefined;
3383
- textDecoration?: "none" | "underline" | "line-through" | undefined;
3384
3383
  icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
3384
+ textDecoration?: "none" | "underline" | "line-through" | undefined;
3385
3385
  textColor?: string | undefined;
3386
3386
  }, {
3387
3387
  dataBar?: {
@@ -3391,8 +3391,8 @@ export declare const cardConditionalFormattingSchema: z.ZodObject<{
3391
3391
  italic?: boolean | undefined;
3392
3392
  fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
3393
3393
  backgroundColor?: string | undefined;
3394
- textDecoration?: "none" | "underline" | "line-through" | undefined;
3395
3394
  icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
3395
+ textDecoration?: "none" | "underline" | "line-through" | undefined;
3396
3396
  textColor?: string | undefined;
3397
3397
  }>>;
3398
3398
  }, "strict", z.ZodTypeAny, {
@@ -3660,8 +3660,8 @@ export declare const cardConditionalFormattingSchema: z.ZodObject<{
3660
3660
  italic?: boolean | undefined;
3661
3661
  fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
3662
3662
  backgroundColor?: string | undefined;
3663
- textDecoration?: "none" | "underline" | "line-through" | undefined;
3664
3663
  icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
3664
+ textDecoration?: "none" | "underline" | "line-through" | undefined;
3665
3665
  textColor?: string | undefined;
3666
3666
  } | undefined;
3667
3667
  enabled?: boolean | undefined;
@@ -3930,8 +3930,8 @@ export declare const cardConditionalFormattingSchema: z.ZodObject<{
3930
3930
  italic?: boolean | undefined;
3931
3931
  fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
3932
3932
  backgroundColor?: string | undefined;
3933
- textDecoration?: "none" | "underline" | "line-through" | undefined;
3934
3933
  icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
3934
+ textDecoration?: "none" | "underline" | "line-through" | undefined;
3935
3935
  textColor?: string | undefined;
3936
3936
  } | undefined;
3937
3937
  enabled?: boolean | undefined;
@@ -4203,8 +4203,8 @@ export declare const cardConditionalFormattingSchema: z.ZodObject<{
4203
4203
  italic?: boolean | undefined;
4204
4204
  fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
4205
4205
  backgroundColor?: string | undefined;
4206
- textDecoration?: "none" | "underline" | "line-through" | undefined;
4207
4206
  icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
4207
+ textDecoration?: "none" | "underline" | "line-through" | undefined;
4208
4208
  textColor?: string | undefined;
4209
4209
  } | undefined;
4210
4210
  enabled?: boolean | undefined;
@@ -4476,8 +4476,8 @@ export declare const cardConditionalFormattingSchema: z.ZodObject<{
4476
4476
  italic?: boolean | undefined;
4477
4477
  fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
4478
4478
  backgroundColor?: string | undefined;
4479
- textDecoration?: "none" | "underline" | "line-through" | undefined;
4480
4479
  icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
4480
+ textDecoration?: "none" | "underline" | "line-through" | undefined;
4481
4481
  textColor?: string | undefined;
4482
4482
  } | undefined;
4483
4483
  enabled?: boolean | undefined;
@@ -1,5 +1,5 @@
1
1
  import { TCard, TCardPreferences } from '../../../lib/types/common-types.js';
2
- import { ConditionalRule } from './types.js';
2
+ import { CardColumnRef, ConditionalRule } from './types.js';
3
3
  /**
4
4
  * A card's stored rules. A rule that doesn't parse is left out rather than
5
5
  * failing the card: the save check refuses one (CR-D9), and a renderer shows
@@ -10,3 +10,12 @@ export declare function readCardConditionalRules(card: {
10
10
  } | undefined): readonly ConditionalRule[];
11
11
  /** The card with these rules as its store; no rules removes the store. */
12
12
  export declare function withCardConditionalRules<T extends Pick<TCard, 'preferences'>>(card: T, rules: readonly ConditionalRule[]): T;
13
+ /** The rules about one column, in store order: a column's Highlight cells edits only these. */
14
+ export declare function columnConditionalRules(rules: readonly ConditionalRule[], column: CardColumnRef): readonly ConditionalRule[];
15
+ /**
16
+ * The store with one column's rules replaced by `edited`, in `edited`'s order
17
+ * (a move in the rule list holds): the column's rules fill the places its
18
+ * rules held, a removal frees one, and any more go last; every other rule
19
+ * stays where it was.
20
+ */
21
+ export declare function withColumnConditionalRules(rules: readonly ConditionalRule[], column: CardColumnRef, edited: readonly ConditionalRule[]): ConditionalRule[];
@@ -1,5 +1,9 @@
1
- /** Explorer datatype eligibility; consumers may further restrict supported operations. */
2
- export declare function getFieldAggregationOptions(dataType: string | undefined): readonly [{
1
+ /**
2
+ * Explorer datatype eligibility; consumers may further restrict supported
3
+ * operations. A count of rows (field `*`) only counts: SUM of `*` is no query
4
+ * (review, 2026-11-15).
5
+ */
6
+ export declare function getFieldAggregationOptions(dataType: string | undefined, fieldName?: string): readonly [{
3
7
  readonly value: "COUNT";
4
8
  readonly label: "Count";
5
9
  }, {
@@ -26,4 +30,7 @@ export declare function getFieldAggregationOptions(dataType: string | undefined)
26
30
  }, {
27
31
  readonly value: "MEDIAN";
28
32
  readonly label: "Median";
33
+ }] | readonly [{
34
+ readonly value: "COUNT";
35
+ readonly label: "Count";
29
36
  }];
@@ -96,6 +96,14 @@ export type FieldFolderTreeOptions<F extends FieldFolder<FieldFolderColumn> = Fi
96
96
  filtering?: boolean;
97
97
  /** Datasets whose folders are open when there is no query. */
98
98
  expanded: readonly string[];
99
+ /**
100
+ * The field lists' order (Rohit, 2026-11-15): a folder's own fields A–Z, its
101
+ * keys among them, then its related datasets' folders A–Z. Every field shows
102
+ * once, in its own dataset's folder (`keyInside` doesn't apply: the key is
103
+ * already among its dataset's fields). Off: each folder stands where its key
104
+ * is, as See records' More columns shows them.
105
+ */
106
+ fieldsThenFolders?: boolean;
99
107
  /**
100
108
  * The parent's key field a folder stands at is listed first inside the
101
109
  * folder (the card editor: it is a field of the parent the author may
@@ -104,12 +112,5 @@ export type FieldFolderTreeOptions<F extends FieldFolder<FieldFolderColumn> = Fi
104
112
  */
105
113
  keyInside?: boolean;
106
114
  };
107
- /**
108
- * The folders as a tree: the roots (folders whose parent isn't offered), each
109
- * folder's fields in order with a child folder in place of the field it hangs
110
- * at, then children that hang at no field. A search shows the fields that
111
- * match (by folder and field label) and opens every folder holding one.
112
- * A dataset already on the way down is never nested again.
113
- */
114
115
  export declare function fieldFolderTree<F extends FieldFolder<FieldFolderColumn>>(folders: readonly F[], options: FieldFolderTreeOptions<F>): FieldFolderNode<F>[];
115
116
  export {};
@@ -6,6 +6,7 @@ export * from './temporal-bucket-authoring.js';
6
6
  export * from './canonical-result-keys.js';
7
7
  export * from './dashboard-card-source-index.js';
8
8
  export * from './document-section-cards.js';
9
+ export * from './sheet-kinds.js';
9
10
  export * from './legacy-table-routing.js';
10
11
  export * from './semantic-card-domain.js';
11
12
  export * from './dashboard-filter-mapping-types.js';
@@ -15,4 +15,4 @@ export { describeMeasureCalculations } from './sentences.js';
15
15
  export { setMeasureCalculations } from './set.js';
16
16
  export { readStoredTransform, readTransform, resolveMeasureTransform, type KeyedWindowTransform, type StoredTransformRead } from './transform.js';
17
17
  export { describeTableColumnTotal, NON_ADDITIVE_SUM_OF_ROWS_HINT, resolveTableColumnTotal, tableColumnTotalLabel, type TableColumnTotal, type TableMeasureTotal, } from './table-column-total.js';
18
- export { validateAndResolveWindowTransforms, WINDOW_ERROR_CODES, WINDOW_WARNING_CODES, type ResolvedMetricWindowTransform, type WindowErrorCode, type WindowValidationError, type WindowValidationResult, type WindowWarningCode, } from './window-transforms.js';
18
+ export { validateAndResolveWindowTransforms, WINDOW_ERROR_CODES, WINDOW_WARNING_CODES, type ResolvedMetricWindowTransform, type WindowErrorCode, type WindowValidationError, type WindowValidationResult, type WindowWarningCode, supportsMetricTransform, } from './window-transforms.js';
@@ -53,6 +53,8 @@ export interface WindowValidationResult {
53
53
  warnings: WindowWarningCode[];
54
54
  resolvedTransforms: ResolvedMetricWindowTransform[];
55
55
  }
56
+ /** Whether a card type can run a metric transform: the field card shows the section only where it can. */
57
+ export declare function supportsMetricTransform(cardType: string | undefined): boolean;
56
58
  export declare function validateAndResolveWindowTransforms({ cardConfig, cardType, }: {
57
59
  cardConfig: CardConfig;
58
60
  cardType?: string;
@@ -47,6 +47,8 @@ export declare function requireCard(dashboard: TDashboard, cardId: string): Fram
47
47
  export declare function addCard(dashboard: TDashboard, operation: Extract<DashboardOperation, {
48
48
  op: 'card.add';
49
49
  }>): OperationOutcome;
50
+ /** What an added card shows: a query card's query, a text card's first words (building a report SPEC §4.2). */
51
+ export declare function describeAdded(card: TCard, dashboard: TDashboard): string | undefined;
50
52
  /**
51
53
  * The sheet after a layout change: the layout engine's frames, and its layouts
52
54
  * and customized breakpoints when they changed (responsive layouts SPEC §3.1,
@@ -1,3 +1,4 @@
1
+ import { SheetShapeIssueCode } from '../sheet-kinds.js';
1
2
  import { DataVariable, EmbeddedFilterDashboardInput, TDashboard, TFrame, TInlineFilter, TextCardRichContent } from '../../../lib/types/common-types.js';
2
3
  import { CalculatedFieldOperation } from './calculated-field-operations.js';
3
4
  import { DocumentEdit } from '../../../lib/document/document-edits.js';
@@ -163,8 +164,10 @@ export type DashboardOperation = ({
163
164
  sheet: {
164
165
  id: string;
165
166
  title: string;
166
- kind?: 'document';
167
+ kind?: 'document' | 'table';
167
168
  };
169
+ /** A Table sheet's one frame with its card, ids included (table sheets TS-D12); refused without it, and for any other kind. */
170
+ frame?: TFrame;
168
171
  } | {
169
172
  op: 'sheet.update';
170
173
  sheetId: string;
@@ -274,7 +277,9 @@ export type OperationFailureCode = 'sheet_not_found'
274
277
  /** A sheet with that id is already on the dashboard (building a report SPEC §4.2). */
275
278
  | 'sheet_id_taken'
276
279
  /** A document sheet places cards through its document, not its grid. */
277
- | 'sheet_not_a_grid' | 'frame_id_taken' | 'frame_not_found' | 'card_not_found' | 'filter_not_found' | 'filter_id_taken'
280
+ | 'sheet_not_a_grid'
281
+ /** A Table sheet would break its one-card shape (table sheets SH-1..SH-4, `checkSheetShapes`). */
282
+ | SheetShapeIssueCode | 'frame_id_taken' | 'frame_not_found' | 'card_not_found' | 'filter_not_found' | 'filter_id_taken'
278
283
  /** The filter settings or mapping fail the input contract; `details.issues` has the core's issues. */
279
284
  | 'filter_invalid'
280
285
  /** A requery part compiled for another type than the card's. */
@@ -142,8 +142,12 @@ export type OutlineVariable = {
142
142
  export type OutlineSheet = {
143
143
  sheetId: string;
144
144
  title: string;
145
- /** Cards can be added only to "dashboard" sheets. */
146
- kind: 'dashboard' | 'document';
145
+ /**
146
+ * Cards can be added only to "dashboard" sheets. A "table" sheet holds one
147
+ * table, detail table or Matrix that fills the tab (table sheets TS-D14): its
148
+ * card is changed with card.update; it takes no other card and has no layout.
149
+ */
150
+ kind: 'dashboard' | 'document' | 'table';
147
151
  /** On a Document sheet, its sections' cards (never editable). */
148
152
  cards: OutlineCard[];
149
153
  /** Document sheets only: the header and footer lines by role, and the text sections, each as runs (DV-D13). */
@@ -0,0 +1,36 @@
1
+ import { TCard, TDashboard, TFrame, TSheet } from '../../lib/types/common-types.js';
2
+ /**
3
+ * The sheet kinds (table sheets TS-D4, spec 3.1 and 3.2): a grid sheet holds
4
+ * cards on a layout grid, a Document holds sections, and a Table sheet holds
5
+ * one table-family card that fills the tab. A sheet with no kind is a grid
6
+ * sheet. "Is it a grid?" is `isGridSheet`; the Dashboard Inputs scope, which
7
+ * knows only dashboard and document sheets, reads a sheet through
8
+ * `inputScopeKindOf`.
9
+ */
10
+ export type SheetKind = 'dashboard' | 'document' | 'table';
11
+ export declare const TABLE_SHEET_CARD_TYPES: readonly ["table", "detailTable", "matrixTable"];
12
+ export type TableSheetCardType = (typeof TABLE_SHEET_CARD_TYPES)[number];
13
+ type KindOf = Pick<TSheet, 'kind'> | null | undefined;
14
+ export declare function sheetKindOf(sheet: KindOf): SheetKind;
15
+ export declare function isTableSheet(sheet: KindOf): boolean;
16
+ /** True only for dashboard sheets: the sheets that hold a layout grid and take cards. */
17
+ export declare function isGridSheet(sheet: KindOf): boolean;
18
+ /** The two-value kind Dashboard Inputs scope uses: a Table sheet is in scope as a dashboard sheet (TS-D2). */
19
+ export declare function inputScopeKindOf(sheet: KindOf): 'dashboard' | 'document';
20
+ export declare function isTableSheetCardType(type: string | undefined): type is TableSheetCardType;
21
+ /** The sheet card and its frame; undefined when the sheet is not a Table sheet or has no single card. */
22
+ export declare function tableSheetCard(sheet: TSheet): {
23
+ frame: TFrame;
24
+ card: TCard;
25
+ } | undefined;
26
+ export type SheetShapeIssueCode = 'table_sheet_no_card' | 'table_sheet_extra_card' | 'table_sheet_card_type' | 'table_sheet_layout';
27
+ export type SheetShapeIssue = {
28
+ code: SheetShapeIssueCode;
29
+ sheetId: string;
30
+ /** One plain sentence naming the sheet by title. */
31
+ message: string;
32
+ fix: string;
33
+ };
34
+ /** SH-1..SH-4 for every Table sheet; [] for a dashboard that has none. */
35
+ export declare function checkSheetShapes(dashboard: Pick<TDashboard, 'sheets'>): SheetShapeIssue[];
36
+ export {};
@@ -0,0 +1,140 @@
1
+ import { TCard } from '../../lib/types/common-types.js';
2
+ import { Field, GroupByField, PivotByField, AggregateFunction } from '../../lib/types/explorer-types.js';
3
+ import { FieldAvailabilityContext } from '../../lib/utils/field-availability-context.js';
4
+ /**
5
+ * A Table sheet's table as a shape (table sheets TS-D30): every row, one row
6
+ * per group (Flat) or levels that open and close (Collapsible). The author
7
+ * never picks a card type; grouping does it. Every move goes through here and
8
+ * the existing type change, so the sheet, the card editor and an agent's
9
+ * `card.update` build the same card:
10
+ *
11
+ * - every row is a detail table (`detailColumns`);
12
+ * - Flat is a table (`groupByColumns`, `metricColumns`, `pivotByColumns`);
13
+ * - Collapsible is that table changed to a Matrix by `changeCardType`. Its
14
+ * levels, spread fields and measures are then edited in place by the
15
+ * Matrix editor's own writers, so its measure filters, highlights, sorts
16
+ * and display stay; only Flat and Collapsible cross the type boundary,
17
+ * and what doesn't carry is named (TS-D19).
18
+ * - A summary made from every row always has a measure (a count when
19
+ * nothing is a number); a Collapsible one keeps a level and a measure, as
20
+ * a Matrix needs, and one without both shows Flat.
21
+ *
22
+ * Grouping or spreading a table that shows every row makes it a summary: its
23
+ * number columns become measures at their default aggregate (named by
24
+ * `addedMeasureLabel`, TS-D22) and its other columns leave, named in
25
+ * `leftOut` (TS-D31). Removing the last level and the last spread field
26
+ * returns to every row with the levels' and measures' fields as columns.
27
+ */
28
+ export type TableSheetDisplay = 'rows' | 'flat' | 'collapsible';
29
+ export type ShapeContext = {
30
+ /** The loaded field catalog: a Matrix is built and read against it. */
31
+ readonly catalog: readonly Field[];
32
+ readonly catalogLoading?: boolean;
33
+ /** Mints new column ids (UUIDs for Matrix fields). */
34
+ readonly createId: () => string;
35
+ /**
36
+ * The editor's field availability (which datasets the card can reach): a
37
+ * field the editor would refuse to place is refused here too (Astra 4).
38
+ */
39
+ readonly availability?: FieldAvailabilityContext;
40
+ /** The folder a related dataset's field sits in: a new level or spread is named after it (`relatedColumnLabel`). */
41
+ readonly relatedFolderLabel?: (field: Field) => string | undefined;
42
+ };
43
+ export type ShapeChange = {
44
+ readonly status: 'changed';
45
+ readonly card: TCard;
46
+ readonly leftOut: readonly string[];
47
+ /** What the Matrix editor's writers say changed with it (a sort or a measure filter that went). */
48
+ readonly notices?: readonly string[];
49
+ } | {
50
+ readonly status: 'unchanged';
51
+ } | {
52
+ readonly status: 'refused';
53
+ readonly reason: 'sql' | 'catalog_loading' | 'not_a_table' | 'last_measure' | 'matrix' | 'unavailable';
54
+ /** The editor's own words, for `matrix` and `unavailable`. */
55
+ readonly message?: string;
56
+ };
57
+ /** Which shape the card is. */
58
+ export declare function tableSheetDisplay(card: Pick<TCard, 'type'>): TableSheetDisplay | undefined;
59
+ export declare function groupRows(card: TCard, picked: Field, ctx: ShapeContext, grain?: GroupByField['granularity']): ShapeChange;
60
+ /** Spread `field`'s values across columns. From every row, the table becomes a summary shown Flat. */
61
+ export declare function spreadAcross(card: TCard, picked: Field, ctx: ShapeContext, grain?: PivotByField['granularity']): ShapeChange;
62
+ /** A column to remove, by id, or by its field when a Matrix was read back as a table (new ids). */
63
+ export type ColumnRef = Pick<Field, 'id' | 'name' | 'qualifiedEntityName'>;
64
+ /** Stop grouping by a level; the last one (with nothing spread) returns to every row. */
65
+ export declare function ungroupRows(card: TCard, level: ColumnRef, ctx: ShapeContext): ShapeChange;
66
+ /** Stop spreading a field across columns; with no level left, back to every row. */
67
+ export declare function unspreadAcross(card: TCard, across: ColumnRef, ctx: ShapeContext): ShapeChange;
68
+ /**
69
+ * Show a summary Flat (one row per group, paged by row) or Collapsible
70
+ * (levels, paged by level); Collapsible needs a level.
71
+ */
72
+ export declare function showSummaryAs(card: TCard, display: 'flat' | 'collapsible', ctx: ShapeContext): ShapeChange;
73
+ /** Remove a column, a measure or a level from the query (Remove is not Hide, TS-D34). */
74
+ export declare function removeColumn(card: TCard, ref: ColumnRef, ctx: ShapeContext): ShapeChange;
75
+ /**
76
+ * How a measure adds up on each group, as the card editor's aggregate
77
+ * control writes it (`metricAggregatePatch`, a generated label renamed); on
78
+ * a Collapsible table, the Matrix measure's aggregate in place.
79
+ */
80
+ export declare function setAggregate(card: TCard, measure: ColumnRef, aggregate: AggregateFunction, ctx: ShapeContext): ShapeChange;
81
+ /** A measure as the sheet lists it: its type decides which aggregates it offers. */
82
+ export type ShapeMeasure = {
83
+ ref: ColumnRef;
84
+ label: string;
85
+ aggregate?: string;
86
+ dataType?: string;
87
+ };
88
+ /** The table's measures as the sheet lists them, whatever card type holds them. */
89
+ export declare function readMeasures(card: TCard): ShapeMeasure[];
90
+ /** A level or a spread field as the sheet lists it: how to name it, and how to remove it. */
91
+ export type ShapeItem = {
92
+ readonly ref: ColumnRef;
93
+ readonly label: string;
94
+ readonly grain?: string;
95
+ readonly dataType?: string;
96
+ };
97
+ /** The table's levels (rows) and spread fields (across), whatever card type holds them. */
98
+ export declare function readShape(card: TCard,
99
+ /** The table's fields: with it, a Collapsible level's ref names its dataset (the Matrix resolver). */
100
+ catalog?: readonly Field[]): {
101
+ display: TableSheetDisplay | undefined;
102
+ levels: ShapeItem[];
103
+ across: ShapeItem[];
104
+ };
105
+ /** A column's field by its id: a column showing every row, a level, a spread field or a measure. */
106
+ export declare function shapeField(card: TCard, id: string | undefined): Field | undefined;
107
+ /** The grains a date groups or spreads at on a Table sheet: never by day (TS-D33). */
108
+ export type ShapeGrain = 'year' | 'quarter';
109
+ export declare const SHAPE_GRAINS: readonly ShapeGrain[];
110
+ /**
111
+ * How a field can group rows or spread across columns, the one rule every
112
+ * surface reads (the lanes, a column's menu, a field's ···): a date at each of
113
+ * `SHAPE_GRAINS`, another field as it is (one `undefined`), a number not at all
114
+ * (numbers are the summary's measures, `/design/table-sheet-grouping`).
115
+ */
116
+ export declare function shapeGrainsFor(field: Pick<Field, 'dataType'>): readonly (ShapeGrain | undefined)[];
117
+ /** `shapeGrainsFor` for each of the table's columns that isn't a measure, by id. */
118
+ export declare function shapeFieldGrains(card: TCard): ReadonlyMap<string, readonly (ShapeGrain | undefined)[]>;
119
+ /**
120
+ * The ids of the table's fields whose cells can be highlighted (TS-D35): its
121
+ * number columns and measures. A spread table's measures are left out: their
122
+ * cells are pivot columns, which a field rule doesn't reach (a highlight there
123
+ * waits for pivot rules on the sheet).
124
+ */
125
+ export declare function shapeNumberFieldIds(card: TCard): ReadonlySet<string>;
126
+ /** Where a column's field sits on a Flat or every-row table: its shelf and place, as the editor's field settings address it (TS-D35). */
127
+ export type ShapePlacement = {
128
+ readonly zone: 'detailColumns' | 'groupBy' | 'pivotBy' | 'metrics';
129
+ readonly index: number;
130
+ readonly field: Field;
131
+ };
132
+ export declare function shapePlacement(card: TCard, id: string): ShapePlacement | undefined;
133
+ /** A Collapsible table's level or measure by its id, as its settings card names it (TS-D35). */
134
+ export declare function matrixColumnField(card: TCard, id: string): {
135
+ name: string;
136
+ label?: string;
137
+ dataType?: string;
138
+ } | undefined;
139
+ /** A new Table sheet's table: every row, nothing placed yet (TS-D36). */
140
+ export declare function everyRowCard(card: TCard): TCard;