react-semaphor 0.1.568 → 0.1.570

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 (191) hide show
  1. package/README.md +0 -7
  2. package/dist/analytics-protocol/index.js +434 -454
  3. package/dist/appearance/index.js +6 -3
  4. package/dist/appearance-runtime/index.js +1 -1
  5. package/dist/assistant-context/index.js +1 -1
  6. package/dist/brand-studio/index.js +572 -436
  7. package/dist/briefings/index.js +4 -4
  8. package/dist/chunks/appearance-context-BwBp25ZG.js +162 -0
  9. package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +80 -0
  10. package/dist/chunks/assistant-chat-B-Ddyy8b.js +5940 -0
  11. package/dist/chunks/{bookmark-impact-CJ-65omV.js → bookmark-impact-DCYD-6Fr.js} +2 -2
  12. package/dist/chunks/{bookmark-state-Du3s13_V.js → bookmark-state-CflS88gq.js} +251 -250
  13. package/dist/chunks/brand-B4BdpAB_.js +54 -0
  14. package/dist/chunks/{card-filter-builder-BBuB99GZ.js → card-filter-builder-0VvKmRst.js} +992 -991
  15. package/dist/chunks/{comparison-window-caption-CMLb3mut.js → comparison-window-caption-PtcDWvkN.js} +252 -253
  16. package/dist/chunks/{dashboard-YnWZC4dK.js → dashboard-DxGIr1vZ.js} +1 -1
  17. package/dist/chunks/{dashboard-briefing-launcher-BF89TU2h.js → dashboard-briefing-launcher-B-quOOOQ.js} +253 -253
  18. package/dist/chunks/{dashboard-controls-atHc1EjP.js → dashboard-controls-Caodx80b.js} +288 -285
  19. package/dist/chunks/dashboard-json-Ct-AGDHF.js +66 -0
  20. package/dist/chunks/{dates-CKO05ino.js → dates-B9mL8BHE.js} +16 -15
  21. package/dist/chunks/edit-Bpdh_P_a.js +226 -0
  22. package/dist/chunks/{edit-dashboard-visual-DdmTfn-J.js → edit-dashboard-visual-DeDTuYB5.js} +2257 -2270
  23. package/dist/chunks/{filter-reach-copy-jZGzK_IH.js → filter-reach-copy-BSY33ro5.js} +1440 -1301
  24. package/dist/chunks/filter-value-text-DvvSNlho.js +146 -0
  25. package/dist/chunks/index-BVKzKl5d.js +90 -0
  26. package/dist/chunks/{index-RNaTnE3m.js → index-CV_Kzou0.js} +233 -223
  27. package/dist/chunks/{index-CPNZW0mu.js → index-y3HUzRNk.js} +76 -77
  28. package/dist/chunks/{layout-grid-0hIlqEtk.js → layout-grid-8rR-LPTk.js} +1 -1
  29. package/dist/chunks/{list-filter-DkgoCeBm.js → list-filter-C1-uTgjR.js} +1 -1
  30. package/dist/chunks/matrix-analytical-definition-dkS8szLM.js +1253 -0
  31. package/dist/chunks/matrix-member-presentation-DRa-9e6Q.js +169 -0
  32. package/dist/chunks/{matrix-operation-contract-Eb6elidS.js → matrix-operation-contract-DCVinw1o.js} +122 -122
  33. package/dist/chunks/{metric-comparison-ChXUFaZu.js → metric-comparison-n9NsIa-2.js} +175 -128
  34. package/dist/chunks/paintbrush-aR17Z3C9.js +27 -0
  35. package/dist/chunks/{palette-4vf2BEEg.js → palette-a5FCZKFI.js} +1 -1
  36. package/dist/chunks/{_commonjsHelpers-DimLPMtv.js → pickers-DkqmtnTL.js} +352 -290
  37. package/dist/chunks/pivot-result-contract-expectations-C-HnUKYe.js +55 -0
  38. package/dist/chunks/{pivot-result-identity-BlbLrqaC.js → pivot-result-identity-B89X5xjb.js} +1 -1
  39. package/dist/chunks/raw-temporal-value-DdT0s47W.js +159 -0
  40. package/dist/chunks/{report-preferences-dialog-Mbd-I0wV.js → report-preferences-dialog-Yvhv3WX2.js} +95 -97
  41. package/dist/chunks/{report-runtime-context-DnA_PiKo.js → report-runtime-context-BhPzLTbS.js} +1 -1
  42. package/dist/chunks/{resolve-dashboard-input-context-Du0fjN3h.js → resolve-dashboard-input-context-Lkbwycwe.js} +5491 -5683
  43. package/dist/chunks/resolver-DG_tfEpt.js +156 -0
  44. package/dist/chunks/{save-D6pHmSSP.js → save-D985VvYp.js} +1 -1
  45. package/dist/chunks/{saved-dashboard-context-y8N6RvjS.js → saved-dashboard-context-DC_TEd6y.js} +6 -6
  46. package/dist/chunks/schema-C9NPiIru.js +2568 -0
  47. package/dist/chunks/{semaphor-ready-indicator-BSEdUq40.js → semaphor-ready-indicator-ByFvqHEO.js} +35916 -36001
  48. package/dist/chunks/{shelf-drop-preview-context-D7QqPl36.js → shelf-drop-preview-context-CjoVaK6J.js} +64 -66
  49. package/dist/chunks/{stored-dashboard-d3xQYxBD.js → stored-dashboard-C0hekXiI.js} +332 -333
  50. package/dist/chunks/{code-editor-DJNOsgJH.js → style-sheet-parts-C7qGZuH1.js} +2402 -2040
  51. package/dist/chunks/{table-export-sheet--DUKWk6o.js → table-export-sheet-CP8zSOhj.js} +1 -1
  52. package/dist/chunks/{temporal-input-presentation--2r9BLr0.js → temporal-input-presentation-CqbJjIuu.js} +18 -18
  53. package/dist/chunks/{token-types-C8JymO8s.js → token-types-iKMplaBL.js} +1 -1
  54. package/dist/chunks/{upload-Cf3wXZT8.js → upload-CiGNKJ_0.js} +1 -1
  55. package/dist/chunks/validators-B8fpdinG.js +3651 -0
  56. package/dist/chunks/{variable-draft-DOX03R4A.js → variable-draft-9-huI1h4.js} +4 -4
  57. package/dist/dashboard/index.js +2 -2
  58. package/dist/dashboard-authoring/index.js +1888 -1826
  59. package/dist/format-utils/index.js +230 -231
  60. package/dist/index.js +349 -353
  61. package/dist/layouts/index.js +1 -1
  62. package/dist/report-runtime-context/index.js +1 -1
  63. package/dist/style.css +1 -1
  64. package/dist/surfboard/index.js +2 -2
  65. package/dist/types/appearance/index.d.ts +1 -0
  66. package/dist/types/brand-studio/brand-studio-draft.d.ts +7 -0
  67. package/dist/types/brand-studio/index.d.ts +1 -1
  68. package/dist/types/components/briefings/briefing-author/run-model.d.ts +1 -2
  69. package/dist/types/components/providers/appearance-runtime-provider.d.ts +4 -1
  70. package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +0 -2
  71. package/dist/types/components/sharing-and-management/utils/types.d.ts +0 -72
  72. package/dist/types/components/surfboard/filter/types.d.ts +5 -4
  73. package/dist/types/components/ui-custom/date-range-presets.d.ts +1 -17
  74. package/dist/types/components/visual/data-table/hooks/use-data-table-logic.d.ts +0 -1
  75. package/dist/types/components/visual/data-table/types/data-table.d.ts +0 -9
  76. package/dist/types/components/visual/data-table/utils/pagination-utils.d.ts +0 -19
  77. package/dist/types/components/visual/shared/utils/table-column-order.d.ts +0 -1
  78. package/dist/types/index.js +9 -9
  79. package/dist/types/lib/appearance/aliases.d.ts +42 -0
  80. package/dist/types/lib/appearance/compiler.d.ts +6 -0
  81. package/dist/types/lib/appearance/defaults.d.ts +6 -0
  82. package/dist/types/lib/appearance/index.d.ts +2 -0
  83. package/dist/types/lib/appearance/normalize-organization.d.ts +17 -0
  84. package/dist/types/lib/appearance/resolver.d.ts +2 -2
  85. package/dist/types/lib/appearance/types.d.ts +38 -1
  86. package/dist/types/lib/charts/types.d.ts +6 -2
  87. package/dist/types/lib/dashboard/semantic-dataset-references.d.ts +0 -1
  88. package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +0 -2
  89. package/dist/types/lib/dashboard-variables/types.d.ts +1 -6
  90. package/dist/types/lib/download-pdf.d.ts +0 -1
  91. package/dist/types/lib/hooks/use-dashboard.d.ts +3 -4
  92. package/dist/types/lib/hooks/use-date-filter.d.ts +3 -3
  93. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
  94. package/dist/types/lib/stores/dashboard-store.d.ts +15 -6
  95. package/dist/types/lib/stores/editor-store.d.ts +0 -1
  96. package/dist/types/lib/stores/table-actions.d.ts +0 -1
  97. package/dist/types/lib/table-formatting/table-formatting-css.d.ts +0 -5
  98. package/dist/types/lib/types/common-types.d.ts +3 -2
  99. package/dist/types/lib/types/explorer-types.d.ts +2 -2
  100. package/dist/types/lib/types/index.d.ts +1 -1
  101. package/dist/types/lib/types/summary-types.d.ts +0 -5
  102. package/dist/types/lib/utils/card-definition.d.ts +7 -7
  103. package/dist/types/shared/analytics-protocol/agent-time-window.d.ts +84 -0
  104. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +4 -4
  105. package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +2 -2
  106. package/dist/types/shared/analytics-protocol/contracts.d.ts +8 -17
  107. package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +10 -10
  108. package/dist/types/shared/analytics-protocol/fixtures.d.ts +3 -2
  109. package/dist/types/shared/analytics-protocol/index.d.ts +2 -4
  110. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +72 -72
  111. package/dist/types/shared/analytics-protocol/relative-date/describe.d.ts +18 -0
  112. package/dist/types/shared/analytics-protocol/relative-date/index.d.ts +7 -0
  113. package/dist/types/shared/analytics-protocol/relative-date/limits.d.ts +3 -0
  114. package/dist/types/shared/analytics-protocol/relative-date/presets.d.ts +11 -0
  115. package/dist/types/shared/analytics-protocol/relative-date/resolve.d.ts +49 -0
  116. package/dist/types/shared/analytics-protocol/relative-date/schemas.d.ts +76 -0
  117. package/dist/types/shared/analytics-protocol/relative-date/traits.d.ts +51 -0
  118. package/dist/types/shared/analytics-protocol/relative-date/window.d.ts +111 -0
  119. package/dist/types/shared/analytics-protocol/selection-contract.d.ts +1 -1
  120. package/dist/types/shared/assistant-protocol/context.d.ts +30 -30
  121. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +0 -2
  122. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +344 -1772
  123. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +4 -1
  124. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +8 -4
  125. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +9 -0
  126. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +104 -104
  127. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +20 -20
  128. package/dist/types/shared/dashboard-authoring/dashboard-style/bounds.d.ts +17 -0
  129. package/dist/types/shared/dashboard-authoring/dashboard-style/brand.d.ts +20 -0
  130. package/dist/types/shared/dashboard-authoring/dashboard-style/edit-words.d.ts +7 -0
  131. package/dist/types/shared/dashboard-authoring/dashboard-style/edit.d.ts +19 -0
  132. package/dist/types/shared/dashboard-authoring/dashboard-style/index.d.ts +15 -0
  133. package/dist/types/shared/dashboard-authoring/dashboard-style/layers.d.ts +19 -0
  134. package/dist/types/shared/dashboard-authoring/dashboard-style/legacy.d.ts +21 -0
  135. package/dist/types/shared/dashboard-authoring/dashboard-style/parse.d.ts +18 -0
  136. package/dist/types/shared/dashboard-authoring/dashboard-style/pickers.d.ts +12 -0
  137. package/dist/types/shared/dashboard-authoring/dashboard-style/types.d.ts +122 -0
  138. package/dist/types/shared/dashboard-authoring/dashboard-style/view.d.ts +10 -0
  139. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
  140. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +11 -0
  141. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +23 -0
  142. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +10 -2
  143. package/dist/types/shared/format-utils/filter-detail.d.ts +2 -8
  144. package/dist/types/shared/format-utils/filter-line.d.ts +2 -2
  145. package/dist/types/shared/format-utils/matrix-continuation.d.ts +10 -10
  146. package/dist/types/shared/temporal/index.d.ts +0 -2
  147. package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +2 -2
  148. package/package.json +7 -26
  149. package/DATA_APP_SDK.md +0 -339
  150. package/dist/chunks/appearance-context-DEYtWinQ.js +0 -126
  151. package/dist/chunks/appearance-runtime-provider-B-M8gwlZ.js +0 -81
  152. package/dist/chunks/assistant-chat-BN5I8KuN.js +0 -8849
  153. package/dist/chunks/color-CJvdlFM_.js +0 -2162
  154. package/dist/chunks/dashboard-json-Cxp3inxd.js +0 -68
  155. package/dist/chunks/filter-value-text-7zhmth1S.js +0 -163
  156. package/dist/chunks/index-CLIro-EG.js +0 -425
  157. package/dist/chunks/index-CuHybtft.js +0 -51
  158. package/dist/chunks/matrix-analytical-definition-C9xB_T84.js +0 -717
  159. package/dist/chunks/matrix-card-BSUeSXpD.js +0 -42
  160. package/dist/chunks/matrix-member-presentation-DZNgQpUq.js +0 -105
  161. package/dist/chunks/operators-B3zZoskU.js +0 -66
  162. package/dist/chunks/pivot-result-contract-expectations-Ddh1rNz5.js +0 -56
  163. package/dist/chunks/raw-temporal-value-Bqz8wc7L.js +0 -242
  164. package/dist/chunks/selection-reducer-OaJ-N5uN.js +0 -46
  165. package/dist/chunks/source-entity-resolution-DF6GulDn.js +0 -607
  166. package/dist/chunks/validators-wtjw0aw6.js +0 -3332
  167. package/dist/data-app-sdk/index.js +0 -1412
  168. package/dist/data-app-sdk-adapters/index.js +0 -361
  169. package/dist/data-app-sdk-validation/index.js +0 -1031
  170. package/dist/types/components/sharing-and-management/utils/group-types.d.ts +0 -105
  171. package/dist/types/data-app-sdk/adapters.d.ts +0 -35
  172. package/dist/types/data-app-sdk/builders.d.ts +0 -62
  173. package/dist/types/data-app-sdk/contracts.d.ts +0 -419
  174. package/dist/types/data-app-sdk/executor.d.ts +0 -5
  175. package/dist/types/data-app-sdk/field-catalog-validation.d.ts +0 -29
  176. package/dist/types/data-app-sdk/hooks.d.ts +0 -11
  177. package/dist/types/data-app-sdk/index.d.ts +0 -9
  178. package/dist/types/data-app-sdk/provider.d.ts +0 -8
  179. package/dist/types/data-app-sdk/relationship-aware-field-policy.d.ts +0 -21
  180. package/dist/types/data-app-sdk/selection.d.ts +0 -2
  181. package/dist/types/data-app-sdk/validation.d.ts +0 -58
  182. package/dist/types/data-app-sdk-adapters.d.ts +0 -2
  183. package/dist/types/data-app-sdk-validation.d.ts +0 -2
  184. package/dist/types/data-app-sdk.d.ts +0 -2
  185. package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +0 -68
  186. package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +0 -20
  187. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +0 -314
  188. package/dist/types/shared/analytics-protocol/time-window.d.ts +0 -52
  189. package/dist/types/shared/temporal/relative-date.d.ts +0 -21
  190. package/dist/types/shared/temporal/time-window-periods.d.ts +0 -21
  191. package/src/data-app-sdk/README.md +0 -402
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.568",
8
+ "version": "0.1.570",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -16,9 +16,7 @@
16
16
  "type": "module",
17
17
  "files": [
18
18
  "dist",
19
- "CHANGELOG.md",
20
- "DATA_APP_SDK.md",
21
- "src/data-app-sdk/README.md"
19
+ "CHANGELOG.md"
22
20
  ],
23
21
  "main": "dist/index.js",
24
22
  "module": "dist/index.js",
@@ -64,18 +62,6 @@
64
62
  "types": "./dist/types/assistant-context.d.ts",
65
63
  "import": "./dist/assistant-context/index.js"
66
64
  },
67
- "./data-app-sdk": {
68
- "types": "./dist/types/data-app-sdk.d.ts",
69
- "import": "./dist/data-app-sdk/index.js"
70
- },
71
- "./data-app-sdk/adapters": {
72
- "types": "./dist/types/data-app-sdk-adapters.d.ts",
73
- "import": "./dist/data-app-sdk-adapters/index.js"
74
- },
75
- "./data-app-sdk/validation": {
76
- "types": "./dist/types/data-app-sdk-validation.d.ts",
77
- "import": "./dist/data-app-sdk-validation/index.js"
78
- },
79
65
  "./appearance": {
80
66
  "types": "./dist/types/appearance.d.ts",
81
67
  "import": "./dist/appearance/index.js"
@@ -127,7 +113,7 @@
127
113
  "build": "node scripts/build.mjs",
128
114
  "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
129
115
  "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/legacy-table-type-references.mjs && node scripts/assistant-chat-imports.mjs && node scripts/filter-model-reads.mjs && node scripts/kpi-figure-reads.mjs && node scripts/layout-engine.mjs && node scripts/text-variable-refs.mjs && node scripts/data-variable-derivation.mjs && node scripts/variable-name-allocation.mjs",
116
+ "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/kpi-figure-reads.mjs && node scripts/layout-engine.mjs && node scripts/text-variable-refs.mjs && node scripts/data-variable-derivation.mjs && node scripts/variable-name-allocation.mjs && node scripts/unreached-modules.mjs && node scripts/dashboard-style-reads.mjs",
131
117
  "preview": "vite preview",
132
118
  "test": "vitest run",
133
119
  "test:changed": "vitest run --changed",
@@ -161,7 +147,7 @@
161
147
  "@dnd-kit/sortable": "^10.0.0",
162
148
  "@dnd-kit/utilities": "^3.2.2",
163
149
  "@floating-ui/react-dom": "^2.1.8",
164
- "@lexical/history": "^0.43.0",
150
+ "@lexical/clipboard": "^0.43.0",
165
151
  "@lexical/link": "^0.43.0",
166
152
  "@lexical/list": "^0.43.0",
167
153
  "@lexical/react": "^0.43.0",
@@ -177,6 +163,7 @@
177
163
  "@radix-ui/react-context-menu": "^2.2.15",
178
164
  "@radix-ui/react-dialog": "^1.1.14",
179
165
  "@radix-ui/react-dropdown-menu": "^2.1.4",
166
+ "@radix-ui/react-focus-scope": "^1.1.7",
180
167
  "@radix-ui/react-hover-card": "^1.1.4",
181
168
  "@radix-ui/react-icons": "^1.3.2",
182
169
  "@radix-ui/react-label": "^2.1.1",
@@ -192,6 +179,7 @@
192
179
  "@radix-ui/react-tabs": "^1.1.2",
193
180
  "@radix-ui/react-toggle": "^1.1.1",
194
181
  "@radix-ui/react-tooltip": "^1.1.6",
182
+ "@radix-ui/react-visually-hidden": "^1.2.3",
195
183
  "@tailwindcss/container-queries": "^0.1.1",
196
184
  "@tanstack/react-query": "^5.62.15",
197
185
  "@tanstack/react-table": "^8.11.7",
@@ -217,7 +205,7 @@
217
205
  "lodash.merge": "^4.6.2",
218
206
  "lucide-react": "^0.453.0",
219
207
  "ms": "^2.1.3",
220
- "next-themes": "^0.4.4",
208
+ "nanoid": "^3.3.11",
221
209
  "prismjs": "^1.30.0",
222
210
  "react-day-picker": "^9.9.0",
223
211
  "react-error-boundary": "^4.1.2",
@@ -225,7 +213,6 @@
225
213
  "react-icons": "^5.0.1",
226
214
  "react-markdown": "^9.0.1",
227
215
  "react-resizable-panels": "^2.1.7",
228
- "react-select": "^5.9.0",
229
216
  "react-simple-code-editor": "^0.14.1",
230
217
  "remark-gfm": "^4.0.1",
231
218
  "sonner": "^1.5.0",
@@ -253,15 +240,11 @@
253
240
  "react-is": "19.3.0"
254
241
  },
255
242
  "devDependencies": {
256
- "@microsoft/api-extractor": "^7.58.7",
257
243
  "@tanstack/react-query-devtools": "^5.62.15",
258
244
  "@testing-library/jest-dom": "^6.9.1",
259
245
  "@testing-library/react": "^16.3.0",
260
246
  "@testing-library/user-event": "^14.6.1",
261
- "@types/chart.js": "^2.9.41",
262
247
  "@types/culori": "^4.0.1",
263
- "@types/dompurify": "^3.0.5",
264
- "@types/jsoneditor": "^9.9.5",
265
248
  "@types/lodash.merge": "^4.6.9",
266
249
  "@types/ms": "^0.7.34",
267
250
  "@types/node": "^20.14.2",
@@ -277,7 +260,6 @@
277
260
  "@vitest/ui": "^4.0.8",
278
261
  "and": "^0.0.3",
279
262
  "autoprefixer": "^10.4.18",
280
- "babel-plugin-react-compiler": "^19.0.0-beta-e552027-20250112",
281
263
  "eslint": "^8.55.0",
282
264
  "eslint-plugin-react-compiler": "^19.0.0-beta-e552027-20250112",
283
265
  "eslint-plugin-react-hooks": "^4.6.0",
@@ -295,7 +277,6 @@
295
277
  "tailwindcss": "^3.4.1",
296
278
  "typescript": "~5.8.2",
297
279
  "vite": "^5.0.8",
298
- "vite-plugin-css-injected-by-js": "^3.5.1",
299
280
  "vite-plugin-dts": "^4.5.0",
300
281
  "vitest": "^4.0.8"
301
282
  }
package/DATA_APP_SDK.md DELETED
@@ -1,339 +0,0 @@
1
- # Data App SDK Quick Reference
2
-
3
- > Frozen: no new work goes into this SDK. A false start, to be retired; no
4
- > replacement SDK is planned for custom looks (they go through the dashboard
5
- > runtime).
6
-
7
- Use this as the public package quick reference for the Data App SDK. Prefer
8
- these patterns over inspecting `dist/types` or SDK implementation files.
9
-
10
- ## Imports
11
-
12
- ```tsx
13
- import {
14
- SemaphorDataAppProvider,
15
- semaphor,
16
- useClearInvalidSemaphorInputValue,
17
- useSemaphorInput,
18
- useSemaphorInputs,
19
- useSemaphorSelection,
20
- useSemaphorQuery,
21
- } from "react-semaphor/data-app-sdk";
22
-
23
- import type {
24
- SemaphorMetricQueryResult,
25
- SemaphorRecordsField,
26
- SemaphorRecordsQueryResult,
27
- SemaphorSourceRef,
28
- } from "react-semaphor/data-app-sdk";
29
- ```
30
-
31
- ## Runtime Provider
32
-
33
- ```tsx
34
- const runtimeToken = import.meta.env.VITE_SEMAPHOR_PROJECT_TOKEN;
35
-
36
- export function Root() {
37
- return (
38
- <SemaphorDataAppProvider token={runtimeToken} debug={import.meta.env.DEV}>
39
- <App />
40
- </SemaphorDataAppProvider>
41
- );
42
- }
43
- ```
44
-
45
- With `debug` on, each query asks the server for debug detail. For an
46
- organization user, the result's `executionResult.metadata.dataAppDebug` then
47
- carries the request id, duration and compiled SQL. Keep it off in production
48
- embeds.
49
-
50
- ## Source And Fields
51
-
52
- ```tsx
53
- const orders = semaphor.source.semantic({
54
- domainId: "sales",
55
- datasetName: "orders",
56
- datasetId: "sales.orders",
57
- }) satisfies SemaphorSourceRef;
58
-
59
- const revenue = semaphor.field.measure("revenue", {
60
- label: "Revenue",
61
- dataType: "number",
62
- aggregate: "SUM",
63
- source: orders,
64
- }) satisfies SemaphorRecordsField;
65
-
66
- const segment = semaphor.field.dimension("segment", {
67
- label: "Segment",
68
- dataType: "string",
69
- source: orders,
70
- }) satisfies SemaphorRecordsField;
71
-
72
- const orderDate = semaphor.field.date("order_date", {
73
- label: "Order Date",
74
- dataType: "date",
75
- source: orders,
76
- });
77
- ```
78
-
79
- ## Metric
80
-
81
- ```tsx
82
- const revenueKpi = semaphor.metric({
83
- id: "revenue-kpi",
84
- source: orders,
85
- measures: [revenue],
86
- primaryMeasure: revenue,
87
- dateField: orderDate,
88
- });
89
-
90
- const result = useSemaphorQuery(revenueKpi);
91
- ```
92
-
93
- ## Records
94
-
95
- ```tsx
96
- const revenueBySegment = semaphor.records({
97
- id: "revenue-by-segment",
98
- source: orders,
99
- fields: [segment, revenue],
100
- dateField: orderDate,
101
- orderBy: { field: revenue, direction: "desc" },
102
- limit: 10,
103
- });
104
-
105
- const result = useSemaphorQuery(revenueBySegment);
106
- ```
107
-
108
- ## Click Selection
109
-
110
- Create one selection input per source chart. Keep it separate from scalar filter
111
- and control inputs, pass its handle through the `selections` query option, and
112
- render its removable chips in the app.
113
-
114
- ```tsx
115
- const segmentSelection = semaphor.selection({
116
- id: "segment-chart-selection",
117
- label: "Segment chart selection",
118
- fields: [segment],
119
- });
120
-
121
- function SegmentDashboard() {
122
- const selection = useSemaphorSelection(segmentSelection);
123
- const chartResult = useSemaphorQuery(revenueBySegment);
124
- const detailResult = useSemaphorQuery(revenueBySegment, {
125
- selections: [selection],
126
- });
127
-
128
- const enterprise = {
129
- conditions: [
130
- { field: segment, operator: "=" as const, value: "Enterprise" },
131
- ],
132
- };
133
-
134
- return (
135
- <>
136
- <SegmentChart result={chartResult} selection={selection} />
137
- <button onClick={() => selection.select(enterprise, { kind: "toggle" })}>
138
- Enterprise
139
- </button>
140
- {selection.tuples.map((tuple) => (
141
- <button
142
- key={JSON.stringify(tuple)}
143
- onClick={() => selection.select(tuple, { kind: "toggle" })}
144
- >
145
- {tuple.conditions.map((condition) => String(condition.value)).join(" · ")} ×
146
- </button>
147
- ))}
148
- <RecordsTable result={detailResult} />
149
- </>
150
- );
151
- }
152
- ```
153
-
154
- The source chart query deliberately omits its own selection handle, so selected
155
- marks stay visible. Pass the handle to every query that should respond.
156
-
157
- A tuple combines its conditions with AND. Multiple tuples combine with OR, so
158
- `(region = West AND segment = Enterprise) OR (region = East AND segment = SMB)`
159
- stays grouped. The shared reducer caps a selection at 100 distinct tuples and
160
- returns `limitReached`; show that outcome beside the chips. Selection handles
161
- have no `toAnalyticsInput()` method and never belong in `inputs`.
162
-
163
- ## Row Access
164
-
165
- Read row values with `columns[].key`; display `columns[].label`.
166
-
167
- ```tsx
168
- function RecordsTable({ result }: { result: SemaphorRecordsQueryResult }) {
169
- const records = result.records ?? [];
170
- const columns = result.columns ?? [];
171
-
172
- return (
173
- <table>
174
- <thead>
175
- <tr>
176
- {columns.map((column) => (
177
- <th key={column.key}>{column.label || column.name}</th>
178
- ))}
179
- </tr>
180
- </thead>
181
- <tbody>
182
- {records.map((row, rowIndex) => (
183
- <tr key={rowIndex}>
184
- {columns.map((column) => (
185
- <td key={column.key}>{String(row[column.key] ?? "")}</td>
186
- ))}
187
- </tr>
188
- ))}
189
- </tbody>
190
- </table>
191
- );
192
- }
193
- ```
194
-
195
- ## Input Options
196
-
197
- ```tsx
198
- const segmentFilter = semaphor.filter({
199
- id: "segment",
200
- label: "Segment",
201
- field: segment,
202
- operator: "in",
203
- });
204
-
205
- const segmentOptions = semaphor.inputOptions({
206
- id: "segment-options",
207
- inputId: "segment",
208
- source: orders,
209
- labelField: segment,
210
- valueField: segment,
211
- limit: 100,
212
- });
213
-
214
- function SegmentFilter() {
215
- const segmentHandle = useSemaphorInput(segmentFilter);
216
- const optionsResult = useSemaphorQuery(segmentOptions);
217
-
218
- useClearInvalidSemaphorInputValue(segmentHandle, optionsResult);
219
-
220
- const selectedValue = Array.isArray(segmentHandle.value)
221
- ? String(segmentHandle.value[0] ?? "")
222
- : "";
223
-
224
- return (
225
- <select
226
- value={selectedValue}
227
- onChange={(event) => {
228
- const nextValue = event.target.value || null;
229
- segmentHandle.setValue(nextValue ? [nextValue] : undefined);
230
- }}
231
- >
232
- <option value="">All segments</option>
233
- {(optionsResult.options ?? []).map((option) => (
234
- <option key={String(option.value)} value={String(option.value)}>
235
- {option.label ?? String(option.value)}
236
- </option>
237
- ))}
238
- </select>
239
- );
240
- }
241
- ```
242
-
243
- Pass the full options query result to `useClearInvalidSemaphorInputValue`.
244
- Do not pass only `optionsResult.options`, because idle/loading results can also
245
- expose an empty options array.
246
- For shadcn/Base UI style selects, type the change callback as accepting
247
- `string | null` and call `handle.clear()` or `handle.setValue(undefined)` for
248
- the empty state. For multi-selects and date ranges, narrow `handle.value` with
249
- `Array.isArray(...)` before indexing or displaying it.
250
-
251
- ## Shared Inputs With Source-Specific Bindings
252
-
253
- Use `semaphor.bindInput(...)` when one visible input maps to different query
254
- fields.
255
-
256
- ```tsx
257
- const dateRange = semaphor.filter({
258
- id: "date_range",
259
- label: "Date Range",
260
- field: orderDate,
261
- operator: "between",
262
- });
263
-
264
- function Dashboard() {
265
- const dateRangeHandle = useSemaphorInput(dateRange);
266
-
267
- const ordersResult = useSemaphorQuery(ordersQuery, {
268
- inputs: [semaphor.bindInput(dateRangeHandle, { field: orderDate })],
269
- });
270
- const invoicesResult = useSemaphorQuery(invoicesQuery, {
271
- inputs: [semaphor.bindInput(dateRangeHandle, { field: invoiceDate })],
272
- });
273
-
274
- const range = Array.isArray(dateRangeHandle.value)
275
- ? dateRangeHandle.value
276
- : [];
277
- }
278
- ```
279
-
280
- ## Related Dimension Filters
281
-
282
- Use a human-readable related dimension as the visible filter and preserve the
283
- relationship hint for each fact query.
284
-
285
- ```tsx
286
- const material = semaphor.source.semantic({
287
- domainId: "ops",
288
- datasetName: "dim_material",
289
- });
290
-
291
- const materialFamily = semaphor.field.dimension("material_family", {
292
- label: "Material Family",
293
- dataType: "string",
294
- source: material,
295
- });
296
-
297
- const materialFamilyFilter = semaphor.filter<string[]>({
298
- id: "material_family",
299
- label: "Material Family",
300
- field: materialFamily,
301
- operator: "in",
302
- multi: true,
303
- });
304
-
305
- const materialOptions = semaphor.inputOptions({
306
- id: "material-family-options",
307
- inputId: "material_family",
308
- source: material,
309
- labelField: materialFamily,
310
- valueField: materialFamily,
311
- limit: 100,
312
- });
313
-
314
- function OpsViews() {
315
- const materialHandle = useSemaphorInput(materialFamilyFilter);
316
- useSemaphorQuery(materialOptions);
317
-
318
- const purchase = useSemaphorQuery(purchaseQuery, {
319
- inputs: [
320
- semaphor.bindInput(materialHandle, {
321
- field: materialFamily,
322
- relationshipHint: { relationshipIds: ["purchase_material"] },
323
- }),
324
- ],
325
- });
326
-
327
- const sales = useSemaphorQuery(salesQuery, {
328
- inputs: [
329
- semaphor.bindInput(materialHandle, {
330
- field: materialFamily,
331
- relationshipHint: { relationshipIds: ["sales_material"] },
332
- }),
333
- ],
334
- });
335
- }
336
- ```
337
-
338
- The query result should remain governed by Semaphor. Do not fetch broad rows and
339
- filter or join them in React to simulate related-dimension behavior.
@@ -1,126 +0,0 @@
1
- import { createContext as g, useContext as C } from "react";
2
- import { c as E } from "./color-CJvdlFM_.js";
3
- import { S as v, a as _, r as k } from "./index-CLIro-EG.js";
4
- const P = {
5
- background: "--semaphor-background",
6
- foreground: "--semaphor-foreground",
7
- muted: "--semaphor-muted",
8
- mutedForeground: "--semaphor-muted-foreground",
9
- border: "--semaphor-border",
10
- input: "--semaphor-input",
11
- primary: "--semaphor-primary",
12
- primaryForeground: "--semaphor-primary-foreground",
13
- accent: "--semaphor-accent",
14
- accentForeground: "--semaphor-accent-foreground",
15
- selection: "--semaphor-selection",
16
- card: "--semaphor-card",
17
- cardForeground: "--semaphor-card-foreground",
18
- positive: "--semaphor-positive",
19
- negative: "--semaphor-negative",
20
- warning: "--semaphor-warning",
21
- info: "--semaphor-info",
22
- destructive: "--semaphor-destructive",
23
- destructiveForeground: "--semaphor-destructive-foreground"
24
- }, R = {
25
- light: {
26
- "--semaphor-code-string": "158 64% 22%",
27
- "--semaphor-code-number": "158 64% 22%",
28
- "--semaphor-code-boolean": "158 64% 22%",
29
- "--semaphor-code-fn": "217 91% 40%",
30
- "--semaphor-code-keyword": "263 70% 42%"
31
- },
32
- dark: {
33
- "--semaphor-code-string": "158 64% 52%",
34
- "--semaphor-code-number": "158 64% 52%",
35
- "--semaphor-code-boolean": "158 64% 52%",
36
- "--semaphor-code-fn": "213 94% 68%",
37
- "--semaphor-code-keyword": "264 89% 74%"
38
- }
39
- };
40
- function T(o) {
41
- var a, c, s, d, f, h, u, i;
42
- const e = o.defaults ?? v, n = o.mode ?? O(o.spec.mode, o.systemMode), r = o.spec.schemes[n] ?? e.schemes[n], m = ((a = r.tokens) == null ? void 0 : a.color) ?? {}, t = {
43
- ...R[n]
44
- };
45
- for (const [p, A] of Object.entries(P)) {
46
- const l = m[p];
47
- if (!l) continue;
48
- const F = E(l);
49
- if (!F)
50
- throw new Error(`Invalid compiled appearance color for ${p}`);
51
- t[A] = F;
52
- }
53
- return z(t, (c = r.tokens) == null ? void 0 : c.radius), x(t, (s = r.tokens) == null ? void 0 : s.typography), {
54
- mode: n,
55
- scheme: r,
56
- cssVariables: t,
57
- colorValues: m,
58
- chartPalette: ((f = (d = r.components) == null ? void 0 : d.chart) == null ? void 0 : f.palette) ?? ((u = (h = e.schemes[n].components) == null ? void 0 : h.chart) == null ? void 0 : u.palette) ?? _,
59
- table: (i = r.components) == null ? void 0 : i.table
60
- };
61
- }
62
- function x(o, e) {
63
- e != null && e.fontFamily && (o["--semaphor-font-family"] = e.fontFamily), e != null && e.headingFontFamily && (o["--semaphor-heading-font-family"] = e.headingFontFamily), e != null && e.monoFontFamily && (o["--semaphor-mono-font-family"] = e.monoFontFamily), (e == null ? void 0 : e.baseFontSize) !== void 0 && (o["--semaphor-font-size"] = `${e.baseFontSize}px`);
64
- }
65
- function z(o, e) {
66
- o["--semaphor-brand"] = o["--semaphor-primary"] ?? o["--semaphor-foreground"], o["--semaphor-secondary"] = o["--semaphor-accent"] ?? o["--semaphor-muted"], o["--semaphor-secondary-foreground"] = o["--semaphor-accent-foreground"] ?? o["--semaphor-foreground"], o["--semaphor-popover"] = o["--semaphor-card"] ?? o["--semaphor-background"], o["--semaphor-popover-foreground"] = o["--semaphor-card-foreground"] ?? o["--semaphor-foreground"], o["--semaphor-ring"] = o["--semaphor-primary"] ?? o["--semaphor-foreground"];
67
- const n = S((e == null ? void 0 : e.control) ?? 5), r = S((e == null ? void 0 : e.card) ?? (e == null ? void 0 : e.control) ?? 5);
68
- o["--semaphor-radius"] = n, o["--semaphor-control-radius"] = n, o["--semaphor-card-radius"] = r;
69
- }
70
- function S(o) {
71
- return `${Number((o / 16).toFixed(4))}rem`;
72
- }
73
- function O(o, e = "light") {
74
- return o === "system" ? e : o;
75
- }
76
- const w = T({
77
- spec: k(),
78
- mode: "light"
79
- }), M = g(
80
- D(
81
- "semaphor-default-appearance",
82
- w
83
- )
84
- );
85
- function $() {
86
- return C(M);
87
- }
88
- function D(o, e) {
89
- return {
90
- instanceId: o,
91
- compiledAppearance: e,
92
- scopeProps: H(o, e),
93
- portalSnapshot: {
94
- instanceId: o,
95
- compiledAppearance: e
96
- }
97
- };
98
- }
99
- function H(o, e) {
100
- return {
101
- className: e.mode,
102
- style: L(e),
103
- "data-semaphor-theme": e.mode,
104
- "data-semaphor-appearance-instance": o
105
- };
106
- }
107
- function L(o) {
108
- var t, a;
109
- const e = {
110
- colorScheme: o.mode
111
- };
112
- o.cssVariables["--semaphor-font-family"] && (e.fontFamily = "var(--semaphor-font-family)");
113
- const r = (t = o.scheme.tokens) == null ? void 0 : t.typography, m = (a = v.schemes[o.mode].tokens) == null ? void 0 : a.typography;
114
- (r == null ? void 0 : r.baseFontSize) !== void 0 && r.baseFontSize !== (m == null ? void 0 : m.baseFontSize) && (e.fontSize = r.baseFontSize);
115
- for (const [c, s] of Object.entries(
116
- o.cssVariables
117
- ))
118
- e[c] = s;
119
- return e;
120
- }
121
- export {
122
- M as A,
123
- D as a,
124
- T as c,
125
- $ as u
126
- };
@@ -1,81 +0,0 @@
1
- import { jsx as f } from "react/jsx-runtime";
2
- import { createContext as w, useId as y, useMemo as m, useContext as M, useState as v, useEffect as A } from "react";
3
- import { c as T, a as x, A as I } from "./appearance-context-DEYtWinQ.js";
4
- import { r as g } from "./index-CLIro-EG.js";
5
- const k = {
6
- theme: "system",
7
- setTheme: () => null
8
- }, C = w(k);
9
- function L(e, n = "system") {
10
- return S(e) ? e : n;
11
- }
12
- function S(e) {
13
- return e === "light" || e === "dark" || e === "system";
14
- }
15
- function $(e) {
16
- return /* @__PURE__ */ f(E, { ...e });
17
- }
18
- function E({
19
- appearance: e,
20
- organizationAppearance: n,
21
- tokenAppearance: a,
22
- reactAppearance: c,
23
- resolvedAppearance: t,
24
- systemMode: r,
25
- children: i
26
- }) {
27
- const o = y(), s = m(() => P(o), [o]), { theme: h } = M(C), d = z(h), u = m(
28
- () => t ?? g({
29
- organizationAppearance: n,
30
- tokenAppearance: a,
31
- reactAppearance: c ?? e
32
- }),
33
- [
34
- e,
35
- n,
36
- c,
37
- t,
38
- a
39
- ]
40
- ), p = m(
41
- () => T({
42
- spec: u,
43
- systemMode: r ?? d
44
- }),
45
- [u, d, r]
46
- ), l = m(
47
- () => x(s, p),
48
- [p, s]
49
- );
50
- return /* @__PURE__ */ f(I.Provider, { value: l, children: i });
51
- }
52
- function P(e) {
53
- return `semaphor-appearance-${e.replace(/[^a-zA-Z0-9_-]/g, "")}`;
54
- }
55
- function z(e) {
56
- const n = L(e), [a, c] = v(
57
- () => R()
58
- );
59
- return A(() => {
60
- var i, o;
61
- if (n !== "system" || typeof window > "u") return;
62
- const t = (i = window.matchMedia) == null ? void 0 : i.call(window, "(prefers-color-scheme: dark)");
63
- if (!t) return;
64
- const r = () => {
65
- c(t.matches ? "dark" : "light");
66
- };
67
- return r(), typeof t.addEventListener == "function" ? (t.addEventListener("change", r), () => t.removeEventListener("change", r)) : ((o = t.addListener) == null || o.call(t, r), () => {
68
- var s;
69
- return (s = t.removeListener) == null ? void 0 : s.call(t, r);
70
- });
71
- }, [n]), n === "system" ? a : n;
72
- }
73
- function R() {
74
- return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
75
- }
76
- export {
77
- $ as A,
78
- E as I,
79
- C as T,
80
- L as n
81
- };