@aintela/bi 0.2.0
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/README.md +299 -0
- package/dist/BiClientProvider-CWJochvi.js +219 -0
- package/dist/BiClientProvider-CWJochvi.js.map +1 -0
- package/dist/ChartCardDefaultsContext-Cl5T25H0.js +32 -0
- package/dist/ChartCardDefaultsContext-Cl5T25H0.js.map +1 -0
- package/dist/ChartContext-C_f_6khG.js +14 -0
- package/dist/ChartContext-C_f_6khG.js.map +1 -0
- package/dist/DashboardParametersContext-Clv--79U.js +39 -0
- package/dist/DashboardParametersContext-Clv--79U.js.map +1 -0
- package/dist/cards/ChartCard.d.ts +62 -0
- package/dist/cards/DataTableCard.d.ts +55 -0
- package/dist/cards/GaugeCard.d.ts +20 -0
- package/dist/cards/GaugeGroup.d.ts +12 -0
- package/dist/cards/MapBubbles.d.ts +35 -0
- package/dist/cards/MapConnections.d.ts +28 -0
- package/dist/cards/MetricCard.d.ts +15 -0
- package/dist/cards/MetricGroupCard.d.ts +10 -0
- package/dist/cards/TreeMapCard.d.ts +15 -0
- package/dist/cards/geoLayers.d.ts +23 -0
- package/dist/cards/index.d.ts +24 -0
- package/dist/cards/licenseGuard.d.ts +9 -0
- package/dist/cards/mapUtils.d.ts +23 -0
- package/dist/cards/useContainerRectangle.d.ts +9 -0
- package/dist/cards/worldMapPath.d.ts +7 -0
- package/dist/cards.d.ts +2 -0
- package/dist/cards.js +28 -0
- package/dist/cards.js.map +1 -0
- package/dist/client/BiClient.d.ts +160 -0
- package/dist/client/BiClientProvider.d.ts +21 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.js +11 -0
- package/dist/client.js.map +1 -0
- package/dist/composer/environment/environmentDom.d.ts +31 -0
- package/dist/composer/environment/types.d.ts +67 -0
- package/dist/composer/icons/cardTypeIcons.d.ts +31 -0
- package/dist/composer/index.d.ts +66 -0
- package/dist/composer/llm/ExampleCardSketch.d.ts +22 -0
- package/dist/composer/llm/ExamplePad.d.ts +18 -0
- package/dist/composer/llm/PrototypePad.d.ts +13 -0
- package/dist/composer/llm/useDashboardPad.d.ts +25 -0
- package/dist/composer/models/catalog.d.ts +33 -0
- package/dist/composer/models/sketchModels.d.ts +102 -0
- package/dist/composer/models/utils.d.ts +9 -0
- package/dist/composer/pad/CardSketch.d.ts +25 -0
- package/dist/composer/pad/ClonedComponent.d.ts +13 -0
- package/dist/composer/pad/DashboardPad.d.ts +38 -0
- package/dist/composer/pad/DashboardPadEditor.d.ts +35 -0
- package/dist/composer/pad/DashboardPadSketch.d.ts +31 -0
- package/dist/composer/pad/DatasetParameterizationControls.d.ts +34 -0
- package/dist/composer/pad/FilterSketch.d.ts +10 -0
- package/dist/composer/pad/HoverButton.d.ts +12 -0
- package/dist/composer/pad/TitleSketch.d.ts +19 -0
- package/dist/composer/pad/ToolBox.d.ts +11 -0
- package/dist/composer/store/ComposerProvider.d.ts +36 -0
- package/dist/composer/store/createComposerStore.d.ts +107 -0
- package/dist/composer/store/drafts.d.ts +20 -0
- package/dist/composer/view/ComposerChatBinding.d.ts +10 -0
- package/dist/composer/view/ComposerView.d.ts +49 -0
- package/dist/composer/view/DashboardPin.d.ts +3 -0
- package/dist/composer/view/DashboardSidePanel.d.ts +10 -0
- package/dist/composer/view/DrawablePrompt.d.ts +22 -0
- package/dist/composer/view/EntryEmptyState.d.ts +22 -0
- package/dist/composer/view/SpotlightOverlay.d.ts +21 -0
- package/dist/composer/view/composerAnimations.d.ts +11 -0
- package/dist/composer/view/composerTypes.d.ts +18 -0
- package/dist/composer/view/data/suggestions.d.ts +10 -0
- package/dist/composer/view/data/templates.d.ts +33 -0
- package/dist/composer/view/surfaces.d.ts +19 -0
- package/dist/composer/view/useComposerChatBridge.d.ts +43 -0
- package/dist/composer.d.ts +2 -0
- package/dist/composer.js +99 -0
- package/dist/composer.js.map +1 -0
- package/dist/createBiTheme-TyUv_UHM.js +93 -0
- package/dist/createBiTheme-TyUv_UHM.js.map +1 -0
- package/dist/data/ChartCardDefaultsContext.d.ts +43 -0
- package/dist/data/dataUtils.d.ts +152 -0
- package/dist/data/index.d.ts +5 -0
- package/dist/data/queryModel.d.ts +23 -0
- package/dist/data.d.ts +2 -0
- package/dist/data.js +37 -0
- package/dist/data.js.map +1 -0
- package/dist/dataUtils-CAUE5uZY.js +372 -0
- package/dist/dataUtils-CAUE5uZY.js.map +1 -0
- package/dist/filters/VizAutoComplete.d.ts +23 -0
- package/dist/filters/VizDatePicker.d.ts +9 -0
- package/dist/filters/VizDateRangePicker.d.ts +14 -0
- package/dist/filters/VizSelect.d.ts +12 -0
- package/dist/filters/VizTextField.d.ts +8 -0
- package/dist/filters/VizTriggerButton.d.ts +9 -0
- package/dist/filters/filterFactory.d.ts +30 -0
- package/dist/filters/friendlyName.d.ts +4 -0
- package/dist/filters/index.d.ts +15 -0
- package/dist/filters.d.ts +2 -0
- package/dist/filters.js +15 -0
- package/dist/filters.js.map +1 -0
- package/dist/grid/BiErrorBoundary.d.ts +24 -0
- package/dist/grid/ChartContext.d.ts +14 -0
- package/dist/grid/GridCard.d.ts +45 -0
- package/dist/grid/GridCardPlaceHolder.d.ts +8 -0
- package/dist/grid/GridLayout.d.ts +147 -0
- package/dist/grid/gridModels.d.ts +33 -0
- package/dist/grid/index.d.ts +14 -0
- package/dist/grid/types.d.ts +23 -0
- package/dist/grid/useGridConfigTranslator.d.ts +72 -0
- package/dist/grid.d.ts +2 -0
- package/dist/grid.js +20 -0
- package/dist/grid.js.map +1 -0
- package/dist/hooks/DashboardParametersContext.d.ts +32 -0
- package/dist/hooks/index.d.ts +8 -0
- package/dist/hooks/useDashboardData.d.ts +20 -0
- package/dist/hooks/useDashboardLazyData.d.ts +79 -0
- package/dist/hooks.d.ts +2 -0
- package/dist/hooks.js +16 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index-BYc79sSy.js +131 -0
- package/dist/index-BYc79sSy.js.map +1 -0
- package/dist/index-C6JQ6770.js +4545 -0
- package/dist/index-C6JQ6770.js.map +1 -0
- package/dist/index-CZbCaXMC.js +15 -0
- package/dist/index-CZbCaXMC.js.map +1 -0
- package/dist/index-D3OoOPjl.js +259 -0
- package/dist/index-D3OoOPjl.js.map +1 -0
- package/dist/index-D7Oo_dC-.js +94 -0
- package/dist/index-D7Oo_dC-.js.map +1 -0
- package/dist/index-D7tVPX8d.js +347 -0
- package/dist/index-D7tVPX8d.js.map +1 -0
- package/dist/index-DGyvUtY3.js +494 -0
- package/dist/index-DGyvUtY3.js.map +1 -0
- package/dist/index-DOpx0R4Y.js +41 -0
- package/dist/index-DOpx0R4Y.js.map +1 -0
- package/dist/index-wtSLspPh.js +1065 -0
- package/dist/index-wtSLspPh.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +236 -0
- package/dist/index.js.map +1 -0
- package/dist/inline/Chart.d.ts +29 -0
- package/dist/inline/IFrame.d.ts +19 -0
- package/dist/inline/Metric.d.ts +16 -0
- package/dist/inline/MetricGroup.d.ts +11 -0
- package/dist/inline/index.d.ts +9 -0
- package/dist/inline/parseKnownNumbers.d.ts +11 -0
- package/dist/inline.d.ts +2 -0
- package/dist/inline.js +9 -0
- package/dist/inline.js.map +1 -0
- package/dist/runtime/IDashboardDefinition.d.ts +22 -0
- package/dist/runtime/biModuleSurface.d.ts +2 -0
- package/dist/runtime/createBiUiTools.d.ts +74 -0
- package/dist/runtime/index.d.ts +9 -0
- package/dist/runtime/loadDashboardBundle.d.ts +32 -0
- package/dist/runtime/registerBiModules.d.ts +36 -0
- package/dist/runtime/version.d.ts +6 -0
- package/dist/runtime.d.ts +2 -0
- package/dist/runtime.js +19 -0
- package/dist/runtime.js.map +1 -0
- package/dist/style.css +1 -0
- package/dist/theme/BiThemeBridge.d.ts +32 -0
- package/dist/theme/biPalette.d.ts +23 -0
- package/dist/theme/createBiTheme.d.ts +25 -0
- package/dist/theme/index.d.ts +5 -0
- package/dist/theme.d.ts +2 -0
- package/dist/theme.js +15 -0
- package/dist/theme.js.map +1 -0
- package/dist/version-DnqajORq.js +83 -0
- package/dist/version-DnqajORq.js.map +1 -0
- package/dist/viewer/ScriptDashboardViewer.d.ts +82 -0
- package/dist/viewer/ScriptDashboardViewerVertical.d.ts +24 -0
- package/dist/viewer/cardMetadata.d.ts +15 -0
- package/dist/viewer/index.d.ts +8 -0
- package/dist/viewer/models.d.ts +67 -0
- package/dist/viewer/useDashboardBundle.d.ts +73 -0
- package/dist/viewer.d.ts +2 -0
- package/dist/viewer.js +9 -0
- package/dist/viewer.js.map +1 -0
- package/package.json +196 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BiClient, BiClientOptions } from './BiClient';
|
|
3
|
+
export interface BiClientProviderProps {
|
|
4
|
+
/** A ready client — or pass `options` and let the provider build one. */
|
|
5
|
+
client?: BiClient;
|
|
6
|
+
options?: BiClientOptions;
|
|
7
|
+
/**
|
|
8
|
+
* Session the inline components (`Chart`, `IFrame`) scope their artifact
|
|
9
|
+
* URLs to when the tool call did not name one. Typically the active chat
|
|
10
|
+
* session id.
|
|
11
|
+
*/
|
|
12
|
+
sessionId?: string;
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare const BiClientProvider: React.FC<BiClientProviderProps>;
|
|
16
|
+
/** The ambient client. Throws with a clear message when no provider is mounted. */
|
|
17
|
+
export declare function useBiClient(): BiClient;
|
|
18
|
+
/** Same as {@link useBiClient} but returns `null` instead of throwing. */
|
|
19
|
+
export declare function useBiClientOptional(): BiClient | null;
|
|
20
|
+
/** The session id the nearest `BiClientProvider` was given, if any. */
|
|
21
|
+
export declare function useBiSessionId(): string | undefined;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { createBiClient, defaultBiRoutes, biDateReviver } from './BiClient';
|
|
2
|
+
export type { BiClient, BiClientOptions, BiRoutes, BiFetch, ArtifactUrlScope, QueryExecutionBody, PagedQueryBody, ExportQueryBody, DashboardActionName, FolderActionName, } from './BiClient';
|
|
3
|
+
export { BiClientProvider, useBiClient, useBiClientOptional, useBiSessionId } from './BiClientProvider';
|
|
4
|
+
export type { BiClientProviderProps } from './BiClientProvider';
|
package/dist/client.d.ts
ADDED
package/dist/client.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { B as s, b as a, c as t, d as B, u as l, a as n, e as o } from "./BiClientProvider-CWJochvi.js";
|
|
2
|
+
export {
|
|
3
|
+
s as BiClientProvider,
|
|
4
|
+
a as biDateReviver,
|
|
5
|
+
t as createBiClient,
|
|
6
|
+
B as defaultBiRoutes,
|
|
7
|
+
l as useBiClient,
|
|
8
|
+
n as useBiClientOptional,
|
|
9
|
+
o as useBiSessionId
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { EnvironmentTarget, GuideStep } from './types';
|
|
2
|
+
/** Class the environment API toggles on highlighted nodes (styled in `composer.css`). */
|
|
3
|
+
export declare const ENV_HIGHLIGHT_CLASS = "llm-env-highlight-active";
|
|
4
|
+
type QueryRoot = Pick<ParentNode, 'querySelectorAll'>;
|
|
5
|
+
export declare function escapeCssValue(value: string): string;
|
|
6
|
+
export declare function looksLikeSelector(value: string): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Every selector an `EnvironmentTarget` may denote, in priority order. A
|
|
9
|
+
* plain identifier fans out to the `data-env-*` attributes first so an
|
|
10
|
+
* LLM naming a card by its `i` finds the sketch node, not a stray class.
|
|
11
|
+
*/
|
|
12
|
+
export declare function toSelectorList(target: EnvironmentTarget): string[];
|
|
13
|
+
/** All nodes matching any selector of `target` under `root` (default `document`). */
|
|
14
|
+
export declare function resolveEnvironmentElements(target: EnvironmentTarget, root?: QueryRoot | null): {
|
|
15
|
+
selectors: string[];
|
|
16
|
+
elements: HTMLElement[];
|
|
17
|
+
};
|
|
18
|
+
export declare function isElementVisible(element: HTMLElement): boolean;
|
|
19
|
+
/** First visible match, else the first match; `includeHidden` skips the visibility test. */
|
|
20
|
+
export declare function pickBestElement(elements: HTMLElement[], includeHidden?: boolean): HTMLElement | null;
|
|
21
|
+
/**
|
|
22
|
+
* The spotlight's resolver: the first VISIBLE element the target denotes,
|
|
23
|
+
* or `null`. Collapsed / zero-size nodes are rejected so a tour never pins
|
|
24
|
+
* itself to something the user cannot see.
|
|
25
|
+
*/
|
|
26
|
+
export declare function resolveGuideElement(target: EnvironmentTarget, root?: QueryRoot | null): HTMLElement | null;
|
|
27
|
+
export declare const PAD_INTERNAL_IDS: ReadonlySet<string>;
|
|
28
|
+
export declare const PAD_INTERNAL_CLASSES: ReadonlySet<string>;
|
|
29
|
+
export declare function targetSuggestsPadInternal(t: EnvironmentTarget): boolean;
|
|
30
|
+
export declare function guideStepsRequireSketch(steps: GuideStep[]): boolean;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ComposerDashboard, SimplePadDefinition } from '../models/sketchModels';
|
|
3
|
+
/**
|
|
4
|
+
* How LLM-emitted code (and the `present_guide` / `present_dashboard_pad`
|
|
5
|
+
* action tools) name a node on the page. A bare string is an identifier
|
|
6
|
+
* looked up as `[data-env-id]`, `[data-env-key]`, `[data-env-name]`, `#id`
|
|
7
|
+
* and `.class`; a string that looks like a CSS selector is used verbatim.
|
|
8
|
+
*/
|
|
9
|
+
export type EnvironmentTarget = string | {
|
|
10
|
+
className?: string;
|
|
11
|
+
identifier?: string;
|
|
12
|
+
selector?: string;
|
|
13
|
+
};
|
|
14
|
+
export interface HighlightOptions {
|
|
15
|
+
durationMs?: number;
|
|
16
|
+
scrollIntoView?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface CloneComponentOptions {
|
|
19
|
+
includeHidden?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface EnvironmentCloneEntry {
|
|
22
|
+
id: string;
|
|
23
|
+
sourceSelector: string;
|
|
24
|
+
html: string;
|
|
25
|
+
source: EnvironmentTarget;
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
createdAt: number;
|
|
29
|
+
}
|
|
30
|
+
export interface CloneComponentResult {
|
|
31
|
+
cloneId: string;
|
|
32
|
+
width: number;
|
|
33
|
+
source: HTMLElement;
|
|
34
|
+
height: number;
|
|
35
|
+
html: string;
|
|
36
|
+
sourceSelector: string;
|
|
37
|
+
/** Ready-to-render clone: hover highlights the original, click forwards to it. */
|
|
38
|
+
component?: React.ReactElement;
|
|
39
|
+
}
|
|
40
|
+
export interface GuideStep {
|
|
41
|
+
target: EnvironmentTarget;
|
|
42
|
+
title?: string;
|
|
43
|
+
description: string;
|
|
44
|
+
placement?: 'top' | 'bottom' | 'left' | 'right' | 'auto';
|
|
45
|
+
}
|
|
46
|
+
export interface GuideOptions {
|
|
47
|
+
onComplete?: () => void;
|
|
48
|
+
overlayOpacity?: number;
|
|
49
|
+
allowInteraction?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The surface the composer exposes to live-TSX blocks (through the chat
|
|
53
|
+
* library's `EnvironmentProvider`) and to the three action tools
|
|
54
|
+
* `createBiUiTools({ environment })` registers. `useComposerEnvironment()`
|
|
55
|
+
* returns one bound to the ambient composer store.
|
|
56
|
+
*/
|
|
57
|
+
export interface DashboardEnvironment {
|
|
58
|
+
/** Adds the highlight class to every match for `durationMs`; returns how many nodes matched. */
|
|
59
|
+
highlightComponent: (target: EnvironmentTarget, options?: HighlightOptions) => number;
|
|
60
|
+
/** Snapshot of the first visible match, with a React clone that proxies hover + click. */
|
|
61
|
+
cloneComponent: (target: EnvironmentTarget, options?: CloneComponentOptions) => CloneComponentResult | null;
|
|
62
|
+
createDashboardPad: (dashboard: ComposerDashboard | SimplePadDefinition) => void;
|
|
63
|
+
updateDashboardPad: (dashboard: ComposerDashboard | SimplePadDefinition) => void;
|
|
64
|
+
refreshDashboard: () => void;
|
|
65
|
+
showGuide: (steps: GuideStep[], options?: GuideOptions) => void;
|
|
66
|
+
dismissGuide: () => void;
|
|
67
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { default as SvgIcon } from '@mui/material/SvgIcon';
|
|
3
|
+
import { CardCategory, CardSpecificType, FilterType } from '../models/sketchModels';
|
|
4
|
+
export type SvgIconComponent = typeof SvgIcon;
|
|
5
|
+
export declare const CATEGORY_ICONS: Record<CardCategory, SvgIconComponent>;
|
|
6
|
+
/** Legacy `SketchCardItem.color` token per category (a name, not a colour). */
|
|
7
|
+
export declare const COLOR_MAP: Record<CardCategory, string>;
|
|
8
|
+
export declare const SPECIFIC_TYPE_ICONS: Record<CardSpecificType, SvgIconComponent>;
|
|
9
|
+
/** `@mui/icons-material` export name per type — what `SketchCardItem.muiIconName` stores. */
|
|
10
|
+
export declare const SPECIFIC_TYPE_ICON_NAMES: Record<CardSpecificType, string>;
|
|
11
|
+
export declare const FILTER_TYPE_ICONS: Record<FilterType, SvgIconComponent>;
|
|
12
|
+
/** The three icon maps the pad draws with. */
|
|
13
|
+
export interface CardTypeIconSet {
|
|
14
|
+
category: Record<CardCategory, SvgIconComponent>;
|
|
15
|
+
specificType: Record<CardSpecificType, SvgIconComponent>;
|
|
16
|
+
filterType: Record<FilterType, SvgIconComponent>;
|
|
17
|
+
}
|
|
18
|
+
export declare const defaultCardTypeIcons: CardTypeIconSet;
|
|
19
|
+
export interface CardTypeIconsProviderProps {
|
|
20
|
+
/** Any subset; unspecified entries keep the MUI defaults. */
|
|
21
|
+
icons: {
|
|
22
|
+
category?: Partial<Record<CardCategory, SvgIconComponent>>;
|
|
23
|
+
specificType?: Partial<Record<CardSpecificType, SvgIconComponent>>;
|
|
24
|
+
filterType?: Partial<Record<FilterType, SvgIconComponent>>;
|
|
25
|
+
};
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
}
|
|
28
|
+
/** Lets a host swap the pad's icons (its own set, or a different MUI style) without forking the pad. */
|
|
29
|
+
export declare const CardTypeIconsProvider: React.FC<CardTypeIconsProviderProps>;
|
|
30
|
+
/** The icon set in scope (MUI defaults when no provider is mounted). */
|
|
31
|
+
export declare function useCardTypeIcons(): CardTypeIconSet;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export { ComposerProvider, useComposer, useComposerStore, useComposerStoreOptional, useComposerEnvironment, environmentFromStore } from './store/ComposerProvider';
|
|
2
|
+
export type { ComposerProviderProps } from './store/ComposerProvider';
|
|
3
|
+
export { createComposerStore, VIEWER_COMMIT_DEBOUNCE_MS, DRAFT_SAVE_DEBOUNCE_MS, GUIDE_SHOW_DELAY_MS } from './store/createComposerStore';
|
|
4
|
+
export type { ComposerState, ComposerStoreApi, CreateComposerStoreOptions, ComposerViewType, ComposerViewport } from './store/createComposerStore';
|
|
5
|
+
export { toDraftPayload, fromUpsertResponse, upsertDashboardDraft, createDashboardDraft } from './store/drafts';
|
|
6
|
+
export type { DraftSeed } from './store/drafts';
|
|
7
|
+
export type { DashboardEnvironment, EnvironmentTarget, HighlightOptions, CloneComponentOptions, CloneComponentResult, EnvironmentCloneEntry, GuideStep, GuideOptions } from './environment/types';
|
|
8
|
+
export { ENV_HIGHLIGHT_CLASS, toSelectorList, resolveEnvironmentElements, resolveGuideElement, pickBestElement, isElementVisible, targetSuggestsPadInternal, guideStepsRequireSketch, PAD_INTERNAL_IDS, PAD_INTERNAL_CLASSES, } from './environment/environmentDom';
|
|
9
|
+
export { DEFAULT_PAD_HEIGHT_PX, joinClientSideChanges } from './models/sketchModels';
|
|
10
|
+
export type { SketchedFilterPad, PadConfig, SimplePadDefinition, ComposerDashboard, PromptDashboardCard, PromptDashboardContainer, PromptDashboardScreenData, PromptDashboardBoxData, DashboardFolder, DashboardFolderHierarchy, DashboardHierarchy, } from './models/sketchModels';
|
|
11
|
+
export { CARD_TYPE_CATALOG, FILTER_TYPE_CATALOG, groupCardCatalog, validateSketch, padConfigToDashboard, isSimplePadDefinition, sketchCardItemComparer, sketchFilterComparer, categoryPrefix } from './models/catalog';
|
|
12
|
+
export type { CardTypeDefinition, FilterTypeDefinition } from './models/catalog';
|
|
13
|
+
export { sanitizeToJsVariable, randomId } from './models/utils';
|
|
14
|
+
export { CATEGORY_ICONS, SPECIFIC_TYPE_ICONS, SPECIFIC_TYPE_ICON_NAMES, FILTER_TYPE_ICONS, COLOR_MAP, defaultCardTypeIcons, CardTypeIconsProvider, useCardTypeIcons } from './icons/cardTypeIcons';
|
|
15
|
+
export type { CardTypeIconSet, CardTypeIconsProviderProps, SvgIconComponent } from './icons/cardTypeIcons';
|
|
16
|
+
export { DashboardPad } from './pad/DashboardPad';
|
|
17
|
+
export type { DashboardPadProps, DashboardPickerRenderArgs } from './pad/DashboardPad';
|
|
18
|
+
export { DashboardPadSketch } from './pad/DashboardPadSketch';
|
|
19
|
+
export type { DashboardPadSketchProps, DashboardPadHandle } from './pad/DashboardPadSketch';
|
|
20
|
+
export { CardSketch, CardScketch } from './pad/CardSketch';
|
|
21
|
+
export type { CardSketchProps } from './pad/CardSketch';
|
|
22
|
+
export { FilterSketch } from './pad/FilterSketch';
|
|
23
|
+
export type { FilterSketchProps } from './pad/FilterSketch';
|
|
24
|
+
export { ToolBox } from './pad/ToolBox';
|
|
25
|
+
export type { ToolBoxProps } from './pad/ToolBox';
|
|
26
|
+
export { DashboardPadEditor } from './pad/DashboardPadEditor';
|
|
27
|
+
export type { DashboardPadEditorProps, DashboardPadEditorHandle, EditorTab, AddMenuItem } from './pad/DashboardPadEditor';
|
|
28
|
+
export { DatasetParameterizationControls } from './pad/DatasetParameterizationControls';
|
|
29
|
+
export type { DatasetParameterizationControlsProps, DatasetOption, AgentOption } from './pad/DatasetParameterizationControls';
|
|
30
|
+
export { TitleSketch, TextSketh, TitleSkath } from './pad/TitleSketch';
|
|
31
|
+
export type { TitleSketchProps } from './pad/TitleSketch';
|
|
32
|
+
export { HoverButton } from './pad/HoverButton';
|
|
33
|
+
export type { HoverButtonProps } from './pad/HoverButton';
|
|
34
|
+
export { ClonedComponent } from './pad/ClonedComponent';
|
|
35
|
+
export type { ClonedComponentProps } from './pad/ClonedComponent';
|
|
36
|
+
export { ExamplePad } from './llm/ExamplePad';
|
|
37
|
+
export type { ExamplePadProps } from './llm/ExamplePad';
|
|
38
|
+
export { ExampleCardSketch, ExampleCardSketh, ExampleCardSkath } from './llm/ExampleCardSketch';
|
|
39
|
+
export type { ExampleCardSketchProps } from './llm/ExampleCardSketch';
|
|
40
|
+
export { PrototypePad } from './llm/PrototypePad';
|
|
41
|
+
export type { PrototypePadProps } from './llm/PrototypePad';
|
|
42
|
+
export { c, dateRange, datePicker, autoComplete, useDashboardPad } from './llm/useDashboardPad';
|
|
43
|
+
export type { CardSize } from './llm/useDashboardPad';
|
|
44
|
+
export { EnvironmentProvider, useEnvironment, useEnvironmentOptional, InertEnvironmentProvider } from '@aintela/chat/components';
|
|
45
|
+
export { ComposerView } from './view/ComposerView';
|
|
46
|
+
export type { ComposerViewProps, ComposerProgressPanelArgs } from './view/ComposerView';
|
|
47
|
+
export { useComposerChatBridge, GRID_ROW_HEIGHT_PX } from './view/useComposerChatBridge';
|
|
48
|
+
export type { ComposerChatBridge, ComposerPromptEnvelope, TurnCompleteInfo } from './view/useComposerChatBridge';
|
|
49
|
+
export { ComposerChatBinding } from './view/ComposerChatBinding';
|
|
50
|
+
export { DrawablePrompt } from './view/DrawablePrompt';
|
|
51
|
+
export type { DrawablePromptProps } from './view/DrawablePrompt';
|
|
52
|
+
export { EntryEmptyState } from './view/EntryEmptyState';
|
|
53
|
+
export type { EntryEmptyStateProps } from './view/EntryEmptyState';
|
|
54
|
+
export { SpotlightOverlay } from './view/SpotlightOverlay';
|
|
55
|
+
export type { SpotlightOverlayProps } from './view/SpotlightOverlay';
|
|
56
|
+
export { DashboardSidePanel } from './view/DashboardSidePanel';
|
|
57
|
+
export type { DashboardSidePanelProps } from './view/DashboardSidePanel';
|
|
58
|
+
export { DashboardPin } from './view/DashboardPin';
|
|
59
|
+
export type { ComposerMode, RecentSessionItem } from './view/composerTypes';
|
|
60
|
+
export { resolveComposerSurfaces } from './view/surfaces';
|
|
61
|
+
export type { ComposerSurfaces } from './view/surfaces';
|
|
62
|
+
export { ambientVariants, ambientVariantsReduced, activityPanelVariants, activityPanelVariantsReduced, composerLayoutTransition, composerLayoutTransitionReduced, } from './view/composerAnimations';
|
|
63
|
+
export { defaultComposerSuggestions } from './view/data/suggestions';
|
|
64
|
+
export type { ComposerSuggestion } from './view/data/suggestions';
|
|
65
|
+
export { defaultComposerTemplates, STARTER_TEMPLATES, TEMPLATE_KIND_TO_SKETCH, templateKinds, seedFromTemplate } from './view/data/templates';
|
|
66
|
+
export type { ComposerTemplate, TemplateCardKind, TemplateCellSeed } from './view/data/templates';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
import { CardCategory, CardSpecificType } from '../models/sketchModels';
|
|
4
|
+
export interface ExampleCardSketchProps {
|
|
5
|
+
description?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
sx?: SxProps<Theme>;
|
|
9
|
+
category?: CardCategory;
|
|
10
|
+
specificType?: CardSpecificType;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Descriptor-style card preview the agent places in an `ExamplePad`
|
|
14
|
+
* (`[name] - description` with the type icon). `padConfigToDashboard`
|
|
15
|
+
* reads its props back when the pad is turned into a sketch.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ExampleCardSketch: React.FC<ExampleCardSketchProps>;
|
|
18
|
+
/** @deprecated legacy spelling the agent instructions still emit — use {@link ExampleCardSketch}. */
|
|
19
|
+
export declare const ExampleCardSketh: React.FC<ExampleCardSketchProps>;
|
|
20
|
+
/** @deprecated legacy spelling — use {@link ExampleCardSketch}. */
|
|
21
|
+
export declare const ExampleCardSkath: React.FC<ExampleCardSketchProps>;
|
|
22
|
+
export default ExampleCardSketch;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PadConfig } from '../models/sketchModels';
|
|
3
|
+
export interface ExamplePadProps {
|
|
4
|
+
/** Optional surface colour for the pad (a theme token is used when omitted). */
|
|
5
|
+
backgroundColor?: string;
|
|
6
|
+
/** Width of the pad inside its frame (default `'80%'`). */
|
|
7
|
+
width?: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
config: PadConfig[];
|
|
10
|
+
zoom?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The agent's sketch preview inside the chat: a 12-column grid of
|
|
14
|
+
* `PadConfig` cells at a reduced zoom. Metric / gauge cells render at a
|
|
15
|
+
* fixed 100px; everything else at its configured height.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ExamplePad: React.FC<ExamplePadProps>;
|
|
18
|
+
export default ExamplePad;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PadConfig } from '../models/sketchModels';
|
|
3
|
+
export interface PrototypePadProps {
|
|
4
|
+
/** Optional surface colour (a theme token is used when omitted). */
|
|
5
|
+
backgroundColor?: string;
|
|
6
|
+
width?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
config: PadConfig[];
|
|
9
|
+
zoom?: number;
|
|
10
|
+
}
|
|
11
|
+
/** Like `ExamplePad`, but for REAL card components: each cell gets its configured height and a 500px cap. */
|
|
12
|
+
export declare const PrototypePad: React.FC<PrototypePadProps>;
|
|
13
|
+
export default PrototypePad;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CardSpecificType, PadConfig, SimplePadDefinition, SketchedFilterPad } from '../models/sketchModels';
|
|
3
|
+
export type CardSize = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
4
|
+
/**
|
|
5
|
+
* Builds one pad cell. Three forms:
|
|
6
|
+
* - `c(size, height, name, specificType, description?)` → an `ExampleCardSketch` preview.
|
|
7
|
+
* - `c(size, height, name, specificType, node)` → metadata kept, `node` drawn.
|
|
8
|
+
* - `c(size, height, node)` → just the node, no metadata.
|
|
9
|
+
*/
|
|
10
|
+
export declare function c(size: CardSize, height: number, node: React.ReactNode): PadConfig;
|
|
11
|
+
export declare function c(size: CardSize, height: number, name: string, specificType: CardSpecificType, description?: string): PadConfig;
|
|
12
|
+
export declare function c(size: CardSize, height: number, name: string, specificType: CardSpecificType, node: React.ReactElement): PadConfig;
|
|
13
|
+
/** Date-range filter (mandatory by default) — the most common one. */
|
|
14
|
+
export declare const dateRange: (i: string, name: string) => SketchedFilterPad;
|
|
15
|
+
/** Single-date filter. */
|
|
16
|
+
export declare const datePicker: (i: string, name: string, mandatory?: boolean) => SketchedFilterPad;
|
|
17
|
+
/** Auto-complete filter (single or multiple selection). */
|
|
18
|
+
export declare const autoComplete: (i: string, name: string, multiple?: boolean, mandatory?: boolean) => SketchedFilterPad;
|
|
19
|
+
/**
|
|
20
|
+
* Pushes `def` into the host's sketch pad on mount, through the ambient
|
|
21
|
+
* `DashboardEnvironment` (`EnvironmentProvider value={useComposerEnvironment()}`).
|
|
22
|
+
* Inside a replayed message the chat library's `InertEnvironmentProvider`
|
|
23
|
+
* turns this into a no-op.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useDashboardPad(def: SimplePadDefinition, type: 'update' | 'create'): void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CardCategory, CardSpecificType, ComposerDashboard, FilterType, SimplePadDefinition, SketchCardItem, SketchedFilter } from './sketchModels';
|
|
2
|
+
export interface CardTypeDefinition {
|
|
3
|
+
label: string;
|
|
4
|
+
category: CardCategory;
|
|
5
|
+
specificType: CardSpecificType;
|
|
6
|
+
}
|
|
7
|
+
/** Every card type the pad's pickers offer, in display order. Labels are the product's Portuguese. */
|
|
8
|
+
export declare const CARD_TYPE_CATALOG: readonly CardTypeDefinition[];
|
|
9
|
+
/** The catalog grouped by category (insertion order preserved) — what the pickers render. */
|
|
10
|
+
export declare function groupCardCatalog(catalog?: readonly CardTypeDefinition[]): Record<string, CardTypeDefinition[]>;
|
|
11
|
+
export interface FilterTypeDefinition {
|
|
12
|
+
label: string;
|
|
13
|
+
filterType: FilterType;
|
|
14
|
+
}
|
|
15
|
+
export declare const FILTER_TYPE_CATALOG: readonly FilterTypeDefinition[];
|
|
16
|
+
export declare const sketchCardItemComparer: (a: SketchCardItem, b: SketchCardItem) => boolean;
|
|
17
|
+
export declare const sketchFilterComparer: (a: SketchedFilter, b: SketchedFilter) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Pre-compose validation: clears every card's `todoItem` and returns the
|
|
20
|
+
* (Portuguese) error message when the sketch cannot be sent — duplicate
|
|
21
|
+
* card names, or no card at all. `null` when it is fine.
|
|
22
|
+
*/
|
|
23
|
+
export declare function validateSketch(dash: ComposerDashboard): string | null;
|
|
24
|
+
/**
|
|
25
|
+
* Converts a `SimplePadDefinition` (flat linear config) into a dashboard
|
|
26
|
+
* document using a 12-column flow-fill. Card metadata is read from the
|
|
27
|
+
* config item first and from an `ExampleCardSketch` element's props second.
|
|
28
|
+
*/
|
|
29
|
+
export declare function padConfigToDashboard(def: SimplePadDefinition): ComposerDashboard;
|
|
30
|
+
/** `true` for the flat pad shape (`{ config: [...] }`), `false` for a dashboard document. */
|
|
31
|
+
export declare function isSimplePadDefinition(d: unknown): d is SimplePadDefinition;
|
|
32
|
+
/** Next unique auto-name for a category (`chart3`, `kpi1`, …) given how many exist. */
|
|
33
|
+
export declare function categoryPrefix(category: CardCategory): string;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CardCategory, CardSpecificType, Dashboard, SketchCardItem } from '../../viewer/models';
|
|
3
|
+
import { FilterType, SketchedFilter } from '../../filters/filterFactory';
|
|
4
|
+
export type { CardCategory, CardSpecificType, Dashboard, SketchCardItem, FilterType, SketchedFilter };
|
|
5
|
+
export declare const DEFAULT_PAD_HEIGHT_PX = 300;
|
|
6
|
+
/** A sketched filter as the C# `JsSimplePadDefinition.Filters` emits it — always carries its parameter names. */
|
|
7
|
+
export interface SketchedFilterPad extends SketchedFilter {
|
|
8
|
+
parametersNames: string[];
|
|
9
|
+
}
|
|
10
|
+
/** A single item in a pad layout (used by `ExamplePad`, `PrototypePad` and `SimplePadDefinition`). */
|
|
11
|
+
export interface PadConfig {
|
|
12
|
+
/** Column span (1–12). */
|
|
13
|
+
size: number;
|
|
14
|
+
/** Card height in pixels. Applied as CSS in `ExamplePad`; converted to grid units in `padConfigToDashboard`. */
|
|
15
|
+
height?: number;
|
|
16
|
+
/** The card content — any React node. Use `ExampleCardSketch` for descriptor-style previews, or a custom component. */
|
|
17
|
+
card: React.ReactNode;
|
|
18
|
+
/** Metadata used by `padConfigToDashboard` when `card` is a custom node (name / type cannot be read from props). */
|
|
19
|
+
id?: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
specificType?: CardSpecificType;
|
|
22
|
+
description?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Single source of truth for `ExamplePad` visuals + `env.createDashboardPad()`.
|
|
26
|
+
* `filters` is the wider {@link SketchedFilterPad} because the runtime objects
|
|
27
|
+
* emitted by the server always include `parametersNames`.
|
|
28
|
+
*/
|
|
29
|
+
export interface SimplePadDefinition {
|
|
30
|
+
id?: string;
|
|
31
|
+
name: string;
|
|
32
|
+
filters?: SketchedFilterPad[];
|
|
33
|
+
config: PadConfig[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The dashboard document as the composer edits it: the viewer's `Dashboard`
|
|
37
|
+
* plus the transient, per-turn `clientSideChanges` accumulator. The
|
|
38
|
+
* accumulator is NEVER persisted (`toDraftPayload` strips it); it is
|
|
39
|
+
* flattened into the prompt by `joinClientSideChanges` and cleared after.
|
|
40
|
+
*/
|
|
41
|
+
export interface ComposerDashboard extends Dashboard {
|
|
42
|
+
/**
|
|
43
|
+
* Keyed by `entity:id:operation` (`card:abc:layout`, `filter:xyz:edit`,
|
|
44
|
+
* `dashboard:name`) so repeated edits to one entity collapse to one entry.
|
|
45
|
+
*/
|
|
46
|
+
clientSideChanges?: Record<string, string>;
|
|
47
|
+
}
|
|
48
|
+
/** Bullet list the agent receives; `undefined` when there is nothing to say. */
|
|
49
|
+
export declare function joinClientSideChanges(map: Record<string, string> | undefined): string | undefined;
|
|
50
|
+
export interface PromptDashboardBoxData {
|
|
51
|
+
widthPx: number;
|
|
52
|
+
heightPx: number;
|
|
53
|
+
}
|
|
54
|
+
export interface PromptDashboardScreenData {
|
|
55
|
+
chatBox?: PromptDashboardBoxData;
|
|
56
|
+
dashboardPreviewBox?: PromptDashboardBoxData;
|
|
57
|
+
dashboardVisualizationBox?: PromptDashboardBoxData;
|
|
58
|
+
gridRowHeightPixelsPerUnit: number;
|
|
59
|
+
gridColumnWidthPixelsPerUnit: number;
|
|
60
|
+
gridColumnWidthPixelsPerUnitFullView: number;
|
|
61
|
+
notes?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface PromptDashboardCard extends SketchCardItem {
|
|
64
|
+
widthPx?: number;
|
|
65
|
+
heightPx?: number;
|
|
66
|
+
}
|
|
67
|
+
/** What every composer prompt carries besides the user's text (mirrors the C# `ClientDashboardMessage`). */
|
|
68
|
+
export interface PromptDashboardContainer {
|
|
69
|
+
id: string;
|
|
70
|
+
name: string;
|
|
71
|
+
cards: PromptDashboardCard[];
|
|
72
|
+
filters: SketchedFilter[];
|
|
73
|
+
layoutType?: 'Naked' | 'Boxed';
|
|
74
|
+
remarks?: string;
|
|
75
|
+
userPrompt?: string;
|
|
76
|
+
screenData?: PromptDashboardScreenData;
|
|
77
|
+
filterValues?: Record<string, unknown>;
|
|
78
|
+
isDatasetParameterized?: boolean;
|
|
79
|
+
defaultDatasetName?: string;
|
|
80
|
+
/** `joinClientSideChanges(dashboard.clientSideChanges)`. */
|
|
81
|
+
clientSideChanges?: string;
|
|
82
|
+
}
|
|
83
|
+
export interface DashboardFolder {
|
|
84
|
+
id: string;
|
|
85
|
+
name: string;
|
|
86
|
+
description?: string | null;
|
|
87
|
+
createdAt?: Date | null;
|
|
88
|
+
updatedAt?: Date | null;
|
|
89
|
+
userId?: string | null;
|
|
90
|
+
accountId?: string | null;
|
|
91
|
+
}
|
|
92
|
+
export interface DashboardFolderHierarchy extends DashboardFolder {
|
|
93
|
+
dashboards: Dashboard[];
|
|
94
|
+
}
|
|
95
|
+
export interface DashboardHierarchy {
|
|
96
|
+
userFolders: DashboardFolderHierarchy[];
|
|
97
|
+
companyFolders: DashboardFolderHierarchy[];
|
|
98
|
+
userRootDashboards: Dashboard[];
|
|
99
|
+
companyRootDashboards: Dashboard[];
|
|
100
|
+
/** Admin-published "Padrão" dashboards — `userId` and `accountId` both null. */
|
|
101
|
+
defaultDashboards: Dashboard[];
|
|
102
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sanitizes an arbitrary string into a valid JS/TS identifier. Separators
|
|
3
|
+
* (spaces, dashes, dots, …) become camelCase boundaries, diacritics are
|
|
4
|
+
* folded to ASCII, a leading digit gets an underscore. Mirrors the C#
|
|
5
|
+
* sanitizer the server applies to card keys.
|
|
6
|
+
*/
|
|
7
|
+
export declare function sanitizeToJsVariable(name: string): string;
|
|
8
|
+
/** A random id (RFC 4122 v4 when `crypto.randomUUID` exists, a hex fallback otherwise). */
|
|
9
|
+
export declare function randomId(): string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TodoItem } from '@aintela/chat/models';
|
|
3
|
+
import { SketchCardItem } from '../models/sketchModels';
|
|
4
|
+
export interface CardSketchProps {
|
|
5
|
+
cellConfig: SketchCardItem;
|
|
6
|
+
todoItem?: TodoItem;
|
|
7
|
+
turnOpen?: boolean;
|
|
8
|
+
onDelete?: (cardKey: string) => void;
|
|
9
|
+
onDataEdit: (data: SketchCardItem) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Draws the description when not editing. Default: plain text with line
|
|
12
|
+
* breaks preserved. The legacy pad rendered Markdown — pass
|
|
13
|
+
* `(text) => <Markdown>{text}</Markdown>` to keep that.
|
|
14
|
+
*/
|
|
15
|
+
renderDescription?: (text: string) => React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* One card on the sketch: type icon (opens the type picker), click-to-edit
|
|
19
|
+
* name and description, delete, and — while a turn is open — the agent's
|
|
20
|
+
* todo status overlaid on the card.
|
|
21
|
+
*/
|
|
22
|
+
export declare const CardSketch: React.FC<CardSketchProps>;
|
|
23
|
+
/** @deprecated legacy spelling — use {@link CardSketch}. */
|
|
24
|
+
export declare const CardScketch: React.FC<CardSketchProps>;
|
|
25
|
+
export default CardSketch;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CloneComponentResult, EnvironmentTarget } from '../environment/types';
|
|
3
|
+
export interface ClonedComponentProps {
|
|
4
|
+
entry: CloneComponentResult;
|
|
5
|
+
/** Fired on hover with the clone's source selector — the store's `highlightComponent`. */
|
|
6
|
+
onHover?: (target: EnvironmentTarget) => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The inline mirror `env.cloneComponent()` hands back to a live-TSX block:
|
|
10
|
+
* hovering highlights the original node on the page, clicking clicks it.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ClonedComponent: React.FC<ClonedComponentProps>;
|
|
13
|
+
export default ClonedComponent;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ComposerDashboard, Dashboard, DashboardHierarchy } from '../models/sketchModels';
|
|
3
|
+
export interface DashboardPickerRenderArgs {
|
|
4
|
+
hierarchy: DashboardHierarchy | null;
|
|
5
|
+
loading: boolean;
|
|
6
|
+
selectedDashboardId: string | null;
|
|
7
|
+
onSelect: (dashboard: Dashboard) => void;
|
|
8
|
+
}
|
|
9
|
+
export interface DashboardPadProps {
|
|
10
|
+
/** Chat session the draft is bound to (`originalSessionId`). */
|
|
11
|
+
sessionId: string;
|
|
12
|
+
/** Load this dashboard into the pad on mount / when it changes. */
|
|
13
|
+
dashboardId?: string;
|
|
14
|
+
turnOpen: boolean;
|
|
15
|
+
/** "Compose": the validated sketch, ready to be sent to the agent. */
|
|
16
|
+
onCompose?: (dashboardDefinition: ComposerDashboard) => void;
|
|
17
|
+
/** After a save / load / new. */
|
|
18
|
+
onChange?: (sketchDashboard: ComposerDashboard) => void;
|
|
19
|
+
onBack?: () => void;
|
|
20
|
+
/**
|
|
21
|
+
* The "Abrir" picker body (the legacy `DashboardListViewer` lives in the
|
|
22
|
+
* host app). Without it the Abrir button is not rendered.
|
|
23
|
+
*/
|
|
24
|
+
renderDashboardPicker?: (args: DashboardPickerRenderArgs) => React.ReactNode;
|
|
25
|
+
/** Debug panel with the sketch JSON. */
|
|
26
|
+
showDebug?: boolean;
|
|
27
|
+
headerExtra?: React.ReactNode;
|
|
28
|
+
renderDescription?: (text: string) => React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The V1 pad: toolbar (Sketch/Dashboard toggle, `ToolBox`, Novo / Salvar /
|
|
32
|
+
* Atualizar / Abrir / Compose) over a `DashboardPadSketch`, or over a
|
|
33
|
+
* `ScriptDashboardViewer` of the published dashboard in Dashboard view.
|
|
34
|
+
* Needs a `ComposerProvider`; the REST calls go through the ambient
|
|
35
|
+
* `BiClient` (buttons that need one are hidden without it).
|
|
36
|
+
*/
|
|
37
|
+
export declare const DashboardPad: React.FC<DashboardPadProps>;
|
|
38
|
+
export default DashboardPad;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
export interface EditorTab {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
contentType: string;
|
|
6
|
+
sourceId?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface AddMenuItem {
|
|
9
|
+
label: string;
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
contentType: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
dividerBefore?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface DashboardPadEditorHandle {
|
|
16
|
+
focusTab: (tabName: string) => void;
|
|
17
|
+
createTab: (contentType?: string, name?: string) => string;
|
|
18
|
+
closeTab: (tabName: string) => void;
|
|
19
|
+
getActiveTab: () => EditorTab | null;
|
|
20
|
+
getTabs: () => EditorTab[];
|
|
21
|
+
}
|
|
22
|
+
export interface DashboardPadEditorProps {
|
|
23
|
+
defaultContentType?: string;
|
|
24
|
+
addMenuItems?: AddMenuItem[];
|
|
25
|
+
renderContent: (tab: EditorTab) => ReactNode;
|
|
26
|
+
renderTabIcon?: (tab: EditorTab) => ReactNode;
|
|
27
|
+
onTabChange?: (tab: EditorTab) => void;
|
|
28
|
+
onTabClose?: (tab: EditorTab) => void;
|
|
29
|
+
onTabCreate?: (tab: EditorTab) => void;
|
|
30
|
+
onTabRename?: (tab: EditorTab, previousName: string) => void;
|
|
31
|
+
tabs?: EditorTab[];
|
|
32
|
+
}
|
|
33
|
+
/** Multi-tab shell (rename on double-click, close, "+" with an optional typed menu); every panel stays mounted. */
|
|
34
|
+
export declare const DashboardPadEditor: React.ForwardRefExoticComponent<DashboardPadEditorProps & React.RefAttributes<DashboardPadEditorHandle>>;
|
|
35
|
+
export default DashboardPadEditor;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CardCategory, CardSpecificType, FilterType } from '../models/sketchModels';
|
|
3
|
+
export interface DashboardPadSketchProps {
|
|
4
|
+
/** Forces the width observer to re-measure when it changes. */
|
|
5
|
+
renderId?: string;
|
|
6
|
+
/** Hide the in-sketch filter chip row (the V2 composer shows filters in its rail instead). */
|
|
7
|
+
hideFiltersInSketch?: boolean;
|
|
8
|
+
/** Hide the built-in top bar (dashboard name + Boxed/Naked toggle). */
|
|
9
|
+
hideInternalHeader?: boolean;
|
|
10
|
+
zoomLevel?: number;
|
|
11
|
+
/** The empty-state CTA ("Clique aqui para adicionar um novo card"). */
|
|
12
|
+
onAddCard?: () => void;
|
|
13
|
+
/** Extra controls in the internal header (the legacy admin dataset / agent block). */
|
|
14
|
+
headerExtra?: React.ReactNode;
|
|
15
|
+
/** Forwarded to every `CardSketch`. */
|
|
16
|
+
renderDescription?: (text: string) => React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
/** What `DashboardPad` / the composer rail drive through a ref. */
|
|
19
|
+
export interface DashboardPadHandle {
|
|
20
|
+
addGenericCell: () => void;
|
|
21
|
+
addTypedCell: (category: CardCategory, specificType: CardSpecificType, label: string) => void;
|
|
22
|
+
handleAddFilter: (filterType: FilterType) => void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The sketch surface: a `GridLayout` of `CardSketch` cells plus the filter
|
|
26
|
+
* chips and (optionally) the name / layout header. Reads and writes the
|
|
27
|
+
* ambient composer store; every user gesture also records a
|
|
28
|
+
* `clientSideChanges` hint for the agent.
|
|
29
|
+
*/
|
|
30
|
+
export declare const DashboardPadSketch: React.ForwardRefExoticComponent<DashboardPadSketchProps & React.RefAttributes<DashboardPadHandle>>;
|
|
31
|
+
export default DashboardPadSketch;
|