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.
- package/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +226 -225
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +4 -4
- package/dist/briefings/index.cjs +1 -1
- package/dist/briefings/index.js +8 -8
- package/dist/chunks/{calculated-field-identity-BiTGmnST.cjs → calculated-field-identity-5bg9oHTw.cjs} +1 -1
- package/dist/chunks/{calculated-field-identity-DnRd4YIY.js → calculated-field-identity-DzJBs2J8.js} +4 -4
- package/dist/chunks/{card-config-utils-B2cDWQqB.js → card-config-utils-Cxnq2R6z.js} +14 -14
- package/dist/chunks/{card-config-utils-CMO4_zVs.cjs → card-config-utils-z86y6tSq.cjs} +1 -1
- package/dist/chunks/column-bands-CU0byntA.cjs +1 -0
- package/dist/chunks/column-bands-RdM-kjDe.js +47 -0
- package/dist/chunks/{dashboard-briefing-launcher-BA_bl05p.js → dashboard-briefing-launcher-BCEHJ_eD.js} +15 -12
- package/dist/chunks/{dashboard-briefing-launcher-B7zqm8P1.cjs → dashboard-briefing-launcher-CjZ4aE34.cjs} +2 -2
- package/dist/chunks/{dashboard-controls-QMW17RKx.js → dashboard-controls-DFfit5KH.js} +12 -12
- package/dist/chunks/{dashboard-controls-x_v9wLOU.cjs → dashboard-controls-f9aJ70Zu.cjs} +1 -1
- package/dist/chunks/{dashboard-date-comparison-definition-D7Bl-YAl.js → dashboard-date-comparison-definition-BqNhECUr.js} +6 -6
- package/dist/chunks/{dashboard-date-comparison-definition-C_w-GO_5.cjs → dashboard-date-comparison-definition-Y6JZwpcr.cjs} +1 -1
- package/dist/chunks/{dashboard-json-DRnpkNwO.js → dashboard-json-DVtcA02f.js} +7 -7
- package/dist/chunks/{dashboard-json-0ZLLBlHj.cjs → dashboard-json-deqQC-UR.cjs} +1 -1
- package/dist/chunks/edit-dashboard-visual-DK6lSC_p.cjs +172 -0
- package/dist/chunks/{edit-dashboard-visual-1ISjhwry.js → edit-dashboard-visual-lJ6rDH3w.js} +4338 -4324
- package/dist/chunks/{editor-action-buttons-BTCKZERI.js → editor-action-buttons-Bnxxa439.js} +7 -7
- package/dist/chunks/{editor-action-buttons-Czq5SnA9.cjs → editor-action-buttons-CmDaQbPN.cjs} +1 -1
- package/dist/chunks/{field-aggregations-CzuQKtqx.js → field-aggregations-Dl2A3rbV.js} +461 -358
- package/dist/chunks/field-aggregations-pH_3kymD.cjs +1 -0
- package/dist/chunks/{field-dependencies-DIab72rQ.cjs → field-dependencies-EB485TdB.cjs} +1 -1
- package/dist/chunks/{field-dependencies-DXW4jtvJ.js → field-dependencies-v-lJNzC7.js} +1 -1
- package/dist/chunks/{index-Dlic9KZs.js → index-BVVl2JDK.js} +57730 -54586
- package/dist/chunks/index-DfqMtR9S.cjs +4 -0
- package/dist/chunks/index-UNKSfi7s.cjs +1434 -0
- package/dist/chunks/{index-v1OE4-eA.js → index-ylOpKRDu.js} +877 -849
- package/dist/chunks/{matrix-analytical-definition-Ct5Tu8np.cjs → matrix-analytical-definition-BWd159lN.cjs} +1 -1
- package/dist/chunks/{matrix-analytical-definition-BDAK2aEi.js → matrix-analytical-definition-BimC4XIV.js} +1 -1
- package/dist/chunks/{matrix-card-U4c72doZ.cjs → matrix-card-C2RjEYZ8.cjs} +1 -1
- package/dist/chunks/{matrix-card-DOIeTmjh.js → matrix-card-CIlz0Dnp.js} +2 -2
- package/dist/chunks/{matrix-control-sources-FjxGIbqk.cjs → matrix-control-sources-BvEJF7d3.cjs} +1 -1
- package/dist/chunks/{matrix-control-sources-BxKH2yu2.js → matrix-control-sources-KbZe1gj_.js} +51 -51
- package/dist/chunks/{matrix-definition-CBJW_4ii.cjs → matrix-definition-DanUT11P.cjs} +1 -1
- package/dist/chunks/{matrix-definition-I9rHB9zN.js → matrix-definition-E5gXXSTZ.js} +1 -1
- package/dist/chunks/matrix-formatter-BJTO8ky9.cjs +1 -0
- package/dist/chunks/{matrix-formatter-BdIsE7Qu.js → matrix-formatter-CCXNRt3s.js} +81 -81
- package/dist/chunks/{matrix-member-presentation-DO1VSqfh.js → matrix-member-presentation-Bw7-JCrr.js} +64 -64
- package/dist/chunks/matrix-member-presentation-DvXDEo0U.cjs +1 -0
- package/dist/chunks/{matrix-operation-contract-DoiWTUbT.cjs → matrix-operation-contract-0RxoU_M3.cjs} +1 -1
- package/dist/chunks/{matrix-operation-contract-D0HfzwZg.js → matrix-operation-contract-D32U2CSw.js} +19 -19
- package/dist/chunks/{metric-comparison-Dqc7_tnW.js → metric-comparison-BphoJ9bq.js} +1 -1
- package/dist/chunks/{metric-comparison-DBQ3EJTz.cjs → metric-comparison-CUmltzpz.cjs} +1 -1
- package/dist/chunks/pivot-header-presentation-BSZhB1g-.js +661 -0
- package/dist/chunks/pivot-header-presentation-EoUS5ze5.cjs +5 -0
- package/dist/chunks/{pivot-result-identity-8M-bZrw9.js → pivot-result-identity-BzUQiCEV.js} +4 -4
- package/dist/chunks/{pivot-result-identity-uTiylUNr.cjs → pivot-result-identity-gquWljbd.cjs} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-vg_suUNb.cjs → pivot-result-lifecycle-gl9cBfB-.cjs} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-CEmyU2At.js → pivot-result-lifecycle-kRhiJkzg.js} +8 -8
- package/dist/chunks/{raw-temporal-Bj6_w9cG.js → raw-temporal-BqOfk-xN.js} +16 -16
- package/dist/chunks/{raw-temporal-contract-CFLGwTiI.js → raw-temporal-contract-BQZIJ1fn.js} +1 -1
- package/dist/chunks/{raw-temporal-contract-DECbTuzA.cjs → raw-temporal-contract-CklMVG_1.cjs} +1 -1
- package/dist/chunks/{raw-temporal-CeblVJbu.cjs → raw-temporal-eJXecCyJ.cjs} +1 -1
- package/dist/chunks/{report-preferences-dialog-b8J6KjSy.js → report-preferences-dialog-CHXPEl7v.js} +6 -6
- package/dist/chunks/{report-preferences-dialog-Dr1BYwuf.cjs → report-preferences-dialog-Cto0vDwI.cjs} +1 -1
- package/dist/chunks/{report-runtime-context-Cs65Mrxj.js → report-runtime-context-CxIoGyNM.js} +1 -1
- package/dist/chunks/{report-runtime-context-DzvHBPxl.cjs → report-runtime-context-CzSrCBsu.cjs} +1 -1
- package/dist/chunks/{selection-reducer-BIiQXbGM.js → selection-reducer-CvCBQbl2.js} +1 -1
- package/dist/chunks/{selection-reducer-CGKKsaPa.cjs → selection-reducer-Kl22OzIk.cjs} +1 -1
- package/dist/chunks/{semantic-format-Dt-nUxFB.js → semantic-format-DwqGYx4V.js} +2 -2
- package/dist/chunks/{semantic-format-DFI1iszk.cjs → semantic-format-mVI32OJH.cjs} +1 -1
- package/dist/chunks/{source-entity-resolution-D7vnmDwm.js → source-entity-resolution-Bzefiive.js} +7 -7
- package/dist/chunks/{source-entity-resolution-CjbgnwyX.cjs → source-entity-resolution-R46X34SE.cjs} +1 -1
- package/dist/chunks/switch-DNbWXEOP.cjs +134 -0
- package/dist/chunks/{switch-D5_tjsIS.js → switch-DNv-hVmt.js} +8230 -7681
- package/dist/chunks/{temporal-bucket-B9hMwemw.js → temporal-bucket-DlFuhCnT.js} +6 -6
- package/dist/chunks/{temporal-bucket-contract-IWDgyTMw.js → temporal-bucket-contract-DTLDRzgV.js} +1 -1
- package/dist/chunks/{temporal-bucket-contract-ZctiyXYk.cjs → temporal-bucket-contract-nTv6gvX5.cjs} +1 -1
- package/dist/chunks/{token-types-Dl0hcKBX.js → token-types-BC6RcUY8.js} +1 -1
- package/dist/chunks/{token-types-Ahh5u4iT.cjs → token-types-aWrzwonf.cjs} +1 -1
- package/dist/chunks/{update-policy-COjFudhl.cjs → update-policy-DRDLWe7Y.cjs} +1 -1
- package/dist/chunks/{update-policy-BeQqjupC.js → update-policy-DhAUtiC8.js} +2 -2
- package/dist/chunks/{validators-CkHsAvwB.js → validators-CsdOtZI6.js} +411 -397
- package/dist/chunks/validators-DFeDcdpA.cjs +1 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +233 -227
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +3 -3
- package/dist/data-app-codegen/index.cjs +1 -1
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.cjs +1 -1
- package/dist/data-app-codegen-node/index.js +3 -3
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +5 -5
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +2 -2
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +5 -5
- package/dist/format-utils/index.cjs +3 -3
- package/dist/format-utils/index.js +291 -402
- package/dist/index.cjs +1 -1
- package/dist/index.js +15 -15
- package/dist/pdf-table-layout/index.cjs +1 -0
- package/dist/pdf-table-layout/index.js +993 -0
- package/dist/report-runtime-context/index.cjs +1 -1
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/briefings/index.d.ts +1 -1
- package/dist/types/components/document-sheet/document-input-bar.d.ts +1 -3
- package/dist/types/components/document-sheet/document-insert-picker.d.ts +37 -0
- package/dist/types/components/document-sheet/document-kpi-section.d.ts +17 -0
- package/dist/types/components/document-sheet/document-matrix-layout-context.d.ts +10 -0
- package/dist/types/components/document-sheet/document-matrix-section.d.ts +27 -0
- package/dist/types/components/document-sheet/document-measure-layer.d.ts +45 -0
- package/dist/types/components/document-sheet/document-outline.d.ts +7 -1
- package/dist/types/components/document-sheet/document-page-navigation.d.ts +22 -0
- package/dist/types/components/document-sheet/document-page.d.ts +9 -5
- package/dist/types/components/document-sheet/document-panel/document-side-panel.d.ts +36 -0
- package/dist/types/components/document-sheet/document-panel/inputs-panel.d.ts +9 -0
- package/dist/types/components/document-sheet/document-panel/page-panel.d.ts +5 -0
- package/dist/types/components/document-sheet/document-panel/panel-controls.d.ts +14 -0
- package/dist/types/components/document-sheet/document-panel/region-panels.d.ts +11 -0
- package/dist/types/components/document-sheet/document-panel/section-panel.d.ts +25 -0
- package/dist/types/components/document-sheet/document-section-print-boundary.d.ts +9 -0
- package/dist/types/components/document-sheet/document-table-chrome.d.ts +22 -0
- package/dist/types/components/document-sheet/document-table-section.d.ts +3 -7
- package/dist/types/components/document-sheet/document-text-preview-context.d.ts +8 -0
- package/dist/types/components/document-sheet/use-first-fitting-variant.d.ts +18 -0
- package/dist/types/components/editor/editor-main/dashboard-variable-node.d.ts +12 -2
- package/dist/types/components/explorer/chart-configuration/matrix-authoring-controls.d.ts +7 -2
- package/dist/types/components/text-variables/variable-chip-plugin.d.ts +23 -0
- package/dist/types/components/text-variables/variable-chip.d.ts +18 -0
- package/dist/types/components/text-variables/variable-picker.d.ts +27 -0
- package/dist/types/components/visual/settings/table-presentation-settings.d.ts +27 -1
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +5 -5
- package/dist/types/lib/dashboard-inputs/text-variable-options.d.ts +15 -0
- package/dist/types/lib/document/document-canvas-actions.d.ts +22 -0
- package/dist/types/lib/document/document-edits.d.ts +119 -0
- package/dist/types/lib/document/document-kpi-figure.d.ts +27 -0
- package/dist/types/lib/document/document-kpi-layout.d.ts +29 -0
- package/dist/types/lib/document/document-kpi-section-edits.d.ts +15 -0
- package/dist/types/lib/document/document-matrix-bands.d.ts +66 -0
- package/dist/types/lib/document/document-matrix-print.d.ts +11 -0
- package/dist/types/lib/document/document-pagination.d.ts +56 -3
- package/dist/types/lib/document/document-panel-target.d.ts +19 -0
- package/dist/types/lib/document/document-section-editor.d.ts +8 -7
- package/dist/types/lib/document/document-section-kinds.d.ts +49 -0
- package/dist/types/lib/document/document-section-query-options.d.ts +25 -0
- package/dist/types/lib/document/document-section-render-state.d.ts +26 -0
- package/dist/types/lib/document/document-section-utils.d.ts +11 -4
- package/dist/types/lib/document/document-table-dom.d.ts +4 -6
- package/dist/types/lib/document/document-table-pagination-model.d.ts +0 -5
- package/dist/types/lib/document/document-table-print-model.d.ts +4 -3
- package/dist/types/lib/document/document-table-style.d.ts +15 -4
- package/dist/types/lib/document/document-table-surface.d.ts +15 -0
- package/dist/types/lib/document/document-variables.d.ts +40 -6
- package/dist/types/lib/document/use-document-section-data.d.ts +39 -0
- package/dist/types/lib/document/use-measured-document-table-layout.d.ts +50 -0
- package/dist/types/lib/formatters/kpi-result-values.d.ts +20 -0
- package/dist/types/lib/hooks/query-context/use-dashboard-card-execution-snapshot.d.ts +8 -2
- package/dist/types/lib/hooks/use-dashboard-frame-query.d.ts +6 -0
- package/dist/types/lib/hooks/use-dashboard-kpi-actions.d.ts +1 -1
- package/dist/types/lib/hooks/use-document-section-editor.d.ts +2 -2
- package/dist/types/lib/hooks/use-document-section-session.d.ts +36 -0
- package/dist/types/lib/hooks/use-editor-preview.d.ts +17 -0
- package/dist/types/lib/hooks/use-is-editing-card.d.ts +7 -0
- package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +2 -0
- package/dist/types/lib/matrix-table/matrix-card-draft.d.ts +2 -0
- package/dist/types/lib/matrix-table/matrix-delivery.d.ts +4 -0
- package/dist/types/lib/matrix-table/matrix-layout-read.d.ts +68 -0
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +8 -1
- package/dist/types/lib/query-context/build-dashboard-frame-base-query-contexts.d.ts +4 -2
- package/dist/types/lib/query-context/card-execution.d.ts +30 -0
- package/dist/types/lib/query-context/document-section-card-query.d.ts +37 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +12 -8
- package/dist/types/lib/stores/editor-store.d.ts +2 -0
- package/dist/types/lib/text-variables/text-variable-types.d.ts +39 -0
- package/dist/types/lib/types/common-types.d.ts +34 -1
- package/dist/types/lib/utils/card-definition.d.ts +2 -0
- package/dist/types/lib/utils/card-utils.d.ts +13 -6
- package/dist/types/pdf-table-layout.d.ts +2 -0
- package/dist/types/shared/analytics-protocol/index.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +45 -0
- package/dist/types/shared/analytics-protocol/matrix-member-presentation.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/document-section-cards.d.ts +56 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +36 -1
- package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +5 -0
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +690 -1
- package/dist/types/shared/format-utils/matrix-print.d.ts +38 -0
- package/dist/types/shared/format-utils/pdf-table-layout/column-bands.d.ts +55 -0
- package/dist/types/shared/format-utils/pdf-table-layout/index.d.ts +6 -0
- package/dist/types/shared/format-utils/pdf-table-layout/page-size.d.ts +7 -0
- package/dist/types/shared/format-utils/pdf-table-layout/table-column-semantics.d.ts +106 -0
- package/dist/types/shared/format-utils/pdf-table-layout/table-column-widths.d.ts +13 -0
- package/dist/types/shared/format-utils/pdf-table-layout/table-page-geometry.d.ts +19 -0
- package/dist/types/shared/format-utils/pdf-table-layout/wide-table-layout.d.ts +46 -0
- package/dist/types/shared/format-utils/table-structure.d.ts +9 -0
- package/package.json +6 -1
- package/dist/chunks/edit-dashboard-visual-CI0EqzKj.cjs +0 -172
- package/dist/chunks/field-aggregations-jSi77h9Z.cjs +0 -1
- package/dist/chunks/index-BMMXKK3G.cjs +0 -4
- package/dist/chunks/index-C6_xef4P.cjs +0 -1424
- package/dist/chunks/matrix-formatter-Dajj91Ni.cjs +0 -1
- package/dist/chunks/matrix-member-presentation-CFHjdrxT.cjs +0 -1
- package/dist/chunks/pivot-header-presentation-BIf4HW3L.js +0 -414
- package/dist/chunks/pivot-header-presentation-B_N11CgN.cjs +0 -5
- package/dist/chunks/switch-Ced9ZZwI.cjs +0 -134
- package/dist/chunks/validators-DVYAnnX0.cjs +0 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Print readiness for a Document section. The scheduler's document mode
|
|
3
|
+
* waits while any `data-document-render-loading` marker is present and fails
|
|
4
|
+
* the PDF on `data-document-render-error` or a delivery error code
|
|
5
|
+
* (`semaphor-report-scheduler/pdf-generation/lib/modes/document.js`).
|
|
6
|
+
*
|
|
7
|
+
* - `ready` and `empty` print as they are.
|
|
8
|
+
* - `loading` holds the PDF until the section settles.
|
|
9
|
+
* - `blocked` (required inputs missing, or the section is not configured) and
|
|
10
|
+
* `error` fail the PDF instead of printing an incomplete report.
|
|
11
|
+
*/
|
|
12
|
+
export type DocumentSectionRenderState = 'ready' | 'empty' | 'loading' | 'blocked' | 'error';
|
|
13
|
+
/**
|
|
14
|
+
* One state for a section with several cards: an error or blocked card fails
|
|
15
|
+
* the section, then any loading card holds it, and it is empty only when every
|
|
16
|
+
* card is empty.
|
|
17
|
+
*/
|
|
18
|
+
export declare function summarizeDocumentSectionRenderStates(states: readonly DocumentSectionRenderState[]): DocumentSectionRenderState;
|
|
19
|
+
export type DocumentSectionRenderAttributes = {
|
|
20
|
+
'data-document-render-loading'?: 'true';
|
|
21
|
+
'data-document-render-error'?: 'true';
|
|
22
|
+
'data-semaphor-render-error-code'?: string;
|
|
23
|
+
'data-semaphor-render-error-message'?: string;
|
|
24
|
+
};
|
|
25
|
+
/** The markers for one render state. `error` is the failure, used for delivery error codes. */
|
|
26
|
+
export declare function getDocumentSectionRenderAttributes(state: DocumentSectionRenderState | undefined, error?: unknown): DocumentSectionRenderAttributes;
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { LucideIcon } from 'lucide-react';
|
|
2
|
+
import { DocumentSectionKindId } from './document-section-kinds.js';
|
|
2
3
|
import { DocumentInputDefinition, DocumentSection } from '../types/common-types.js';
|
|
3
4
|
export type DocumentSectionType = DocumentSection['type'];
|
|
4
|
-
|
|
5
|
+
/** Section kinds offered when adding a section (Matrix is stored as a table). */
|
|
6
|
+
export type AddableDocumentSectionType = Exclude<DocumentSectionKindId, 'chart' | 'pivot'>;
|
|
5
7
|
export declare const DOCUMENT_SECTION_LABELS: Record<DocumentSectionType, string>;
|
|
6
|
-
|
|
7
|
-
export declare function documentSectionIcon(type:
|
|
8
|
-
export declare function createDocumentSection(type: AddableDocumentSectionType): DocumentSection;
|
|
8
|
+
/** The icon of a section kind; pass `getDocumentSectionKind(section).id` for a stored section. */
|
|
9
|
+
export declare function documentSectionIcon(type: DocumentSectionKindId): LucideIcon;
|
|
9
10
|
export declare function getDocumentSectionLabel(section: DocumentSection, inputs: DocumentInputDefinition[]): string;
|
|
10
11
|
export declare function getDocumentSectionTitle(section: DocumentSection, inputs: DocumentInputDefinition[]): string;
|
|
11
12
|
export declare function getDocumentSectionSubtitle(section: DocumentSection): string | null;
|
|
13
|
+
/**
|
|
14
|
+
* What a data section reads, for its toolbar label: the dataset of a table
|
|
15
|
+
* section's card, or how many KPIs a KPI section holds. Undefined for other
|
|
16
|
+
* kinds and for a card with no dataset yet (SQL cards name none).
|
|
17
|
+
*/
|
|
18
|
+
export declare function getDocumentSectionDataLabel(section: DocumentSection): string | undefined;
|
|
@@ -10,22 +10,20 @@ export declare function getDocumentTableMeasuredChromeMetrics({ sectionElement,
|
|
|
10
10
|
chromeHeightPx: number;
|
|
11
11
|
trailingChromePx: number;
|
|
12
12
|
};
|
|
13
|
-
export declare function getDocumentPageElement(element: HTMLElement | null): HTMLElement | null;
|
|
14
|
-
export declare function getDocumentPageFooterElement(pageElement: HTMLElement | null): HTMLElement | null;
|
|
15
|
-
export declare function getIntendedDocumentPageBoxHeightPx(pageElement: HTMLElement): number;
|
|
16
|
-
export declare function getDocumentPageBodyBoundaryPx(pageElement: HTMLElement): number;
|
|
17
13
|
export declare function hasMaterialTableLayoutMeasurementChange(previousMeasurement: {
|
|
18
14
|
rowHeightPx: number;
|
|
19
15
|
averageRowHeightPx?: number;
|
|
20
16
|
rowHeightsPx?: Array<number | undefined>;
|
|
21
17
|
chromeHeightPx: number;
|
|
22
18
|
renderedMinHeightPx?: number;
|
|
23
|
-
|
|
19
|
+
columnWidthsPx?: number[];
|
|
20
|
+
matrixFit?: unknown;
|
|
24
21
|
} | null, nextMeasurement: {
|
|
25
22
|
rowHeightPx: number;
|
|
26
23
|
averageRowHeightPx?: number;
|
|
27
24
|
rowHeightsPx?: Array<number | undefined>;
|
|
28
25
|
chromeHeightPx: number;
|
|
29
26
|
renderedMinHeightPx?: number;
|
|
30
|
-
|
|
27
|
+
columnWidthsPx?: number[];
|
|
28
|
+
matrixFit?: unknown;
|
|
31
29
|
}): boolean;
|
|
@@ -55,11 +55,6 @@ export declare function getDocumentTableRowsThatFit({ rowMeasurementState, start
|
|
|
55
55
|
availableHeightPx: number;
|
|
56
56
|
}): number;
|
|
57
57
|
export declare function getDocumentTableEffectiveRowHeightFromState(rowMeasurementState: DocumentTableRowMeasurementState): number;
|
|
58
|
-
export declare function shouldReportDocumentTableLayoutMeasurement(_options: {
|
|
59
|
-
tableSlice?: {
|
|
60
|
-
pageIndex: number;
|
|
61
|
-
} | undefined;
|
|
62
|
-
}): boolean;
|
|
63
58
|
export declare function canUpdateDocumentTableLayoutChrome({ tableSlice, }: {
|
|
64
59
|
tableSlice?: {
|
|
65
60
|
pageIndex: number;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { DOCUMENT_TABLE_PRINT_RENDER_CONTRACT } from './document-visual-render-contract.js';
|
|
2
|
+
import { DocumentMatrixFit } from './document-matrix-bands.js';
|
|
2
3
|
import { DocumentTableSection } from '../types/common-types.js';
|
|
3
4
|
export declare const DOCUMENT_TABLE_DEFAULT_ROW_HEIGHT_PX = 40;
|
|
4
5
|
export declare const DOCUMENT_TABLE_MIN_MEASURED_ROW_HEIGHT_PX = 18;
|
|
5
6
|
export declare const DOCUMENT_TABLE_MIN_RENDERED_SURFACE_HEIGHT_PX = 120;
|
|
6
|
-
export type DocumentTablePrintKind = 'table' | 'pivotTable';
|
|
7
|
+
export type DocumentTablePrintKind = 'table' | 'pivotTable' | 'matrix';
|
|
7
8
|
export type DocumentTableLayoutMeasurement = {
|
|
8
9
|
rowHeightPx: number;
|
|
9
10
|
averageRowHeightPx?: number;
|
|
@@ -14,7 +15,8 @@ export type DocumentTableLayoutMeasurement = {
|
|
|
14
15
|
chromeHeightPx: number;
|
|
15
16
|
renderedMinHeightPx?: number;
|
|
16
17
|
canUpdateLayoutChrome?: boolean;
|
|
17
|
-
|
|
18
|
+
columnWidthsPx?: number[];
|
|
19
|
+
matrixFit?: DocumentMatrixFit;
|
|
18
20
|
};
|
|
19
21
|
export type DocumentTablePrintModel = {
|
|
20
22
|
sectionId: string;
|
|
@@ -34,7 +36,6 @@ export type DocumentTablePrintModel = {
|
|
|
34
36
|
effectiveRowHeightPx: number;
|
|
35
37
|
chromeHeightPx?: number;
|
|
36
38
|
renderedMinHeightPx?: number;
|
|
37
|
-
measuredRowsPerPage?: number;
|
|
38
39
|
renderContract: typeof DOCUMENT_TABLE_PRINT_RENDER_CONTRACT;
|
|
39
40
|
};
|
|
40
41
|
export declare function getDocumentTablePrintModel({ section, totalRowCount, layoutMeasurement, }: {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { TableDensity } from '../../components/visual/data-table/types/data-table.js';
|
|
2
2
|
import { DocumentTableSection } from '../types/common-types.js';
|
|
3
3
|
import { getTableTotalsBorderTopWidthValue, getTableTotalsFontWeightValue, ResolvedTablePresentationStyle } from '../table-formatting/table-presentation-style.js';
|
|
4
|
-
|
|
4
|
+
/** The densities a Document offers: on paper, only a few row heights differ.
|
|
5
|
+
* Stored Spacious and Dense values still print as they are. */
|
|
6
|
+
export declare const DOCUMENT_TABLE_DENSITY_OPTIONS: readonly TableDensity[];
|
|
5
7
|
export declare const DOCUMENT_TABLE_HEADER_STYLE_OPTIONS: readonly ["plain", "filled", "accent"];
|
|
6
8
|
export declare const DOCUMENT_TABLE_GRID_LINE_OPTIONS: readonly ["full", "outer", "inner", "horizontal", "vertical", "top", "right", "bottom", "left", "none"];
|
|
7
9
|
export declare const DOCUMENT_TABLE_DEFAULT_STYLE: {
|
|
@@ -15,14 +17,23 @@ export declare const DOCUMENT_TABLE_DEFAULT_STYLE: {
|
|
|
15
17
|
wrapText: false;
|
|
16
18
|
};
|
|
17
19
|
export declare const DOCUMENT_TABLE_TOTALS_FONT_WEIGHT_OPTIONS: readonly ["normal", "medium", "semibold", "bold"];
|
|
20
|
+
/**
|
|
21
|
+
* A Document table's total prints like a Matrix section's grand total
|
|
22
|
+
* (Plan 2, P1): no tint, semibold, between a firm top rule and a double
|
|
23
|
+
* bottom rule (drawn by the surface). What an author sets still wins, except
|
|
24
|
+
* that the double rule is always the closing one: a double top rule prints
|
|
25
|
+
* single, so the total never sits between two double rules.
|
|
26
|
+
*/
|
|
27
|
+
/** Top-rule styles a Document offers: its closing rule is already double. */
|
|
28
|
+
export declare const DOCUMENT_TABLE_TOTALS_BORDER_STYLE_OPTIONS: readonly ["solid", "dashed", "dotted"];
|
|
18
29
|
export declare const DOCUMENT_TABLE_DEFAULT_TOTALS_STYLE: {
|
|
19
|
-
enabled: false;
|
|
20
30
|
backgroundColor: string;
|
|
31
|
+
fontWeight: "semibold";
|
|
32
|
+
borderTopColor: string;
|
|
33
|
+
enabled: false;
|
|
21
34
|
textColor: string;
|
|
22
|
-
fontWeight: "medium";
|
|
23
35
|
borderTop: true;
|
|
24
36
|
borderTopStyle: "solid";
|
|
25
|
-
borderTopColor: string;
|
|
26
37
|
};
|
|
27
38
|
export type ResolvedDocumentTableStyle = ResolvedTablePresentationStyle;
|
|
28
39
|
export declare function resolveDocumentTableStyle(section: DocumentTableSection): ResolvedDocumentTableStyle;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { ResolvedDocumentTableStyle } from './document-table-style.js';
|
|
3
|
+
/**
|
|
4
|
+
* Light theme tokens for anything drawn on the page. A Document is paper, so
|
|
5
|
+
* its content stays light when the app is in dark mode.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DOCUMENT_TABLE_LIGHT_THEME_STYLE: CSSProperties;
|
|
8
|
+
export declare function getDocumentTableSurfaceClassName(style: ResolvedDocumentTableStyle): string;
|
|
9
|
+
/** The surface's CSS variables: row height, header and totals colors. */
|
|
10
|
+
export declare function getDocumentTableSurfaceStyle({ style, rowHeightPx, isSliced, }: {
|
|
11
|
+
style: ResolvedDocumentTableStyle;
|
|
12
|
+
rowHeightPx: number;
|
|
13
|
+
/** A page slice has no minimum surface height. */
|
|
14
|
+
isSliced: boolean;
|
|
15
|
+
}): CSSProperties;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TFilterValue } from '../../components/surfboard/filter/types.js';
|
|
2
2
|
import { ControlOption, DocumentInputDefinition, DocumentTextInlineFormat, DocumentTextContent, DocumentVariableRef, ResolvedDocumentInput } from '../types/common-types.js';
|
|
3
|
+
import { TextVariableChipFace, TextVariableOption, TextVariableSelection } from '../text-variables/text-variable-types.js';
|
|
3
4
|
export type DocumentTextRenderContext = {
|
|
4
5
|
inputs: DocumentInputDefinition[];
|
|
5
6
|
resolvedInputsById: Record<string, ResolvedDocumentInput>;
|
|
@@ -11,11 +12,6 @@ export type DocumentTextRenderContext = {
|
|
|
11
12
|
timezone?: string;
|
|
12
13
|
generatedAtFormat?: string;
|
|
13
14
|
};
|
|
14
|
-
export type DocumentVariableChoice = {
|
|
15
|
-
label: string;
|
|
16
|
-
token: string;
|
|
17
|
-
ref: DocumentVariableRef;
|
|
18
|
-
};
|
|
19
15
|
export type ParsedDocumentTextContent = {
|
|
20
16
|
content: DocumentTextContent;
|
|
21
17
|
unresolvedTokens: string[];
|
|
@@ -38,12 +34,50 @@ export type RenderedDocumentTextPart = {
|
|
|
38
34
|
type: 'text' | 'variable';
|
|
39
35
|
value: string;
|
|
40
36
|
format?: DocumentTextInlineFormat;
|
|
37
|
+
/** Authoring: how a variable reads as a chip. */
|
|
38
|
+
chip?: TextVariableChipFace;
|
|
41
39
|
};
|
|
42
40
|
export declare function parseDocumentTextContent(value: string, inputs: DocumentInputDefinition[]): ParsedDocumentTextContent;
|
|
43
41
|
export declare function parseDocumentTextContentWithSource(value: string, inputs: DocumentInputDefinition[]): ParsedDocumentTextContentWithSource;
|
|
44
|
-
export declare function getDocumentVariableChoices(inputs: DocumentInputDefinition[]): DocumentVariableChoice[];
|
|
45
42
|
export declare function appendDocumentVariable(content: DocumentTextContent | undefined, ref: DocumentVariableRef): DocumentTextContent;
|
|
46
43
|
export declare function getDocumentVariableLabel(ref: DocumentVariableRef, inputs: DocumentInputDefinition[]): string;
|
|
44
|
+
/** What a reference shows, as the picker names it. */
|
|
45
|
+
export declare function getDocumentVariableSelection(ref: DocumentVariableRef): TextVariableSelection;
|
|
46
|
+
/** The reference a picker selection stands for. */
|
|
47
|
+
export declare function getDocumentVariableRefFromSelection(selection: TextVariableSelection): DocumentVariableRef;
|
|
48
|
+
/** How a reference reads as a chip: the input's name, or Missing input. */
|
|
49
|
+
export declare function getDocumentVariableChipFace(ref: DocumentVariableRef, inputs: DocumentInputDefinition[]): TextVariableChipFace;
|
|
50
|
+
/**
|
|
51
|
+
* The inputs and report values a Document text can show, each part with what
|
|
52
|
+
* it holds now when `context` is given.
|
|
53
|
+
*/
|
|
54
|
+
export declare function getDocumentTextVariableOptions(inputs: DocumentInputDefinition[], context?: DocumentTextRenderContext): TextVariableOption[];
|
|
55
|
+
/**
|
|
56
|
+
* Where a document shows an input: the header, the footer and its text
|
|
57
|
+
* sections, in reading order.
|
|
58
|
+
*/
|
|
59
|
+
export declare function getDocumentInputTextUsage(document: {
|
|
60
|
+
header?: {
|
|
61
|
+
blocks: Array<{
|
|
62
|
+
type: string;
|
|
63
|
+
content?: DocumentTextContent;
|
|
64
|
+
}>;
|
|
65
|
+
};
|
|
66
|
+
footer?: {
|
|
67
|
+
blocks: Array<{
|
|
68
|
+
type: string;
|
|
69
|
+
content?: DocumentTextContent;
|
|
70
|
+
}>;
|
|
71
|
+
};
|
|
72
|
+
sections: Array<{
|
|
73
|
+
type: string;
|
|
74
|
+
content?: DocumentTextContent;
|
|
75
|
+
}>;
|
|
76
|
+
}, inputId: string): {
|
|
77
|
+
header: boolean;
|
|
78
|
+
footer: boolean;
|
|
79
|
+
textSections: number;
|
|
80
|
+
};
|
|
47
81
|
export declare function buildDocumentTextRenderContext({ inputs, filterValuesByInputId, controlValuesByInputId, controlOptionsByInputId, generatedAt, timezone, generatedAtFormat, pageNumber, pageCount, }: {
|
|
48
82
|
inputs: DocumentInputDefinition[];
|
|
49
83
|
filterValuesByInputId: Record<string, TFilterValue | undefined>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DocumentSectionRenderState } from './document-section-render-state.js';
|
|
2
|
+
import { DashboardCardQueryResult } from '../hooks/use-dashboard-frame-query.js';
|
|
3
|
+
import { DocumentKpiSection, TCard } from '../types/common-types.js';
|
|
4
|
+
import { ComparisonMetadataMap } from '../types/query-types.js';
|
|
5
|
+
import { DocumentSectionRuntime } from './document-section-query-options.js';
|
|
6
|
+
export type DocumentCardDataStatus = 'unconfigured'
|
|
7
|
+
/** Waiting for required inputs; the query will not run until they are set. */
|
|
8
|
+
| 'blocked' | 'loading' | 'ready' | 'empty' | 'error';
|
|
9
|
+
export type DocumentCardDataState = {
|
|
10
|
+
cardId: string;
|
|
11
|
+
card: TCard;
|
|
12
|
+
status: DocumentCardDataStatus;
|
|
13
|
+
/** The card query's records, unchanged. Empty unless `ready`. */
|
|
14
|
+
records: Record<string, unknown>[];
|
|
15
|
+
comparisonMetadata?: ComparisonMetadataMap;
|
|
16
|
+
errorMessage?: string;
|
|
17
|
+
/** The query failure, for delivery error attributes. */
|
|
18
|
+
error?: unknown;
|
|
19
|
+
/** `blocked` only: the required inputs to set. */
|
|
20
|
+
missingRequiredInputLabels?: string[];
|
|
21
|
+
};
|
|
22
|
+
/** A card can run once it is set up (the dashboard's own rule: a connection plus SQL or fields). */
|
|
23
|
+
export declare function isDocumentSectionCardRunnable(card: TCard): boolean;
|
|
24
|
+
/** The print readiness a card's data status means. */
|
|
25
|
+
export declare function getDocumentCardRenderState(status: DocumentCardDataStatus): DocumentSectionRenderState;
|
|
26
|
+
/** One card's data state from its query result. Exported for tests. */
|
|
27
|
+
export declare function toDocumentCardDataState(card: TCard, result: Pick<DashboardCardQueryResult, 'data' | 'isPending' | 'isFetching' | 'isError' | 'error' | 'errorMessage' | 'comparisonMetadata' | 'isCurrentQueryResult' | 'missingRequiredInputLabels'>): DocumentCardDataState;
|
|
28
|
+
/**
|
|
29
|
+
* Data for every card of a KPI section, in display order. Each card runs
|
|
30
|
+
* through the dashboard card query in the section's runtime (section-scoped
|
|
31
|
+
* inputs, document filters and controls), so a Document never has its own
|
|
32
|
+
* query path.
|
|
33
|
+
*
|
|
34
|
+
* KPI sections only: table sections acquire their rows through
|
|
35
|
+
* `useDocumentTableRows` (row policy, full-result acquisition for export) and
|
|
36
|
+
* share only the options builder. Reading a table through this hook would
|
|
37
|
+
* print a partial result.
|
|
38
|
+
*/
|
|
39
|
+
export declare function useDocumentSectionData(section: DocumentKpiSection, runtime: Omit<DocumentSectionRuntime, 'missingRequiredInputLabels'>): readonly DocumentCardDataState[];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { DocumentTableSlice } from './document-pagination.js';
|
|
3
|
+
import { DocumentTableLayoutMeasurement } from './document-table-print-model.js';
|
|
4
|
+
export declare function useMeasuredTableLayout({ sectionId, sectionRef, tableSurfaceRef, enabled, measureKey, measurementScale, fallbackRowHeightPx, rowRangeStartIndex, rowRangeEndIndex, totalRowCount, canUpdateLayoutChrome, measureColumnWidths, extraMeasurement, onTableLayoutMeasure, }: {
|
|
5
|
+
sectionId: string;
|
|
6
|
+
sectionRef: RefObject<HTMLDivElement | null>;
|
|
7
|
+
tableSurfaceRef: RefObject<HTMLDivElement | null>;
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
measureKey: string;
|
|
10
|
+
measurementScale: number;
|
|
11
|
+
/** For a drawn row with no layout box (a test DOM). */
|
|
12
|
+
fallbackRowHeightPx: number;
|
|
13
|
+
rowRangeStartIndex: number;
|
|
14
|
+
rowRangeEndIndex: number;
|
|
15
|
+
totalRowCount: number;
|
|
16
|
+
canUpdateLayoutChrome: boolean;
|
|
17
|
+
/** Report the first drawn row's cell widths (Matrix). */
|
|
18
|
+
measureColumnWidths?: boolean;
|
|
19
|
+
/** Reported with the measurement (a Matrix's fit). Keep it stable. */
|
|
20
|
+
extraMeasurement?: Pick<DocumentTableLayoutMeasurement, 'matrixFit'>;
|
|
21
|
+
onTableLayoutMeasure?: (sectionId: string, measurement: DocumentTableLayoutMeasurement) => void;
|
|
22
|
+
}): void;
|
|
23
|
+
/**
|
|
24
|
+
* Measures a Matrix printed in column bands (Plan 2, 2c, B2): every band draws
|
|
25
|
+
* every row, inside a `[data-document-matrix-band]` container under
|
|
26
|
+
* `bandsRef`. A row's height is its tallest across the bands, and the chrome
|
|
27
|
+
* is the tallest band's, so a slice of rows fits the page in every band.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useMeasuredBandedTableLayout({ sectionId, sectionRef, bandsRef, enabled, measureKey, measurementScale, fallbackRowHeightPx, rowCount, extraMeasurement, onTableLayoutMeasure, }: {
|
|
30
|
+
sectionId: string;
|
|
31
|
+
sectionRef: RefObject<HTMLDivElement | null>;
|
|
32
|
+
bandsRef: RefObject<HTMLDivElement | null>;
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
measureKey: string;
|
|
35
|
+
measurementScale: number;
|
|
36
|
+
fallbackRowHeightPx: number;
|
|
37
|
+
rowCount: number;
|
|
38
|
+
/** Reported with the measurement: widths and the fit. Keep it stable. */
|
|
39
|
+
extraMeasurement?: Pick<DocumentTableLayoutMeasurement, 'matrixFit' | 'columnWidthsPx'>;
|
|
40
|
+
onTableLayoutMeasure?: (sectionId: string, measurement: DocumentTableLayoutMeasurement) => void;
|
|
41
|
+
}): void;
|
|
42
|
+
export declare function getMeasurementRowRange({ tableSlice, initialRowsPerPageLimit, totalRowCount, }: {
|
|
43
|
+
tableSlice?: DocumentTableSlice;
|
|
44
|
+
initialRowsPerPageLimit?: number;
|
|
45
|
+
totalRowCount: number;
|
|
46
|
+
}): {
|
|
47
|
+
startIndex: number;
|
|
48
|
+
endIndex: number;
|
|
49
|
+
totalRowCount: number;
|
|
50
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads KPI values out of a card query result. Shared by the dashboard KPI
|
|
3
|
+
* cards and the Document KPI section, so both read the same number from the
|
|
4
|
+
* same result.
|
|
5
|
+
*/
|
|
6
|
+
/** A finite number from a numeric value or a numeric string (thousands commas allowed). */
|
|
7
|
+
export declare function toFiniteKpiNumber(value: unknown): number | null;
|
|
8
|
+
/**
|
|
9
|
+
* SQL-backed KPI: the first row's first displayed numeric column is the
|
|
10
|
+
* current value, the second is the previous value.
|
|
11
|
+
*/
|
|
12
|
+
export declare function readSqlKpiValues(data?: Record<string, unknown>[] | null): {
|
|
13
|
+
current: number | null;
|
|
14
|
+
previous: number | null;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Explorer KPI: the value of a result segment (`current`, `comparison`) for
|
|
18
|
+
* the primary metric. Rows without a `metricId` match any metric.
|
|
19
|
+
*/
|
|
20
|
+
export declare function readKpiSegmentValue(data: Record<string, unknown>[] | null | undefined, segment: string, metricId?: string): number | null;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { MatrixCardCatalog } from '../../matrix-table/matrix-card-adapter.js';
|
|
2
2
|
import { TCard } from '../../types/common-types.js';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { DocumentSectionCardRuntime } from '../../query-context/document-section-card-query.js';
|
|
4
|
+
/**
|
|
5
|
+
* Store adapter only: field, input, scope and precision decisions stay in the
|
|
6
|
+
* compiler. A Document section passes its runtime; the editor's preview of a
|
|
7
|
+
* section's card uses the editor's snapshot of the document inputs, as the
|
|
8
|
+
* card's frame query does.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useDashboardCardExecutionSnapshot(card: TCard, matrixCatalog: MatrixCardCatalog, documentSection?: DocumentSectionCardRuntime): import('../../query-context/build-dashboard-execution-snapshot.js').DashboardCardExecutionSnapshotResult;
|
|
@@ -27,6 +27,12 @@ type AdditionalState = {
|
|
|
27
27
|
effectiveCardConfig?: CardConfig;
|
|
28
28
|
resultOwner: TemporalResultOwner;
|
|
29
29
|
isCurrentQueryResult: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Required inputs this card's Document section query is waiting for. When
|
|
32
|
+
* non-empty the query is disabled and will not run until they are set, so
|
|
33
|
+
* a Document renders it as blocked, not loading.
|
|
34
|
+
*/
|
|
35
|
+
missingRequiredInputLabels: string[];
|
|
30
36
|
};
|
|
31
37
|
export type DashboardCardQueryResult = UseQueryResult<any, Error> & AdditionalState;
|
|
32
38
|
export type DashboardCardQueryOptions = {
|
|
@@ -2,7 +2,7 @@ import { TCard } from '../types/common-types.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Hook that provides KPI card actions scoped to visual editor mode.
|
|
4
4
|
*/
|
|
5
|
-
export declare function useDashboardKpiActions(
|
|
5
|
+
export declare function useDashboardKpiActions(card: TCard): {
|
|
6
6
|
setTitle: (title: string) => void;
|
|
7
7
|
setCountryLogo: (countryId: string | null) => void;
|
|
8
8
|
isEditable: boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ControlDefinition, DocumentTableSection } from '../types/common-types.js';
|
|
1
|
+
import { ControlDefinition, DocumentKpiSection, DocumentTableSection } from '../types/common-types.js';
|
|
2
2
|
import { TFilterValue } from '../../components/surfboard/filter/types.js';
|
|
3
|
-
export declare function useDocumentSectionEditor(): (sheetId: string, section: DocumentTableSection, documentFilterValues?: TFilterValue[], documentControlDefinitions?: ControlDefinition[], documentControlValues?: Record<string, unknown>, missingRequiredInputLabels?: string[]) => void;
|
|
3
|
+
export declare function useDocumentSectionEditor(): (sheetId: string, section: DocumentTableSection | DocumentKpiSection, documentFilterValues?: TFilterValue[], documentControlDefinitions?: ControlDefinition[], documentControlValues?: Record<string, unknown>, missingRequiredInputLabels?: string[], cardId?: string) => void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ControlDefinition, DocumentKpiSection, DocumentTableSection, TFrame } from '../types/common-types.js';
|
|
2
|
+
import { TFilterValue } from '../../components/surfboard/filter/types.js';
|
|
3
|
+
export type DocumentSectionCommitResult = {
|
|
4
|
+
ok: true;
|
|
5
|
+
} | {
|
|
6
|
+
ok: false;
|
|
7
|
+
reason: string;
|
|
8
|
+
};
|
|
9
|
+
export type OpenDocumentSectionSession = {
|
|
10
|
+
sheetId: string;
|
|
11
|
+
section: DocumentTableSection | DocumentKpiSection;
|
|
12
|
+
/** The card to edit; required for a KPI section with several cards. */
|
|
13
|
+
cardId?: string;
|
|
14
|
+
documentFilterValues?: TFilterValue[];
|
|
15
|
+
documentControlDefinitions?: ControlDefinition[];
|
|
16
|
+
documentControlValues?: Record<string, unknown>;
|
|
17
|
+
missingRequiredInputLabels?: string[];
|
|
18
|
+
};
|
|
19
|
+
export type DocumentSectionSession = {
|
|
20
|
+
open(target: OpenDocumentSectionSession): void;
|
|
21
|
+
/**
|
|
22
|
+
* Writes the accepted frame's card, and its calculated fields, in one
|
|
23
|
+
* document edit. `acceptedFrame` is the frame Accept built and validated:
|
|
24
|
+
* metadata is resolved for it and it is what is written, as a dashboard
|
|
25
|
+
* visual's save does, so the two always match.
|
|
26
|
+
*/
|
|
27
|
+
commit(acceptedFrame: TFrame): Promise<DocumentSectionCommitResult>;
|
|
28
|
+
discard(): void;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* One editor session on one card of a document section. It opens today's
|
|
32
|
+
* full-screen visual editor on the existing path (`setupEditorWithCard`, so
|
|
33
|
+
* `isVisualEditing` stays the calculated-field draft boundary and query gate),
|
|
34
|
+
* and nothing reaches the dashboard until `commit()`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function useDocumentSectionSession(): DocumentSectionSession;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Marks everything below it as the visual editor's preview. Only `<Editor>`
|
|
4
|
+
* provides it. Whether a component is the editor's preview is a fact about
|
|
5
|
+
* where it renders, not a global mode: a Document page stays on screen while
|
|
6
|
+
* one of its cards is open in the editor, and it is a report, not the
|
|
7
|
+
* editor's preview.
|
|
8
|
+
*/
|
|
9
|
+
export declare function EditorPreviewScope({ children }: {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}): import('react').FunctionComponentElement<import('react').ProviderProps<boolean>>;
|
|
12
|
+
/**
|
|
13
|
+
* Whether this component renders inside the visual editor. Visuals, filters
|
|
14
|
+
* and queries read this, never the store's `isVisualEditing`, which only
|
|
15
|
+
* means "the editor UI is open" (tech spec M7).
|
|
16
|
+
*/
|
|
17
|
+
export declare function useIsEditorPreview(): boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether this card is the one open in the visual editor. Card-level editing
|
|
3
|
+
* affordances (inline title and description) key on this rather than the
|
|
4
|
+
* global `isVisualEditing`, so a page that shows several cards while one is
|
|
5
|
+
* edited, such as a Document, keeps the others read-only.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useIsEditingCard(cardId: string | undefined): boolean;
|
|
@@ -35,6 +35,7 @@ export declare function prepareMatrixCard(card: TCard, catalog: MatrixCardCatalo
|
|
|
35
35
|
position: "before" | "after";
|
|
36
36
|
label?: string | undefined;
|
|
37
37
|
}>>;
|
|
38
|
+
skipRedundant?: boolean | undefined;
|
|
38
39
|
};
|
|
39
40
|
rows: {
|
|
40
41
|
grand: {
|
|
@@ -47,6 +48,7 @@ export declare function prepareMatrixCard(card: TCard, catalog: MatrixCardCatalo
|
|
|
47
48
|
position: "before" | "after";
|
|
48
49
|
label?: string | undefined;
|
|
49
50
|
}>>;
|
|
51
|
+
skipRedundant?: boolean | undefined;
|
|
50
52
|
};
|
|
51
53
|
};
|
|
52
54
|
layout: {
|
|
@@ -15,6 +15,7 @@ export declare function initializeMatrixCardDraft(card: Pick<TCard, 'config' | '
|
|
|
15
15
|
position: "before" | "after";
|
|
16
16
|
label?: string | undefined;
|
|
17
17
|
}>>;
|
|
18
|
+
skipRedundant?: boolean | undefined;
|
|
18
19
|
};
|
|
19
20
|
rows: {
|
|
20
21
|
grand: {
|
|
@@ -27,6 +28,7 @@ export declare function initializeMatrixCardDraft(card: Pick<TCard, 'config' | '
|
|
|
27
28
|
position: "before" | "after";
|
|
28
29
|
label?: string | undefined;
|
|
29
30
|
}>>;
|
|
31
|
+
skipRedundant?: boolean | undefined;
|
|
30
32
|
};
|
|
31
33
|
};
|
|
32
34
|
layout: {
|
|
@@ -98,6 +98,7 @@ export declare function buildMatrixDeliveryPayload(input: {
|
|
|
98
98
|
position: "before" | "after";
|
|
99
99
|
label?: string | undefined;
|
|
100
100
|
}>>;
|
|
101
|
+
skipRedundant?: boolean | undefined;
|
|
101
102
|
};
|
|
102
103
|
rows: {
|
|
103
104
|
grand: {
|
|
@@ -110,6 +111,7 @@ export declare function buildMatrixDeliveryPayload(input: {
|
|
|
110
111
|
position: "before" | "after";
|
|
111
112
|
label?: string | undefined;
|
|
112
113
|
}>>;
|
|
114
|
+
skipRedundant?: boolean | undefined;
|
|
113
115
|
};
|
|
114
116
|
};
|
|
115
117
|
layout: {
|
|
@@ -448,6 +450,7 @@ export declare function buildMatrixDeliveryPayload(input: {
|
|
|
448
450
|
position: "before" | "after";
|
|
449
451
|
label?: string | undefined;
|
|
450
452
|
}>>;
|
|
453
|
+
skipRedundant?: boolean | undefined;
|
|
451
454
|
};
|
|
452
455
|
rows: {
|
|
453
456
|
grand: {
|
|
@@ -460,6 +463,7 @@ export declare function buildMatrixDeliveryPayload(input: {
|
|
|
460
463
|
position: "before" | "after";
|
|
461
464
|
label?: string | undefined;
|
|
462
465
|
}>>;
|
|
466
|
+
skipRedundant?: boolean | undefined;
|
|
463
467
|
};
|
|
464
468
|
};
|
|
465
469
|
layout: {
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { MatrixLayoutReadResult } from '../../shared/dashboard-authoring/matrix-delivery.js';
|
|
2
|
+
import { buildMatrixDeliveryPayload } from './matrix-delivery.js';
|
|
3
|
+
import { DocumentTableRowFacts } from '../document/document-pagination.js';
|
|
4
|
+
import { FastPathTableStructure } from '../../shared/format-utils/table-structure.js';
|
|
5
|
+
import { ReportRuntimeContext } from '../../shared/report-runtime-context/index.js';
|
|
6
|
+
/** Matrix sections on one page read at most this many full results at once (tech spec G6). */
|
|
7
|
+
export declare const MATRIX_LAYOUT_READ_CONCURRENCY = 2;
|
|
8
|
+
/**
|
|
9
|
+
* The full Matrix result a Document section prints, from the delivery-authorized
|
|
10
|
+
* layout route (tech spec D-M1). Always resolves to the typed result; an abort
|
|
11
|
+
* rejects, so it is never kept as a result.
|
|
12
|
+
*/
|
|
13
|
+
export declare function readMatrixLayout(input: {
|
|
14
|
+
apiServiceUrl: string;
|
|
15
|
+
token: string;
|
|
16
|
+
payload: ReturnType<typeof buildMatrixDeliveryPayload>;
|
|
17
|
+
signal: AbortSignal;
|
|
18
|
+
}): Promise<MatrixLayoutReadResult>;
|
|
19
|
+
/** How a printed row reads: its role and where it sits in the hierarchy. */
|
|
20
|
+
export type MatrixPrintRowKind = 'member'
|
|
21
|
+
/** A parent row in outline layout, heading its children. */
|
|
22
|
+
| 'group'
|
|
23
|
+
/** The subtotal of the innermost group level. */
|
|
24
|
+
| 'subtotal_inner'
|
|
25
|
+
/** The subtotal of an outer group level. */
|
|
26
|
+
| 'subtotal_outer' | 'grand_total';
|
|
27
|
+
export type MatrixPrintRow = {
|
|
28
|
+
kind: MatrixPrintRowKind;
|
|
29
|
+
/**
|
|
30
|
+
* Group labels this row hides because the row above shows them, by column
|
|
31
|
+
* index. A page that starts at this row repeats them, marked "(cont.)".
|
|
32
|
+
*/
|
|
33
|
+
continuation?: Readonly<Record<number, string>>;
|
|
34
|
+
/**
|
|
35
|
+
* Indented layout: the parent header rows a page that starts at this row
|
|
36
|
+
* repeats, outermost first, already indented and marked "(cont.)".
|
|
37
|
+
*/
|
|
38
|
+
continuationHeaders?: readonly string[];
|
|
39
|
+
};
|
|
40
|
+
/** A read as the page draws it: the formatted table and each row's print facts. */
|
|
41
|
+
export type DocumentMatrixRead = {
|
|
42
|
+
status: 'ok';
|
|
43
|
+
table: FastPathTableStructure;
|
|
44
|
+
rows: readonly MatrixPrintRow[];
|
|
45
|
+
/** Indented layout: the column that carries the row labels. */
|
|
46
|
+
hierarchyColumn?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Column groups for bands (Plan 2, 2c): per column, the index of its
|
|
49
|
+
* group in `groups`, or `null` for a row-label column. A group is one
|
|
50
|
+
* column member (or total) with all its measures.
|
|
51
|
+
*/
|
|
52
|
+
columnGroups: readonly (number | null)[];
|
|
53
|
+
/** Each group's label, as the header prints it ("Houston", "Grand Total"). */
|
|
54
|
+
groupLabels: readonly string[];
|
|
55
|
+
/** What bands name their groups by: the innermost column level, or "Measures". */
|
|
56
|
+
groupLevelLabel: string;
|
|
57
|
+
/** How the paginator may split these rows (Plan 2, L1 and L5). */
|
|
58
|
+
pageBreaks: DocumentTableRowFacts;
|
|
59
|
+
} | Extract<MatrixLayoutReadResult, {
|
|
60
|
+
status: 'failed';
|
|
61
|
+
}>;
|
|
62
|
+
/**
|
|
63
|
+
* Formats a read once, with the definition that ran. The Document section
|
|
64
|
+
* does this in its query, so every page slice shares one formatted table.
|
|
65
|
+
* The table is the one every Matrix PDF prints (`buildMatrixPrintTable`);
|
|
66
|
+
* this adds what only a Document uses, such as "(cont.)" labels.
|
|
67
|
+
*/
|
|
68
|
+
export declare function formatMatrixLayoutRead(result: MatrixLayoutReadResult, report: ReportRuntimeContext): DocumentMatrixRead;
|
|
@@ -6,6 +6,7 @@ import { BuildCardQueryContextParams, CompiledCardQueryContext } from './build-c
|
|
|
6
6
|
import { CompiledDashboardCardFilters } from './compile-dashboard-card-filters.js';
|
|
7
7
|
import { DashboardInputResolveMode } from '../dashboard-inputs/resolve-dashboard-input-context.js';
|
|
8
8
|
import { prepareMatrixCard, MatrixCardCatalog } from '../matrix-table/matrix-card-adapter.js';
|
|
9
|
+
import { DocumentSectionCardRuntime } from './document-section-card-query.js';
|
|
9
10
|
export type DashboardExecutionSnapshot = {
|
|
10
11
|
selectedSheetId: string | null;
|
|
11
12
|
filterValues: TFilterValue[];
|
|
@@ -36,6 +37,12 @@ export type BuildDashboardCardExecutionSnapshotParams = Omit<BuildCardQueryConte
|
|
|
36
37
|
/** Editor drafts replace their persisted card only for this computation. */
|
|
37
38
|
cardOverride?: TCard;
|
|
38
39
|
sheetId?: string | null;
|
|
40
|
+
/**
|
|
41
|
+
* Runs the target card as a Document section (tech spec G3), with the same
|
|
42
|
+
* rules as every section card's frame query. Other cards keep the dashboard
|
|
43
|
+
* runtime.
|
|
44
|
+
*/
|
|
45
|
+
documentSection?: DocumentSectionCardRuntime;
|
|
39
46
|
};
|
|
40
47
|
export type DashboardCardExecutionSnapshot = {
|
|
41
48
|
status: 'ready';
|
|
@@ -52,5 +59,5 @@ export type DashboardCardExecutionSnapshotResult = DashboardCardExecutionSnapsho
|
|
|
52
59
|
message?: string;
|
|
53
60
|
} | null;
|
|
54
61
|
export declare function requireReadyDashboardCardExecutionSnapshot(result: DashboardCardExecutionSnapshotResult): DashboardCardExecutionSnapshot | null;
|
|
55
|
-
export declare function buildDashboardCardExecutionSnapshot({ dashboard, cardId, transientContexts, cardViewStates, semanticExecutionPayload, filters, filterValues, inlineFilterValuesMap, dashboardControls, dashboardControlValues, cardControlValuesMap, dashboardInputValues, dashboardInputMode, timezone, matrixCatalog, cardOverride, sheetId, }: BuildDashboardCardExecutionSnapshotParams): DashboardCardExecutionSnapshotResult;
|
|
62
|
+
export declare function buildDashboardCardExecutionSnapshot({ dashboard, cardId, transientContexts, cardViewStates, semanticExecutionPayload, filters, filterValues, inlineFilterValuesMap, dashboardControls, dashboardControlValues, cardControlValuesMap, dashboardInputValues, dashboardInputMode, timezone, matrixCatalog, cardOverride, sheetId, documentSection, }: BuildDashboardCardExecutionSnapshotParams): DashboardCardExecutionSnapshotResult;
|
|
56
63
|
export {};
|