react-semaphor 0.1.515 → 0.1.516

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 (210) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +226 -225
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +4 -4
  5. package/dist/briefings/index.cjs +1 -1
  6. package/dist/briefings/index.js +8 -8
  7. package/dist/chunks/{calculated-field-identity-BiTGmnST.cjs → calculated-field-identity-5bg9oHTw.cjs} +1 -1
  8. package/dist/chunks/{calculated-field-identity-DnRd4YIY.js → calculated-field-identity-DzJBs2J8.js} +4 -4
  9. package/dist/chunks/{card-config-utils-B2cDWQqB.js → card-config-utils-Cxnq2R6z.js} +14 -14
  10. package/dist/chunks/{card-config-utils-CMO4_zVs.cjs → card-config-utils-z86y6tSq.cjs} +1 -1
  11. package/dist/chunks/column-bands-CU0byntA.cjs +1 -0
  12. package/dist/chunks/column-bands-RdM-kjDe.js +47 -0
  13. package/dist/chunks/{dashboard-briefing-launcher-BA_bl05p.js → dashboard-briefing-launcher-BCEHJ_eD.js} +15 -12
  14. package/dist/chunks/{dashboard-briefing-launcher-B7zqm8P1.cjs → dashboard-briefing-launcher-CjZ4aE34.cjs} +2 -2
  15. package/dist/chunks/{dashboard-controls-QMW17RKx.js → dashboard-controls-DFfit5KH.js} +12 -12
  16. package/dist/chunks/{dashboard-controls-x_v9wLOU.cjs → dashboard-controls-f9aJ70Zu.cjs} +1 -1
  17. package/dist/chunks/{dashboard-date-comparison-definition-D7Bl-YAl.js → dashboard-date-comparison-definition-BqNhECUr.js} +6 -6
  18. package/dist/chunks/{dashboard-date-comparison-definition-C_w-GO_5.cjs → dashboard-date-comparison-definition-Y6JZwpcr.cjs} +1 -1
  19. package/dist/chunks/{dashboard-json-DRnpkNwO.js → dashboard-json-DVtcA02f.js} +7 -7
  20. package/dist/chunks/{dashboard-json-0ZLLBlHj.cjs → dashboard-json-deqQC-UR.cjs} +1 -1
  21. package/dist/chunks/edit-dashboard-visual-DK6lSC_p.cjs +172 -0
  22. package/dist/chunks/{edit-dashboard-visual-1ISjhwry.js → edit-dashboard-visual-lJ6rDH3w.js} +4338 -4324
  23. package/dist/chunks/{editor-action-buttons-BTCKZERI.js → editor-action-buttons-Bnxxa439.js} +7 -7
  24. package/dist/chunks/{editor-action-buttons-Czq5SnA9.cjs → editor-action-buttons-CmDaQbPN.cjs} +1 -1
  25. package/dist/chunks/{field-aggregations-CzuQKtqx.js → field-aggregations-Dl2A3rbV.js} +461 -358
  26. package/dist/chunks/field-aggregations-pH_3kymD.cjs +1 -0
  27. package/dist/chunks/{field-dependencies-DIab72rQ.cjs → field-dependencies-EB485TdB.cjs} +1 -1
  28. package/dist/chunks/{field-dependencies-DXW4jtvJ.js → field-dependencies-v-lJNzC7.js} +1 -1
  29. package/dist/chunks/{index-Dlic9KZs.js → index-BVVl2JDK.js} +57730 -54586
  30. package/dist/chunks/index-DfqMtR9S.cjs +4 -0
  31. package/dist/chunks/index-UNKSfi7s.cjs +1434 -0
  32. package/dist/chunks/{index-v1OE4-eA.js → index-ylOpKRDu.js} +877 -849
  33. package/dist/chunks/{matrix-analytical-definition-Ct5Tu8np.cjs → matrix-analytical-definition-BWd159lN.cjs} +1 -1
  34. package/dist/chunks/{matrix-analytical-definition-BDAK2aEi.js → matrix-analytical-definition-BimC4XIV.js} +1 -1
  35. package/dist/chunks/{matrix-card-U4c72doZ.cjs → matrix-card-C2RjEYZ8.cjs} +1 -1
  36. package/dist/chunks/{matrix-card-DOIeTmjh.js → matrix-card-CIlz0Dnp.js} +2 -2
  37. package/dist/chunks/{matrix-control-sources-FjxGIbqk.cjs → matrix-control-sources-BvEJF7d3.cjs} +1 -1
  38. package/dist/chunks/{matrix-control-sources-BxKH2yu2.js → matrix-control-sources-KbZe1gj_.js} +51 -51
  39. package/dist/chunks/{matrix-definition-CBJW_4ii.cjs → matrix-definition-DanUT11P.cjs} +1 -1
  40. package/dist/chunks/{matrix-definition-I9rHB9zN.js → matrix-definition-E5gXXSTZ.js} +1 -1
  41. package/dist/chunks/matrix-formatter-BJTO8ky9.cjs +1 -0
  42. package/dist/chunks/{matrix-formatter-BdIsE7Qu.js → matrix-formatter-CCXNRt3s.js} +81 -81
  43. package/dist/chunks/{matrix-member-presentation-DO1VSqfh.js → matrix-member-presentation-Bw7-JCrr.js} +64 -64
  44. package/dist/chunks/matrix-member-presentation-DvXDEo0U.cjs +1 -0
  45. package/dist/chunks/{matrix-operation-contract-DoiWTUbT.cjs → matrix-operation-contract-0RxoU_M3.cjs} +1 -1
  46. package/dist/chunks/{matrix-operation-contract-D0HfzwZg.js → matrix-operation-contract-D32U2CSw.js} +19 -19
  47. package/dist/chunks/{metric-comparison-Dqc7_tnW.js → metric-comparison-BphoJ9bq.js} +1 -1
  48. package/dist/chunks/{metric-comparison-DBQ3EJTz.cjs → metric-comparison-CUmltzpz.cjs} +1 -1
  49. package/dist/chunks/pivot-header-presentation-BSZhB1g-.js +661 -0
  50. package/dist/chunks/pivot-header-presentation-EoUS5ze5.cjs +5 -0
  51. package/dist/chunks/{pivot-result-identity-8M-bZrw9.js → pivot-result-identity-BzUQiCEV.js} +4 -4
  52. package/dist/chunks/{pivot-result-identity-uTiylUNr.cjs → pivot-result-identity-gquWljbd.cjs} +1 -1
  53. package/dist/chunks/{pivot-result-lifecycle-vg_suUNb.cjs → pivot-result-lifecycle-gl9cBfB-.cjs} +1 -1
  54. package/dist/chunks/{pivot-result-lifecycle-CEmyU2At.js → pivot-result-lifecycle-kRhiJkzg.js} +8 -8
  55. package/dist/chunks/{raw-temporal-Bj6_w9cG.js → raw-temporal-BqOfk-xN.js} +16 -16
  56. package/dist/chunks/{raw-temporal-contract-CFLGwTiI.js → raw-temporal-contract-BQZIJ1fn.js} +1 -1
  57. package/dist/chunks/{raw-temporal-contract-DECbTuzA.cjs → raw-temporal-contract-CklMVG_1.cjs} +1 -1
  58. package/dist/chunks/{raw-temporal-CeblVJbu.cjs → raw-temporal-eJXecCyJ.cjs} +1 -1
  59. package/dist/chunks/{report-preferences-dialog-b8J6KjSy.js → report-preferences-dialog-CHXPEl7v.js} +6 -6
  60. package/dist/chunks/{report-preferences-dialog-Dr1BYwuf.cjs → report-preferences-dialog-Cto0vDwI.cjs} +1 -1
  61. package/dist/chunks/{report-runtime-context-Cs65Mrxj.js → report-runtime-context-CxIoGyNM.js} +1 -1
  62. package/dist/chunks/{report-runtime-context-DzvHBPxl.cjs → report-runtime-context-CzSrCBsu.cjs} +1 -1
  63. package/dist/chunks/{selection-reducer-BIiQXbGM.js → selection-reducer-CvCBQbl2.js} +1 -1
  64. package/dist/chunks/{selection-reducer-CGKKsaPa.cjs → selection-reducer-Kl22OzIk.cjs} +1 -1
  65. package/dist/chunks/{semantic-format-Dt-nUxFB.js → semantic-format-DwqGYx4V.js} +2 -2
  66. package/dist/chunks/{semantic-format-DFI1iszk.cjs → semantic-format-mVI32OJH.cjs} +1 -1
  67. package/dist/chunks/{source-entity-resolution-D7vnmDwm.js → source-entity-resolution-Bzefiive.js} +7 -7
  68. package/dist/chunks/{source-entity-resolution-CjbgnwyX.cjs → source-entity-resolution-R46X34SE.cjs} +1 -1
  69. package/dist/chunks/switch-DNbWXEOP.cjs +134 -0
  70. package/dist/chunks/{switch-D5_tjsIS.js → switch-DNv-hVmt.js} +8230 -7681
  71. package/dist/chunks/{temporal-bucket-B9hMwemw.js → temporal-bucket-DlFuhCnT.js} +6 -6
  72. package/dist/chunks/{temporal-bucket-contract-IWDgyTMw.js → temporal-bucket-contract-DTLDRzgV.js} +1 -1
  73. package/dist/chunks/{temporal-bucket-contract-ZctiyXYk.cjs → temporal-bucket-contract-nTv6gvX5.cjs} +1 -1
  74. package/dist/chunks/{token-types-Dl0hcKBX.js → token-types-BC6RcUY8.js} +1 -1
  75. package/dist/chunks/{token-types-Ahh5u4iT.cjs → token-types-aWrzwonf.cjs} +1 -1
  76. package/dist/chunks/{update-policy-COjFudhl.cjs → update-policy-DRDLWe7Y.cjs} +1 -1
  77. package/dist/chunks/{update-policy-BeQqjupC.js → update-policy-DhAUtiC8.js} +2 -2
  78. package/dist/chunks/{validators-CkHsAvwB.js → validators-CsdOtZI6.js} +411 -397
  79. package/dist/chunks/validators-DFeDcdpA.cjs +1 -0
  80. package/dist/dashboard/index.cjs +1 -1
  81. package/dist/dashboard/index.js +1 -1
  82. package/dist/dashboard-authoring/index.cjs +3 -3
  83. package/dist/dashboard-authoring/index.js +233 -227
  84. package/dist/data-app-builder/index.cjs +1 -1
  85. package/dist/data-app-builder/index.js +3 -3
  86. package/dist/data-app-codegen/index.cjs +1 -1
  87. package/dist/data-app-codegen/index.js +2 -2
  88. package/dist/data-app-codegen-node/index.cjs +1 -1
  89. package/dist/data-app-codegen-node/index.js +3 -3
  90. package/dist/data-app-sdk/index.cjs +1 -1
  91. package/dist/data-app-sdk/index.js +5 -5
  92. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  93. package/dist/data-app-sdk-adapters/index.js +2 -2
  94. package/dist/data-app-sdk-validation/index.cjs +1 -1
  95. package/dist/data-app-sdk-validation/index.js +5 -5
  96. package/dist/format-utils/index.cjs +3 -3
  97. package/dist/format-utils/index.js +291 -402
  98. package/dist/index.cjs +1 -1
  99. package/dist/index.js +15 -15
  100. package/dist/pdf-table-layout/index.cjs +1 -0
  101. package/dist/pdf-table-layout/index.js +993 -0
  102. package/dist/report-runtime-context/index.cjs +1 -1
  103. package/dist/report-runtime-context/index.js +2 -2
  104. package/dist/style.css +1 -1
  105. package/dist/surfboard/index.cjs +1 -1
  106. package/dist/surfboard/index.js +2 -2
  107. package/dist/types/briefings/index.d.ts +1 -1
  108. package/dist/types/components/document-sheet/document-input-bar.d.ts +1 -3
  109. package/dist/types/components/document-sheet/document-insert-picker.d.ts +37 -0
  110. package/dist/types/components/document-sheet/document-kpi-section.d.ts +17 -0
  111. package/dist/types/components/document-sheet/document-matrix-layout-context.d.ts +10 -0
  112. package/dist/types/components/document-sheet/document-matrix-section.d.ts +27 -0
  113. package/dist/types/components/document-sheet/document-measure-layer.d.ts +45 -0
  114. package/dist/types/components/document-sheet/document-outline.d.ts +7 -1
  115. package/dist/types/components/document-sheet/document-page-navigation.d.ts +22 -0
  116. package/dist/types/components/document-sheet/document-page.d.ts +9 -5
  117. package/dist/types/components/document-sheet/document-panel/document-side-panel.d.ts +36 -0
  118. package/dist/types/components/document-sheet/document-panel/inputs-panel.d.ts +9 -0
  119. package/dist/types/components/document-sheet/document-panel/page-panel.d.ts +5 -0
  120. package/dist/types/components/document-sheet/document-panel/panel-controls.d.ts +14 -0
  121. package/dist/types/components/document-sheet/document-panel/region-panels.d.ts +11 -0
  122. package/dist/types/components/document-sheet/document-panel/section-panel.d.ts +25 -0
  123. package/dist/types/components/document-sheet/document-section-print-boundary.d.ts +9 -0
  124. package/dist/types/components/document-sheet/document-table-chrome.d.ts +22 -0
  125. package/dist/types/components/document-sheet/document-table-section.d.ts +3 -7
  126. package/dist/types/components/document-sheet/document-text-preview-context.d.ts +8 -0
  127. package/dist/types/components/document-sheet/use-first-fitting-variant.d.ts +18 -0
  128. package/dist/types/components/editor/editor-main/dashboard-variable-node.d.ts +12 -2
  129. package/dist/types/components/explorer/chart-configuration/matrix-authoring-controls.d.ts +7 -2
  130. package/dist/types/components/text-variables/variable-chip-plugin.d.ts +23 -0
  131. package/dist/types/components/text-variables/variable-chip.d.ts +18 -0
  132. package/dist/types/components/text-variables/variable-picker.d.ts +27 -0
  133. package/dist/types/components/visual/settings/table-presentation-settings.d.ts +27 -1
  134. package/dist/types/index.cjs +1 -1
  135. package/dist/types/index.js +5 -5
  136. package/dist/types/lib/dashboard-inputs/text-variable-options.d.ts +15 -0
  137. package/dist/types/lib/document/document-canvas-actions.d.ts +22 -0
  138. package/dist/types/lib/document/document-edits.d.ts +119 -0
  139. package/dist/types/lib/document/document-kpi-figure.d.ts +27 -0
  140. package/dist/types/lib/document/document-kpi-layout.d.ts +29 -0
  141. package/dist/types/lib/document/document-kpi-section-edits.d.ts +15 -0
  142. package/dist/types/lib/document/document-matrix-bands.d.ts +66 -0
  143. package/dist/types/lib/document/document-matrix-print.d.ts +11 -0
  144. package/dist/types/lib/document/document-pagination.d.ts +56 -3
  145. package/dist/types/lib/document/document-panel-target.d.ts +19 -0
  146. package/dist/types/lib/document/document-section-editor.d.ts +8 -7
  147. package/dist/types/lib/document/document-section-kinds.d.ts +49 -0
  148. package/dist/types/lib/document/document-section-query-options.d.ts +25 -0
  149. package/dist/types/lib/document/document-section-render-state.d.ts +26 -0
  150. package/dist/types/lib/document/document-section-utils.d.ts +11 -4
  151. package/dist/types/lib/document/document-table-dom.d.ts +4 -6
  152. package/dist/types/lib/document/document-table-pagination-model.d.ts +0 -5
  153. package/dist/types/lib/document/document-table-print-model.d.ts +4 -3
  154. package/dist/types/lib/document/document-table-style.d.ts +15 -4
  155. package/dist/types/lib/document/document-table-surface.d.ts +15 -0
  156. package/dist/types/lib/document/document-variables.d.ts +40 -6
  157. package/dist/types/lib/document/use-document-section-data.d.ts +39 -0
  158. package/dist/types/lib/document/use-measured-document-table-layout.d.ts +50 -0
  159. package/dist/types/lib/formatters/kpi-result-values.d.ts +20 -0
  160. package/dist/types/lib/hooks/query-context/use-dashboard-card-execution-snapshot.d.ts +8 -2
  161. package/dist/types/lib/hooks/use-dashboard-frame-query.d.ts +6 -0
  162. package/dist/types/lib/hooks/use-dashboard-kpi-actions.d.ts +1 -1
  163. package/dist/types/lib/hooks/use-document-section-editor.d.ts +2 -2
  164. package/dist/types/lib/hooks/use-document-section-session.d.ts +36 -0
  165. package/dist/types/lib/hooks/use-editor-preview.d.ts +17 -0
  166. package/dist/types/lib/hooks/use-is-editing-card.d.ts +7 -0
  167. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +2 -0
  168. package/dist/types/lib/matrix-table/matrix-card-draft.d.ts +2 -0
  169. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +4 -0
  170. package/dist/types/lib/matrix-table/matrix-layout-read.d.ts +68 -0
  171. package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +8 -1
  172. package/dist/types/lib/query-context/build-dashboard-frame-base-query-contexts.d.ts +4 -2
  173. package/dist/types/lib/query-context/card-execution.d.ts +30 -0
  174. package/dist/types/lib/query-context/document-section-card-query.d.ts +37 -0
  175. package/dist/types/lib/stores/dashboard-store.d.ts +12 -8
  176. package/dist/types/lib/stores/editor-store.d.ts +2 -0
  177. package/dist/types/lib/text-variables/text-variable-types.d.ts +39 -0
  178. package/dist/types/lib/types/common-types.d.ts +34 -1
  179. package/dist/types/lib/utils/card-definition.d.ts +2 -0
  180. package/dist/types/lib/utils/card-utils.d.ts +13 -6
  181. package/dist/types/pdf-table-layout.d.ts +2 -0
  182. package/dist/types/shared/analytics-protocol/index.d.ts +1 -1
  183. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +45 -0
  184. package/dist/types/shared/analytics-protocol/matrix-member-presentation.d.ts +4 -0
  185. package/dist/types/shared/dashboard-authoring/document-section-cards.d.ts +56 -0
  186. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
  187. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +36 -1
  188. package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +5 -0
  189. package/dist/types/shared/format-utils/index.d.ts +1 -0
  190. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +690 -1
  191. package/dist/types/shared/format-utils/matrix-print.d.ts +38 -0
  192. package/dist/types/shared/format-utils/pdf-table-layout/column-bands.d.ts +55 -0
  193. package/dist/types/shared/format-utils/pdf-table-layout/index.d.ts +6 -0
  194. package/dist/types/shared/format-utils/pdf-table-layout/page-size.d.ts +7 -0
  195. package/dist/types/shared/format-utils/pdf-table-layout/table-column-semantics.d.ts +106 -0
  196. package/dist/types/shared/format-utils/pdf-table-layout/table-column-widths.d.ts +13 -0
  197. package/dist/types/shared/format-utils/pdf-table-layout/table-page-geometry.d.ts +19 -0
  198. package/dist/types/shared/format-utils/pdf-table-layout/wide-table-layout.d.ts +46 -0
  199. package/dist/types/shared/format-utils/table-structure.d.ts +9 -0
  200. package/package.json +6 -1
  201. package/dist/chunks/edit-dashboard-visual-CI0EqzKj.cjs +0 -172
  202. package/dist/chunks/field-aggregations-jSi77h9Z.cjs +0 -1
  203. package/dist/chunks/index-BMMXKK3G.cjs +0 -4
  204. package/dist/chunks/index-C6_xef4P.cjs +0 -1424
  205. package/dist/chunks/matrix-formatter-Dajj91Ni.cjs +0 -1
  206. package/dist/chunks/matrix-member-presentation-CFHjdrxT.cjs +0 -1
  207. package/dist/chunks/pivot-header-presentation-BIf4HW3L.js +0 -414
  208. package/dist/chunks/pivot-header-presentation-B_N11CgN.cjs +0 -5
  209. package/dist/chunks/switch-Ced9ZZwI.cjs +0 -134
  210. package/dist/chunks/validators-DVYAnnX0.cjs +0 -1
@@ -0,0 +1,27 @@
1
+ import { TextVariableKind, TextVariableOption, TextVariableSelection } from '../../lib/text-variables/text-variable-types.js';
2
+ export declare function TextVariableKindIcon({ kind, className, }: {
3
+ kind: TextVariableKind;
4
+ className?: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ type VariablePickerProps = {
7
+ options: readonly TextVariableOption[];
8
+ /** What the chip shows now (editing a chip). */
9
+ selection?: TextVariableSelection;
10
+ /** The chip's input no longer exists. */
11
+ missing?: boolean;
12
+ /**
13
+ * `search`: the picker has its own search box. `typeahead`: the text typed
14
+ * after {{ is the search, and the editor keeps focus.
15
+ */
16
+ mode: {
17
+ kind: 'search';
18
+ } | {
19
+ kind: 'typeahead';
20
+ query: string;
21
+ activeOptionId?: string;
22
+ };
23
+ onPick: (selection: TextVariableSelection) => void;
24
+ onRemove?: () => void;
25
+ };
26
+ export declare function VariablePicker({ options, selection, missing, mode, onPick, onRemove, }: VariablePickerProps): import("react/jsx-runtime").JSX.Element;
27
+ export {};
@@ -4,6 +4,10 @@ import { ReactNode } from 'react';
4
4
  type TablePresentationSettingsProps = {
5
5
  style: ResolvedTablePresentationStyle;
6
6
  onDensityChange: (density: TableDensity) => void;
7
+ /** The densities offered, in order. Defaults to all of them. A current
8
+ * value outside the list is still shown, so nothing changes until the
9
+ * author picks. */
10
+ densityOptions?: readonly TableDensity[];
7
11
  onStyleChange: (update: Partial<TableStylePreferences>) => void;
8
12
  totals?: {
9
13
  enabled?: boolean;
@@ -20,8 +24,30 @@ type TablePresentationSettingsProps = {
20
24
  * the surrounding "Appearance" tab can hand custom content in without
21
25
  * forking the layout. */
22
26
  extraSection?: ReactNode;
27
+ /** What the totals colors reset to; a Document passes its own. */
28
+ totalsDefaults?: Required<TableTotalsStylePreferences>;
29
+ /** The top-rule styles offered; a Document leaves out Double. */
30
+ totalsBorderStyleOptions?: readonly Required<TableTotalsStylePreferences>['borderTopStyle'][];
23
31
  onReset?: () => void;
24
32
  className?: string;
25
33
  };
26
- export declare function TablePresentationSettings({ style, onDensityChange, onStyleChange, totals, showFullStyle, showBorderStyle, extraSection, onReset, className, }: TablePresentationSettingsProps): import("react/jsx-runtime").JSX.Element;
34
+ export declare function TablePresentationSettings({ style, onDensityChange, densityOptions, onStyleChange, totals, showFullStyle, showBorderStyle, extraSection, totalsDefaults, totalsBorderStyleOptions, onReset, className, }: TablePresentationSettingsProps): import("react/jsx-runtime").JSX.Element;
35
+ export declare function TableSettingsSection({ label, action, children, }: {
36
+ label: string;
37
+ /** Optional right-aligned slot in the section header — use for a master
38
+ * toggle that gates the whole section (e.g. "Show totals row"). The
39
+ * styling rows below should only render when the master is on. */
40
+ action?: ReactNode;
41
+ children: ReactNode;
42
+ }): import("react/jsx-runtime").JSX.Element;
43
+ export declare function TableSettingsRow({ label, htmlFor, children, }: {
44
+ label: string;
45
+ htmlFor?: string;
46
+ children: ReactNode;
47
+ }): import("react/jsx-runtime").JSX.Element;
48
+ export declare function TableSettingsSwitchRow({ label, checked, onCheckedChange, }: {
49
+ label: string;
50
+ checked: boolean;
51
+ onCheckedChange: (checked: boolean) => void;
52
+ }): import("react/jsx-runtime").JSX.Element;
27
53
  export {};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../chunks/common-types-nBuCd3u2.cjs"),e=require("../chunks/validators-DVYAnnX0.cjs"),t=require("../chunks/field-dependencies-DIab72rQ.cjs"),r=require("../chunks/token-types-Ahh5u4iT.cjs"),l=require("../chunks/pivot-result-identity-uTiylUNr.cjs"),o=require("../chunks/report-runtime-context-DzvHBPxl.cjs"),i=["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"];exports.CONTROL_CARD_DEFAULT_VALUE=a.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=a.EMPTY_SELECTION;exports.CALCULATED_FIELD_ENTITY_MARKER=e.CALCULATED_FIELD_ENTITY_MARKER;exports.DATE_FORMAT_VALUES=e.DATE_FORMAT_VALUES;exports.LEGACY_CALCULATED_FIELD_ENTITY_MARKER=e.LEGACY_CALCULATED_FIELD_ENTITY_MARKER;exports.PivotMarkerEnum=e.PivotMarkerEnum;exports.getCalculatedFieldComputeStage=e.getCalculatedFieldComputeStage;exports.getFieldRuntimeColumnName=e.getFieldRuntimeColumnName;exports.hasCalculatedFieldMarker=e.hasCalculatedFieldMarker;exports.hasCalculatedFormulaInputs=e.hasCalculatedFormulaInputs;exports.hasSyntheticCalculatedFieldOwner=e.hasSyntheticCalculatedFieldOwner;exports.inspectCalculatedField=e.inspectCalculatedField;exports.isCalculatedDimension=e.isCalculatedDimension;exports.isCalculatedMetric=e.isCalculatedMetric;exports.isDerivedField=e.isDerivedField;exports.normalizeCalculatedFieldRepresentation=e.normalizeCalculatedFieldRepresentation;exports.shouldDropInheritedCalculationAggregate=e.shouldDropInheritedCalculationAggregate;exports.collectDatasetNamesFromExplorerField=t.collectDatasetNamesFromExplorerField;exports.collectDatasetNamesFromFilterGroup=t.collectDatasetNamesFromFilterGroup;exports.collectExecutionDatasetNamesFromExplorerField=t.collectExecutionDatasetNamesFromExplorerField;exports.collectPreferredDatasetNamesFromExplorerField=t.collectPreferredDatasetNamesFromExplorerField;exports.collectQualifiedDatasetNamesFromExplorerField=t.collectQualifiedDatasetNamesFromExplorerField;exports.datasetRefFromSource=t.datasetRefFromSource;exports.dependencyDisplayIdentity=t.dependencyDisplayIdentity;exports.humanizeDatasetName=t.humanizeDatasetName;exports.resolveFieldDatasetDependencies=t.resolveFieldDatasetDependencies;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=r.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.resolveQueryColumnKeyMapEntry=l.resolveQueryColumnKeyMapEntry;exports.resolveUniqueQueryColumnKeyMapEntry=l.resolveUniqueQueryColumnKeyMapEntry;exports.DEFAULT_CALENDAR_CONTEXT=o.DEFAULT_CALENDAR_CONTEXT;exports.CALCULATED_FIELD_TEMPLATE_IDS=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../chunks/common-types-nBuCd3u2.cjs"),e=require("../chunks/validators-DFeDcdpA.cjs"),t=require("../chunks/field-dependencies-EB485TdB.cjs"),r=require("../chunks/token-types-aWrzwonf.cjs"),l=require("../chunks/pivot-result-identity-gquWljbd.cjs"),o=require("../chunks/report-runtime-context-CzSrCBsu.cjs"),i=["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"];exports.CONTROL_CARD_DEFAULT_VALUE=a.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=a.EMPTY_SELECTION;exports.CALCULATED_FIELD_ENTITY_MARKER=e.CALCULATED_FIELD_ENTITY_MARKER;exports.DATE_FORMAT_VALUES=e.DATE_FORMAT_VALUES;exports.LEGACY_CALCULATED_FIELD_ENTITY_MARKER=e.LEGACY_CALCULATED_FIELD_ENTITY_MARKER;exports.PivotMarkerEnum=e.PivotMarkerEnum;exports.getCalculatedFieldComputeStage=e.getCalculatedFieldComputeStage;exports.getFieldRuntimeColumnName=e.getFieldRuntimeColumnName;exports.hasCalculatedFieldMarker=e.hasCalculatedFieldMarker;exports.hasCalculatedFormulaInputs=e.hasCalculatedFormulaInputs;exports.hasSyntheticCalculatedFieldOwner=e.hasSyntheticCalculatedFieldOwner;exports.inspectCalculatedField=e.inspectCalculatedField;exports.isCalculatedDimension=e.isCalculatedDimension;exports.isCalculatedMetric=e.isCalculatedMetric;exports.isDerivedField=e.isDerivedField;exports.normalizeCalculatedFieldRepresentation=e.normalizeCalculatedFieldRepresentation;exports.shouldDropInheritedCalculationAggregate=e.shouldDropInheritedCalculationAggregate;exports.collectDatasetNamesFromExplorerField=t.collectDatasetNamesFromExplorerField;exports.collectDatasetNamesFromFilterGroup=t.collectDatasetNamesFromFilterGroup;exports.collectExecutionDatasetNamesFromExplorerField=t.collectExecutionDatasetNamesFromExplorerField;exports.collectPreferredDatasetNamesFromExplorerField=t.collectPreferredDatasetNamesFromExplorerField;exports.collectQualifiedDatasetNamesFromExplorerField=t.collectQualifiedDatasetNamesFromExplorerField;exports.datasetRefFromSource=t.datasetRefFromSource;exports.dependencyDisplayIdentity=t.dependencyDisplayIdentity;exports.humanizeDatasetName=t.humanizeDatasetName;exports.resolveFieldDatasetDependencies=t.resolveFieldDatasetDependencies;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=r.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.resolveQueryColumnKeyMapEntry=l.resolveQueryColumnKeyMapEntry;exports.resolveUniqueQueryColumnKeyMapEntry=l.resolveUniqueQueryColumnKeyMapEntry;exports.DEFAULT_CALENDAR_CONTEXT=o.DEFAULT_CALENDAR_CONTEXT;exports.CALCULATED_FIELD_TEMPLATE_IDS=i;
@@ -1,9 +1,9 @@
1
1
  import { C as r, E as s } from "../chunks/common-types-C6cAQgyh.js";
2
- import { C as o, D as i, L as n, P as c, f as d, g as m, k as u, j as E, l as p, e as C, c as D, b as F, d as A, n as f, h as _ } from "../chunks/validators-CkHsAvwB.js";
3
- import { c as T, g as h, f as x, b as N, e as y, d as I, a as M, h as R, r as b } from "../chunks/field-dependencies-DXW4jtvJ.js";
4
- import { D as S } from "../chunks/token-types-Dl0hcKBX.js";
5
- import { r as O, a as v } from "../chunks/pivot-result-identity-8M-bZrw9.js";
6
- import { D as w } from "../chunks/report-runtime-context-Cs65Mrxj.js";
2
+ import { C as o, D as i, L as n, P as c, f as d, g as m, k as u, j as E, l as p, e as C, c as D, b as F, d as A, n as f, h as _ } from "../chunks/validators-CsdOtZI6.js";
3
+ import { c as T, g as h, f as x, b as N, e as y, d as I, a as M, h as R, r as b } from "../chunks/field-dependencies-v-lJNzC7.js";
4
+ import { D as S } from "../chunks/token-types-BC6RcUY8.js";
5
+ import { r as O, a as v } from "../chunks/pivot-result-identity-BzUQiCEV.js";
6
+ import { D as w } from "../chunks/report-runtime-context-CxIoGyNM.js";
7
7
  const e = [
8
8
  "concatenate",
9
9
  "conditional-category",
@@ -0,0 +1,15 @@
1
+ import { DashboardInputVariableRef, ResolvedDashboardInputContext } from '../types/common-types.js';
2
+ import { TextVariableChipFace, TextVariableOption, TextVariableSelection } from '../text-variables/text-variable-types.js';
3
+ /** What resolves a reference to its input. */
4
+ type DashboardVariableLookup = Pick<ResolvedDashboardInputContext, 'variablesById' | 'variablesByName'>;
5
+ /** 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
+ /** What a reference shows, as the picker names it; undefined when missing. */
8
+ export declare function getDashboardVariableSelection(ref: DashboardInputVariableRef, context?: DashboardVariableLookup): TextVariableSelection | undefined;
9
+ /** The reference a picker selection stands for. */
10
+ export declare function getDashboardVariableRefFromSelection(selection: TextVariableSelection): DashboardInputVariableRef;
11
+ /** 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
+ /** `name.part`, for copying a variable as a typed token. */
14
+ export declare function getDashboardVariableToken(ref: DashboardInputVariableRef, context?: DashboardVariableLookup): string;
15
+ export {};
@@ -0,0 +1,22 @@
1
+ import { DocumentKpiSection, DocumentTableSection } from '../types/common-types.js';
2
+ import { DashboardCardLocation } from '../../shared/dashboard-authoring/document-section-cards.js';
3
+ /**
4
+ * Canvas editing actions for the Document page: the floating section
5
+ * toolbar, the gutters between sections, and the insert picker. The sheet
6
+ * provides them only while editing; each routes through `editDocument`.
7
+ */
8
+ export type DocumentCanvasActions = {
9
+ /** Section ids in document order, for Move up and Move down. */
10
+ sectionIds: readonly string[];
11
+ moveSection: (sectionId: string, delta: -1 | 1) => void;
12
+ duplicateSection: (sectionId: string) => void;
13
+ deleteSection: (sectionId: string) => void;
14
+ openFullEditor: (section: DocumentTableSection | DocumentKpiSection) => void;
15
+ copyCard: (source: DashboardCardLocation, index: number) => void;
16
+ /** The page region whose settings the side panel shows, if any. */
17
+ selectedRegion: 'header' | 'footer' | null;
18
+ selectRegion: (region: 'header' | 'footer') => void;
19
+ };
20
+ export declare const DocumentCanvasActionsContext: import('react').Context<DocumentCanvasActions | null>;
21
+ /** The canvas actions, or null outside the editing surface. */
22
+ export declare function useDocumentCanvasActions(): DocumentCanvasActions | null;
@@ -0,0 +1,119 @@
1
+ import { DocumentDefinition, DocumentKpiSection, DocumentSection, DocumentTableSection, DocumentTextContent, DocumentTextStyle, TCard, TDashboard } from '../types/common-types.js';
2
+ import { Field } from '../types/explorer-types.js';
3
+ import { DashboardCardLocation } from '../../shared/dashboard-authoring/document-section-cards.js';
4
+ import { DocumentPanelTarget } from './document-panel-target.js';
5
+ import { DocumentIdFactory, DocumentSectionKindId } from './document-section-kinds.js';
6
+ /**
7
+ * The only write to a Document's sections. Every structural change (insert,
8
+ * copy, move, duplicate, remove, card replacement, KPI list edits) and every
9
+ * kind-specific option update is a `DocumentEdit`, applied by one pure
10
+ * function. The store's `editDocument` wraps it and persists the result;
11
+ * page, header, footer and input edits stay on `updateSheetDocument`.
12
+ */
13
+ export type DocumentEdit = {
14
+ type: 'insert';
15
+ kind: DocumentSectionKindId;
16
+ index: number;
17
+ } | {
18
+ type: 'copyCard';
19
+ source: DashboardCardLocation;
20
+ index: number;
21
+ } | {
22
+ type: 'replaceWithCopy';
23
+ sectionId: string;
24
+ source: DashboardCardLocation;
25
+ } | {
26
+ type: 'move';
27
+ sectionId: string;
28
+ toIndex: number;
29
+ } | {
30
+ type: 'duplicate';
31
+ sectionId: string;
32
+ } | {
33
+ type: 'remove';
34
+ sectionId: string;
35
+ } | {
36
+ type: 'rename';
37
+ sectionId: string;
38
+ title: string;
39
+ } | {
40
+ type: 'updateText';
41
+ sectionId: string;
42
+ content: DocumentTextContent;
43
+ style?: DocumentTextStyle;
44
+ } | {
45
+ type: 'updateTableOptions';
46
+ sectionId: string;
47
+ options: Partial<DocumentTableSection['table']>;
48
+ } | {
49
+ type: 'updateKpiOptions';
50
+ sectionId: string;
51
+ options: Partial<DocumentKpiSection['kpi']>;
52
+ } | {
53
+ type: 'setSpacerHeight';
54
+ sectionId: string;
55
+ heightPx: number;
56
+ } | {
57
+ type: 'replaceCard';
58
+ sectionId: string;
59
+ oldCardId: string;
60
+ card: TCard;
61
+ calculatedFields?: Field[];
62
+ }
63
+ /** A placeholder KPI when neither `card` nor `source` is given. */
64
+ | {
65
+ type: 'addKpi';
66
+ sectionId: string;
67
+ card?: TCard;
68
+ source?: DashboardCardLocation;
69
+ } | {
70
+ type: 'removeKpi';
71
+ sectionId: string;
72
+ cardId: string;
73
+ } | {
74
+ type: 'moveKpi';
75
+ sectionId: string;
76
+ cardId: string;
77
+ toIndex: number;
78
+ };
79
+ export type DocumentEditResult = {
80
+ document: DocumentDefinition;
81
+ /** Where the panel goes next: the inserted, moved or edited section, or a removed section's neighbor. */
82
+ target: DocumentPanelTarget;
83
+ /** The sheet's full calculated fields after a copy brought new ones; persist as the sheet's list. */
84
+ calculatedFields?: Field[];
85
+ /** Card ids removed (`to: null`) or replaced by a new id, for reference cleanup. */
86
+ retargetedCardIds?: Array<{
87
+ from: string;
88
+ to: string | null;
89
+ }>;
90
+ };
91
+ export type DocumentEditContext = {
92
+ dashboard: Pick<TDashboard, 'sheets'>;
93
+ sheetId: string;
94
+ ids: DocumentIdFactory;
95
+ };
96
+ /** A refused edit: the command does not apply to the section, or would break the saved shape. */
97
+ export declare class DocumentEditError extends Error {
98
+ constructor(message: string);
99
+ }
100
+ export declare const DOCUMENT_SPACER_MIN_HEIGHT_PX = 8;
101
+ export declare const DOCUMENT_SPACER_MAX_HEIGHT_PX = 240;
102
+ /** Fresh section and card ids. */
103
+ export declare function createDocumentIdFactory(): DocumentIdFactory;
104
+ export declare function clampDocumentSpacerHeight(heightPx: number): number;
105
+ /**
106
+ * The index a section ends up at when dropped before or after another one.
107
+ * Returns the current index when either section is missing.
108
+ */
109
+ export declare function getDocumentSectionDropIndex(sections: readonly Pick<DocumentSection, 'id'>[], sectionId: string, targetSectionId: string, placement: 'before' | 'after'): number;
110
+ /**
111
+ * Cards a Document can copy: every executable table, pivot table, Matrix or KPI in
112
+ * the dashboard, including other document sections, except the given
113
+ * section's own cards. Linked library visuals are not offered: their stored
114
+ * card is completed by hydration, so a copy could be incomplete.
115
+ */
116
+ export declare function listCopyableDocumentCardLocations(dashboard: Pick<TDashboard, 'sheets'>, options?: {
117
+ excludeSectionId?: string;
118
+ }): DashboardCardLocation[];
119
+ export declare function applyDocumentEdit(document: DocumentDefinition, edit: DocumentEdit, context: DocumentEditContext): DocumentEditResult;
@@ -0,0 +1,27 @@
1
+ import { TCard } from '../types/common-types.js';
2
+ import { ComparisonMetadataMap } from '../types/query-types.js';
3
+ import { MetricComparisonSentiment } from '../../shared/analytics-protocol/index.js';
4
+ /**
5
+ * What a KPI shows in print: its value and, when the card compares, one
6
+ * comparison line. Reads the result exactly as the dashboard KPI cards do
7
+ * (`kpi-result-values`), without their interactive layout.
8
+ */
9
+ export type DocumentKpiFigure = {
10
+ label: string;
11
+ value: number | null;
12
+ /** Shown instead of a value when there is none. */
13
+ emptyMessage?: string;
14
+ comparison?: {
15
+ /** "Previous", "Target", or the author's label. */
16
+ label: string;
17
+ value: number;
18
+ /** Change against the comparison, as a ratio (0.042 = +4.2%). Null when the comparison is 0. */
19
+ change: number | null;
20
+ sentiment: MetricComparisonSentiment;
21
+ };
22
+ };
23
+ export declare function resolveDocumentKpiFigure({ card, data, comparisonMetadata, }: {
24
+ card: TCard;
25
+ data?: Record<string, unknown>[] | null;
26
+ comparisonMetadata?: ComparisonMetadataMap;
27
+ }): DocumentKpiFigure;
@@ -0,0 +1,29 @@
1
+ import { DocumentKpiSection } from '../types/common-types.js';
2
+ /**
3
+ * Fixed geometry of a KPI section. The renderer sets these heights exactly,
4
+ * so the pagination estimate equals the printed height and a KPI section is
5
+ * placed on a page as one block.
6
+ */
7
+ export declare const DOCUMENT_KPI_SECTION_TITLE_HEIGHT_PX = 24;
8
+ export declare const DOCUMENT_KPI_TILE_ROW_HEIGHT_PX = 72;
9
+ export declare const DOCUMENT_KPI_LINE_HEIGHT_PX = 28;
10
+ /** Top and bottom rule plus the inner padding of the lines grid. */
11
+ export declare const DOCUMENT_KPI_LINES_FRAME_HEIGHT_PX = 18;
12
+ /** Top and bottom rule of the tile row. */
13
+ export declare const DOCUMENT_KPI_TILES_FRAME_HEIGHT_PX = 2;
14
+ export type DocumentKpiLayout = {
15
+ kind: 'tiles';
16
+ columns: number;
17
+ } | {
18
+ kind: 'lines';
19
+ columns: 1 | 2;
20
+ rows: number;
21
+ };
22
+ /**
23
+ * The layout a KPI section prints with. A `tiles` section with more cards
24
+ * than tiles allow (save rejects it, but a runtime guard costs nothing) prints
25
+ * as two-column lines.
26
+ */
27
+ export declare function resolveDocumentKpiLayout(section: Pick<DocumentKpiSection, 'cards' | 'kpi'>): DocumentKpiLayout;
28
+ /** Printed height of a KPI section; the renderer uses the same numbers. */
29
+ export declare function estimateKpiSectionHeightPx(section: Pick<DocumentKpiSection, 'cards' | 'kpi' | 'title'>): number;
@@ -0,0 +1,15 @@
1
+ import { DocumentKpiSection, TCard } from '../types/common-types.js';
2
+ /**
3
+ * Pure edits for a KPI section that keep the saved shape valid (1 to 8 KPI
4
+ * cards, at most 6 in tiles). Each returns the same section when the edit is
5
+ * not allowed, so callers can compare by reference. Phase 1.3's
6
+ * `applyDocumentEdit` builds its `addKpi`, `removeKpi` and `updateKpiOptions`
7
+ * cases on these.
8
+ */
9
+ export declare function canAddDocumentKpiCard(section: DocumentKpiSection): boolean;
10
+ /** Whether the next card forces the section from tiles to lines. */
11
+ export declare function addingDocumentKpiCardSwitchesToLines(section: DocumentKpiSection): boolean;
12
+ export declare function addDocumentKpiSectionCard(section: DocumentKpiSection, card: TCard): DocumentKpiSection;
13
+ export declare function removeDocumentKpiSectionCard(section: DocumentKpiSection, cardId: string): DocumentKpiSection;
14
+ export declare function canUseDocumentKpiTiles(section: DocumentKpiSection): boolean;
15
+ export declare function updateDocumentKpiSectionOptions(section: DocumentKpiSection, options: Partial<DocumentKpiSection['kpi']>): DocumentKpiSection;
@@ -0,0 +1,66 @@
1
+ /** A report allows this many bands (B4). */
2
+ export declare const DOCUMENT_MATRIX_MAX_BANDS = 6;
3
+ /**
4
+ * Row labels in a band get their unwrapped width, up to this share of the
5
+ * page, as the card PDF's banding limits its anchor columns (35%).
6
+ */
7
+ export declare const DOCUMENT_MATRIX_LABEL_SHARE = 0.35;
8
+ export type DocumentMatrixBand = {
9
+ /** Column indices the band prints: the row labels, then its groups. */
10
+ columns: number[];
11
+ /** "Yard: Tacoma to Newark (4 to 6 of 6)" (B6). */
12
+ caption: string;
13
+ };
14
+ /**
15
+ * What the measuring instance measured, before any page's label rule, so the
16
+ * same Matrix can be planned for another page (the landscape suggestion).
17
+ */
18
+ export type DocumentMatrixMeasuredColumns = {
19
+ /** Each column's width in the tightest layout (labels wrapped). */
20
+ columnWidthsPx: readonly number[];
21
+ /** Each row-label column's width with its labels on one line. */
22
+ labelNaturalWidthsPx?: readonly (number | undefined)[];
23
+ /** Each column's group, or `null` for a row-label column. */
24
+ columnGroups: readonly (number | null)[];
25
+ };
26
+ export type DocumentMatrixFit = {
27
+ kind: 'fits';
28
+ } | {
29
+ kind: 'bands';
30
+ bands: DocumentMatrixBand[];
31
+ measured: DocumentMatrixMeasuredColumns;
32
+ } | {
33
+ kind: 'too_wide';
34
+ /** `group`: one group is wider than the page beside the row labels. */
35
+ reason: 'group' | 'bands';
36
+ bandCount?: number;
37
+ groupLevelLabel: string;
38
+ measured: DocumentMatrixMeasuredColumns;
39
+ };
40
+ /** The order band pages print in (B3). */
41
+ export type DocumentMatrixBandOrder = 'across' | 'down';
42
+ /**
43
+ * Plans how a Matrix prints on a page body `bodyWidthPx` wide, from each
44
+ * column's measured width and group.
45
+ */
46
+ export declare function planDocumentMatrixFit({ columnWidthsPx, labelNaturalWidthsPx, columnGroups, groupLabels, groupLevelLabel, bodyWidthPx, }: {
47
+ /** Each column's width in the tightest layout (labels wrapped). */
48
+ columnWidthsPx: readonly number[];
49
+ /** Each row-label column's width with its labels on one line. */
50
+ labelNaturalWidthsPx?: readonly (number | undefined)[];
51
+ columnGroups: readonly (number | null)[];
52
+ groupLabels: readonly string[];
53
+ groupLevelLabel: string;
54
+ bodyWidthPx: number;
55
+ }): DocumentMatrixFit;
56
+ /**
57
+ * How many bands the same Matrix needs on another page body width, with the
58
+ * label rule applied at that width, as the measuring layer would apply it.
59
+ */
60
+ export declare function countDocumentMatrixBands(fit: Extract<DocumentMatrixFit, {
61
+ measured: DocumentMatrixMeasuredColumns;
62
+ }>, bodyWidthPx: number): number | undefined;
63
+ /** The message for a Matrix too wide to print (B4). */
64
+ export declare function documentMatrixTooWideMessage(fit: Extract<DocumentMatrixFit, {
65
+ kind: 'too_wide';
66
+ }>): string;
@@ -0,0 +1,11 @@
1
+ import { DocumentTableSection } from '../types/common-types.js';
2
+ /**
3
+ * How a Document prints a Matrix section (Plan 2, K1). These are print
4
+ * settings of the section, not of the Matrix: the section applies them to the
5
+ * layout read's presentation (`applyMatrixPrintOrganization`), so the card's
6
+ * definition never changes.
7
+ */
8
+ export type DocumentMatrixPrintOptions = NonNullable<DocumentTableSection['table']['matrix']>;
9
+ /** Report-style defaults, as in `/design/document-matrix-report`. */
10
+ export declare const DOCUMENT_MATRIX_PRINT_DEFAULTS: Required<DocumentMatrixPrintOptions>;
11
+ export declare function resolveDocumentMatrixPrint(section: Pick<DocumentTableSection, 'table'>): Required<DocumentMatrixPrintOptions>;
@@ -1,3 +1,4 @@
1
+ import { DocumentMatrixBandOrder } from './document-matrix-bands.js';
1
2
  import { DocumentTableRowMeasurementState } from './document-table-pagination-model.js';
2
3
  import { getDocumentTablePrintModel, DocumentTableLayoutMeasurement } from './document-table-print-model.js';
3
4
  import { DocumentTextRenderContext } from './document-variables.js';
@@ -11,14 +12,51 @@ export type DocumentGeneratedPageSection = {
11
12
  export type DocumentTableSlice = {
12
13
  startIndex: number;
13
14
  endIndex: number;
15
+ /** The row slice's position; band pages of one slice share it. */
14
16
  pageIndex: number;
15
17
  pageCount: number;
16
18
  totalRows: number;
17
19
  rowsPerPage: number;
20
+ /** A Matrix printed in column bands: which band this page draws (2c). */
21
+ band?: {
22
+ index: number;
23
+ count: number;
24
+ };
18
25
  };
19
- export type DocumentTablePaginationPlan = {
26
+ /**
27
+ * What a table section tells the paginator about its rows, beyond their count
28
+ * (Plan 2, L4). Every field is optional: a section that reports none
29
+ * paginates as before.
30
+ */
31
+ export type DocumentTableRowFacts = {
32
+ /** Per row: a page may not break before it (keep rules). */
33
+ keepWithPrevious?: readonly boolean[];
34
+ /** Per row: header rows a page that starts there repeats (Indented Matrix). */
35
+ continuationRowCounts?: readonly number[];
36
+ /** The section prints nothing: it is empty and set to hide when empty. */
37
+ hidden?: boolean;
38
+ };
39
+ /** What an empty section set to hide when empty reports (Plan 2, L6). */
40
+ export declare const DOCUMENT_TABLE_HIDDEN_ROW_FACTS: DocumentTableRowFacts;
41
+ /** How a table section reports its row count, and optionally its row facts. */
42
+ export type DocumentTableRowCountChange = (sectionId: string, rowCount: number, facts?: DocumentTableRowFacts) => void;
43
+ /**
44
+ * Whether the paginator has what it needs for a table section (Plan 2, N3):
45
+ * a settled row count, and a measured height for every row unless the
46
+ * section prints none. Print holds the PDF until this holds for every
47
+ * section.
48
+ */
49
+ export declare function isDocumentTableSectionMeasured({ rowCount, facts, measurement, }: {
50
+ rowCount: number | undefined;
51
+ facts: DocumentTableRowFacts | undefined;
52
+ measurement: DocumentTableLayoutMeasurement | undefined;
53
+ }): boolean;
54
+ export type DocumentTablePaginationPlan = DocumentTableRowFacts & {
20
55
  rowCount: number;
21
56
  rowsPerPage: number;
57
+ /** A Matrix wider than the page prints each row slice once per band (2c). */
58
+ bandCount?: number;
59
+ bandOrder?: DocumentMatrixBandOrder;
22
60
  footerRowCount?: number;
23
61
  fallbackRowHeightPx?: number;
24
62
  rowMeasurementState?: DocumentTableRowMeasurementState;
@@ -27,7 +65,6 @@ export type DocumentTablePaginationPlan = {
27
65
  rowHeightsPx?: Array<number | undefined>;
28
66
  chromeHeightPx?: number;
29
67
  renderedMinHeightPx?: number;
30
- measuredRowsPerPage?: number;
31
68
  };
32
69
  export type DocumentPaginationMetricsMode = 'preview' | 'print';
33
70
  export type DocumentGeneratedPage = {
@@ -46,12 +83,28 @@ type DocumentPaginationOptions = {
46
83
  textRenderContext?: DocumentTextRenderContext;
47
84
  };
48
85
  export declare function paginateDocumentSectionsByManualBreaks(sections: DocumentSection[], options?: DocumentPaginationOptions): DocumentGeneratedPage[];
49
- export declare function buildDocumentTablePaginationPlans({ document, tableRowCountsBySectionId, tableLayoutMeasurementsBySectionId, shouldPaginateTables, pageMetricsMode, }: {
86
+ /**
87
+ * The order a table's pages print in: one page per row slice, or, for a
88
+ * Matrix in bands, one per slice and band (B3).
89
+ */
90
+ export declare function orderDocumentTableBandPages(sliceCount: number, bandCount: number, bandOrder?: DocumentMatrixBandOrder): {
91
+ pageIndex: number;
92
+ band: number;
93
+ }[];
94
+ export declare function buildDocumentTablePaginationPlans({ document, tableRowCountsBySectionId, tableRowFactsBySectionId, tableLayoutMeasurementsBySectionId, shouldPaginateTables, pageMetricsMode, }: {
50
95
  document: DocumentDefinition;
51
96
  tableRowCountsBySectionId: Record<string, number>;
97
+ /** Row facts a section reported with its count (Matrix keep rules). */
98
+ tableRowFactsBySectionId?: Record<string, DocumentTableRowFacts>;
52
99
  tableLayoutMeasurementsBySectionId?: Record<string, DocumentTableLayoutMeasurement>;
53
100
  shouldPaginateTables: boolean;
54
101
  pageMetricsMode?: DocumentPaginationMetricsMode;
55
102
  }): Record<string, DocumentTablePaginationPlan>;
56
103
  export declare function isDocumentTablePaginationEligible(section: DocumentSection): section is DocumentTableSection;
57
104
  export declare function getDocumentTableRowsPerPage(document: DocumentDefinition, printModel: ReturnType<typeof getDocumentTablePrintModel>, pageMetricsMode?: DocumentPaginationMetricsMode): number;
105
+ /**
106
+ * The page (1-based) each section starts on. A table split across pages
107
+ * starts on the page with its first slice, and a page break is on the page
108
+ * it ends.
109
+ */
110
+ export declare function getDocumentSectionStartPages(pages: readonly Pick<DocumentGeneratedPage, 'sections' | 'breakAfterSection'>[]): Record<string, number>;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * What the Document side panel shows: the document (page, header and footer,
3
+ * inputs), the header, the footer, or one section (and, for a KPI section,
4
+ * optionally one KPI). `applyDocumentEdit` returns where the panel goes after
5
+ * an edit. The dashboard store keeps one per sheet, and the sheet derives
6
+ * its selected section from it.
7
+ */
8
+ export type DocumentPanelTarget = {
9
+ kind: 'document';
10
+ group?: 'page' | 'headerFooter' | 'inputs';
11
+ } | {
12
+ kind: 'header';
13
+ } | {
14
+ kind: 'footer';
15
+ } | {
16
+ kind: 'section';
17
+ sectionId: string;
18
+ cardId?: string;
19
+ };
@@ -1,8 +1,9 @@
1
- import { DocumentChartSection, DocumentTableSection, TCard, TFrame } from '../types/common-types.js';
2
- type DataBackedDocumentSection = DocumentTableSection | DocumentChartSection;
3
- export declare const DOCUMENT_TABLE_CARD_TYPES: readonly ["table", "pivotTable"];
4
- export declare function createDocumentSectionEditorFrame(section: DataBackedDocumentSection): TFrame;
5
- export declare function getActiveDocumentSectionCard(frame: TFrame): TCard | null;
1
+ import { DocumentSection, TCard, TFrame } from '../types/common-types.js';
2
+ /**
3
+ * The transient frame the visual editor opens for one card of a section.
4
+ * It holds that card only: a KPI section is never edited, or rendered, as one
5
+ * multi-card frame (that would trigger the dashboard's KPI-plus-info layout).
6
+ * Omit `cardId` for a single-card section.
7
+ */
8
+ export declare function createDocumentSectionEditorFrame(section: DocumentSection, cardId?: string): TFrame;
6
9
  export declare function getDocumentSectionEditorCard(frame: TFrame, cardId: string): TCard | null;
7
- export declare function isSupportedDocumentTableCardType(card: Pick<TCard, 'type'>): boolean;
8
- export {};
@@ -0,0 +1,49 @@
1
+ import { TChartType } from '../charts/types.js';
2
+ import { DocumentSection, TCard } from '../types/common-types.js';
3
+ /**
4
+ * Author-facing identity of a Document section. It differs from the storage
5
+ * `type`: Table, Pivot and Matrix are all stored as `type: 'table'` and are
6
+ * told apart by `card.type`.
7
+ */
8
+ export type DocumentSectionKindId = 'text' | 'table' | 'matrix' | 'kpi' | 'spacer' | 'page_break'
9
+ /** Existing sections only. */
10
+ | 'pivot'
11
+ /** Contract-only: not addable, not rendered. */
12
+ | 'chart';
13
+ export type DocumentIdFactory = {
14
+ section(): string;
15
+ card(): string;
16
+ };
17
+ export type DocumentSectionKind = {
18
+ id: DocumentSectionKindId;
19
+ label: string;
20
+ /** Picker copy, one line. */
21
+ description: string;
22
+ group: 'data' | 'content' | 'layout';
23
+ /** Offered when adding a section. */
24
+ addable: boolean;
25
+ /** Card types a section of this kind accepts. Empty for non-data kinds. */
26
+ cardTypes: readonly TChartType[];
27
+ /** A new section with defaults. Data kinds start with a placeholder card and no data source. */
28
+ create(ids: DocumentIdFactory): DocumentSection;
29
+ };
30
+ /** A placeholder KPI card with no data source yet. */
31
+ export declare function createDocumentKpiCard(cardId: string): TCard;
32
+ export declare const DOCUMENT_SECTION_KINDS: Readonly<Record<DocumentSectionKindId, DocumentSectionKind>>;
33
+ /** Author-facing kind of a stored section. */
34
+ export declare function getDocumentSectionKind(section: DocumentSection): DocumentSectionKind;
35
+ /** Whether a section of this kind may hold a card of this type. */
36
+ export declare function documentSectionAcceptsCardType(section: DocumentSection, cardType: TChartType): boolean;
37
+ /** Why a section refuses a card type, or null when it accepts it. */
38
+ export declare function getDocumentSectionCardTypeError(section: DocumentSection, cardType: TChartType): string | null;
39
+ /**
40
+ * The section with `oldCardId` replaced by `card`. Throws when the section
41
+ * does not own `oldCardId`, or its kind does not accept `card.type`.
42
+ */
43
+ export declare function replaceDocumentSectionCard(section: DocumentSection, oldCardId: string, card: TCard): DocumentSection;
44
+ /** The addable kinds, in registry order, grouped for the insert picker. */
45
+ export declare function getAddableDocumentSectionKindGroups(): {
46
+ kinds: DocumentSectionKind[];
47
+ id: DocumentSectionKind["group"];
48
+ label: string;
49
+ }[];
@@ -0,0 +1,25 @@
1
+ import { TFilterValue } from '../../components/surfboard/filter/types.js';
2
+ import { DashboardCardQueryOptions } from '../hooks/use-dashboard-frame-query.js';
3
+ import { ControlDefinition, DashboardInputValues } from '../types/common-types.js';
4
+ import { TableTotalsRequest } from '../types/explorer-types.js';
5
+ /** Inputs, filters and controls the Document sheet has already resolved for its sections. */
6
+ export type DocumentSectionRuntime = {
7
+ documentFilterValues: TFilterValue[];
8
+ documentControlDefinitions: ControlDefinition[];
9
+ documentControlValues: Record<string, unknown>;
10
+ documentDashboardInputValues?: DashboardInputValues;
11
+ missingRequiredInputLabels: string[];
12
+ };
13
+ /**
14
+ * Query options for every card of a Document section, so table and KPI
15
+ * sections run their cards in the same section runtime: section-scoped inputs,
16
+ * document filter and control values, and no carried dashboard context.
17
+ */
18
+ export declare function buildDocumentSectionQueryOptions({ sectionId, runtime, tableTotalsRequest, }: {
19
+ sectionId: string;
20
+ runtime: Omit<DocumentSectionRuntime, 'missingRequiredInputLabels'>;
21
+ /** Flat-table grand totals; table sections only. */
22
+ tableTotalsRequest?: TableTotalsRequest;
23
+ }): DashboardCardQueryOptions;
24
+ /** The query key marker every Document section query carries. */
25
+ export declare const DOCUMENT_SECTION_QUERY_MARKER = "documentSection";