react-semaphor 0.1.546 → 0.1.547

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 (57) hide show
  1. package/dist/analytics-protocol/index.js +70 -67
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/briefings/index.js +1 -1
  4. package/dist/chunks/applied-constraints-DU-wndZ7.js +47 -0
  5. package/dist/chunks/{assistant-chat-BPXhulAx.js → assistant-chat-CK84cPAB.js} +106 -106
  6. package/dist/chunks/{bookmark-state-C4vetoa0.js → bookmark-state-Cu-a5ie_.js} +2 -8
  7. package/dist/chunks/{custom-visual-inputs-CkJW9pBS.js → custom-visual-inputs-ChL54gGm.js} +1 -1
  8. package/dist/chunks/{dashboard-C3CoKbGY.js → dashboard-DCk26-6i.js} +1 -1
  9. package/dist/chunks/{dashboard-briefing-launcher-Be4h-7My.js → dashboard-briefing-launcher-CQ1eYsGy.js} +528 -528
  10. package/dist/chunks/{dashboard-controls-bxPrlSyp.js → dashboard-controls-BMeZjF7r.js} +45 -45
  11. package/dist/chunks/{dashboard-json-BrjxIiRt.js → dashboard-json-BZqCoanC.js} +1 -1
  12. package/dist/chunks/{document-dashboard-inputs-CRVHpIHp.js → document-dashboard-inputs-tYd7ao0o.js} +94 -94
  13. package/dist/chunks/{edit-dashboard-visual-DYYYDjY6.js → edit-dashboard-visual-Bv3MHM_G.js} +281 -281
  14. package/dist/chunks/{column-catalog-BYnochWQ.js → filter-reach-copy-CGWsL_ez.js} +978 -861
  15. package/dist/chunks/{global-date-filter-utils-9d6m9-FE.js → global-date-filter-utils-BhAu8zIM.js} +4070 -3792
  16. package/dist/chunks/{index-DkQkMKa1.js → index-DmrLP5Ro.js} +30 -30
  17. package/dist/chunks/{raw-temporal-presentation-CBzrDOjM.js → raw-temporal-presentation-DypB7sMX.js} +1 -1
  18. package/dist/chunks/{report-preferences-dialog-4QEZWe5U.js → report-preferences-dialog-DoVyriYC.js} +59 -59
  19. package/dist/chunks/{resolve-dashboard-input-context-UpK_LBpL.js → resolve-dashboard-input-context-D0JDUa4h.js} +1511 -1612
  20. package/dist/chunks/{saved-dashboard-context-D_I3Lxk0.js → saved-dashboard-context-BfAH5j4L.js} +5 -5
  21. package/dist/chunks/{semaphor-ready-indicator-4zpRHE-X.js → semaphor-ready-indicator-CRm17oIP.js} +37137 -36459
  22. package/dist/chunks/{shelf-drop-preview-context-Cfw7TRAx.js → shelf-drop-preview-context-vy6P9THz.js} +80 -80
  23. package/dist/chunks/{table-settings-CunhoDUi.js → table-settings-WysCBj62.js} +133 -124
  24. package/dist/chunks/{use-create-flow-overlay-state-DZBZiiD-.js → use-create-flow-overlay-state-Csx_Xjsh.js} +2 -2
  25. package/dist/dashboard/index.js +2 -2
  26. package/dist/dashboard-authoring/index.js +1419 -1340
  27. package/dist/index.js +14 -14
  28. package/dist/surfboard/index.js +2 -2
  29. package/dist/types/components/surfboard/filter/types.d.ts +7 -0
  30. package/dist/types/components/surfboard/screen-size-preview-button.d.ts +7 -4
  31. package/dist/types/components/visual/matrix-table/matrix-card-view.d.ts +3 -0
  32. package/dist/types/index.js +2 -2
  33. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +346 -21
  34. package/dist/types/lib/dashboard-inputs/dashboard-filter-value-identity.d.ts +65 -0
  35. package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +3 -3
  36. package/dist/types/lib/hooks/use-dashboard-card.d.ts +2 -0
  37. package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
  38. package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +9 -1
  39. package/dist/types/lib/matrix-table/matrix-runtime.d.ts +5 -1
  40. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +83 -13
  41. package/dist/types/lib/stores/dashboard-store.d.ts +12 -0
  42. package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +57 -1
  43. package/dist/types/shared/assistant-protocol/context.d.ts +8 -8
  44. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
  45. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +7 -0
  46. package/dist/types/shared/dashboard-authoring/click-to-filter-settings.d.ts +3 -3
  47. package/dist/types/shared/dashboard-authoring/dashboard-filter-automatic-target.d.ts +4 -4
  48. package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +3 -1
  49. package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-types.d.ts +27 -1
  50. package/dist/types/shared/dashboard-authoring/dashboard-filter-value-compatibility.d.ts +12 -3
  51. package/dist/types/shared/dashboard-authoring/filter-reach-copy.d.ts +18 -0
  52. package/dist/types/shared/dashboard-authoring/filter-reach-preview.d.ts +97 -0
  53. package/dist/types/shared/dashboard-authoring/index.d.ts +5 -1
  54. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +7 -0
  55. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +26 -4
  56. package/dist/types/shared/dashboard-authoring/semantic-auto-join-card.d.ts +22 -0
  57. package/package.json +1 -1
@@ -0,0 +1,97 @@
1
+ import { SemaphorRelationshipRoute, SemaphorSkippedConstraintReason } from '../analytics-protocol/index.js';
2
+ import { TFilter } from '../../components/surfboard/filter/types.js';
3
+ import { DashboardFilterOptionSource, DashboardFilterRelationshipTarget } from './dashboard-filter-mapping-types.js';
4
+ /**
5
+ * The Cards tab's relationship preview (relationship filter reach, Phase 3):
6
+ * `POST /api/v1/filter-reach` resolves each in-scope card the way its query
7
+ * will, without a value. Authoring only, never on the card query path.
8
+ */
9
+ export type FilterReachRequest = {
10
+ dashboardId: string;
11
+ /** The filter as staged in the settings popover (unsaved edits included). */
12
+ filter: TFilter;
13
+ /** The draft's Option Source; absent when the draft has none (ledger R-04). */
14
+ optionSource?: DashboardFilterOptionSource;
15
+ /** In-scope cards, each as the draft runs it. */
16
+ cards: FilterReachPreviewCard[];
17
+ };
18
+ /** A card to preview, with the route the draft runs it with (ledger R-02). */
19
+ export type FilterReachPreviewCard = {
20
+ cardId: string;
21
+ /**
22
+ * The card's chosen route as the draft stands (RF-D10): a staged choice,
23
+ * else the saved one unless the author dropped it. Absent: the card has no
24
+ * entry of its own, and the preview says what the domain's relationships do.
25
+ */
26
+ target?: DashboardFilterRelationshipTarget;
27
+ };
28
+ /**
29
+ * What the domain's relationships do for a card as the draft runs it
30
+ * (relationship filter reach S-D).
31
+ */
32
+ export type FilterReachCardOutcome = {
33
+ status: 'applied';
34
+ route: SemaphorRelationshipRoute;
35
+ } | {
36
+ status: 'skipped';
37
+ reason: SemaphorSkippedConstraintReason;
38
+ }
39
+ /** More than one equally preferred path: the card skips the filter until one is chosen (P-7). */
40
+ | {
41
+ status: 'needsPath';
42
+ } | {
43
+ status: 'blocked';
44
+ message: string;
45
+ }
46
+ /**
47
+ * The card applies the value as one of its own filters: the value's dataset
48
+ * is one its query already uses (its own filters included), so no route is
49
+ * needed (ledger R-05).
50
+ */
51
+ | {
52
+ status: 'kept';
53
+ }
54
+ /** Reached another way, or not a semantic auto-join card. */
55
+ | {
56
+ status: 'notRelationship';
57
+ };
58
+ /**
59
+ * One card's preview: the outcome for the decision it answers, and the
60
+ * card's paths. A reader shows the outcome only while the card's decision is
61
+ * still the one named in `answers` (RF-INV-15); the paths don't depend on the
62
+ * decision (RF-D27).
63
+ */
64
+ export type FilterReachCardPreview = {
65
+ cardId: string;
66
+ /** The decision this outcome is for: the path ids the request carried for the card, or none. */
67
+ answers: {
68
+ relationshipIds?: string[];
69
+ };
70
+ outcome: FilterReachCardOutcome;
71
+ /** The card's equally preferred paths, worked out with no path chosen; empty without a tie. */
72
+ paths: FilterReachPathOption[];
73
+ };
74
+ /**
75
+ * One path an author can choose, with the target that saves it: built by the
76
+ * server from the filter's value field in the card's domain, never from the
77
+ * browser's guess of that field (ledger R-16).
78
+ */
79
+ export type FilterReachPathOption = {
80
+ route: SemaphorRelationshipRoute;
81
+ target: DashboardFilterRelationshipTarget;
82
+ };
83
+ export type FilterReachResponse = {
84
+ previews: FilterReachCardPreview[];
85
+ /** Present only when the caller can edit the domain the routes run in. */
86
+ manageRelationships?: {
87
+ href: string;
88
+ };
89
+ };
90
+ /** Whether a preview answers a card's decision as it stands: the same path, or no path for both (RF-INV-15). */
91
+ export declare function filterReachPreviewAnswers(preview: Pick<FilterReachCardPreview, 'answers'>, relationshipIds: readonly string[] | undefined): boolean;
92
+ /**
93
+ * Reads a `/api/v1/filter-reach` response body. A malformed preview is
94
+ * dropped whole: one with no decision it answers, an unknown outcome, a
95
+ * malformed path, or a tie with fewer than two paths.
96
+ */
97
+ export declare function readFilterReachResponse(body: unknown): FilterReachResponse;
@@ -48,10 +48,14 @@ export * from './outline/outline-dashboard.js';
48
48
  export * from './column-catalog.js';
49
49
  export { prepareLoadedDashboard } from '../../lib/dashboard-inputs/prepare-loaded-dashboard.js';
50
50
  export { buildFilterInputFromField, buildFilterInputFromDefinition, applyFilterSettingsChange } from '../../lib/dashboard-inputs/filter-settings.js';
51
+ export { relationshipRouteTarget } from '../../lib/dashboard-inputs/dashboard-filter-value-identity.js';
51
52
  export type { FilterSettingsChange, FilterValueEffect } from '../../lib/dashboard-inputs/filter-settings.js';
52
- export { describeDashboardFilterCardReach, type DashboardFilterCardReach } from '../../lib/query-context/dashboard-filter-mapping-resolution.js';
53
+ export { describeDashboardFilterCardReach, describeDashboardFilterCardReachDetail, type DashboardFilterCardReach, type DashboardFilterCardReachDetail, type DashboardRelationshipReachResolver, } from '../../lib/query-context/dashboard-filter-mapping-resolution.js';
53
54
  export { changeCardType, sharedCardPreferences, type CardTypeChange, type CardTypeChangeOptions, } from '../../lib/utils/card-type-change.js';
54
55
  export { buildSavedEditorCard } from '../../lib/utils/build-saved-editor-card.js';
55
56
  export { getCardDefinition, type AuthoredCardFields } from '../../lib/utils/card-definition.js';
56
57
  export { changeMatrixEditor, dropMatrixEditorField, matrixEditorCatalogFromFields, } from '../../lib/matrix-table/matrix-editor.js';
57
58
  export * from './filter-applicability.js';
59
+ export * from './semantic-auto-join-card.js';
60
+ export * from './filter-reach-preview.js';
61
+ export * from './filter-reach-copy.js';
@@ -1,3 +1,4 @@
1
+ import { DashboardRelationshipReachResolver } from '../../../lib/query-context/dashboard-filter-mapping-resolution.js';
1
2
  import { TDashboard } from '../../../lib/types/common-types.js';
2
3
  import { FrameWidth } from '../../layouts/index.js';
3
4
  import { NotEditableReason, OutlineCardSource } from '../changes/read-card-query.js';
@@ -26,6 +27,12 @@ export type OutlineViewer = {
26
27
  maxQueryCards?: number;
27
28
  /** The report calendar filter defaults are read in; without one, a fixed calendar at `updatedAt` (S-INV-8). */
28
29
  calendar?: CalendarContext;
30
+ /**
31
+ * Server side only: resolves relationship reach the way the card query
32
+ * does, with each card's domain preloaded (relationship filter reach RF-D15).
33
+ * Without one, such cards are listed under `relationshipPending`.
34
+ */
35
+ relationshipReach?: DashboardRelationshipReachResolver;
29
36
  };
30
37
  export type OutlineCard = {
31
38
  cardId: string;
@@ -1,4 +1,6 @@
1
1
  import { TDashboard } from '../../../lib/types/common-types.js';
2
+ import { DashboardRelationshipReachResolver } from '../../../lib/query-context/dashboard-filter-mapping-resolution.js';
3
+ import { SemaphorSkippedConstraintReason } from '../../analytics-protocol/index.js';
2
4
  import { FilterInputEntry } from '../filter-model/index.js';
3
5
  import { CalendarContext } from '../../report-runtime-context/index.js';
4
6
  import { FilterValue, TimeWindow } from '../changes/dashboard-change.js';
@@ -35,11 +37,12 @@ export type OutlineFilter = {
35
37
  reaches: string[];
36
38
  /** Card ids excluded explicitly. */
37
39
  excluded: string[];
38
- /** In scope, not matched. */
40
+ /** In scope, not matched; with a resolver (server side), the reason relationship reach gave. */
39
41
  notReached: Array<{
40
42
  cardId: string;
41
43
  title: string;
42
44
  datasetName?: string;
45
+ reason?: SemaphorSkippedConstraintReason;
43
46
  }>;
44
47
  /** In scope, and blocked when the filter has a value: a binding the card can't run, or two fields it could take. */
45
48
  blocked?: Array<{
@@ -47,6 +50,16 @@ export type OutlineFilter = {
47
50
  title: string;
48
51
  reason: 'blocked' | 'ambiguous';
49
52
  }>;
53
+ /**
54
+ * In scope, on another dataset of the card's domain: the server decides
55
+ * when the card runs, through the domain's relationships, whether the
56
+ * filter applies. Never counted as reached.
57
+ */
58
+ relationshipPending?: Array<{
59
+ cardId: string;
60
+ title: string;
61
+ datasetName?: string;
62
+ }>;
50
63
  } | {
51
64
  filterId: string;
52
65
  label: string;
@@ -63,6 +76,15 @@ export type OutlineFilter = {
63
76
  title: string;
64
77
  reason: 'blocked' | 'ambiguous';
65
78
  }>;
79
+ relationshipPending?: Array<{
80
+ cardId: string;
81
+ title: string;
82
+ datasetName?: string;
83
+ }>;
84
+ };
85
+ /** Server-side readers resolve relationship reach the way the card query does (RF-D15). */
86
+ export type OutlineReachOptions = {
87
+ relationshipReach?: DashboardRelationshipReachResolver;
66
88
  };
67
89
  /**
68
90
  * The calendar a summary reads defaults in: the report's, else a fixed one at
@@ -71,8 +93,8 @@ export type OutlineFilter = {
71
93
  * resolves to.
72
94
  */
73
95
  export declare function outlineCalendar(calendar: CalendarContext | undefined, updatedAt: string | undefined): CalendarContext;
74
- export declare function summarizeFilter(dashboard: TDashboard, entry: FilterInputEntry, calendar?: CalendarContext): OutlineFilter;
96
+ export declare function summarizeFilter(dashboard: TDashboard, entry: FilterInputEntry, calendar?: CalendarContext, options?: OutlineReachOptions): OutlineFilter;
75
97
  /** Every filter on the dashboard, in the filter model's order. */
76
- export declare function outlineFilters(dashboard: TDashboard, calendar?: CalendarContext): OutlineFilter[];
98
+ export declare function outlineFilters(dashboard: TDashboard, calendar?: CalendarContext, options?: OutlineReachOptions): OutlineFilter[];
77
99
  /** One filter by its input id, or undefined. */
78
- export declare function outlineFilter(dashboard: TDashboard, filterId: string, calendar?: CalendarContext): OutlineFilter | undefined;
100
+ export declare function outlineFilter(dashboard: TDashboard, filterId: string, calendar?: CalendarContext, options?: OutlineReachOptions): OutlineFilter | undefined;
@@ -0,0 +1,22 @@
1
+ import { TFilterValue } from '../../components/surfboard/filter/types.js';
2
+ import { TCard } from '../../lib/types/common-types.js';
3
+ /**
4
+ * Where relationship filter reach runs (relationship filter reach RF-D18): a
5
+ * card on a semantic domain with no explicit join plan. The join plan is read
6
+ * as the card's filter source index reads it: a Matrix card's from its spec,
7
+ * every other card's from its config. The browser decides only whether to
8
+ * send a value (`decideDashboardFilterCardTarget`, `relationship`); the server
9
+ * decides reach through the domain's relationships. Both call this.
10
+ */
11
+ export declare function isSemanticAutoJoinCard(card: Pick<TCard, 'type' | 'dataSource' | 'config'> & {
12
+ sql?: string;
13
+ python?: string;
14
+ }): boolean;
15
+ /**
16
+ * The one semantic dataset a filter value's field reads, with its domain:
17
+ * undefined when the value names no dataset, several, or no semantic domain.
18
+ */
19
+ export declare function filterValueSemanticDataset(value: Pick<TFilterValue, 'fieldMeta' | 'semanticContext'>): {
20
+ domainId: string;
21
+ datasetName: string;
22
+ } | undefined;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.546",
8
+ "version": "0.1.547",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",