react-semaphor 0.1.555 → 0.1.557

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 (114) hide show
  1. package/DATA_APP_SDK.md +6 -29
  2. package/dist/analytics-protocol/index.js +20 -21
  3. package/dist/assistant-context/index.js +1 -1
  4. package/dist/assistant-protocol/index.js +5 -5
  5. package/dist/brand-studio/index.js +426 -444
  6. package/dist/briefings/index.js +56 -57
  7. package/dist/chunks/{analytics-base-schemas-BKs3flFS.js → analytics-base-schemas-BUFUoO6G.js} +2 -2
  8. package/dist/chunks/{assistant-chat-8NZP6m-u.js → assistant-chat-WMTpYirZ.js} +79 -81
  9. package/dist/chunks/{bookmark-state-BAeGKd3s.js → bookmark-state-PjQpxbG7.js} +3 -3
  10. package/dist/chunks/{braces-o9UiRQes.js → braces-BOErQVyi.js} +1 -1
  11. package/dist/chunks/comparison-window-caption-Dc7BaCMz.js +1218 -0
  12. package/dist/chunks/{context-BerEBuFR.js → context-DVy4HOU0.js} +1 -1
  13. package/dist/chunks/{custom-visual-inputs-Gw-Ggg3O.js → custom-visual-inputs-CxYI-gFa.js} +31 -33
  14. package/dist/chunks/{dashboard-Ds68ckO3.js → dashboard-4D8Vy4pL.js} +1 -1
  15. package/dist/chunks/{dashboard-briefing-launcher-DlTr-VGc.js → dashboard-briefing-launcher-C4EmOfxs.js} +149 -151
  16. package/dist/chunks/{dashboard-controls-oNXJZN6x.js → dashboard-controls-DBWykmvL.js} +171 -173
  17. package/dist/chunks/{dashboard-json-CW7Q_efH.js → dashboard-json-DiX-p0F7.js} +21 -22
  18. package/dist/chunks/{document-dashboard-inputs-C21mL3ib.js → document-dashboard-inputs-DP5hquBR.js} +32 -32
  19. package/dist/chunks/{edit-dashboard-visual-BnnT_oKR.js → edit-dashboard-visual-n1jLV_7V.js} +5842 -5955
  20. package/dist/chunks/{filter-reach-copy-DlNPHbE-.js → filter-reach-copy-BB9iakLA.js} +915 -986
  21. package/dist/chunks/{filter-value-text-DMrpj4h9.js → filter-value-text-CUBpotVN.js} +5 -5
  22. package/dist/chunks/{global-date-filter-utils-7OboTgrM.js → global-date-filter-utils-Cc5tqkoW.js} +2908 -3112
  23. package/dist/chunks/{index-B2k6KtUN.js → index-CgjhzkKM.js} +72 -80
  24. package/dist/chunks/{index-CtoK1Lgu.js → index-dIV-Gdsb.js} +159 -161
  25. package/dist/chunks/{layout-grid-Bgzth8vd.js → layout-grid-CcNklCwL.js} +1 -1
  26. package/dist/chunks/{list-filter-DsaTbM3J.js → list-filter-Ds_4UTpD.js} +1 -1
  27. package/dist/chunks/{matrix-analytical-definition-DPVGg1mU.js → matrix-analytical-definition-4GTUDheD.js} +22 -22
  28. package/dist/chunks/{matrix-card-D9bsdAye.js → matrix-card-fS_4O7zA.js} +3 -3
  29. package/dist/chunks/{matrix-member-presentation-DRWcJ8Mi.js → matrix-member-presentation-Dj7HaAHC.js} +1 -1
  30. package/dist/chunks/{matrix-operation-contract--lMaLlpV.js → matrix-operation-contract-CpgLZ7E5.js} +52 -52
  31. package/dist/chunks/{metric-comparison-CYIt2F5X.js → metric-comparison-C8LY7GG5.js} +4 -4
  32. package/dist/chunks/{model-change-B0rAK-5w.js → model-change-CJEj3ZD6.js} +1 -1
  33. package/dist/chunks/{palette-D10o_yYX.js → palette-DMkIhagj.js} +1 -1
  34. package/dist/chunks/{matrix-formatter-K2OVPJQI.js → pivot-result-contract-expectations-DMk-mKhG.js} +451 -402
  35. package/dist/chunks/pivot-result-identity-CrQ54Xbj.js +77 -0
  36. package/dist/chunks/{raw-temporal-presentation-CivONfcO.js → raw-temporal-presentation-DdEpgPRB.js} +25 -26
  37. package/dist/chunks/report-preferences-dialog-CFg5VFLk.js +2109 -0
  38. package/dist/chunks/{report-runtime-context-BaIKSaja.js → report-runtime-context-CohdtiMg.js} +2 -2
  39. package/dist/chunks/{resolve-dashboard-input-context-CIm9A8_j.js → resolve-dashboard-input-context-Djl3kCFL.js} +1396 -1550
  40. package/dist/chunks/{save-CfJpQQ68.js → save-D1EpMcwT.js} +1 -1
  41. package/dist/chunks/{saved-dashboard-context-akb9JfOL.js → saved-dashboard-context-umlQFevH.js} +9 -9
  42. package/dist/chunks/selection-reducer-_d6aKJnj.js +46 -0
  43. package/dist/chunks/{semaphor-ready-indicator-Ba7dwP5_.js → semaphor-ready-indicator-4cOp6sla.js} +54479 -63899
  44. package/dist/chunks/{shelf-drop-preview-context-5rg3pJHW.js → shelf-drop-preview-context-DAtRuvR7.js} +7 -7
  45. package/dist/chunks/{source-entity-resolution-CGymm5td.js → source-entity-resolution-DXW1HpKf.js} +1 -1
  46. package/dist/chunks/{switch-B-UTI6v-.js → switch-9CJt5EF_.js} +1431 -1342
  47. package/dist/chunks/{table-export-sheet-CgO6gaSM.js → table-export-sheet-CTCTA_bd.js} +1 -1
  48. package/dist/chunks/{table-settings-DOT_Bv1m.js → table-settings-DF1gdVQR.js} +3 -3
  49. package/dist/chunks/temporal-input-presentation-DoSniQj1.js +2939 -0
  50. package/dist/chunks/{token-types-DYECHYGH.js → token-types-DFyLflLY.js} +1 -1
  51. package/dist/chunks/{upload-BFX7apKV.js → upload-LSNKpt0w.js} +1 -1
  52. package/dist/chunks/{use-create-flow-overlay-state-BHNs0wl7.js → use-create-flow-overlay-state-esyMT9vU.js} +125 -127
  53. package/dist/chunks/{validators-ClKLGDGZ.js → validators-hmfNNQz8.js} +305 -307
  54. package/dist/chunks/zoned-wall-clock-E35Frf9v.js +191 -0
  55. package/dist/dashboard/index.js +2 -2
  56. package/dist/dashboard-authoring/index.js +168 -169
  57. package/dist/data-app-sdk/index.js +789 -4154
  58. package/dist/data-app-sdk-adapters/index.js +3 -3
  59. package/dist/data-app-sdk-validation/index.js +6 -6
  60. package/dist/format-utils/index.js +234 -253
  61. package/dist/index.js +233 -235
  62. package/dist/layouts/index.js +1 -1
  63. package/dist/pdf-export-policy/index.js +9 -11
  64. package/dist/report-runtime-context/index.js +2 -2
  65. package/dist/style.css +1 -1
  66. package/dist/surfboard/index.js +2 -2
  67. package/dist/types/brand-studio/brand-studio-draft.d.ts +0 -3
  68. package/dist/types/brand-studio/index.d.ts +1 -1
  69. package/dist/types/components/visual/data-table/types/data-table.d.ts +0 -1
  70. package/dist/types/components/visual/shared/utils/table-column-order.d.ts +0 -6
  71. package/dist/types/data-app-sdk/contracts.d.ts +0 -146
  72. package/dist/types/data-app-sdk/index.d.ts +0 -2
  73. package/dist/types/index.js +27 -28
  74. package/dist/types/lib/api/exports-api.d.ts +1 -1
  75. package/dist/types/lib/charts/table-chart-types.d.ts +1 -1
  76. package/dist/types/lib/charts/types.d.ts +2 -2
  77. package/dist/types/lib/dashboard-viewer/export-table-view.d.ts +0 -3
  78. package/dist/types/lib/document/document-edits.d.ts +1 -1
  79. package/dist/types/lib/document/document-section-kinds.d.ts +2 -4
  80. package/dist/types/lib/document/document-table-data-policy.d.ts +1 -2
  81. package/dist/types/lib/formatters/grouped-temporal-activation.d.ts +3 -3
  82. package/dist/types/lib/formatters/grouped-temporal-presentation.d.ts +0 -6
  83. package/dist/types/lib/query-context/card-server-request.d.ts +0 -1
  84. package/dist/types/lib/table-formatting/table-formatting-types.d.ts +1 -1
  85. package/dist/types/lib/types/common-types.d.ts +0 -7
  86. package/dist/types/lib/types/explorer-types.d.ts +1 -14
  87. package/dist/types/lib/utils/card-config-utils.d.ts +11 -1
  88. package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +1 -2
  89. package/dist/types/shared/dashboard-authoring/filter-model/filter-definitions.d.ts +1 -7
  90. package/dist/types/shared/dashboard-authoring/legacy-table-routing.d.ts +9 -4
  91. package/dist/types/shared/format-utils/grouped-table-presentation.d.ts +0 -14
  92. package/dist/types/shared/format-utils/index.d.ts +0 -2
  93. package/dist/types/shared/format-utils/pdf-export-policy.d.ts +1 -1
  94. package/dist/types/shared/format-utils/pivot-result-contract-expectations.d.ts +2 -20
  95. package/dist/types/shared/format-utils/pivot-result-identity.d.ts +0 -20
  96. package/dist/types/shared/format-utils/table-export/prepare-table-export.d.ts +0 -1
  97. package/dist/types/shared/format-utils/table-export/table-export-result.d.ts +0 -4
  98. package/package.json +2 -4
  99. package/src/data-app-sdk/README.md +7 -31
  100. package/dist/chunks/comparison-window-caption-C2WNTlxK.js +0 -1433
  101. package/dist/chunks/pivot-header-presentation-CX4fkRuG.js +0 -42
  102. package/dist/chunks/pivot-result-identity-BHJGZwIc.js +0 -94
  103. package/dist/chunks/pivot-result-lifecycle-BygCpOhk.js +0 -1238
  104. package/dist/chunks/raw-temporal-contract-WuXA8jBP.js +0 -64
  105. package/dist/chunks/report-preferences-dialog-D_KyuEFx.js +0 -2261
  106. package/dist/chunks/selection-reducer-yw_JgICP.js +0 -111
  107. package/dist/chunks/temporal-bucket-C4rqmwaQ.js +0 -2071
  108. package/dist/chunks/x-4f5U2XwU.js +0 -100
  109. package/dist/chunks/zoned-wall-clock-MulfA26h.js +0 -129
  110. package/dist/types/components/visual/pivot-table/types.d.ts +0 -80
  111. package/dist/types/data-app-sdk/devtools/index.d.ts +0 -49
  112. package/dist/types/data-app-sdk/devtools.d.ts +0 -1
  113. package/dist/types/shared/format-utils/aggregate-table-row-presentation.d.ts +0 -85
  114. package/dist/types/shared/format-utils/pivot-result-lifecycle.d.ts +0 -55
@@ -1,15 +1 @@
1
1
  export declare const PDF_GROUP_CONTINUATION_CLASS = "pdf-group-continuation";
2
- /**
3
- * Show a label when its canonical hierarchy prefix changes. Compare only
4
- * adjacent rows and never suppress across subtotal or grand-total boundaries.
5
- * Adapters supply canonical values, not formatted labels or serialized keys.
6
- */
7
- export declare function shouldPresentGroupedTableValue<T extends {
8
- isSubtotal?: unknown;
9
- isGrandTotal?: unknown;
10
- }>(input: {
11
- row: T;
12
- previousRow?: T;
13
- levelIndex: number;
14
- getValue: (row: T, index: number) => unknown;
15
- }): boolean;
@@ -37,11 +37,9 @@ export * from './attachment-filter-line.js';
37
37
  export { describeFilterValueInFullDetail, type FullDetailFilterValue, } from './filter-value-text.js';
38
38
  export { describeConditionInFullDetail, type FilterClauseText } from './filter-detail.js';
39
39
  export { formatCanonicalComparisonRange } from '../../lib/utils/comparison-window-caption.js';
40
- export * from './aggregate-table-row-presentation.js';
41
40
  export { PDF_GROUP_CONTINUATION_CLASS } from './grouped-table-presentation.js';
42
41
  export { SEMAPHOR_GENERATED_COUNT_METRIC_ID } from '../analytics-protocol/contracts.js';
43
42
  export { resolveMetricResultAlias } from '../analytics-protocol/metric-comparison.js';
44
43
  export * from './pivot-header-presentation.js';
45
44
  export * from './pivot-result-identity.js';
46
45
  export * from './pivot-result-contract-expectations.js';
47
- export * from './pivot-result-lifecycle.js';
@@ -18,7 +18,7 @@ export declare const PDF_SAFETY_LIMIT_EXCEEDED: "PDF_SAFETY_LIMIT_EXCEEDED";
18
18
  * fast path, the print views and scheduled attachments (report attachment
19
19
  * delivery RA-D1).
20
20
  */
21
- export declare const PDF_TABLE_CARD_TYPES: readonly ["table", "detailTable", "aggregateTable", "pivotTable"];
21
+ export declare const PDF_TABLE_CARD_TYPES: readonly ["table", "detailTable"];
22
22
  export type PdfTableCardType = (typeof PDF_TABLE_CARD_TYPES)[number];
23
23
  export declare function isPdfTableCardType(cardType: unknown): cardType is PdfTableCardType;
24
24
  /** Exact UTF-8 bytes used by the structured POST body. */
@@ -1,28 +1,10 @@
1
1
  import { MetricResultAliasInput } from '../analytics-protocol/index.js';
2
- import { PivotResultExpectedRoleFieldIds } from './pivot-result-lifecycle.js';
3
- type IdentifiedField = {
2
+ type IdentifiedMetricField = {
4
3
  id?: string;
5
- };
6
- type IdentifiedMetricField = IdentifiedField & MetricResultAliasInput;
7
- export type PivotResultContractExpectations = {
8
- expectedRoleFieldIds: PivotResultExpectedRoleFieldIds;
9
- expectedMetricAliases: string[];
10
- };
4
+ } & MetricResultAliasInput;
11
5
  /**
12
6
  * Returns the stable aliases required to distinguish repeated instances of
13
7
  * one metric field. Unique metric fields remain role/field scoped.
14
8
  */
15
9
  export declare function deriveMetricInstanceAliasExpectations(metrics: readonly IdentifiedMetricField[]): string[];
16
- /**
17
- * Derives the authored identity expectations stored in a canonical pivot
18
- * lifecycle contract. Producers and cache-compatibility consumers must use
19
- * this same projection so generated Count and repeated metric instances cannot
20
- * drift across the transport seam.
21
- */
22
- export declare function derivePivotResultContractExpectations(input: {
23
- groupByFields?: readonly IdentifiedField[];
24
- metricFields?: readonly IdentifiedMetricField[];
25
- pivotByFields?: readonly IdentifiedField[];
26
- detailFields?: readonly IdentifiedField[];
27
- }): PivotResultContractExpectations;
28
10
  export {};
@@ -12,15 +12,6 @@ export interface QueryColumnKeyMap {
12
12
  byRole: QueryColumnKeyMapByRole;
13
13
  byMetricAlias?: Record<string, QueryColumnKeyMapEntry>;
14
14
  }
15
- export type PivotResultColumnClassification = {
16
- isSubtotal?: boolean;
17
- subtotalScope?: 'base' | 'pivot-value' | 'grand-total';
18
- };
19
- export declare function isPivotSubtotalPrefix(classification: PivotResultColumnClassification | undefined): boolean;
20
- export declare function isPivotEmptyTupleAllowed(input: {
21
- expectedPivotFieldIds: readonly string[];
22
- classification?: PivotResultColumnClassification;
23
- }): boolean;
24
15
  export declare class PivotResultIdentityError extends Error {
25
16
  readonly deliveryBlocking = true;
26
17
  readonly code: "missing_pivot_member_identity";
@@ -30,23 +21,12 @@ export declare function requirePivotHeaderMembers(input: {
30
21
  identity: SemaphorPivotResultColumnIdentity;
31
22
  columnKey: string;
32
23
  expectedPivotFieldIds?: readonly string[];
33
- allowPrefix?: boolean;
34
- allowEmpty?: boolean;
35
24
  }): readonly SemaphorPivotResultMember[];
36
25
  export declare function requirePivotResultColumnIdentities(columns: readonly {
37
26
  key: string;
38
27
  pivotIdentity?: SemaphorPivotResultColumnIdentity;
39
28
  }[], options: {
40
29
  expectedPivotFieldIds: readonly string[];
41
- columnClassifications?: Readonly<Record<string, PivotResultColumnClassification | undefined>>;
42
- allowPrefixForColumn?: (column: {
43
- key: string;
44
- pivotIdentity?: SemaphorPivotResultColumnIdentity;
45
- }) => boolean;
46
- allowEmptyForColumn?: (column: {
47
- key: string;
48
- pivotIdentity?: SemaphorPivotResultColumnIdentity;
49
- }) => boolean;
50
30
  }): void;
51
31
  export declare function resolveQueryColumnKeyMapEntry(columnKeyMap: QueryColumnKeyMap | undefined, fieldId: string, role: QueryColumnKeyRole): QueryColumnKeyMapEntry | undefined;
52
32
  export declare function resolveUniqueQueryColumnKeyMapEntry(columnKeyMap: QueryColumnKeyMap | undefined, fieldId: string): QueryColumnKeyMapEntry | undefined;
@@ -44,7 +44,6 @@ export type TableExportFormatter = {
44
44
  };
45
45
  export declare function prepareTableExport(input: {
46
46
  formatting: TableExportFormatting;
47
- cardType: 'table' | 'detailTable' | 'pivotTable' | 'aggregateTable';
48
47
  /** The /api/v1/query body the rows came from (a background job's `queryPayload`). Read for the effective card config, result owner, SQL and Python flags. */
49
48
  queryPayload: Record<string, unknown>;
50
49
  }): TableExportFormatter;
@@ -24,8 +24,4 @@ export type TableExportResult = {
24
24
  /** Authoritative data types (SemaphorResultColumn.dataType), from the same response. Missing columns are 'unknown'. */
25
25
  resultColumns: readonly Pick<SemaphorResultColumn, 'key' | 'dataType'>[];
26
26
  columnKeyMap?: QueryColumnKeyMap;
27
- /** Pivot column classifications (deprecated pivot results only). */
28
- columnMetadata?: unknown;
29
- /** 'not_pivot' for Table and Detail Table; the other values only for deprecated pivot results. */
30
- pivotResultKind: 'not_pivot' | 'canonical' | 'legacy_raw';
31
27
  };
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.555",
8
+ "version": "0.1.557",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -127,7 +127,7 @@
127
127
  "build": "node scripts/build.mjs",
128
128
  "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
129
129
  "lint:regressions": "node scripts/lint-regressions.mjs",
130
- "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/matrix-conversion-imports.mjs && node scripts/assistant-chat-imports.mjs && node scripts/filter-model-reads.mjs && node scripts/layout-engine.mjs",
130
+ "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/matrix-conversion-imports.mjs && node scripts/legacy-table-type-references.mjs && node scripts/assistant-chat-imports.mjs && node scripts/filter-model-reads.mjs && node scripts/layout-engine.mjs",
131
131
  "preview": "vite preview",
132
132
  "test": "vitest run",
133
133
  "test:changed": "vitest run --changed",
@@ -161,7 +161,6 @@
161
161
  "@dnd-kit/sortable": "^10.0.0",
162
162
  "@dnd-kit/utilities": "^3.2.2",
163
163
  "@floating-ui/react-dom": "^2.1.8",
164
- "@headlessui/react": "^2.2.0",
165
164
  "@lexical/history": "^0.43.0",
166
165
  "@lexical/link": "^0.43.0",
167
166
  "@lexical/list": "^0.43.0",
@@ -292,7 +291,6 @@
292
291
  "prettier-plugin-tailwindcss": "^0.6.1",
293
292
  "react": "19.3.0",
294
293
  "react-dom": "19.3.0",
295
- "react-grab": "^0.1.16",
296
294
  "rollup-plugin-visualizer": "^5.12.0",
297
295
  "simple-zustand-devtools": "^1.1.0",
298
296
  "tailwindcss": "^3.4.1",
@@ -12,7 +12,6 @@ Do not inspect SDK implementation internals to discover these patterns.
12
12
  ```tsx
13
13
  import {
14
14
  SemaphorDataAppProvider,
15
- SemaphorDevtools,
16
15
  semaphor,
17
16
  useClearInvalidSemaphorInputValue,
18
17
  useSemaphorInputs,
@@ -28,46 +27,24 @@ import type {
28
27
  } from "react-semaphor/data-app-sdk";
29
28
  ```
30
29
 
31
- ## Runtime Provider And DevTools
32
-
33
- Generated local/dev apps should mount one root DevTools instance and enable the
34
- debug bridge only outside production embeds.
30
+ ## Runtime Provider
35
31
 
36
32
  ```tsx
37
33
  const runtimeToken = import.meta.env.VITE_SEMAPHOR_PROJECT_TOKEN;
38
- const enableDevtools =
39
- import.meta.env.DEV ||
40
- (typeof window !== "undefined" && window.location.hostname === "localhost");
41
34
 
42
35
  export function Root() {
43
36
  return (
44
- <SemaphorDataAppProvider
45
- token={runtimeToken}
46
- debug={enableDevtools ? { exposeWindowBridge: true } : false}
47
- >
37
+ <SemaphorDataAppProvider token={runtimeToken} debug={import.meta.env.DEV}>
48
38
  <App />
49
- <SemaphorDevtools
50
- initialIsOpen={false}
51
- buttonPosition="bottom-right"
52
- panelPosition="right"
53
- />
54
39
  </SemaphorDataAppProvider>
55
40
  );
56
41
  }
57
42
  ```
58
43
 
59
- Add hook-level debug source hints when they are cheap and non-repetitive:
60
-
61
- ```tsx
62
- const result = useSemaphorQuery(revenueBySegment, {
63
- debug: {
64
- sourceHint: {
65
- file: "src/views/RevenueBySegment.tsx",
66
- component: "RevenueBySegment",
67
- },
68
- },
69
- });
70
- ```
44
+ With `debug` on, each query asks the server for debug detail. For an
45
+ organization user, the result's `executionResult.metadata.dataAppDebug` then
46
+ carries the request id, duration and compiled SQL. Keep it off in production
47
+ embeds.
71
48
 
72
49
  ## Query State
73
50
 
@@ -129,8 +106,7 @@ Important state fields:
129
106
 
130
107
  Validation failures produce a structured `SemaphorDataAppQueryError` in
131
108
  `result.error`, with `kind: "data_app_query_error"`, `validation`,
132
- `validationIssues`, and `executionResult` when available. DevTools traces expose
133
- the same execution status and structured issues.
109
+ `validationIssues`, and `executionResult` when available.
134
110
 
135
111
  ## Source And Fields
136
112