react-semaphor 0.1.543 → 0.1.545
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.
- package/dist/activity/index.js +73 -0
- package/dist/analytics-protocol/index.js +35 -34
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +2 -2
- package/dist/briefings/index.js +56 -52
- package/dist/chunks/{class-utils-Df1OVOT1.js → _commonjsHelpers-DimLPMtv.js} +124 -98
- package/dist/chunks/{apply-dashboard-operations-CG9S7MGt.js → apply-dashboard-operations-CZEMsx8E.js} +778 -958
- package/dist/chunks/{assistant-chat-BFMRUYoB.js → assistant-chat-D7sWTypJ.js} +26 -27
- package/dist/chunks/calendar-day-equality-dvoQp1xW.js +410 -0
- package/dist/chunks/{comparison-window-caption-Bv18samq.js → comparison-window-caption-D4E6IHPD.js} +462 -456
- package/dist/chunks/{custom-visual-inputs-DUtpYZOk.js → custom-visual-inputs-DLCD9Y5V.js} +8 -2
- package/dist/chunks/dashboard-B1tMju0u.js +14 -0
- package/dist/chunks/dashboard-briefing-launcher-CePgIu0Z.js +3720 -0
- package/dist/chunks/{dashboard-controls-UGpjOM2k.js → dashboard-controls-Cq05n3e0.js} +526 -521
- package/dist/chunks/{dashboard-json-DG8dz0eX.js → dashboard-json-CoYRPqxx.js} +3 -3
- package/dist/chunks/document-dashboard-inputs-BesAHZvB.js +3112 -0
- package/dist/chunks/{edit-dashboard-visual-CDpA4y5e.js → edit-dashboard-visual-JPtNfJRb.js} +5628 -5618
- package/dist/chunks/export-file-format-C-tJsxsf.js +111 -0
- package/dist/chunks/{filter-value-text-CYsVYPuD.js → filter-value-text-ff7osJr7.js} +1 -1
- package/dist/chunks/{index-l5LclZvs.js → index-DRWiuqyd.js} +378 -332
- package/dist/chunks/{matrix-formatter-BnsTX90d.js → matrix-formatter-DnCyRXJE.js} +13 -13
- package/dist/chunks/{numeric-presentation-F_-H6VAw.js → numeric-presentation-7X_IrD58.js} +2572 -2573
- package/dist/chunks/{pivot-result-lifecycle-DupbRk-R.js → pivot-result-lifecycle-DM4CyGKs.js} +285 -393
- package/dist/chunks/{raw-temporal-presentation-D-azM_98.js → raw-temporal-presentation-C3mUgnEx.js} +2 -2
- package/dist/chunks/{zoned-wall-clock-MulfA26h.js → relative-date-label-Bk2j94pA.js} +21 -64
- package/dist/chunks/rendered-file-D8xEuVVx.js +108 -0
- package/dist/chunks/{report-preferences-dialog-CPwRwEJx.js → report-preferences-dialog-DUtuUL_5.js} +640 -612
- package/dist/chunks/resolve-dashboard-input-context-DJ2tICwz.js +9415 -0
- package/dist/chunks/{saved-dashboard-context-BKvMfRfC.js → saved-dashboard-context-LrF_kW0l.js} +183 -211
- package/dist/chunks/selection-filter-compiler-BKXmyLrS.js +79 -0
- package/dist/chunks/{semaphor-ready-indicator-CN2AHm2x.js → semaphor-ready-indicator-BxF96Yhv.js} +46859 -47102
- package/dist/chunks/shelf-drop-preview-context-CNaM_Gmh.js +2469 -0
- package/dist/chunks/{switch-C3jLxlG0.js → switch-uDtPgQlQ.js} +44 -45
- package/dist/chunks/{table-export-sheet-BDRXLLdq.js → table-export-sheet-YzMioA7Y.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-BnclfB2k.js → use-create-flow-overlay-state-CjB7ig1o.js} +153 -164
- package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +553 -541
- package/dist/data-app-sdk/index.js +1 -1
- package/dist/format-utils/index.js +241 -227
- package/dist/index.js +354 -331
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/activity.d.ts +2 -0
- package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
- package/dist/types/briefings/attachments.d.ts +33 -6
- package/dist/types/briefings/index.d.ts +6 -5
- package/dist/types/components/activity/activity-bell.d.ts +11 -0
- package/dist/types/components/activity/activity-instance.d.ts +50 -0
- package/dist/types/components/activity/activity-notices.d.ts +7 -0
- package/dist/types/components/activity/activity-provider.d.ts +21 -0
- package/dist/types/components/activity/activity-types.d.ts +177 -0
- package/dist/types/components/activity/index.d.ts +6 -0
- package/dist/types/components/activity/use-activity.d.ts +20 -0
- package/dist/types/components/briefings/briefing-author/run-model.d.ts +1 -2
- package/dist/types/components/briefings/briefing-author.d.ts +14 -12
- package/dist/types/components/briefings/dashboard-briefing-launcher.d.ts +5 -0
- package/dist/types/components/briefings/use-briefing-run-detail.d.ts +34 -0
- package/dist/types/components/index.d.ts +1 -4
- package/dist/types/components/surfboard/filter/types.d.ts +0 -14
- package/dist/types/lib/activity-identity.d.ts +21 -0
- package/dist/types/lib/api/exports-api.d.ts +4 -4
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +68 -82
- package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +0 -8
- package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +35 -1
- package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +199 -0
- package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +7 -2
- package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +1 -1
- package/dist/types/lib/dashboard-viewer/captured-runtime-values.d.ts +40 -0
- package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +16 -16
- package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +11 -9
- package/dist/types/lib/download-pdf.d.ts +75 -1
- package/dist/types/lib/hooks/index.d.ts +1 -3
- package/dist/types/lib/hooks/use-date-filter.d.ts +5 -0
- package/dist/types/lib/hooks/use-text-filter.d.ts +5 -0
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +5 -4
- package/dist/types/lib/matrix-table/matrix-delivery.d.ts +4 -0
- package/dist/types/lib/query-context/assemble-card-query.d.ts +158 -0
- package/dist/types/lib/query-context/build-card-query-context.d.ts +3 -3
- package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +15 -6
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +11 -13
- package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +22 -12
- package/dist/types/lib/stores/dashboard-store.d.ts +39 -55
- package/dist/types/lib/stores/editor-store.d.ts +0 -3
- package/dist/types/lib/types/common-types.d.ts +21 -6
- package/dist/types/shared/activity/activity-contract.d.ts +84 -0
- package/dist/types/shared/activity/index.d.ts +5 -0
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +4 -11
- package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +6 -0
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +12 -12
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +92 -0
- package/dist/types/shared/dashboard-authoring/filter-model/ad-hoc-filter-values.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/filter-model/filter-definitions.d.ts +29 -0
- package/dist/types/shared/dashboard-authoring/filter-model/filter-values.d.ts +58 -0
- package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/filter-model/prototype-document-inputs.d.ts +15 -0
- package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +78 -0
- package/dist/types/shared/dashboard-authoring/filter-model/stored-dashboard.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/filter-model/toolbar-filter-reach.d.ts +23 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +2 -0
- package/dist/types/shared/format-utils/export-policy.d.ts +12 -0
- package/dist/types/shared/format-utils/exporters/index.d.ts +2 -0
- package/dist/types/shared/format-utils/exporters/rendered-file.d.ts +106 -0
- package/package.json +6 -2
- package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +0 -28
- package/dist/chunks/calendar-day-equality-BmJAWduY.js +0 -460
- package/dist/chunks/dashboard-B9mKTJoy.js +0 -14
- package/dist/chunks/dashboard-briefing-launcher-Bdmry_oG.js +0 -4248
- package/dist/chunks/document-dashboard-inputs-OwqCbrVp.js +0 -8087
- package/dist/chunks/document-sheet-utils-BTb3VZxV.js +0 -3619
- package/dist/chunks/shelf-drop-preview-context-BGl_rxcW.js +0 -2407
- package/dist/chunks/sort-target-MT1WK1vX.js +0 -29
- package/dist/types/components/briefings/briefing-author/run-ui.d.ts +0 -81
- package/dist/types/components/briefings/use-briefing-run-polling.d.ts +0 -34
- package/dist/types/components/notifications/export-notification-item.d.ts +0 -24
- package/dist/types/components/notifications/export-notification-list.d.ts +0 -8
- package/dist/types/components/notifications/index.d.ts +0 -3
- package/dist/types/components/notifications/notification-bell.d.ts +0 -13
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +0 -88
- package/dist/types/lib/dashboard-inputs/dashboard-input-scope.d.ts +0 -10
- package/dist/types/lib/exports/bounded-request.d.ts +0 -12
- package/dist/types/lib/hooks/use-export-polling.d.ts +0 -32
- package/dist/types/lib/hooks/use-export-recovery.d.ts +0 -11
- package/dist/types/lib/stores/export-store.d.ts +0 -62
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TFilter } from '../../../components/surfboard/filter/types.js';
|
|
2
|
+
import { NormalizedFilterDashboardInput, TDashboard } from '../../../lib/types/common-types.js';
|
|
3
|
+
import { FilterInputEntry } from './read-dashboard-filter-model.js';
|
|
4
|
+
/** One definition per filter input, in model order. The same array for the same dashboard object. */
|
|
5
|
+
export declare function listDashboardFilterDefinitions(dashboard: TDashboard): readonly TFilter[];
|
|
6
|
+
/** The dashboard's Global Date filter, whichever input holds it. */
|
|
7
|
+
export declare function getDashboardGlobalDateFilter(dashboard: TDashboard): TFilter | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* The filter inputs the tab-presence rule places on a tab (M2), in model
|
|
10
|
+
* order: what the tab's filter bar shows. `sheetKind` overrides the tab's
|
|
11
|
+
* own kind. None for an unknown tab.
|
|
12
|
+
*/
|
|
13
|
+
export declare function listDashboardFilterInputsOnTab(dashboard: TDashboard, sheetId: string | null | undefined, sheetKind?: 'dashboard' | 'document'): readonly FilterInputEntry[];
|
|
14
|
+
/**
|
|
15
|
+
* A filter hidden from the toolbar and not attached to a visual: a toolbar
|
|
16
|
+
* filter's `hide`, or an input placed `hidden` (OF-D14). The edit-mode strip
|
|
17
|
+
* of hidden filters lists these.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isHiddenFilterInput(input: NormalizedFilterDashboardInput): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Every filter definition the stored template holds, as stored: toolbar
|
|
22
|
+
* filters, stored inputs' filters and prototype Document inputs' filters,
|
|
23
|
+
* rejected inputs included (the model leaves those out). The objects
|
|
24
|
+
* themselves, so a writer of the stored shape (a migration's remap, a demo
|
|
25
|
+
* copy) rewrites them in place on its own copy, and a reader that must see
|
|
26
|
+
* every stored definition (the connections a migration maps) sees what the
|
|
27
|
+
* remap writes (one filter model P4b-02 (f)).
|
|
28
|
+
*/
|
|
29
|
+
export declare function listStoredFilterDefinitions(dashboard: TDashboard): TFilter[];
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { TFilter, TFilterValue } from '../../../components/surfboard/filter/types.js';
|
|
2
|
+
import { DashboardInputValues, NormalizedFilterDashboardInput, TDashboard } from '../../../lib/types/common-types.js';
|
|
3
|
+
import { CalendarContext } from '../../report-runtime-context/index.js';
|
|
4
|
+
import { DashboardInputRuntimeTarget } from '../../../lib/dashboard-inputs/dashboard-input-values.js';
|
|
5
|
+
import { DashboardInputRuntimeValues } from '../../../lib/dashboard-inputs/resolve-dashboard-input-context.js';
|
|
6
|
+
/**
|
|
7
|
+
* M5, the filter value adapters (one filter model SPEC 4.7): they move values
|
|
8
|
+
* between the old filter value list, keyed by `filterId`, and input slots.
|
|
9
|
+
* They decide no precedence.
|
|
10
|
+
*/
|
|
11
|
+
/** A host filter default: a full filter value, or the short `{ filterId, values }` embed form. */
|
|
12
|
+
export type HostFilterValue = TFilterValue | {
|
|
13
|
+
readonly filterId: string;
|
|
14
|
+
readonly values: string[] | number[];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A host value as a filter value of this definition (today's hydration rule).
|
|
18
|
+
* The short embed form names no operation: it takes the filter's own, so the
|
|
19
|
+
* slot passes the input's validation (ledger P4a-03).
|
|
20
|
+
*/
|
|
21
|
+
export declare function hostFilterValueFor(filter: TFilter, hostValue: HostFilterValue, calendar: CalendarContext | null | undefined): TFilterValue;
|
|
22
|
+
/**
|
|
23
|
+
* Host overlay in: each value goes to the input owning its `filterId`, as a
|
|
24
|
+
* runtime slot over saved defaults. A `shared` input gets one slot; a
|
|
25
|
+
* `perSheet` input gets one on every tab the input is on (a host default is
|
|
26
|
+
* dashboard-wide, as today). A value whose `filterId` owns no input, or
|
|
27
|
+
* whose input holds one value per card or section, is dropped and listed.
|
|
28
|
+
* The values that own no input are also returned as they were listed: the
|
|
29
|
+
* caller decides whether they are ad-hoc values (SPEC 5.8, 5.9).
|
|
30
|
+
*/
|
|
31
|
+
export declare function hostFilterValuesToSlots(dashboard: TDashboard, values: readonly HostFilterValue[] | undefined, options: {
|
|
32
|
+
calendar: CalendarContext | null | undefined;
|
|
33
|
+
}): {
|
|
34
|
+
slots: DashboardInputValues;
|
|
35
|
+
adHocFilterValues: TFilterValue[];
|
|
36
|
+
droppedFilterIds: string[];
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* List out, tab-wide: each filter shown on this tab with its effective value
|
|
40
|
+
* (the inputs the tab-presence rule places on it, in model order, each
|
|
41
|
+
* through the hydration owner), followed by the tab's ad-hoc values. Inputs
|
|
42
|
+
* with no value, or cleared, are left out. Used by `onFilterValuesChange`,
|
|
43
|
+
* captures and every reader that reports a tab's filters.
|
|
44
|
+
*/
|
|
45
|
+
export declare function readFilterValueList(params: {
|
|
46
|
+
dashboard: TDashboard;
|
|
47
|
+
runtimeValues: Pick<DashboardInputRuntimeValues, 'dashboardInputValues'>;
|
|
48
|
+
adHocFilterValues: readonly TFilterValue[] | undefined;
|
|
49
|
+
sheetId: string | null | undefined;
|
|
50
|
+
sheetKind: 'dashboard' | 'document';
|
|
51
|
+
calendar: CalendarContext | null;
|
|
52
|
+
}): TFilterValue[];
|
|
53
|
+
/**
|
|
54
|
+
* Every runtime target a filter input holds a value at: one for a `shared`
|
|
55
|
+
* input, each tab it is on for `perSheet`, each card it reaches for
|
|
56
|
+
* `perCard`, each section it reaches for `perDocumentSection`.
|
|
57
|
+
*/
|
|
58
|
+
export declare function listFilterInputValueTargets(dashboard: TDashboard, input: NormalizedFilterDashboardInput): DashboardInputRuntimeTarget[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './read-dashboard-filter-model.js';
|
|
2
|
+
export * from './toolbar-filter-reach.js';
|
|
3
|
+
export { foldPrototypeDocumentInputs } from './prototype-document-inputs.js';
|
|
4
|
+
export * from './filter-values.js';
|
|
5
|
+
export * from './filter-definitions.js';
|
|
6
|
+
export * from './ad-hoc-filter-values.js';
|
|
7
|
+
export { upgradeToStoredDashboard } from './stored-dashboard.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DashboardInput, DocumentInputDefinition, TDashboard } from '../../../lib/types/common-types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The prototype Document input fold (one filter model SPEC 4.3 step 3), moved
|
|
4
|
+
* unchanged from `document-input-prototype-normalizer.ts`: inputs stored in
|
|
5
|
+
* `sheet.document.inputs` (the earliest Document shape) become Dashboard
|
|
6
|
+
* Inputs scoped to their tab, with variable names and control ids aligned as
|
|
7
|
+
* before. Returns the input dashboard when nothing changes.
|
|
8
|
+
*/
|
|
9
|
+
export declare function foldPrototypeDocumentInputs(dashboard: TDashboard): TDashboard;
|
|
10
|
+
/** The ids of the prototype Document inputs the fold would add (not already stored). */
|
|
11
|
+
export declare function listUnfoldedPrototypeDocumentInputs(dashboard: Pick<TDashboard, 'inputs' | 'sheets'>): Array<{
|
|
12
|
+
sheetId: string;
|
|
13
|
+
input: DocumentInputDefinition;
|
|
14
|
+
}>;
|
|
15
|
+
export declare function prototypeDocumentInputToDashboardInput(input: DocumentInputDefinition, sheetId: string): DashboardInput;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { TFilter } from '../../../components/surfboard/filter/types.js';
|
|
2
|
+
import { DashboardInputScope, DashboardInputValues, EmbeddedFilterDashboardInput, NormalizedFilterDashboardInput, TDashboard } from '../../../lib/types/common-types.js';
|
|
3
|
+
import { DashboardFilterMappingContractIssue } from '../dashboard-filter-mapping-contract.js';
|
|
4
|
+
import { DashboardCardLocation } from '../document-section-cards.js';
|
|
5
|
+
/**
|
|
6
|
+
* The filter model (one filter model M1): every stored filter shape read as a
|
|
7
|
+
* filter input. One entry point, `readDashboardFilterModel`, used by the
|
|
8
|
+
* client runtime and by the server alike. Pure, never throws, memoized per
|
|
9
|
+
* dashboard object.
|
|
10
|
+
*/
|
|
11
|
+
/** A filter, by its filter id or by an input id (a legacy `compat-filter:` id included). */
|
|
12
|
+
export type FilterRef = {
|
|
13
|
+
filterId: string;
|
|
14
|
+
} | {
|
|
15
|
+
inputId: string;
|
|
16
|
+
};
|
|
17
|
+
export type FilterInputOrigin = 'embeddedInput' | 'referencedInput' | 'prototypeDocumentInput' | 'toolbarFilter';
|
|
18
|
+
export type FilterInputEntry = {
|
|
19
|
+
/** What the runtime consumes; see the runtime view in SPEC 4.3. */
|
|
20
|
+
input: NormalizedFilterDashboardInput;
|
|
21
|
+
origin: FilterInputOrigin;
|
|
22
|
+
};
|
|
23
|
+
/** The shared card location plus its tab kind. */
|
|
24
|
+
export type ReachedCard = DashboardCardLocation & {
|
|
25
|
+
sheetKind: 'dashboard' | 'document';
|
|
26
|
+
};
|
|
27
|
+
export type FilterModelIssueCode = 'contract' | 'duplicate_filter_owner' | 'compat_id_conflict' | 'duplicate_global_date';
|
|
28
|
+
export type FilterModelIssue = {
|
|
29
|
+
code: FilterModelIssueCode;
|
|
30
|
+
/** A customer-safe sentence, in the style of the template validator's messages. */
|
|
31
|
+
message: string;
|
|
32
|
+
/** JSON path in the template that was read. */
|
|
33
|
+
path: string;
|
|
34
|
+
inputId?: string;
|
|
35
|
+
filterId?: string;
|
|
36
|
+
contractIssue?: DashboardFilterMappingContractIssue;
|
|
37
|
+
};
|
|
38
|
+
export type DashboardFilterModel = {
|
|
39
|
+
/** Accepted filter inputs: stored inputs in stored order, then prototype Document inputs, then toolbar filters. */
|
|
40
|
+
readonly inputs: readonly FilterInputEntry[];
|
|
41
|
+
readonly issues: readonly FilterModelIssue[];
|
|
42
|
+
/** Ids of stored inputs left out because of an issue. */
|
|
43
|
+
readonly rejectedInputIds: ReadonlySet<string>;
|
|
44
|
+
readonly globalDateInput: FilterInputEntry | undefined;
|
|
45
|
+
/** True when `toStoredDashboard()` would change anything. */
|
|
46
|
+
readonly needsUpgrade: boolean;
|
|
47
|
+
/** The saved defaults the runtime reads: stored `defaultInputValues` with owned `defaultFilterValues` entries moved in. */
|
|
48
|
+
readonly defaultInputValues: DashboardInputValues;
|
|
49
|
+
/**
|
|
50
|
+
* The variable name today's lift gives every toolbar filter, owned ones
|
|
51
|
+
* included, in filter order. Inputs named after toolbar filters (dashboard
|
|
52
|
+
* control compatibility inputs) are named against these, so their aliases
|
|
53
|
+
* stay what they are today (OF-INV-3).
|
|
54
|
+
*/
|
|
55
|
+
readonly toolbarFilterVariableNames: readonly string[];
|
|
56
|
+
/** The owning entry. `{ inputId: 'compat-filter:x' }` resolves to the entry holding filter x, whatever its id. */
|
|
57
|
+
findFilterInput(ref: FilterRef): FilterInputEntry | undefined;
|
|
58
|
+
/** Card locations in dashboard order the input reaches (`options.scope` instead of its own when given). */
|
|
59
|
+
reachedCards(ref: FilterRef, options?: {
|
|
60
|
+
scope?: DashboardInputScope;
|
|
61
|
+
}): readonly ReachedCard[];
|
|
62
|
+
/** The template with every filter as an embedded input. The same object when `needsUpgrade` is false. Throws `FilterModelError` when `issues` is not empty. */
|
|
63
|
+
toStoredDashboard(): TDashboard;
|
|
64
|
+
};
|
|
65
|
+
export declare class FilterModelError extends Error {
|
|
66
|
+
readonly issues: readonly FilterModelIssue[];
|
|
67
|
+
constructor(issues: readonly FilterModelIssue[]);
|
|
68
|
+
}
|
|
69
|
+
/** One message for a persistence error: each issue's `message`, joined by "\n". */
|
|
70
|
+
export declare function formatFilterModelIssues(issues: readonly FilterModelIssue[]): string;
|
|
71
|
+
export declare function readDashboardFilterModel(dashboard: TDashboard): DashboardFilterModel;
|
|
72
|
+
/**
|
|
73
|
+
* The input fields a toolbar filter's own fields give it (step 4), for a
|
|
74
|
+
* writer that creates or updates its input before Phase 5. The variable name
|
|
75
|
+
* is not among them: it depends on the dashboard's other inputs (use the
|
|
76
|
+
* model's entry).
|
|
77
|
+
*/
|
|
78
|
+
export declare function toolbarFilterInputFields(dashboard: Pick<TDashboard, 'sheets'>, filter: TFilter): Pick<EmbeddedFilterDashboardInput, 'label' | 'scope' | 'presentation' | 'exports'>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TDashboard } from '../../../lib/types/common-types.js';
|
|
2
|
+
/**
|
|
3
|
+
* A template in the stored shape (one filter model SPEC 5.1, 5.4): every
|
|
4
|
+
* filter an embedded input. The one upgrade, for the load
|
|
5
|
+
* (`prepareLoadedDashboard`) and every template write (the app's
|
|
6
|
+
* `prepareDashboardDocument`).
|
|
7
|
+
*
|
|
8
|
+
* The old shape's toolbar list also reserved names that compatibility
|
|
9
|
+
* aliases (dashboard controls, card controls, card inline filters) were
|
|
10
|
+
* allocated around; without it those aliases can change (`region3` becomes
|
|
11
|
+
* `region2`). So alias-based text is first bound to stable input ids against
|
|
12
|
+
* the template as read, then the model writes the stored shape (OF-INV-3,
|
|
13
|
+
* ledger P5-11).
|
|
14
|
+
*
|
|
15
|
+
* The same object when nothing needs upgrading. Throws `FilterModelError`
|
|
16
|
+
* when the model reports issues, as `toStoredDashboard()` does.
|
|
17
|
+
*/
|
|
18
|
+
export declare function upgradeToStoredDashboard(dashboard: TDashboard): TDashboard;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TFilter } from '../../../components/surfboard/filter/types.js';
|
|
2
|
+
import { DashboardInputScope, TDashboard } from '../../../lib/types/common-types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The reach conversion from a toolbar filter's own reach fields to a
|
|
5
|
+
* `DashboardInputScope` (one filter model SPEC 4.2), owned by the filter
|
|
6
|
+
* model. Since Phase 5 only the upgrade reads it: a stored filter has no
|
|
7
|
+
* reach fields, so nothing converts a scope back.
|
|
8
|
+
*/
|
|
9
|
+
/** The `TFilter` fields that store reach on the old shape. */
|
|
10
|
+
export declare const TOOLBAR_FILTER_REACH_FIELDS: readonly ["sheetId", "applyToSheetIds", "excludeSheetIds", "applyToCardIds", "excludeCardIds"];
|
|
11
|
+
export type ToolbarFilterReachField = (typeof TOOLBAR_FILTER_REACH_FIELDS)[number];
|
|
12
|
+
/** Today's `doesFilterApplyToSheet`: does the toolbar filter reach this tab? */
|
|
13
|
+
export declare function doesToolbarFilterReachTab(filter: TFilter, sheetId: string): boolean;
|
|
14
|
+
/** Whether a toolbar filter stores any reach field. */
|
|
15
|
+
export declare function hasToolbarFilterReachField(filter: TFilter): boolean;
|
|
16
|
+
/** The filter without its reach fields (S-3). The same object when it has none. */
|
|
17
|
+
export declare function withoutToolbarFilterReachFields(filter: TFilter): TFilter;
|
|
18
|
+
/**
|
|
19
|
+
* Toolbar filter reach to scope (SPEC 4.2): the first matching row wins; for
|
|
20
|
+
* arrays "set" means `!== undefined`, for `sheetId` truthy; every id kept names
|
|
21
|
+
* an existing tab or card. Tab reach is the regular tabs the filter reaches.
|
|
22
|
+
*/
|
|
23
|
+
export declare function toolbarFilterScope(filter: TFilter, dashboard: Pick<TDashboard, 'sheets'>): DashboardInputScope;
|
|
@@ -16,6 +16,8 @@ export * from './dashboard-filter-automatic-target.js';
|
|
|
16
16
|
export * from './dashboard-filter-sql-subscription.js';
|
|
17
17
|
export * from './dashboard-filter-sql-target.js';
|
|
18
18
|
export * from './dashboard-filter-mapping-contract.js';
|
|
19
|
+
export * from './dashboard-input-scope.js';
|
|
20
|
+
export * from './filter-model/index.js';
|
|
19
21
|
export * from './dashboard-filter-value-compatibility.js';
|
|
20
22
|
export * from './card-reference-remapping.js';
|
|
21
23
|
export * from './apply-group-by-override.js';
|
|
@@ -17,3 +17,15 @@ export declare const MATRIX_EXPORT_MAX_ENCODED_BYTES: number;
|
|
|
17
17
|
export declare const MATRIX_EXPORT_MAX_ARTIFACT_BYTES: number;
|
|
18
18
|
/** Return true when a complete CSV must use the asynchronous chunked path. */
|
|
19
19
|
export declare function requiresChunkedCsvExport(totalRows: number): boolean;
|
|
20
|
+
/** Where a data export (CSV or Excel) runs (background-activity BA-D2, SPEC §4.1). */
|
|
21
|
+
export type DataExportRoute = 'direct' | 'background' | 'try-direct' | 'blocked';
|
|
22
|
+
/**
|
|
23
|
+
* The one route rule for data exports in CSV and Excel (they share every
|
|
24
|
+
* limit): a Matrix tries the direct path first; a table routes on its loaded
|
|
25
|
+
* row count. The loaded count only routes; the server sizes the job (BA-D3).
|
|
26
|
+
*/
|
|
27
|
+
export declare function dataExportRoute(input: {
|
|
28
|
+
cardType: 'table' | 'detailTable' | 'matrixTable';
|
|
29
|
+
/** The loaded row count of a server-paged table, else null. */
|
|
30
|
+
loadedRowCount: number | null;
|
|
31
|
+
}): DataExportRoute;
|
|
@@ -2,6 +2,8 @@ export { CSV_ENCODINGS, DEFAULT_CSV_ENCODING, CSV_DELIMITERS, CSV_RECORD_SEPARAT
|
|
|
2
2
|
export type { CsvEncoding, CsvDelimiter, CsvCell } from './csv-utils.js';
|
|
3
3
|
export { EXPORT_FILE_FORMATS, XLSX_CONTENT_TYPE, parseExportFileFormat, exportFileTraits, exportFileFormatFromStored, exportFileFormatFromContentType, exportFileName, } from './export-file-format.js';
|
|
4
4
|
export type { ExportFileFormat, ExportFileTraits } from './export-file-format.js';
|
|
5
|
+
export { EMAIL_IMAGE_DASHBOARD_WIDTH, IMAGE_CAPTURE_LIMITS, RENDERED_FILE_KINDS, cardImageSize, parseImageCaptureRequest, writeImageCaptureRequest, planImageViewport, renderedFileTraits, renderedFileName, sheetImageEntryName, } from './rendered-file.js';
|
|
6
|
+
export type { ImageCaptureRequest, ImageViewport, ImageViewportPlan, RenderedFileKind, RenderedFileTraits, } from './rendered-file.js';
|
|
5
7
|
export { resolveXlsxColumn, exportCellText } from './export-cells.js';
|
|
6
8
|
export type { ExportDataType, XlsxColumnInput, XlsxColumnPresentation, XlsxColumn, ExportCell, ExportWallClock, } from './export-cells.js';
|
|
7
9
|
export { XlsxLimitError, isXlsxLimitError, XLSX_LIMIT_FAILURE_REASONS, xlsxLimitFailureReason, assertXlsxColumnCount, defineXlsxSheet, serializeXlsxSheet, parseXlsxSheet, withXlsxSheetColumns, serializeXlsxColumns, parseXlsxColumns, xlsxColumnsFingerprint, encodeXlsxFile, encodeXlsxRows, streamXlsxFile, } from './xlsx-file.js';
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The rendered file contract: what a file the renderer draws from the print
|
|
3
|
+
* view (a PDF or a PNG image, or a zip of sheet images) is called and typed
|
|
4
|
+
* as, and how big an image is. The browser, the app and the renderer (through
|
|
5
|
+
* its generated bundle) all read and write the image size through this module,
|
|
6
|
+
* so its limits and URL parameter names have one owner. See the PNG exports
|
|
7
|
+
* plan (semaphor-app docs/implementation-plans/png-exports, SPEC §2.1 to §2.3).
|
|
8
|
+
* IMPORTANT: No React or browser-specific imports allowed
|
|
9
|
+
*/
|
|
10
|
+
/** How big the image is. Every number is CSS pixels. */
|
|
11
|
+
export type ImageCaptureRequest =
|
|
12
|
+
/** A downloaded card: its size on the viewer's screen, measured at the click. */
|
|
13
|
+
{
|
|
14
|
+
fit: 'card';
|
|
15
|
+
cssWidth: number;
|
|
16
|
+
cssHeight: number;
|
|
17
|
+
}
|
|
18
|
+
/** An emailed card: the print page sizes it from its saved layout on a dashboard this wide (PN-D13). */
|
|
19
|
+
| {
|
|
20
|
+
fit: 'layout';
|
|
21
|
+
dashboardWidth: number;
|
|
22
|
+
}
|
|
23
|
+
/** A dashboard sheet: the width is the viewer's (or the reference width); the renderer measures the height. */
|
|
24
|
+
| {
|
|
25
|
+
fit: 'sheet';
|
|
26
|
+
cssWidth: number;
|
|
27
|
+
};
|
|
28
|
+
/** The dashboard width an emailed card or sheet is drawn at (PN-D13). */
|
|
29
|
+
export declare const EMAIL_IMAGE_DASHBOARD_WIDTH = 1280;
|
|
30
|
+
export declare const IMAGE_CAPTURE_LIMITS: {
|
|
31
|
+
readonly minCssWidth: 320;
|
|
32
|
+
readonly minCssHeight: 120;
|
|
33
|
+
readonly maxCardCssWidth: 4096;
|
|
34
|
+
readonly maxCardCssHeight: 4096;
|
|
35
|
+
readonly maxSheetCssWidth: 4096;
|
|
36
|
+
/** Chromium's largest capture in device pixels, either side. */
|
|
37
|
+
readonly maxDevicePixels: 16384;
|
|
38
|
+
};
|
|
39
|
+
type ParamSource = URLSearchParams | Readonly<Record<string, string | undefined>>;
|
|
40
|
+
/** A card image's size, rounded and clamped to the card limits: the clamp the browser, the page and the renderer share. */
|
|
41
|
+
export declare function cardImageSize(input: {
|
|
42
|
+
cssWidth: number;
|
|
43
|
+
cssHeight: number;
|
|
44
|
+
}): {
|
|
45
|
+
cssWidth: number;
|
|
46
|
+
cssHeight: number;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Reads a request from URL parameters (`imageFit`, `imageWidth`, `imageHeight`;
|
|
50
|
+
* `imageWidth` is the dashboard width for `layout`)
|
|
51
|
+
* and clamps it. Null when a parameter is missing, not an integer, or does
|
|
52
|
+
* not match the fit. The browser, the app and the renderer read and write
|
|
53
|
+
* these parameters through this module only.
|
|
54
|
+
*/
|
|
55
|
+
export declare function parseImageCaptureRequest(params: ParamSource): ImageCaptureRequest | null;
|
|
56
|
+
export declare function writeImageCaptureRequest(request: ImageCaptureRequest, params: URLSearchParams): void;
|
|
57
|
+
export type ImageViewport = {
|
|
58
|
+
width: number;
|
|
59
|
+
height: number;
|
|
60
|
+
deviceScaleFactor: 1 | 2;
|
|
61
|
+
};
|
|
62
|
+
export type ImageViewportPlan = {
|
|
63
|
+
status: 'ready';
|
|
64
|
+
viewport: ImageViewport;
|
|
65
|
+
}
|
|
66
|
+
/** Even at scale 1 a side is over `maxDevicePixels`. */
|
|
67
|
+
| {
|
|
68
|
+
status: 'too_large';
|
|
69
|
+
cssWidth: number;
|
|
70
|
+
cssHeight: number;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* The renderer's viewport. For `card`, the request's own size. For `layout`,
|
|
74
|
+
* the dashboard width by 1,024; the page sizes the card and the renderer
|
|
75
|
+
* captures the card's element. For `sheet`, `measuredCssHeight` is the
|
|
76
|
+
* sheet's full height after every card loaded; required for a sheet (throws
|
|
77
|
+
* without it), ignored otherwise.
|
|
78
|
+
*/
|
|
79
|
+
export declare function planImageViewport(request: ImageCaptureRequest, measuredCssHeight?: number): ImageViewportPlan;
|
|
80
|
+
/** The kind of file a render produces. CSV keeps its own traits (`exportFileTraits`). */
|
|
81
|
+
export type RenderedFileKind = 'pdf' | 'png' | 'zip';
|
|
82
|
+
export type RenderedFileTraits = {
|
|
83
|
+
kind: RenderedFileKind;
|
|
84
|
+
extension: 'pdf' | 'png' | 'zip';
|
|
85
|
+
contentType: 'application/pdf' | 'image/png' | 'application/zip';
|
|
86
|
+
/** The customer's name for the format in dialogs and attachment lists. */
|
|
87
|
+
label: 'PDF' | 'PNG image' | 'PNG images (zip)';
|
|
88
|
+
};
|
|
89
|
+
export declare const RENDERED_FILE_KINDS: readonly ["pdf", "png", "zip"];
|
|
90
|
+
export declare function renderedFileTraits(kind: RenderedFileKind): RenderedFileTraits;
|
|
91
|
+
/**
|
|
92
|
+
* The saved file's name: `<title>-<ISO instant>.<extension>`, `Report` for an
|
|
93
|
+
* empty title. For kind `pdf` it equals today's inline name in
|
|
94
|
+
* `download-pdf.ts`. Used by the browser for every rendered file.
|
|
95
|
+
*/
|
|
96
|
+
export declare function renderedFileName(input: {
|
|
97
|
+
kind: RenderedFileKind;
|
|
98
|
+
title: string | null | undefined;
|
|
99
|
+
at: Date;
|
|
100
|
+
}): string;
|
|
101
|
+
/** One sheet's entry in an all-sheets zip: `01 Revenue.png`; position is 1-based, at least two digits; the title sanitized for a file name. */
|
|
102
|
+
export declare function sheetImageEntryName(input: {
|
|
103
|
+
position: number;
|
|
104
|
+
title: string | null | undefined;
|
|
105
|
+
}): string;
|
|
106
|
+
export {};
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"email": "support@semaphor.cloud"
|
|
6
6
|
},
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"version": "0.1.
|
|
8
|
+
"version": "0.1.545",
|
|
9
9
|
"description": "Fully interactive and customizable dashboards for your apps.",
|
|
10
10
|
"keywords": [
|
|
11
11
|
"react",
|
|
@@ -88,6 +88,10 @@
|
|
|
88
88
|
"types": "./dist/types/brand-studio.d.ts",
|
|
89
89
|
"import": "./dist/brand-studio/index.js"
|
|
90
90
|
},
|
|
91
|
+
"./activity": {
|
|
92
|
+
"types": "./dist/types/activity.d.ts",
|
|
93
|
+
"import": "./dist/activity/index.js"
|
|
94
|
+
},
|
|
91
95
|
"./briefings": {
|
|
92
96
|
"types": "./dist/types/briefings.d.ts",
|
|
93
97
|
"import": "./dist/briefings/index.js"
|
|
@@ -119,7 +123,7 @@
|
|
|
119
123
|
"build": "node scripts/build.mjs",
|
|
120
124
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
121
125
|
"lint:regressions": "node scripts/lint-regressions.mjs",
|
|
122
|
-
"check:guards": "node scripts/card-config-consumers.mjs && node scripts/components-entry-imports.mjs && node scripts/types-entry-imports.mjs && node scripts/card-query-assembly-imports.mjs && node scripts/assistant-chat-imports.mjs",
|
|
126
|
+
"check:guards": "node scripts/card-config-consumers.mjs && node scripts/components-entry-imports.mjs && node scripts/types-entry-imports.mjs && node scripts/card-query-assembly-imports.mjs && node scripts/assistant-chat-imports.mjs && node scripts/filter-model-reads.mjs",
|
|
123
127
|
"preview": "vite preview",
|
|
124
128
|
"test": "vitest run",
|
|
125
129
|
"test:changed": "vitest run --changed",
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
var u = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2
|
-
function f(e) {
|
|
3
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
|
-
}
|
|
5
|
-
function l(e) {
|
|
6
|
-
if (e.__esModule) return e;
|
|
7
|
-
var r = e.default;
|
|
8
|
-
if (typeof r == "function") {
|
|
9
|
-
var t = function o() {
|
|
10
|
-
return this instanceof o ? Reflect.construct(r, arguments, this.constructor) : r.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
t.prototype = r.prototype;
|
|
13
|
-
} else t = {};
|
|
14
|
-
return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(e).forEach(function(o) {
|
|
15
|
-
var n = Object.getOwnPropertyDescriptor(e, o);
|
|
16
|
-
Object.defineProperty(t, o, n.get ? n : {
|
|
17
|
-
enumerable: !0,
|
|
18
|
-
get: function() {
|
|
19
|
-
return e[o];
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}), t;
|
|
23
|
-
}
|
|
24
|
-
export {
|
|
25
|
-
l as a,
|
|
26
|
-
u as c,
|
|
27
|
-
f as g
|
|
28
|
-
};
|