react-semaphor 0.1.525 → 0.1.526

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 (54) hide show
  1. package/dist/brand-studio/index.js +37 -37
  2. package/dist/briefings/index.js +3 -3
  3. package/dist/chunks/{calculated-field-identity-Dy_WpDdo.js → calculated-field-identity-D1ofR4KJ.js} +28 -28
  4. package/dist/chunks/{card-config-utils-CAyjC5Tp.js → card-config-utils-9sv4e-Vb.js} +15 -15
  5. package/dist/chunks/{switch-CWPcwAZ4.js → code-highlight-994tgM9v.js} +6309 -8642
  6. package/dist/chunks/dashboard-CsHvEtjN.js +15 -0
  7. package/dist/chunks/{dashboard-briefing-launcher-BilVIEyw.js → dashboard-briefing-launcher-DXz1GhFZ.js} +364 -370
  8. package/dist/chunks/{dashboard-controls-DyLPcvCK.js → dashboard-controls-Df8qOSrs.js} +163 -168
  9. package/dist/chunks/dashboard-json-Xldp0qww.js +65 -0
  10. package/dist/chunks/{edit-dashboard-visual-DtmKNNdE.js → edit-dashboard-visual-COHBqyic.js} +1108 -1107
  11. package/dist/chunks/editor-action-buttons-DahlP57T.js +2071 -0
  12. package/dist/chunks/{index-ON7Gpvcv.js → index-CbjuruKe.js} +40 -40
  13. package/dist/chunks/{matrix-control-sources-B1K7x0SL.js → matrix-control-sources-2VAzGlt8.js} +29 -29
  14. package/dist/chunks/pre-block-Cq1RqhZX.js +3987 -0
  15. package/dist/chunks/report-preferences-dialog-BcH-0lR-.js +1232 -0
  16. package/dist/chunks/search-CJz-QQ0Q.js +24 -0
  17. package/dist/chunks/{selection-reducer-CvCBQbl2.js → selection-reducer-NF5C07yM.js} +25 -46
  18. package/dist/chunks/{index-DYOaHuLS.js → semaphor-ready-indicator-BLRDuLr4.js} +142229 -147767
  19. package/dist/chunks/slider-BYIH4icg.js +877 -0
  20. package/dist/chunks/switch-XaAACBrJ.js +2234 -0
  21. package/dist/dashboard/index.js +1 -1
  22. package/dist/dashboard-authoring/index.js +4 -4
  23. package/dist/data-app-builder/index.js +67 -67
  24. package/dist/data-app-sdk/index.js +33 -32
  25. package/dist/index.js +435 -243
  26. package/dist/surfboard/index.js +4 -5
  27. package/dist/types/components/dashboard/dashboard-container.d.ts +1 -1
  28. package/dist/types/components/dashboard/sheet/layout-change-guard.d.ts +1 -1
  29. package/dist/types/components/dashboard/sheet/sheet-layout.d.ts +1 -1
  30. package/dist/types/components/editor/editor-main/text-card.d.ts +1 -1
  31. package/dist/types/components/editor/editor.d.ts +1 -1
  32. package/dist/types/components/providers/semaphor-context-provider.d.ts +1 -1
  33. package/dist/types/components/providers/theme-provider-context.d.ts +1 -1
  34. package/dist/types/components/providers/theme-provider.d.ts +1 -1
  35. package/dist/types/components/shared/unsaved-changes/use-pristine-snapshot-initializer.d.ts +1 -1
  36. package/dist/types/components/surfboard/dashboard-plus.d.ts +1 -1
  37. package/dist/types/components/visual/column-display-utils.d.ts +1 -1
  38. package/dist/types/components/visual/kpi-visual/kpi-utils.d.ts +1 -1
  39. package/dist/types/components/visual/settings/color-format.d.ts +1 -1
  40. package/dist/types/components/visual/visual-utils.d.ts +1 -1
  41. package/dist/types/lib/actions/data-point-click-action.d.ts +2 -1
  42. package/dist/types/lib/dashboard/normalize-dashboard-for-dirty-check.d.ts +1 -1
  43. package/dist/types/lib/hooks/explorer/use-schemas.d.ts +1 -1
  44. package/dist/types/lib/hooks/use-dashboard.d.ts +2 -2
  45. package/dist/types/lib/interactions/get-click-context-from-chartjs.d.ts +1 -2
  46. package/dist/types/lib/stores/editor-store.d.ts +1 -2
  47. package/dist/types/lib/stores/table-actions.d.ts +2 -1
  48. package/dist/types/lib/types/token-types.d.ts +0 -12
  49. package/dist/types/lib/utils.d.ts +0 -2
  50. package/package.json +2 -1
  51. package/dist/chunks/dashboard-json-QEoU-mx4.js +0 -75
  52. package/dist/chunks/editor-action-buttons-B9VRW3Bh.js +0 -2019
  53. package/dist/chunks/report-preferences-dialog-BLaFmlE2.js +0 -723
  54. package/dist/types/lib/encrypt-utils.d.ts +0 -9
@@ -1,10 +1,9 @@
1
- import { b as a, a as o } from "../chunks/index-DYOaHuLS.js";
2
- import { C as f, E } from "../chunks/common-types-C6cAQgyh.js";
3
- import { R as t } from "../chunks/report-preferences-dialog-BLaFmlE2.js";
1
+ import { a, R as s, D as o } from "../chunks/report-preferences-dialog-BcH-0lR-.js";
2
+ import { C as f, E as D } from "../chunks/common-types-C6cAQgyh.js";
4
3
  export {
5
4
  f as CONTROL_CARD_DEFAULT_VALUE,
6
5
  a as DisplayFormatPreferencesFields,
7
- E as EMPTY_SELECTION,
8
- t as ReportPreferencesDialog,
6
+ D as EMPTY_SELECTION,
7
+ s as ReportPreferencesDialog,
9
8
  o as Surfboard
10
9
  };
@@ -1,5 +1,5 @@
1
1
  import { HTMLAttributes } from 'react';
2
- import { DashboardProps } from '../index.js';
2
+ import { DashboardProps } from '../../lib/types/common-types.js';
3
3
  type ContainerProps = DashboardProps & HTMLAttributes<HTMLDivElement> & {
4
4
  type?: 'dashboard' | 'visual';
5
5
  cardId?: string;
@@ -1,4 +1,4 @@
1
- import { TDashboard } from '../../index.js';
1
+ import { TDashboard } from '../../../lib/types/common-types.js';
2
2
  type DashboardSheet = NonNullable<TDashboard['sheets']>[number];
3
3
  type SheetLayouts = NonNullable<DashboardSheet['layouts']>;
4
4
  export declare function shouldPersistLayouts(currentLayouts: SheetLayouts | undefined, nextLayouts: SheetLayouts | undefined): boolean;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { TSheet } from '../../index.js';
2
+ import { TSheet } from '../../../lib/types/common-types.js';
3
3
  export declare function Sheet({ sheet }: {
4
4
  sheet: TSheet;
5
5
  }): React.JSX.Element;
@@ -1,4 +1,4 @@
1
- import { TCard } from '../../index.js';
1
+ import { TCard } from '../../../lib/types/common-types.js';
2
2
  import { default as React } from 'react';
3
3
  type TextCardProps = {
4
4
  isLoading: boolean;
@@ -1,4 +1,4 @@
1
- import { AuthToken, TFrame } from '../index.js';
1
+ import { AuthToken, TFrame } from '../../lib/types/common-types.js';
2
2
  type EditorProps = {
3
3
  authToken?: AuthToken;
4
4
  onSave?: (frame: TFrame) => void;
@@ -1,4 +1,4 @@
1
- import { DashboardProps } from '../index.js';
1
+ import { DashboardProps } from '../../lib/types/common-types.js';
2
2
  import { TokenProps } from '../../lib/types/token-types.js';
3
3
  type SemaphorContextType = DashboardProps & {
4
4
  tokenProps: TokenProps;
@@ -1,4 +1,4 @@
1
- import { Theme } from '../index.js';
1
+ import { Theme } from '../../lib/types/common-types.js';
2
2
  export type ThemeProviderState = {
3
3
  theme: Theme;
4
4
  setTheme: (theme: Theme) => void;
@@ -1,4 +1,4 @@
1
- import { Theme } from '../index.js';
1
+ import { Theme } from '../../lib/types/common-types.js';
2
2
  type ThemeProviderProps = {
3
3
  children: React.ReactNode;
4
4
  defaultTheme?: Theme;
@@ -1,4 +1,4 @@
1
- import { TDashboard } from '../../index.js';
1
+ import { TDashboard } from '../../../lib/types/common-types.js';
2
2
  /**
3
3
  * Initialize a pristine dashboard snapshot whenever edit mode turns on.
4
4
  * Keeps logic centralized so programmatic entry points are covered.
@@ -1,4 +1,4 @@
1
- import { DashboardProps } from '../index.js';
1
+ import { DashboardProps } from '../../lib/types/common-types.js';
2
2
  type DashboardPlusProps = {
3
3
  showControls?: boolean;
4
4
  showFooter?: boolean;
@@ -1,2 +1,2 @@
1
- import { DateOptions } from '../index.js';
1
+ import { DateOptions } from '../../lib/types/common-types.js';
2
2
  export declare function getDateOptions(locale: string, format: string): DateOptions;
@@ -1,4 +1,4 @@
1
- import { ColorRange } from '../../index.js';
1
+ import { ColorRange } from '../../../lib/types/common-types.js';
2
2
  type FormatNumber = {
3
3
  number: number;
4
4
  decimalPlaces: number;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { ColorRange } from '../../index.js';
2
+ import { ColorRange } from '../../../lib/types/common-types.js';
3
3
  type ColorFormatProps = {
4
4
  colorRanges: ColorRange[];
5
5
  setColorRanges: (ranges: ColorRange[]) => void;
@@ -1,5 +1,5 @@
1
1
  import { Chart } from 'chart.js';
2
- import { TCard } from '../index.js';
2
+ import { TCard } from '../../lib/types/common-types.js';
3
3
  import { BlurEffectProps, TChartConfiguration } from '../../lib/charts/types.js';
4
4
  import { ComparisonMetadataMap } from '../../lib/types/query-types.js';
5
5
  export declare function handleBlurEffect({ chart, elementIndex, datasetIndex, cardType, cfg, apply, }: BlurEffectProps): void;
@@ -1,4 +1,5 @@
1
- import { DashboardStore, TCard } from '../../components/index.js';
1
+ import { DashboardStore } from '../stores/dashboard-store.js';
2
+ import { TCard } from '../types/common-types.js';
2
3
  type dataPointActionProps = {
3
4
  get: () => DashboardStore;
4
5
  set: (nextStateOrUpdater: DashboardStore | Partial<DashboardStore>) => any;
@@ -1,4 +1,4 @@
1
- import { TDashboard } from '../../components/index.js';
1
+ import { TDashboard } from '../types/common-types.js';
2
2
  type DashboardSheet = NonNullable<TDashboard['sheets']>[number];
3
3
  type SheetLayouts = NonNullable<DashboardSheet['layouts']>;
4
4
  /**
@@ -2,7 +2,7 @@ import { AuthToken } from '../../types/common-types.js';
2
2
  export declare function useSchemas(token?: AuthToken): {
3
3
  isPending: boolean;
4
4
  error: Error | null;
5
- schemas: import('../../../components/index.js').DropdownItem[];
5
+ schemas: import('../../types/dropdown-types.js').DropdownItem[];
6
6
  refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<any, Error>>;
7
7
  label: string;
8
8
  };
@@ -1,6 +1,6 @@
1
1
  import { AuthToken, ControlBinding, ControlDefinition, CustomCard, DashboardLifecycleEvent, DashboardInputExecutionSnapshot, TDashboard, TEvent, TStyle } from '../types/common-types.js';
2
2
  import { PresentationExecutionSnapshot } from '../../shared/format-utils/index.js';
3
- import { TFilterValue } from '../../components/index.js';
3
+ import { TFilterValue } from '../../components/surfboard/filter/types.js';
4
4
  type UseDashboardProps = {
5
5
  id?: string;
6
6
  version?: string;
@@ -39,7 +39,7 @@ export declare function useDashboard({ customStyle, currentTheme, onSave, onEven
39
39
  dashboard: TDashboard;
40
40
  assistantProfileId?: string;
41
41
  semanticExecutionPayload: import('../types/semantic-runtime-types.js').SemanticExecutionPayload;
42
- organizationAppearance?: import('../../components/index.js').AppearanceSpec | null;
42
+ organizationAppearance?: import('../appearance/types.js').AppearanceSpec | null;
43
43
  } | null, Error>>;
44
44
  };
45
45
  export {};
@@ -1,6 +1,5 @@
1
1
  import { TCard } from '../types/index.js';
2
- import { CardConfig, Field } from '../../components/index.js';
3
- import { QueryColumnKeyMap } from '../types/explorer-types.js';
2
+ import { QueryColumnKeyMap, CardConfig, Field } from '../types/explorer-types.js';
4
3
  import { ClickedMetricValue, ClickFilterCondition } from '../types/interaction-types.js';
5
4
  import { Chart } from 'chart.js';
6
5
  import { SemaphorResultColumn } from '../../shared/analytics-protocol/index.js';
@@ -1,7 +1,6 @@
1
- import { ColorRange, TCard, TCardPreferences, TCustomCardPreferences, TFrame, TLegendOptions, AggregateCalc, SqlGen, ControlDefinition } from '../types/common-types.js';
1
+ import { ColorRange, TCard, TCardPreferences, TCustomCardPreferences, TFrame, TLegendOptions, AIScopeTable, AggregateCalc, SqlGen, ControlDefinition } from '../types/common-types.js';
2
2
  import { TFilterValue } from '../../components/surfboard/filter/types.js';
3
3
  import { TChartType } from '../charts/types.js';
4
- import { AIScopeTable } from '../../components/index.js';
5
4
  import { FilterByColumn, OldFilterValue, GroupByColumn, MetricColumn, OrderBy, QueryConfig } from '../types/query-types.js';
6
5
  import { TableActions } from './table-actions.js';
7
6
  import { CardConfig, QueryColumnKeyMap } from '../types/explorer-types.js';
@@ -1,6 +1,7 @@
1
1
  import { PersistedColumnSettingsMap } from '../../components/visual/data-table/types/data-table.js';
2
2
  import { ColumnSizingState } from '@tanstack/react-table';
3
- import { EditorStore, TCard } from '../../components/index.js';
3
+ import { EditorStore } from './editor-store.js';
4
+ import { TCard } from '../types/common-types.js';
4
5
  import { TableBaseFormatting, TableConditionalFormatting } from '../table-formatting/index.js';
5
6
  export declare const EMPTY_COLUMN_SETTINGS: PersistedColumnSettingsMap;
6
7
  export declare const EMPTY_COLUMN_VISIBILITY: Record<string, boolean>;
@@ -67,10 +67,6 @@ export type TokenSecurityPolicy = {
67
67
  * UI and behavior configuration for the embedded dashboard.
68
68
  */
69
69
  export type UIConfig = {
70
- /**
71
- * Enables self-service editing by the end user. Legacy field. Use config.allowEdit instead.
72
- */
73
- allowEdit?: boolean;
74
70
  /**
75
71
  * Enables advanced mode features in the dashboard.
76
72
  * Defaults to true unless explicitly disabled.
@@ -202,10 +198,6 @@ export type TokenRequest = {
202
198
  * Display name of the end user.
203
199
  */
204
200
  displayName?: string;
205
- /**
206
- * Enables self-service editing by the end user.
207
- */
208
- allowEdit?: boolean;
209
201
  /**
210
202
  * Schema level security policy. The schema name for the tenant.
211
203
  */
@@ -274,10 +266,6 @@ export type TokenProps = {
274
266
  * Display name of the end user.
275
267
  */
276
268
  displayName?: string;
277
- /**
278
- * Enables self-service editing by the end user.
279
- */
280
- allowEdit?: boolean;
281
269
  /**
282
270
  * Schema level security policy. The schema name for the tenant.
283
271
  */
@@ -24,9 +24,7 @@ export declare function getRequestErrorSql(error: unknown): string | undefined;
24
24
  export declare function getRequestErrorFromResponse(response: Response): Promise<RequestError>;
25
25
  export declare function requestJsonRegular(url: string, authToken: string, method?: string, data?: unknown, signal?: AbortSignal): Promise<any>;
26
26
  export declare function getRequest(url: string, authToken: string, params?: {}, signal?: AbortSignal): Promise<any>;
27
- export declare function postRequestEncrypted(url: string, authToken: string, data?: {}, method?: string): Promise<any>;
28
27
  export declare function postRequestRegular(url: string, authToken: string, data?: {}, method?: string): Promise<any>;
29
- export declare const postRequest: typeof postRequestRegular;
30
28
  export declare function getTenantAndEndUserId(accessToken: string | undefined): {
31
29
  tenantId: string;
32
30
  endUserId: string;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.525",
8
+ "version": "0.1.526",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -134,6 +134,7 @@
134
134
  "check:card-config-consumers": "node scripts/card-config-consumers.mjs",
135
135
  "preview": "vite preview",
136
136
  "test": "vitest run",
137
+ "test:changed": "vitest run --changed",
137
138
  "test:watch": "vitest",
138
139
  "test:ui": "vitest --ui",
139
140
  "test:run": "vitest run",
@@ -1,75 +0,0 @@
1
- import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
- import { useMemo as p, useState as u, useRef as f, useEffect as b } from "react";
3
- import { X as S } from "./x-CXDkqdur.js";
4
- import { u as r, c as N, B as D, C as J } from "./switch-CWPcwAZ4.js";
5
- import "./card-config-utils-CAyjC5Tp.js";
6
- import "./validators-CsdOtZI6.js";
7
- import "./matrix-operation-contract-D32U2CSw.js";
8
- import "../value-format-preferences/index.js";
9
- import "./index-DYOaHuLS.js";
10
- import "./appearance-runtime-provider-B-M8gwlZ.js";
11
- import "./appearance-context-DEYtWinQ.js";
12
- import "./index-CLIro-EG.js";
13
- import "./field-aggregations-BQjogiI1.js";
14
- import "zod";
15
- import "./matrix-continuation-C4sRcjZU.js";
16
- import "./color-CJvdlFM_.js";
17
- import "react-dom";
18
- import "./index-ON7Gpvcv.js";
19
- function F() {
20
- const a = r((o) => o.dashboard), c = r((o) => o.actions.setDashboard), m = r(
21
- (o) => o.showDashboardJSON
22
- ), h = r(
23
- (o) => o.actions.setShowDashboardJSON
24
- ), s = p(
25
- () => a ? JSON.stringify(a, null, 2) : "",
26
- [a]
27
- ), [l, i] = u(s), t = f(s);
28
- return b(() => {
29
- s !== t.current && (i(s), t.current = s);
30
- }, [s]), /* @__PURE__ */ d(
31
- "div",
32
- {
33
- className: N("relative p-2", {
34
- hidden: !m
35
- }),
36
- children: [
37
- /* @__PURE__ */ d(
38
- D,
39
- {
40
- variant: "secondary",
41
- size: "sm",
42
- className: "absolute right-2 top-2 z-10 h-8",
43
- onClick: () => h(!1),
44
- children: [
45
- /* @__PURE__ */ e(S, { className: "mr-2 h-4 w-4" }),
46
- "Close"
47
- ]
48
- }
49
- ),
50
- /* @__PURE__ */ e("div", { className: "h-[550px] overflow-hidden", children: /* @__PURE__ */ e(
51
- J,
52
- {
53
- value: l,
54
- onValueChange: (o) => {
55
- i(o);
56
- try {
57
- const n = JSON.parse(o);
58
- t.current = JSON.stringify(
59
- n,
60
- null,
61
- 2
62
- ), c(n);
63
- } catch {
64
- }
65
- },
66
- language: "json"
67
- }
68
- ) })
69
- ]
70
- }
71
- );
72
- }
73
- export {
74
- F as default
75
- };