react-semaphor 0.1.544 → 0.1.546

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 (179) hide show
  1. package/dist/analytics-protocol/index.js +405 -441
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +100 -76
  4. package/dist/brand-studio/index.js +5 -5
  5. package/dist/briefings/index.js +55 -52
  6. package/dist/chunks/{class-utils-Df1OVOT1.js → _commonjsHelpers-DimLPMtv.js} +124 -98
  7. package/dist/chunks/{add-to-dashboard-BuAqfA2Y.js → add-to-dashboard-BQRAAnc3.js} +55 -33
  8. package/dist/chunks/{analytics-base-schemas-BFAoRlkU.js → analytics-base-schemas-BKs3flFS.js} +2 -2
  9. package/dist/chunks/{assistant-chat-BNLkCDml.js → assistant-chat-BPXhulAx.js} +2792 -2562
  10. package/dist/chunks/{bookmark-state-CXw7lZ50.js → bookmark-state-C4vetoa0.js} +7 -8
  11. package/dist/chunks/column-catalog-BYnochWQ.js +3363 -0
  12. package/dist/chunks/comparison-window-caption-C2xF-eWw.js +1433 -0
  13. package/dist/chunks/{context-ClREvqCZ.js → context-BerEBuFR.js} +11 -6
  14. package/dist/chunks/custom-visual-inputs-CkJW9pBS.js +295 -0
  15. package/dist/chunks/{dashboard-g5a4DKWq.js → dashboard-C3CoKbGY.js} +1 -1
  16. package/dist/chunks/dashboard-briefing-launcher-Be4h-7My.js +3734 -0
  17. package/dist/chunks/dashboard-controls-bxPrlSyp.js +2307 -0
  18. package/dist/chunks/{dashboard-json-7qT9jmfL.js → dashboard-json-BrjxIiRt.js} +6 -6
  19. package/dist/chunks/document-dashboard-inputs-CRVHpIHp.js +3010 -0
  20. package/dist/chunks/{edit-dashboard-visual-BfJwnRIZ.js → edit-dashboard-visual-DYYYDjY6.js} +5986 -6063
  21. package/dist/chunks/{filter-value-text-CYsVYPuD.js → filter-value-text-Ddf55Ku1.js} +8 -8
  22. package/dist/chunks/global-date-filter-utils-9d6m9-FE.js +11859 -0
  23. package/dist/chunks/index-CtoK1Lgu.js +586 -0
  24. package/dist/chunks/{index-DkAyQvC6.js → index-DkQkMKa1.js} +385 -339
  25. package/dist/chunks/list-filter-DsaTbM3J.js +15 -0
  26. package/dist/chunks/matrix-analytical-definition-B9vW-osb.js +717 -0
  27. package/dist/chunks/{matrix-card-DjwWcCo8.js → matrix-card-LiMEipvq.js} +3 -3
  28. package/dist/chunks/{matrix-formatter-CxJLkztA.js → matrix-formatter-DWEeC0_c.js} +55 -55
  29. package/dist/chunks/{matrix-member-presentation-CQGdVks6.js → matrix-member-presentation-DqzG-UhQ.js} +1 -1
  30. package/dist/chunks/{matrix-operation-contract-8OIO4gob.js → matrix-operation-contract-D6vYkZK4.js} +72 -72
  31. package/dist/chunks/{metric-comparison-DEwi9uc2.js → metric-comparison-zpGw4lD6.js} +2 -2
  32. package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +119 -0
  33. package/dist/chunks/{pivot-header-presentation-DHcx1XGQ.js → pivot-header-presentation-CQnIDtUv.js} +1 -1
  34. package/dist/chunks/{pivot-result-identity-DJhXXcns.js → pivot-result-identity-C-Q1j1Wb.js} +1 -1
  35. package/dist/chunks/{pivot-result-lifecycle-DM4CyGKs.js → pivot-result-lifecycle-pwq3b7LC.js} +571 -380
  36. package/dist/chunks/{raw-temporal-contract-C51YG48G.js → raw-temporal-contract-WuXA8jBP.js} +1 -1
  37. package/dist/chunks/{raw-temporal-presentation-CLiVi90c.js → raw-temporal-presentation-CBzrDOjM.js} +8 -8
  38. package/dist/chunks/rendered-file-D8xEuVVx.js +108 -0
  39. package/dist/chunks/{report-preferences-dialog-Df7VpRVW.js → report-preferences-dialog-4QEZWe5U.js} +637 -610
  40. package/dist/chunks/{report-runtime-context-Dq8XyODK.js → report-runtime-context-hWiTCzFV.js} +2 -2
  41. package/dist/chunks/resolve-dashboard-input-context-UpK_LBpL.js +5677 -0
  42. package/dist/chunks/{saved-dashboard-context-B-mQ--nV.js → saved-dashboard-context-D_I3Lxk0.js} +184 -212
  43. package/dist/chunks/selection-filter-compiler-BKXmyLrS.js +79 -0
  44. package/dist/chunks/{selection-reducer-Dj_8xD69.js → selection-reducer-CJzkTZio.js} +15 -15
  45. package/dist/chunks/{semaphor-ready-indicator-DDAxk8us.js → semaphor-ready-indicator-4zpRHE-X.js} +56832 -59068
  46. package/dist/chunks/{shelf-drop-preview-context-BSRPwaED.js → shelf-drop-preview-context-Cfw7TRAx.js} +890 -871
  47. package/dist/chunks/{source-entity-resolution-BYn9giz3.js → source-entity-resolution-BIGRvtbG.js} +13 -13
  48. package/dist/chunks/{switch-C3jLxlG0.js → switch-CEBOR4n7.js} +47 -48
  49. package/dist/chunks/{table-export-sheet-CPfGAQ9X.js → table-export-sheet-4X9mAG3V.js} +1 -1
  50. package/dist/chunks/table-settings-CunhoDUi.js +605 -0
  51. package/dist/chunks/{temporal-bucket-D7NBrrtL.js → temporal-bucket-CQOSbv9-.js} +26 -26
  52. package/dist/chunks/{token-types-DBbZVQsm.js → token-types-BMqRmT-C.js} +1 -1
  53. package/dist/chunks/{use-create-flow-overlay-state-BxzFviM-.js → use-create-flow-overlay-state-DZBZiiD-.js} +83 -83
  54. package/dist/chunks/{validators-DMHTpf7a.js → validators-C-aOQlTB.js} +713 -658
  55. package/dist/dashboard/index.js +2 -2
  56. package/dist/dashboard-authoring/index.js +1800 -1135
  57. package/dist/data-app-sdk/index.js +6 -6
  58. package/dist/data-app-sdk-adapters/index.js +3 -3
  59. package/dist/data-app-sdk-validation/index.js +14 -14
  60. package/dist/format-utils/index.js +198 -187
  61. package/dist/index.js +359 -325
  62. package/dist/layouts/index.js +5 -242
  63. package/dist/report-runtime-context/index.js +2 -2
  64. package/dist/shared/index.js +4 -5
  65. package/dist/style.css +1 -1
  66. package/dist/surfboard/index.js +2 -2
  67. package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
  68. package/dist/types/briefings/attachments.d.ts +33 -6
  69. package/dist/types/briefings/index.d.ts +6 -5
  70. package/dist/types/components/index.d.ts +2 -0
  71. package/dist/types/components/surfboard/arrange-layout-button.d.ts +8 -0
  72. package/dist/types/components/surfboard/filter/types.d.ts +0 -14
  73. package/dist/types/components/surfboard/screen-size-preview-button.d.ts +7 -0
  74. package/dist/types/index.js +6 -6
  75. package/dist/types/lib/charts/table-chart-types.d.ts +4 -0
  76. package/dist/types/lib/charts/types.d.ts +2 -2
  77. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +68 -82
  78. package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +0 -8
  79. package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +41 -1
  80. package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +201 -0
  81. package/dist/types/lib/dashboard-inputs/prepare-loaded-dashboard.d.ts +15 -0
  82. package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +7 -2
  83. package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +1 -1
  84. package/dist/types/lib/dashboard-viewer/captured-runtime-values.d.ts +40 -0
  85. package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +16 -16
  86. package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +11 -9
  87. package/dist/types/lib/download-pdf.d.ts +75 -1
  88. package/dist/types/lib/hooks/use-date-filter.d.ts +5 -0
  89. package/dist/types/lib/hooks/use-text-filter.d.ts +5 -0
  90. package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +5 -4
  91. package/dist/types/lib/matrix-table/matrix-editor.d.ts +52 -0
  92. package/dist/types/lib/query-context/assemble-card-query.d.ts +158 -0
  93. package/dist/types/lib/query-context/build-card-query-context.d.ts +3 -3
  94. package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +15 -6
  95. package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +11 -13
  96. package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +22 -12
  97. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +69 -0
  98. package/dist/types/lib/stores/dashboard-store.d.ts +159 -56
  99. package/dist/types/lib/stores/editor-store.d.ts +0 -3
  100. package/dist/types/lib/types/common-types.d.ts +29 -6
  101. package/dist/types/lib/types/explorer-types.d.ts +10 -0
  102. package/dist/types/lib/types/semantic-types.d.ts +84 -0
  103. package/dist/types/lib/utils/build-saved-editor-card.d.ts +20 -0
  104. package/dist/types/lib/utils/card-type-change.d.ts +16 -0
  105. package/dist/types/lib/utils/field-availability-context.d.ts +25 -0
  106. package/dist/types/lib/utils/field-placement.d.ts +96 -0
  107. package/dist/types/lib/utils/field-state-calculator.d.ts +161 -0
  108. package/dist/types/lib/utils/qualified-entity-name.d.ts +2 -0
  109. package/dist/types/shared/analytics-protocol/field-provenance.d.ts +89 -0
  110. package/dist/types/shared/analytics-protocol/index.d.ts +2 -0
  111. package/dist/types/shared/analytics-protocol/query-policies.d.ts +52 -0
  112. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +1 -1
  113. package/dist/types/shared/analytics-protocol/time-window.d.ts +40 -1
  114. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +8 -12
  115. package/dist/types/shared/assistant-protocol/answer-text.d.ts +20 -0
  116. package/dist/types/shared/assistant-protocol/context.d.ts +21 -21
  117. package/dist/types/shared/assistant-protocol/index.d.ts +1 -0
  118. package/dist/types/shared/assistant-protocol/limits.d.ts +6 -1
  119. package/dist/types/shared/assistant-protocol/parts.d.ts +43 -3
  120. package/dist/types/shared/assistant-protocol/request.d.ts +14 -2
  121. package/dist/types/shared/dashboard-authoring/calculated-field-identity.d.ts +3 -0
  122. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +487 -0
  123. package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +34 -0
  124. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +7886 -0
  125. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +43 -0
  126. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +54 -0
  127. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +89 -0
  128. package/dist/types/shared/dashboard-authoring/column-catalog.d.ts +32 -0
  129. package/dist/types/shared/dashboard-authoring/contracts.d.ts +0 -55
  130. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +16 -6
  131. package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +9 -1
  132. package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +7 -0
  133. package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +118 -0
  134. package/dist/types/shared/dashboard-authoring/filter-applicability.d.ts +75 -0
  135. package/dist/types/shared/dashboard-authoring/filter-model/ad-hoc-filter-values.d.ts +10 -0
  136. package/dist/types/shared/dashboard-authoring/filter-model/filter-definitions.d.ts +29 -0
  137. package/dist/types/shared/dashboard-authoring/filter-model/filter-values.d.ts +58 -0
  138. package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +7 -0
  139. package/dist/types/shared/dashboard-authoring/filter-model/prototype-document-inputs.d.ts +15 -0
  140. package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +78 -0
  141. package/dist/types/shared/dashboard-authoring/filter-model/stored-dashboard.d.ts +18 -0
  142. package/dist/types/shared/dashboard-authoring/filter-model/toolbar-filter-reach.d.ts +23 -0
  143. package/dist/types/shared/dashboard-authoring/index.d.ts +20 -2
  144. package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +10 -37
  145. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +189 -0
  146. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +94 -0
  147. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +78 -0
  148. package/dist/types/shared/dashboard-authoring/validators.d.ts +1 -2
  149. package/dist/types/shared/format-utils/exporters/index.d.ts +2 -0
  150. package/dist/types/shared/format-utils/exporters/rendered-file.d.ts +106 -0
  151. package/dist/types/shared/layouts/engine/grid.d.ts +25 -0
  152. package/dist/types/shared/layouts/engine/index.d.ts +4 -0
  153. package/dist/types/shared/layouts/engine/sheet-layout.d.ts +7 -0
  154. package/dist/types/shared/layouts/engine/types.d.ts +125 -0
  155. package/dist/types/shared/layouts/index.d.ts +1 -2
  156. package/package.json +2 -2
  157. package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +0 -28
  158. package/dist/chunks/apply-dashboard-operations-Bz4n1Lq6.js +0 -2260
  159. package/dist/chunks/calendar-day-equality-BmJAWduY.js +0 -460
  160. package/dist/chunks/comparison-window-caption-BTkrN3W4.js +0 -1623
  161. package/dist/chunks/custom-visual-inputs-DUtpYZOk.js +0 -323
  162. package/dist/chunks/dashboard-briefing-launcher-DQ_8O_e2.js +0 -3725
  163. package/dist/chunks/dashboard-controls-8RyBTQUO.js +0 -2315
  164. package/dist/chunks/dashboard-filter-value-compatibility-CwQ_iSNb.js +0 -108
  165. package/dist/chunks/document-dashboard-inputs-BC6p-ESg.js +0 -8087
  166. package/dist/chunks/document-sheet-utils-Duo9uLoH.js +0 -3619
  167. package/dist/chunks/matrix-analytical-definition-C7Gb0e12.js +0 -117
  168. package/dist/chunks/normalize-dashboard-for-dirty-check-Bk3VYv_q.js +0 -67
  169. package/dist/chunks/numeric-presentation-DESvLiu9.js +0 -5227
  170. package/dist/chunks/sort-target-MT1WK1vX.js +0 -29
  171. package/dist/chunks/stable-serialize-CfqXeiBP.js +0 -6
  172. package/dist/chunks/table-settings-CLZocegs.js +0 -501
  173. package/dist/chunks/use-debounced-dirty-check-BwAbnX_5.js +0 -59
  174. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +0 -88
  175. package/dist/types/lib/dashboard-inputs/dashboard-input-scope.d.ts +0 -10
  176. package/dist/types/shared/dashboard-authoring/change-compiler.d.ts +0 -7
  177. package/dist/types/shared/dashboard-authoring/layout-compiler.d.ts +0 -2
  178. package/dist/types/shared/layouts/create-frame-layouts.d.ts +0 -27
  179. package/dist/types/shared/layouts/frame-layouts.d.ts +0 -23
@@ -1,3 +1,2 @@
1
- import { DashboardAuthoringValidationResult, DashboardChangePlan, DashboardPlan } from './contracts.js';
1
+ import { DashboardAuthoringValidationResult, DashboardPlan } from './contracts.js';
2
2
  export declare function validateDashboardPlan(plan: DashboardPlan): DashboardAuthoringValidationResult;
3
- export declare function validateDashboardChangePlan(plan: DashboardChangePlan): DashboardAuthoringValidationResult;
@@ -2,6 +2,8 @@ export { CSV_ENCODINGS, DEFAULT_CSV_ENCODING, CSV_DELIMITERS, CSV_RECORD_SEPARAT
2
2
  export type { CsvEncoding, CsvDelimiter, CsvCell } from './csv-utils.js';
3
3
  export { EXPORT_FILE_FORMATS, XLSX_CONTENT_TYPE, parseExportFileFormat, exportFileTraits, exportFileFormatFromStored, exportFileFormatFromContentType, exportFileName, } from './export-file-format.js';
4
4
  export type { ExportFileFormat, ExportFileTraits } from './export-file-format.js';
5
+ export { EMAIL_IMAGE_DASHBOARD_WIDTH, IMAGE_CAPTURE_LIMITS, RENDERED_FILE_KINDS, cardImageSize, parseImageCaptureRequest, writeImageCaptureRequest, planImageViewport, renderedFileTraits, renderedFileName, sheetImageEntryName, } from './rendered-file.js';
6
+ export type { ImageCaptureRequest, ImageViewport, ImageViewportPlan, RenderedFileKind, RenderedFileTraits, } from './rendered-file.js';
5
7
  export { resolveXlsxColumn, exportCellText } from './export-cells.js';
6
8
  export type { ExportDataType, XlsxColumnInput, XlsxColumnPresentation, XlsxColumn, ExportCell, ExportWallClock, } from './export-cells.js';
7
9
  export { XlsxLimitError, isXlsxLimitError, XLSX_LIMIT_FAILURE_REASONS, xlsxLimitFailureReason, assertXlsxColumnCount, defineXlsxSheet, serializeXlsxSheet, parseXlsxSheet, withXlsxSheetColumns, serializeXlsxColumns, parseXlsxColumns, xlsxColumnsFingerprint, encodeXlsxFile, encodeXlsxRows, streamXlsxFile, } from './xlsx-file.js';
@@ -0,0 +1,106 @@
1
+ /**
2
+ * The rendered file contract: what a file the renderer draws from the print
3
+ * view (a PDF or a PNG image, or a zip of sheet images) is called and typed
4
+ * as, and how big an image is. The browser, the app and the renderer (through
5
+ * its generated bundle) all read and write the image size through this module,
6
+ * so its limits and URL parameter names have one owner. See the PNG exports
7
+ * plan (semaphor-app docs/implementation-plans/png-exports, SPEC §2.1 to §2.3).
8
+ * IMPORTANT: No React or browser-specific imports allowed
9
+ */
10
+ /** How big the image is. Every number is CSS pixels. */
11
+ export type ImageCaptureRequest =
12
+ /** A downloaded card: its size on the viewer's screen, measured at the click. */
13
+ {
14
+ fit: 'card';
15
+ cssWidth: number;
16
+ cssHeight: number;
17
+ }
18
+ /** An emailed card: the print page sizes it from its saved layout on a dashboard this wide (PN-D13). */
19
+ | {
20
+ fit: 'layout';
21
+ dashboardWidth: number;
22
+ }
23
+ /** A dashboard sheet: the width is the viewer's (or the reference width); the renderer measures the height. */
24
+ | {
25
+ fit: 'sheet';
26
+ cssWidth: number;
27
+ };
28
+ /** The dashboard width an emailed card or sheet is drawn at (PN-D13). */
29
+ export declare const EMAIL_IMAGE_DASHBOARD_WIDTH = 1280;
30
+ export declare const IMAGE_CAPTURE_LIMITS: {
31
+ readonly minCssWidth: 320;
32
+ readonly minCssHeight: 120;
33
+ readonly maxCardCssWidth: 4096;
34
+ readonly maxCardCssHeight: 4096;
35
+ readonly maxSheetCssWidth: 4096;
36
+ /** Chromium's largest capture in device pixels, either side. */
37
+ readonly maxDevicePixels: 16384;
38
+ };
39
+ type ParamSource = URLSearchParams | Readonly<Record<string, string | undefined>>;
40
+ /** A card image's size, rounded and clamped to the card limits: the clamp the browser, the page and the renderer share. */
41
+ export declare function cardImageSize(input: {
42
+ cssWidth: number;
43
+ cssHeight: number;
44
+ }): {
45
+ cssWidth: number;
46
+ cssHeight: number;
47
+ };
48
+ /**
49
+ * Reads a request from URL parameters (`imageFit`, `imageWidth`, `imageHeight`;
50
+ * `imageWidth` is the dashboard width for `layout`)
51
+ * and clamps it. Null when a parameter is missing, not an integer, or does
52
+ * not match the fit. The browser, the app and the renderer read and write
53
+ * these parameters through this module only.
54
+ */
55
+ export declare function parseImageCaptureRequest(params: ParamSource): ImageCaptureRequest | null;
56
+ export declare function writeImageCaptureRequest(request: ImageCaptureRequest, params: URLSearchParams): void;
57
+ export type ImageViewport = {
58
+ width: number;
59
+ height: number;
60
+ deviceScaleFactor: 1 | 2;
61
+ };
62
+ export type ImageViewportPlan = {
63
+ status: 'ready';
64
+ viewport: ImageViewport;
65
+ }
66
+ /** Even at scale 1 a side is over `maxDevicePixels`. */
67
+ | {
68
+ status: 'too_large';
69
+ cssWidth: number;
70
+ cssHeight: number;
71
+ };
72
+ /**
73
+ * The renderer's viewport. For `card`, the request's own size. For `layout`,
74
+ * the dashboard width by 1,024; the page sizes the card and the renderer
75
+ * captures the card's element. For `sheet`, `measuredCssHeight` is the
76
+ * sheet's full height after every card loaded; required for a sheet (throws
77
+ * without it), ignored otherwise.
78
+ */
79
+ export declare function planImageViewport(request: ImageCaptureRequest, measuredCssHeight?: number): ImageViewportPlan;
80
+ /** The kind of file a render produces. CSV keeps its own traits (`exportFileTraits`). */
81
+ export type RenderedFileKind = 'pdf' | 'png' | 'zip';
82
+ export type RenderedFileTraits = {
83
+ kind: RenderedFileKind;
84
+ extension: 'pdf' | 'png' | 'zip';
85
+ contentType: 'application/pdf' | 'image/png' | 'application/zip';
86
+ /** The customer's name for the format in dialogs and attachment lists. */
87
+ label: 'PDF' | 'PNG image' | 'PNG images (zip)';
88
+ };
89
+ export declare const RENDERED_FILE_KINDS: readonly ["pdf", "png", "zip"];
90
+ export declare function renderedFileTraits(kind: RenderedFileKind): RenderedFileTraits;
91
+ /**
92
+ * The saved file's name: `<title>-<ISO instant>.<extension>`, `Report` for an
93
+ * empty title. For kind `pdf` it equals today's inline name in
94
+ * `download-pdf.ts`. Used by the browser for every rendered file.
95
+ */
96
+ export declare function renderedFileName(input: {
97
+ kind: RenderedFileKind;
98
+ title: string | null | undefined;
99
+ at: Date;
100
+ }): string;
101
+ /** One sheet's entry in an all-sheets zip: `01 Revenue.png`; position is 1-based, at least two digits; the title sanitized for a file name. */
102
+ export declare function sheetImageEntryName(input: {
103
+ position: number;
104
+ title: string | null | undefined;
105
+ }): string;
106
+ export {};
@@ -0,0 +1,25 @@
1
+ import { Breakpoint, CustomizableBreakpoint } from '../../../lib/types/common-types.js';
2
+ /**
3
+ * The dashboard grid's breakpoints and columns: the only place these values
4
+ * exist (responsive layouts SPEC §2.1, RL-INV-1).
5
+ */
6
+ export type { CustomizableBreakpoint };
7
+ /** Breakpoints the editor can edit: Desktop, Tablet, Phone (RL-D11, RL-D14). */
8
+ export type EditableBreakpoint = 'lg' | CustomizableBreakpoint;
9
+ /** Breakpoints a grid edit can arrive at: the editable ones, and `md`, an edit of Desktop at laptop width (RL-D17). */
10
+ export type GridEditBreakpoint = EditableBreakpoint | 'md';
11
+ export declare const DASHBOARD_GRID: {
12
+ /** Widest first. */
13
+ readonly breakpoints: readonly Breakpoint[];
14
+ readonly columns: Readonly<Record<Breakpoint, number>>;
15
+ /** react-grid-layout's default breakpoint widths, now stated. */
16
+ readonly minContainerWidthPx: Readonly<Record<Breakpoint, number>>;
17
+ readonly editable: readonly EditableBreakpoint[];
18
+ readonly customizable: readonly CustomizableBreakpoint[];
19
+ /** The preview canvas widths: Laptop, Tablet, Phone, Small phone (Desktop is at least `minContainerWidthPx.lg`; RL-D19). */
20
+ readonly previewWidthPx: Readonly<Record<Exclude<Breakpoint, "lg">, number>>;
21
+ };
22
+ export declare const LG_COLUMNS: number;
23
+ export declare function isCustomizableBreakpoint(value: unknown): value is CustomizableBreakpoint;
24
+ export declare function isEditableBreakpoint(value: unknown): value is EditableBreakpoint;
25
+ export declare function isGridEditBreakpoint(value: unknown): value is GridEditBreakpoint;
@@ -0,0 +1,4 @@
1
+ export { DASHBOARD_GRID } from './grid.js';
2
+ export type { CustomizableBreakpoint, EditableBreakpoint, GridEditBreakpoint } from './grid.js';
3
+ export type { FramePlacement, FramePosition, FrameWidth, LayoutItem, LayoutKind, SheetLayoutChange, SheetLayoutFailure, SheetLayoutInput, SheetLayoutResult, SheetLayoutRow, SheetLayouts, SheetLayoutTile, SheetLayoutView, } from './types.js';
4
+ export { applySheetLayoutChange, assertSheetLayouts, readSheetLayout } from './sheet-layout.js';
@@ -0,0 +1,7 @@
1
+ import { SheetLayoutChange, SheetLayoutInput, SheetLayoutResult, SheetLayouts, SheetLayoutView } from './types.js';
2
+ /** Every layout read (SPEC §3.2): complete, valid layouts; customized breakpoints, stored or inferred; `lg` as rows. Never fails. */
3
+ export declare function readSheetLayout(sheet: SheetLayoutInput): SheetLayoutView;
4
+ /** Every layout write (SPEC §3.1). `sheet` is the sheet before the change. */
5
+ export declare function applySheetLayoutChange(sheet: SheetLayoutInput, change: SheetLayoutChange): SheetLayoutResult;
6
+ /** Throws when layouts break invariants 1 to 4 (complete, in bounds, no overlaps, packed). For tests and development builds. */
7
+ export declare function assertSheetLayouts(layouts: SheetLayouts, frameIds: readonly string[]): void;
@@ -0,0 +1,125 @@
1
+ import { Breakpoint, TFrame, TSheet } from '../../../lib/types/common-types.js';
2
+ import { CustomizableBreakpoint, GridEditBreakpoint } from './grid.js';
3
+ /** One frame's tile on one breakpoint. The keys the dirty check persists (`PERSISTED_LAYOUT_KEYS`). */
4
+ export type LayoutItem = {
5
+ /** The frame id. */
6
+ i: string;
7
+ x: number;
8
+ y: number;
9
+ w: number;
10
+ h: number;
11
+ minW?: number;
12
+ minH?: number;
13
+ maxW?: number;
14
+ maxH?: number;
15
+ static?: boolean;
16
+ isResizable?: boolean;
17
+ isDraggable?: boolean;
18
+ };
19
+ /** Complete layouts: every breakpoint present. What the engine returns. */
20
+ export type SheetLayouts = Record<Breakpoint, LayoutItem[]>;
21
+ /** What the engine reads from a sheet. */
22
+ export type SheetLayoutInput = Pick<TSheet, 'id' | 'frames' | 'layouts' | 'layout' | 'customizedBreakpoints'>;
23
+ /** How a frame is sized and grouped (SPEC §2.4). */
24
+ export type LayoutKind = 'kpi' | 'chart' | 'table' | 'text';
25
+ /** A width by intent, as a share of the 48 `lg` columns: full 48, half 24, third 16, quarter 12. */
26
+ export type FrameWidth = 'full' | 'half' | 'third' | 'quarter';
27
+ /** Where a new frame goes on `lg`. Ids are frame ids. */
28
+ export type FramePosition = 'top' | 'end' | {
29
+ after: string;
30
+ } | {
31
+ beside: string;
32
+ };
33
+ /** How a caller states a new frame's place. Absent: placed by kind (SPEC §4.2). */
34
+ export type FramePlacement = {
35
+ position?: FramePosition;
36
+ width?: FrameWidth;
37
+ };
38
+ export type SheetLayoutChange =
39
+ /** A new frame, not in `sheet.frames` yet. Without `placement`: by kind. */
40
+ {
41
+ kind: 'frame_added';
42
+ frame: TFrame;
43
+ placement?: FramePlacement;
44
+ }
45
+ /** A frame in `sheet.frames` that leaves the sheet. */
46
+ | {
47
+ kind: 'frame_removed';
48
+ frameId: string;
49
+ }
50
+ /** A frame's content changed: the frame after the change, same id, in `sheet.frames`. */
51
+ | {
52
+ kind: 'frame_updated';
53
+ frame: TFrame;
54
+ resizeForNewKind: boolean;
55
+ }
56
+ /** The grid's items after a drag or resize stop at the breakpoint being edited. */
57
+ | {
58
+ kind: 'grid_edited';
59
+ breakpoint: GridEditBreakpoint;
60
+ items: readonly LayoutItem[];
61
+ }
62
+ /** "Back to automatic" for one customized breakpoint. */
63
+ | {
64
+ kind: 'reset_to_automatic';
65
+ breakpoint: CustomizableBreakpoint;
66
+ }
67
+ /** Arrange the sheet. */
68
+ | {
69
+ kind: 'arrange';
70
+ keepOrder?: boolean;
71
+ };
72
+ export type SheetLayoutFailure = {
73
+ code: 'frame_not_on_sheet';
74
+ frameId: string;
75
+ message: string;
76
+ } | {
77
+ code: 'frame_already_on_sheet';
78
+ frameId: string;
79
+ message: string;
80
+ } | {
81
+ code: 'position_target_not_found';
82
+ frameId: string;
83
+ message: string;
84
+ } | {
85
+ code: 'breakpoint_not_editable';
86
+ breakpoint: string;
87
+ message: string;
88
+ };
89
+ export type SheetLayoutResult = {
90
+ ok: true;
91
+ /** The sheet's frames in their new order; the input array itself when untouched. */
92
+ frames: TFrame[];
93
+ layouts: SheetLayouts;
94
+ customizedBreakpoints: CustomizableBreakpoint[];
95
+ /** False when `frames`, `layouts` and `customizedBreakpoints` equal what `readSheetLayout(sheet)` gives. */
96
+ changed: boolean;
97
+ /**
98
+ * False when `layouts` and `customizedBreakpoints` equal the view's. Callers write them only when
99
+ * true, so a change with no layout effect (a frame update keeping its kind) leaves stored layouts
100
+ * untouched: a no-op editor Done stays clean (V-50).
101
+ */
102
+ layoutsChanged: boolean;
103
+ } | {
104
+ ok: false;
105
+ failure: SheetLayoutFailure;
106
+ };
107
+ /** `width`: the `FrameWidth` whose column count is nearest the item's `lg` `w`; a tie goes to the wider. */
108
+ export type SheetLayoutTile = {
109
+ frameId: string;
110
+ kind: LayoutKind;
111
+ width: FrameWidth;
112
+ };
113
+ export type SheetLayoutRow = {
114
+ tiles: SheetLayoutTile[];
115
+ };
116
+ export type SheetLayoutView = {
117
+ /** Complete and valid on every breakpoint; what the grid renders. */
118
+ layouts: SheetLayouts;
119
+ /** Stored `customizedBreakpoints`, or inferred when absent (SPEC §4.6). */
120
+ customizedBreakpoints: CustomizableBreakpoint[];
121
+ /** The `lg` layout as rows, top to bottom, tiles left to right. */
122
+ rows: SheetLayoutRow[];
123
+ /** True when `layouts` differs from what is stored. */
124
+ repaired: boolean;
125
+ };
@@ -1,2 +1 @@
1
- export * from './create-frame-layouts.js';
2
- export * from './frame-layouts.js';
1
+ export * from './engine/index.js';
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.544",
8
+ "version": "0.1.546",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -123,7 +123,7 @@
123
123
  "build": "node scripts/build.mjs",
124
124
  "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
125
125
  "lint:regressions": "node scripts/lint-regressions.mjs",
126
- "check:guards": "node scripts/card-config-consumers.mjs && node scripts/components-entry-imports.mjs && node scripts/types-entry-imports.mjs && node scripts/card-query-assembly-imports.mjs && node scripts/assistant-chat-imports.mjs",
126
+ "check:guards": "node scripts/card-config-consumers.mjs && node scripts/components-entry-imports.mjs && node scripts/types-entry-imports.mjs && node scripts/card-query-assembly-imports.mjs && node scripts/assistant-chat-imports.mjs && node scripts/filter-model-reads.mjs && node scripts/layout-engine.mjs",
127
127
  "preview": "vite preview",
128
128
  "test": "vitest run",
129
129
  "test:changed": "vitest run --changed",
@@ -1,28 +0,0 @@
1
- var u = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2
- function f(e) {
3
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
4
- }
5
- function l(e) {
6
- if (e.__esModule) return e;
7
- var r = e.default;
8
- if (typeof r == "function") {
9
- var t = function o() {
10
- return this instanceof o ? Reflect.construct(r, arguments, this.constructor) : r.apply(this, arguments);
11
- };
12
- t.prototype = r.prototype;
13
- } else t = {};
14
- return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(e).forEach(function(o) {
15
- var n = Object.getOwnPropertyDescriptor(e, o);
16
- Object.defineProperty(t, o, n.get ? n : {
17
- enumerable: !0,
18
- get: function() {
19
- return e[o];
20
- }
21
- });
22
- }), t;
23
- }
24
- export {
25
- l as a,
26
- u as c,
27
- f as g
28
- };