@infotrust/ui 0.0.0-stage → 0.30.1
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/LICENSE +24 -0
- package/NOTICE.md +37 -0
- package/README.md +53 -2
- package/dist/assistant-session-DP4_70Xk.js +1381 -0
- package/dist/command-Bjncx7YR.js +1279 -0
- package/dist/components/actions/ItActionMenu.vue.d.ts +24 -0
- package/dist/components/actions/ItDecisionToggle.vue.d.ts +22 -0
- package/dist/components/actions/ItIconButton.vue.d.ts +24 -0
- package/dist/components/actions/ItLinkButton.vue.d.ts +17 -0
- package/dist/components/actions/action-menu.d.ts +19 -0
- package/dist/components/charts/ItBarChart.vue.d.ts +121 -0
- package/dist/components/charts/ItCalendarChart.vue.d.ts +80 -0
- package/dist/components/charts/ItChartLegend.vue.d.ts +47 -0
- package/dist/components/charts/ItChartTable.vue.d.ts +16 -0
- package/dist/components/charts/ItChartTooltip.vue.d.ts +52 -0
- package/dist/components/charts/ItDonutChart.vue.d.ts +79 -0
- package/dist/components/charts/ItProportionBar.vue.d.ts +42 -0
- package/dist/components/charts/ItSparkline.vue.d.ts +42 -0
- package/dist/components/charts/ItTrendChart.vue.d.ts +80 -0
- package/dist/components/charts/chart.d.ts +84 -0
- package/dist/components/charts/selection.d.ts +14 -0
- package/dist/components/charts/skeleton.d.ts +16 -0
- package/dist/components/command/ItAssistantPanel.vue.d.ts +56 -0
- package/dist/components/command/ItAssistantThread.vue.d.ts +73 -0
- package/dist/components/command/ItCommandPalette.vue.d.ts +102 -0
- package/dist/components/command/ItMarkdown.vue.d.ts +12 -0
- package/dist/components/command/assistant-session.d.ts +26 -0
- package/dist/components/command/command.d.ts +127 -0
- package/dist/components/command/markdown.d.ts +55 -0
- package/dist/components/content/ItDocsArticle.vue.d.ts +18 -0
- package/dist/components/content/ItDocsLayout.vue.d.ts +29 -0
- package/dist/components/content/ItDocsPager.vue.d.ts +12 -0
- package/dist/components/content/ItProse.vue.d.ts +18 -0
- package/dist/components/content/docs.d.ts +23 -0
- package/dist/components/dag/ItDagCanvas.vue.d.ts +143 -0
- package/dist/components/dag/ItDagControls.vue.d.ts +2 -0
- package/dist/components/dag/ItDagEdge.vue.d.ts +21 -0
- package/dist/components/dag/ItDagLibrary.vue.d.ts +19 -0
- package/dist/components/dag/ItDagNode.vue.d.ts +20 -0
- package/dist/components/dag/dag.d.ts +182 -0
- package/dist/components/dag/history.d.ts +51 -0
- package/dist/components/dag/layout.d.ts +54 -0
- package/dist/components/dag/route.d.ts +24 -0
- package/dist/components/data/DataError.vue.d.ts +12 -0
- package/dist/components/data/ItChangeList.vue.d.ts +48 -0
- package/dist/components/data/ItCodeBlock.vue.d.ts +23 -0
- package/dist/components/data/ItDataTable.vue.d.ts +135 -0
- package/dist/components/data/ItDataToolbar.vue.d.ts +57 -0
- package/dist/components/data/ItDescriptionList.vue.d.ts +30 -0
- package/dist/components/data/ItEmptyState.vue.d.ts +22 -0
- package/dist/components/data/ItKpiCard.vue.d.ts +89 -0
- package/dist/components/data/ItKpiDetail.vue.d.ts +40 -0
- package/dist/components/data/ItKpiGrid.vue.d.ts +19 -0
- package/dist/components/data/ItObjectName.vue.d.ts +64 -0
- package/dist/components/data/ItPaginator.vue.d.ts +46 -0
- package/dist/components/data/ItResourceList.vue.d.ts +39 -0
- package/dist/components/data/ItResourceListItem.vue.d.ts +40 -0
- package/dist/components/data/ItSkeleton.vue.d.ts +14 -0
- package/dist/components/data/ItTablePaginator.vue.d.ts +34 -0
- package/dist/components/data/ItTime.vue.d.ts +13 -0
- package/dist/components/data/ItTreeTable.vue.d.ts +109 -0
- package/dist/components/data/TableChevron.vue.d.ts +8 -0
- package/dist/components/data/TableExpansion.vue.d.ts +22 -0
- package/dist/components/data/column-sizing.d.ts +31 -0
- package/dist/components/data/data-table.d.ts +15 -0
- package/dist/components/data/highlight-worker.d.ts +1 -0
- package/dist/components/data/highlight.d.ts +3 -0
- package/dist/components/data/kpi-placement.d.ts +40 -0
- package/dist/components/data/kpi.d.ts +16 -0
- package/dist/components/data/sticky-header.d.ts +9 -0
- package/dist/components/data/table-skeleton.d.ts +11 -0
- package/dist/components/data/table-source.d.ts +77 -0
- package/dist/components/data/tree-table-public.d.ts +17 -0
- package/dist/components/data/tree-table.d.ts +30 -0
- package/dist/components/feedback/ItCallout.vue.d.ts +25 -0
- package/dist/components/feedback/ItConfirmHost.vue.d.ts +2 -0
- package/dist/components/feedback/ItOverlayHost.vue.d.ts +2 -0
- package/dist/components/feedback/ItProgressBar.vue.d.ts +19 -0
- package/dist/components/feedback/ItToastHost.vue.d.ts +2 -0
- package/dist/components/forms/FieldClearButton.vue.d.ts +11 -0
- package/dist/components/forms/ItAutoComplete.vue.d.ts +69 -0
- package/dist/components/forms/ItCheckboxGroup.vue.d.ts +27 -0
- package/dist/components/forms/ItChipInput.vue.d.ts +32 -0
- package/dist/components/forms/ItCodeEditor.vue.d.ts +64 -0
- package/dist/components/forms/ItDatePicker.vue.d.ts +35 -0
- package/dist/components/forms/ItFileDrop.vue.d.ts +47 -0
- package/dist/components/forms/ItFilterChip.vue.d.ts +13 -0
- package/dist/components/forms/ItFilterMenu.vue.d.ts +37 -0
- package/dist/components/forms/ItFilterPopover.vue.d.ts +44 -0
- package/dist/components/forms/ItFormActions.vue.d.ts +14 -0
- package/dist/components/forms/ItFormField.vue.d.ts +44 -0
- package/dist/components/forms/ItFormRows.vue.d.ts +50 -0
- package/dist/components/forms/ItFormSection.vue.d.ts +28 -0
- package/dist/components/forms/ItLabelCell.vue.d.ts +42 -0
- package/dist/components/forms/ItLabelPicker.vue.d.ts +34 -0
- package/dist/components/forms/ItMultiSelect.vue.d.ts +53 -0
- package/dist/components/forms/ItOptionCardGroup.vue.d.ts +35 -0
- package/dist/components/forms/ItRadioGroup.vue.d.ts +29 -0
- package/dist/components/forms/ItSearchInput.vue.d.ts +25 -0
- package/dist/components/forms/ItSegmentedControl.vue.d.ts +25 -0
- package/dist/components/forms/ItSelect.vue.d.ts +50 -0
- package/dist/components/forms/ItSwitch.vue.d.ts +31 -0
- package/dist/components/forms/ItTabs.vue.d.ts +27 -0
- package/dist/components/forms/OptionSourceSlot.vue.d.ts +13 -0
- package/dist/components/forms/choice.d.ts +24 -0
- package/dist/components/forms/code-editor.d.ts +17 -0
- package/dist/components/forms/field-context.d.ts +39 -0
- package/dist/components/forms/file-drop.d.ts +19 -0
- package/dist/components/forms/form-errors.d.ts +7 -0
- package/dist/components/forms/form-rows.d.ts +8 -0
- package/dist/components/forms/option-source.d.ts +39 -0
- package/dist/components/forms/virtual-options.d.ts +12 -0
- package/dist/components/layout/ItBreadcrumb.vue.d.ts +12 -0
- package/dist/components/layout/ItDetailSection.vue.d.ts +21 -0
- package/dist/components/layout/ItPage.vue.d.ts +44 -0
- package/dist/components/layout/ItPanel.vue.d.ts +47 -0
- package/dist/components/layout/ItSectionNav.vue.d.ts +43 -0
- package/dist/components/layout/ItWizard.vue.d.ts +57 -0
- package/dist/components/layout/ItWizardSteps.vue.d.ts +15 -0
- package/dist/components/layout/SectionNavLinks.vue.d.ts +15 -0
- package/dist/components/layout/panel.d.ts +18 -0
- package/dist/components/layout/section-nav.d.ts +17 -0
- package/dist/components/layout/wizard.d.ts +13 -0
- package/dist/components/logic/ItFieldPicker.vue.d.ts +40 -0
- package/dist/components/logic/ItLogicBuilder.vue.d.ts +58 -0
- package/dist/components/logic/ItLogicCondition.vue.d.ts +9 -0
- package/dist/components/logic/ItLogicGroup.vue.d.ts +9 -0
- package/dist/components/logic/ItOperatorSelect.vue.d.ts +25 -0
- package/dist/components/logic/ItValueInput.vue.d.ts +29 -0
- package/dist/components/logic/logic.d.ts +263 -0
- package/dist/components/logic/region.d.ts +44 -0
- package/dist/components/overlays/ItDrawer.vue.d.ts +48 -0
- package/dist/components/overlays/ItModal.vue.d.ts +53 -0
- package/dist/components/overlays/escape-stack.d.ts +7 -0
- package/dist/components/overlays/modal.d.ts +23 -0
- package/dist/components/shell/ItAppShell.vue.d.ts +68 -0
- package/dist/components/shell/ItCommandTrigger.vue.d.ts +17 -0
- package/dist/components/shell/ItOrgSwitcher.vue.d.ts +26 -0
- package/dist/components/shell/ItShellMenuItem.vue.d.ts +18 -0
- package/dist/components/shell/ItShellNavBranch.vue.d.ts +15 -0
- package/dist/components/shell/ItShellNavLink.vue.d.ts +18 -0
- package/dist/components/shell/ItShellSidebarButton.vue.d.ts +15 -0
- package/dist/components/shell/ItThemeControl.vue.d.ts +13 -0
- package/dist/components/shell/org.d.ts +36 -0
- package/dist/components/shell/types.d.ts +67 -0
- package/dist/components/status/ItBadge.vue.d.ts +12 -0
- package/dist/components/status/ItEntityTypeChip.vue.d.ts +14 -0
- package/dist/components/status/ItLabelChip.vue.d.ts +21 -0
- package/dist/components/status/ItLabelChipList.vue.d.ts +27 -0
- package/dist/components/status/ItPlatformChip.vue.d.ts +20 -0
- package/dist/components/status/ItPlatformLogo.vue.d.ts +17 -0
- package/dist/components/status/ItSeverityBadge.vue.d.ts +9 -0
- package/dist/components/status/ItStatus.vue.d.ts +12 -0
- package/dist/components.css +1 -0
- package/dist/composables/iconMotion.d.ts +12 -0
- package/dist/composables/ripple.d.ts +3 -0
- package/dist/composables/useItConfirm.d.ts +16 -0
- package/dist/composables/useItCopy.d.ts +4 -0
- package/dist/composables/useItCursorPager.d.ts +50 -0
- package/dist/composables/useItTheme.d.ts +26 -0
- package/dist/composables/useItToast.d.ts +24 -0
- package/dist/dag.d.ts +5 -0
- package/dist/dag.js +1754 -0
- package/dist/dev-D7A7MIn_.js +1264 -0
- package/dist/directives/truncate.d.ts +29 -0
- package/dist/elk-worker.min-O2A22ecl.js +6321 -0
- package/dist/format/index.d.ts +53 -0
- package/dist/highlight-worker-DIrLC7a2.js +25 -0
- package/dist/index.d.ts +147 -0
- package/dist/index.js +11989 -0
- package/dist/licenses/@vue-flow__core.LICENSE +20 -0
- package/dist/licenses/elkjs.LICENSE.md +263 -0
- package/dist/licenses/highlight.js.LICENSE +29 -0
- package/dist/licenses/vue-sonner.LICENSE +21 -0
- package/dist/platform-art-Bt1CnaKE.js +86 -0
- package/dist/plugin.d.ts +69 -0
- package/dist/registries/entity-type.d.ts +18 -0
- package/dist/registries/platform-art.d.ts +2 -0
- package/dist/registries/platform-marks.d.ts +12 -0
- package/dist/registries/platform.d.ts +22 -0
- package/dist/registries/severity.d.ts +23 -0
- package/dist/registries/status.d.ts +13 -0
- package/dist/styles.css +26 -0
- package/dist/text-nGkJYA88.js +470 -0
- package/dist/utils/chip-truncation.d.ts +8 -0
- package/dist/utils/chunk-recovery.d.ts +24 -0
- package/dist/utils/dev.d.ts +2 -0
- package/dist/utils/listeners.d.ts +10 -0
- package/dist/utils/router.d.ts +9 -0
- package/dist/utils/scroll.d.ts +8 -0
- package/dist/utils/select.d.ts +21 -0
- package/dist/utils/text.d.ts +6 -0
- package/package.json +91 -3
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type ItChartDate, type ItChartSeries, type ItValueFormatter } from './chart';
|
|
2
|
+
export interface ItTrendPoint {
|
|
3
|
+
x: ItChartDate;
|
|
4
|
+
/** `null` leaves a gap in the line (no scan that day). */
|
|
5
|
+
y: number | null;
|
|
6
|
+
}
|
|
7
|
+
export interface ItTrendSeries extends ItChartSeries {
|
|
8
|
+
points: ItTrendPoint[];
|
|
9
|
+
}
|
|
10
|
+
export interface ItChartAnnotation {
|
|
11
|
+
/** The date of the event (a vertical marker). */
|
|
12
|
+
x: ItChartDate;
|
|
13
|
+
/** End date: shades the span from `x` to `x2` instead of a single line. */
|
|
14
|
+
x2?: ItChartDate;
|
|
15
|
+
/** Short text: "Scan rules changed". */
|
|
16
|
+
label: string;
|
|
17
|
+
}
|
|
18
|
+
type __VLS_Props = {
|
|
19
|
+
series: ItTrendSeries[];
|
|
20
|
+
/** What is plotted, with its period: "Open findings, last 30 days". Starts the accessible summary and names the table. */
|
|
21
|
+
label: string;
|
|
22
|
+
/** Replaces the generated accessible summary. */
|
|
23
|
+
summary?: string;
|
|
24
|
+
/** The smallest total height in px, including the date axis. The chart grows to fill a taller panel. */
|
|
25
|
+
height?: number;
|
|
26
|
+
/** Area wash under the lines. Defaults to on for a single series. */
|
|
27
|
+
area?: boolean;
|
|
28
|
+
annotations?: ItChartAnnotation[];
|
|
29
|
+
/** Noun after values in the readout: "findings". */
|
|
30
|
+
unit?: string;
|
|
31
|
+
/** Value formatter (readout, table, end label). Defaults to formatCount. */
|
|
32
|
+
formatValue?: ItValueFormatter;
|
|
33
|
+
/** Date formatter for ticks, readout, and table. Defaults to formatDate ("Oct 9"). */
|
|
34
|
+
formatX?: (time: number) => string;
|
|
35
|
+
/** Skeleton on first load; on refetch the previous render dims instead. */
|
|
36
|
+
loading?: boolean;
|
|
37
|
+
/** The data did not load: a danger callout in place of the chart (a string says why). Retry with a `@retry` listener; `#error` replaces it. */
|
|
38
|
+
error?: string | boolean;
|
|
39
|
+
emptyTitle?: string;
|
|
40
|
+
emptyDescription?: string;
|
|
41
|
+
/** Keys of hidden series (`v-model:hidden`). The legend toggles them. */
|
|
42
|
+
hidden?: string[];
|
|
43
|
+
/** `table` shows the data table in place of the plot. */
|
|
44
|
+
view?: 'chart' | 'table';
|
|
45
|
+
};
|
|
46
|
+
declare var __VLS_1: {
|
|
47
|
+
message: string;
|
|
48
|
+
retry: () => void;
|
|
49
|
+
};
|
|
50
|
+
type __VLS_Slots = {} & {
|
|
51
|
+
error?: (props: typeof __VLS_1) => any;
|
|
52
|
+
};
|
|
53
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
54
|
+
retry: () => any;
|
|
55
|
+
"update:hidden": (keys: string[]) => any;
|
|
56
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
57
|
+
onRetry?: (() => any) | undefined;
|
|
58
|
+
"onUpdate:hidden"?: ((keys: string[]) => any) | undefined;
|
|
59
|
+
}>, {
|
|
60
|
+
area: boolean;
|
|
61
|
+
summary: string;
|
|
62
|
+
error: string | boolean;
|
|
63
|
+
height: number;
|
|
64
|
+
view: "chart" | "table";
|
|
65
|
+
loading: boolean;
|
|
66
|
+
unit: string;
|
|
67
|
+
hidden: string[];
|
|
68
|
+
emptyTitle: string;
|
|
69
|
+
emptyDescription: string;
|
|
70
|
+
annotations: ItChartAnnotation[];
|
|
71
|
+
formatValue: ItValueFormatter;
|
|
72
|
+
formatX: (time: number) => string;
|
|
73
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
74
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
75
|
+
export default _default;
|
|
76
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
77
|
+
new (): {
|
|
78
|
+
$slots: S;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
/** Status tones a series may wear when it *means* a state (critical, passed). */
|
|
3
|
+
export type ItChartTone = 'danger' | 'warning' | 'info' | 'success' | 'neutral';
|
|
4
|
+
/**
|
|
5
|
+
* One series (or stacked segment) in a chart. Color follows the series'
|
|
6
|
+
* position in its array (`--it-color-chart-1…6`, in order) unless `tone`
|
|
7
|
+
* maps it onto a status color. Hiding a series never repaints the others.
|
|
8
|
+
*/
|
|
9
|
+
export interface ItChartSeries {
|
|
10
|
+
key: string;
|
|
11
|
+
label: string;
|
|
12
|
+
/** Use only when the series means a state (severity, pass/fail). Never mix tones and categorical series in one chart. */
|
|
13
|
+
tone?: ItChartTone;
|
|
14
|
+
}
|
|
15
|
+
/** Number of categorical slots in the token set. */
|
|
16
|
+
export declare const CHART_SLOTS = 6;
|
|
17
|
+
/**
|
|
18
|
+
* CSS color for a series: the status solid for a tone, otherwise the
|
|
19
|
+
* categorical slot for its index. Slots are never cycled or generated; past
|
|
20
|
+
* the sixth series every extra series shares slot 6 (fold the tail into an
|
|
21
|
+
* "Other" series instead).
|
|
22
|
+
*/
|
|
23
|
+
export declare function chartColor(index: number, tone?: ItChartTone): string;
|
|
24
|
+
/** The single-series fill: slot 1 by default, or a status tone. */
|
|
25
|
+
export declare function singleColor(tone?: ItChartTone | 'default'): string;
|
|
26
|
+
/**
|
|
27
|
+
* A "nice" step near `rough`: 1, 2, 2.5, or 5 times a power of ten. With
|
|
28
|
+
* `integer`, steps stay whole numbers (counts never get a 2.5 tick).
|
|
29
|
+
*/
|
|
30
|
+
export declare function niceStep(rough: number, integer?: boolean): number;
|
|
31
|
+
/**
|
|
32
|
+
* Evenly spaced round ticks that cover [min, max] with about `count`
|
|
33
|
+
* intervals. The first tick is ≤ min and the last ≥ max, so the domain of a
|
|
34
|
+
* chart is `[ticks[0], ticks.at(-1)]`. An empty or flat range gets one step.
|
|
35
|
+
*/
|
|
36
|
+
export declare function niceTicks(min: number, max: number, count?: number, integer?: boolean): number[];
|
|
37
|
+
/** Maps a domain onto a range linearly. A zero-width domain maps to the range start. */
|
|
38
|
+
export declare function scaleLinear(domain: [number, number], range: [number, number]): (value: number) => number;
|
|
39
|
+
/**
|
|
40
|
+
* Indices of the x labels to show: `max` of them, the first and the last
|
|
41
|
+
* included, spread evenly between, so the last label sits as far from its
|
|
42
|
+
* neighbour as every other pair does.
|
|
43
|
+
*/
|
|
44
|
+
export declare function tickIndices(count: number, max: number): number[];
|
|
45
|
+
/** Nearest index in a sorted list of positions. */
|
|
46
|
+
export declare function nearestIndex(positions: number[], target: number): number;
|
|
47
|
+
/** Approximate rendered width of a 13px Poppins label, for reserving axis room. */
|
|
48
|
+
export declare function textWidth(text: string): number;
|
|
49
|
+
export type ItChartDate = Date | string | number;
|
|
50
|
+
/**
|
|
51
|
+
* Milliseconds for a chart x value. A bare `YYYY-MM-DD` string is a local
|
|
52
|
+
* calendar day (not UTC midnight), so "2026-10-01" never renders as Sep 30.
|
|
53
|
+
*/
|
|
54
|
+
export declare function toTime(value: ItChartDate): number;
|
|
55
|
+
/** Default x formatter: `formatDate` ("Oct 9"). */
|
|
56
|
+
export declare function formatChartDate(time: number): string;
|
|
57
|
+
export type ItValueFormatter = (value: number) => string;
|
|
58
|
+
export declare const defaultFormat: ItValueFormatter;
|
|
59
|
+
/** "412 findings" or "412" when there is no unit. */
|
|
60
|
+
export declare function withUnit(text: string, unit?: string): string;
|
|
61
|
+
/** First and last finite values of a list, or null when it has none. */
|
|
62
|
+
export declare function endpoints(values: Array<number | null | undefined>): {
|
|
63
|
+
first: number;
|
|
64
|
+
last: number;
|
|
65
|
+
} | null;
|
|
66
|
+
/** "1,284 → 1,012" for a series, or "no data". */
|
|
67
|
+
export declare function trendPhrase(values: Array<number | null | undefined>, format?: ItValueFormatter): string;
|
|
68
|
+
export declare function sum(values: Array<number | null | undefined>): number;
|
|
69
|
+
/** Share of a total as a whole percent ("12%"); totals of zero give "0%". */
|
|
70
|
+
export declare function sharePercent(value: number, total: number): string;
|
|
71
|
+
/** --it-duration-slow on `el`, in ms (250 when the token is not loaded). The browser may report it in seconds (".25s"). */
|
|
72
|
+
export declare function slowMs(el: Element | null | undefined): number;
|
|
73
|
+
/**
|
|
74
|
+
* Whether the page lays out, so a zero width means the chart is not shown
|
|
75
|
+
* (display: none, a hidden tab). A DOM without layout (a test DOM) reads
|
|
76
|
+
* every width as zero; there a draw-in never waits to be shown.
|
|
77
|
+
*/
|
|
78
|
+
export declare function pageLaysOut(): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Whether prefers-reduced-motion is on, kept current when the setting
|
|
81
|
+
* changes (as the CSS motion rules are). Call it in a component's setup; the
|
|
82
|
+
* listener goes when the component unmounts.
|
|
83
|
+
*/
|
|
84
|
+
export declare function useReducedMotion(): Readonly<Ref<boolean>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Shared controlled toggle semantics for bar and donut drill-down. */
|
|
2
|
+
export declare function useChartSelection(props: {
|
|
3
|
+
selectable?: boolean;
|
|
4
|
+
selected?: readonly string[];
|
|
5
|
+
}): {
|
|
6
|
+
isSelected: (item: {
|
|
7
|
+
key: string;
|
|
8
|
+
}) => boolean;
|
|
9
|
+
pressed: (item: {
|
|
10
|
+
key: string;
|
|
11
|
+
}) => "true" | "false" | undefined;
|
|
12
|
+
};
|
|
13
|
+
/** Arrow keys and Home / End share the bar chart's bounded navigation. */
|
|
14
|
+
export declare function chartStep(key: string, current: number, last: number): number | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Horizontal bars, largest first: the shape `sort="value"` gives. */
|
|
2
|
+
export declare const SKELETON_BAR_WIDTHS: string[];
|
|
3
|
+
/** Horizontal bars in their given order. */
|
|
4
|
+
export declare const SKELETON_BAR_WIDTHS_UNSORTED: string[];
|
|
5
|
+
/** Category labels: short names of different lengths, in px. */
|
|
6
|
+
export declare const SKELETON_LABEL_WIDTHS: number[];
|
|
7
|
+
/** Vertical columns, as a share of the plot height: the Suite's uneven trend placeholder. */
|
|
8
|
+
export declare const SKELETON_COLUMN_HEIGHTS: number[];
|
|
9
|
+
/** Grid lines from the top of the plot, in percent; the last is the baseline. */
|
|
10
|
+
export declare const SKELETON_GRID: number[];
|
|
11
|
+
/** Rows a skeleton draws: the data's own count when the app already knows it, else `fallback`. */
|
|
12
|
+
export declare function skeletonCount(known: number, fallback: number, max: number): number;
|
|
13
|
+
/** `clip-path` for a line of `thickness` px along the wave, at any plot size. */
|
|
14
|
+
export declare function skeletonLineClip(thickness?: number): string;
|
|
15
|
+
/** `clip-path` for the area under the wave, down to the baseline. */
|
|
16
|
+
export declare function skeletonAreaClip(): string;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ItAssistantSession } from './assistant-session';
|
|
2
|
+
import { type ItAssistantAction, type ItAssistantStarter } from './command';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
session: ItAssistantSession;
|
|
5
|
+
title?: string;
|
|
6
|
+
/** A line under the title: what the assistant can do here, or what it is doing now. */
|
|
7
|
+
status?: string;
|
|
8
|
+
/** Shown, with the starters, while the thread is empty. */
|
|
9
|
+
intro?: string;
|
|
10
|
+
starters?: readonly ItAssistantStarter[];
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
/** Show Close (emits `close`). */
|
|
13
|
+
closable?: boolean;
|
|
14
|
+
/** Follows a link inside the app. */
|
|
15
|
+
navigate?: (href: string) => void;
|
|
16
|
+
};
|
|
17
|
+
type __VLS_Slots = {
|
|
18
|
+
/** Controls in the header, before New thread (an app's "Undo the assistant's changes"). */
|
|
19
|
+
actions?: () => unknown;
|
|
20
|
+
attachment?: (scope: {
|
|
21
|
+
attachment: unknown;
|
|
22
|
+
}) => unknown;
|
|
23
|
+
action?: (scope: {
|
|
24
|
+
action: ItAssistantAction;
|
|
25
|
+
review: () => void;
|
|
26
|
+
}) => unknown;
|
|
27
|
+
error?: (scope: {
|
|
28
|
+
message: string;
|
|
29
|
+
details: unknown;
|
|
30
|
+
retry: () => void;
|
|
31
|
+
}) => unknown;
|
|
32
|
+
};
|
|
33
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
|
|
34
|
+
focus: () => void | undefined;
|
|
35
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
36
|
+
close: () => any;
|
|
37
|
+
review: (action: ItAssistantAction) => any;
|
|
38
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
39
|
+
onClose?: (() => any) | undefined;
|
|
40
|
+
onReview?: ((action: ItAssistantAction) => any) | undefined;
|
|
41
|
+
}>, {
|
|
42
|
+
title: string;
|
|
43
|
+
placeholder: string;
|
|
44
|
+
status: string;
|
|
45
|
+
closable: boolean;
|
|
46
|
+
navigate: (href: string) => void;
|
|
47
|
+
starters: readonly ItAssistantStarter[];
|
|
48
|
+
intro: string;
|
|
49
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
50
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
51
|
+
export default _default;
|
|
52
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
53
|
+
new (): {
|
|
54
|
+
$slots: S;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type ItAssistantAction } from './command';
|
|
2
|
+
export interface ItThreadTool {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
state: 'running' | 'done' | 'error';
|
|
6
|
+
detail?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ItThreadMessage {
|
|
9
|
+
id: string;
|
|
10
|
+
role: 'user' | 'assistant';
|
|
11
|
+
text: string;
|
|
12
|
+
tools: ItThreadTool[];
|
|
13
|
+
attachments: unknown[];
|
|
14
|
+
action?: ItAssistantAction;
|
|
15
|
+
/** What went wrong, said so the person can act. */
|
|
16
|
+
error?: string;
|
|
17
|
+
/** The app's own detail for the error (an error id, a request): the `error` slot gets it. */
|
|
18
|
+
errorDetails?: unknown;
|
|
19
|
+
/** The reply has finished arriving. */
|
|
20
|
+
done: boolean;
|
|
21
|
+
/** The person stopped the reply: it ends where it was, marked "Stopped". */
|
|
22
|
+
stopped?: boolean;
|
|
23
|
+
}
|
|
24
|
+
type __VLS_Props = {
|
|
25
|
+
messages: readonly ItThreadMessage[];
|
|
26
|
+
/** A reply is on its way: the send button stops it. */
|
|
27
|
+
busy: boolean;
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
/** Follows a link inside the app. */
|
|
30
|
+
navigate?: (href: string) => void;
|
|
31
|
+
};
|
|
32
|
+
type __VLS_Slots = {
|
|
33
|
+
/** Something a reply carries beyond text (a label graph, a chart). */
|
|
34
|
+
attachment?: (scope: {
|
|
35
|
+
attachment: unknown;
|
|
36
|
+
}) => unknown;
|
|
37
|
+
/** Replaces the draft card. */
|
|
38
|
+
action?: (scope: {
|
|
39
|
+
action: ItAssistantAction;
|
|
40
|
+
review: () => void;
|
|
41
|
+
}) => unknown;
|
|
42
|
+
/** Replaces the error callout: the app's own error view, with its details and a way to try again. */
|
|
43
|
+
error?: (scope: {
|
|
44
|
+
message: string;
|
|
45
|
+
details: unknown;
|
|
46
|
+
retry: () => void;
|
|
47
|
+
}) => unknown;
|
|
48
|
+
};
|
|
49
|
+
/** The palette moves focus here when the thread opens. */
|
|
50
|
+
declare function focus(): void;
|
|
51
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
|
|
52
|
+
focus: typeof focus;
|
|
53
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
54
|
+
stop: () => any;
|
|
55
|
+
review: (action: ItAssistantAction) => any;
|
|
56
|
+
send: (text: string) => any;
|
|
57
|
+
retry: () => any;
|
|
58
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
59
|
+
onStop?: (() => any) | undefined;
|
|
60
|
+
onReview?: ((action: ItAssistantAction) => any) | undefined;
|
|
61
|
+
onSend?: ((text: string) => any) | undefined;
|
|
62
|
+
onRetry?: (() => any) | undefined;
|
|
63
|
+
}>, {
|
|
64
|
+
placeholder: string;
|
|
65
|
+
navigate: (href: string) => void;
|
|
66
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
67
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
68
|
+
export default _default;
|
|
69
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
70
|
+
new (): {
|
|
71
|
+
$slots: S;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { type ItAssistantSession } from './assistant-session';
|
|
2
|
+
import { type ItAssistantAction, type ItAssistantClient, type ItAssistantStarter, type ItCommandItem, type ItCommandSource } from './command';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
visible: boolean;
|
|
5
|
+
/** What search looks in, one section each, in this order. */
|
|
6
|
+
sources: readonly ItCommandSource[];
|
|
7
|
+
/** "Jump to" places shown with an empty query. */
|
|
8
|
+
jumpTo?: readonly ItCommandItem[];
|
|
9
|
+
/** "Ask the assistant" starters shown with an empty query. */
|
|
10
|
+
starters?: readonly ItAssistantStarter[];
|
|
11
|
+
/** The app's assistant. Without it (and without `session`) the palette searches only. */
|
|
12
|
+
assistant?: ItAssistantClient | null;
|
|
13
|
+
/**
|
|
14
|
+
* The app's conversation (createItAssistantSession), when it shows the
|
|
15
|
+
* same conversation elsewhere too, such as a panel docked beside a canvas.
|
|
16
|
+
* Without it the palette keeps its own, with `assistant`.
|
|
17
|
+
*/
|
|
18
|
+
session?: ItAssistantSession | null;
|
|
19
|
+
/** The assistant's name in the thread header: "Assistant". */
|
|
20
|
+
assistantName?: string;
|
|
21
|
+
/** The footer's credit: "Powered by the Suite assistant". */
|
|
22
|
+
poweredBy?: string;
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
/** The thread's message box placeholder. */
|
|
25
|
+
askPlaceholder?: string;
|
|
26
|
+
/** The review view's title (with the `review` region): "Review draft". */
|
|
27
|
+
reviewTitle?: string;
|
|
28
|
+
/** Prevent review exit while saving. */
|
|
29
|
+
reviewBusy?: boolean;
|
|
30
|
+
/** Return false to keep the edited draft. Rejections also keep it open. */
|
|
31
|
+
beforeReviewLeave?: (reason: 'back' | 'close') => boolean | Promise<boolean>;
|
|
32
|
+
/** Milliseconds a remote source waits after typing. */
|
|
33
|
+
debounce?: number;
|
|
34
|
+
};
|
|
35
|
+
/** What the review regions get: the draft, the way back to the conversation, and `done` (new thread, then close). */
|
|
36
|
+
interface ReviewScope {
|
|
37
|
+
action: ItAssistantAction;
|
|
38
|
+
back: () => void;
|
|
39
|
+
done: () => void;
|
|
40
|
+
}
|
|
41
|
+
type __VLS_Slots = {
|
|
42
|
+
/** Something a reply carries beyond text. */
|
|
43
|
+
attachment?: (scope: {
|
|
44
|
+
attachment: unknown;
|
|
45
|
+
}) => unknown;
|
|
46
|
+
/** Replaces the "Ready for review" card. */
|
|
47
|
+
action?: (scope: {
|
|
48
|
+
action: ItAssistantAction;
|
|
49
|
+
review: () => void;
|
|
50
|
+
}) => unknown;
|
|
51
|
+
/** Replaces a failed reply's callout: the app's error view, with its details and a way to try again. */
|
|
52
|
+
error?: (scope: {
|
|
53
|
+
message: string;
|
|
54
|
+
details: unknown;
|
|
55
|
+
retry: () => void;
|
|
56
|
+
}) => unknown;
|
|
57
|
+
/** The app's review of a draft, inside the palette. With it, Review opens this view. */
|
|
58
|
+
review?: (scope: ReviewScope) => unknown;
|
|
59
|
+
/** Controls in the review view's header, before Close (Undo, Save). */
|
|
60
|
+
'review-actions'?: (scope: ReviewScope) => unknown;
|
|
61
|
+
/** A failed search source, independent of assistant errors. */
|
|
62
|
+
'source-error'?: (scope: {
|
|
63
|
+
source: ItCommandSource;
|
|
64
|
+
error: unknown;
|
|
65
|
+
retry: () => void;
|
|
66
|
+
}) => unknown;
|
|
67
|
+
};
|
|
68
|
+
/** Starts over: stops a reply, empties the thread, and gives the next question a new conversation id. */
|
|
69
|
+
declare function newThread(): void;
|
|
70
|
+
declare function backToSearch(): Promise<void>;
|
|
71
|
+
declare function close(): Promise<void>;
|
|
72
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
|
|
73
|
+
newThread: typeof newThread;
|
|
74
|
+
showSearch: typeof backToSearch;
|
|
75
|
+
requestClose: typeof close;
|
|
76
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
77
|
+
select: (item: ItCommandItem) => any;
|
|
78
|
+
"update:visible": (visible: boolean) => any;
|
|
79
|
+
review: (action: ItAssistantAction) => any;
|
|
80
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
81
|
+
onSelect?: ((item: ItCommandItem) => any) | undefined;
|
|
82
|
+
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
83
|
+
onReview?: ((action: ItAssistantAction) => any) | undefined;
|
|
84
|
+
}>, {
|
|
85
|
+
placeholder: string;
|
|
86
|
+
debounce: number;
|
|
87
|
+
assistant: ItAssistantClient | null;
|
|
88
|
+
jumpTo: readonly ItCommandItem[];
|
|
89
|
+
starters: readonly ItAssistantStarter[];
|
|
90
|
+
session: ItAssistantSession | null;
|
|
91
|
+
assistantName: string;
|
|
92
|
+
poweredBy: string;
|
|
93
|
+
askPlaceholder: string;
|
|
94
|
+
reviewTitle: string;
|
|
95
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
96
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
97
|
+
export default _default;
|
|
98
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
99
|
+
new (): {
|
|
100
|
+
$slots: S;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
source: string;
|
|
3
|
+
/** The text is still arriving: draw code plain. */
|
|
4
|
+
streaming?: boolean;
|
|
5
|
+
/** Follows a link inside the app ("/rules/RI-1N93"). Without it, the browser follows it. */
|
|
6
|
+
navigate?: (href: string) => void;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
|
+
navigate: (href: string) => void;
|
|
10
|
+
streaming: boolean;
|
|
11
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import type { ItThreadMessage } from './ItAssistantThread.vue';
|
|
3
|
+
import type { ItAssistantClient } from './command';
|
|
4
|
+
export interface ItAssistantSession {
|
|
5
|
+
/** The conversation, oldest first. Replace it, never mutate it. */
|
|
6
|
+
readonly messages: Ref<ItThreadMessage[]>;
|
|
7
|
+
/** A reply is on its way. */
|
|
8
|
+
readonly busy: Ref<boolean>;
|
|
9
|
+
/** Characters each reply has typed out: the thread keeps its place when it remounts. */
|
|
10
|
+
readonly shown: Ref<Record<string, number>>;
|
|
11
|
+
/** The id that keys the conversation on the server; New thread changes it. */
|
|
12
|
+
readonly conversationId: Ref<string>;
|
|
13
|
+
/** Asks the next question (ignored while a reply is on its way). */
|
|
14
|
+
send(text: string): Promise<void>;
|
|
15
|
+
/** Ends the reply at once: the composer is free, and whatever the client still sends is dropped. */
|
|
16
|
+
stop(): void;
|
|
17
|
+
/** Tries the last question again: drops the failed reply, every bubble of it, and asks once more. */
|
|
18
|
+
retry(): void;
|
|
19
|
+
/** Starts over: stops a reply, empties the thread, and gives the next question a new conversation id. */
|
|
20
|
+
newThread(): void;
|
|
21
|
+
}
|
|
22
|
+
type ClientSource = ItAssistantClient | null | undefined | (() => ItAssistantClient | null | undefined);
|
|
23
|
+
export declare function newItConversationId(): string;
|
|
24
|
+
/** A conversation with the app's assistant. Pass a function when the client can change (another organization). */
|
|
25
|
+
export declare function createItAssistantSession(client: ClientSource): ItAssistantSession;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { Component, InjectionKey, Ref } from 'vue';
|
|
2
|
+
import type { ItRouteLocation } from '../../utils/router';
|
|
3
|
+
/** One result: a page, an asset, a rule, an org. Selecting it navigates (`to`, `href`) or runs (`run`). */
|
|
4
|
+
export interface ItCommandItem {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
/** One muted line under the label: what it is, where it lives. */
|
|
8
|
+
meta?: string;
|
|
9
|
+
/** A Lucide icon for the kind of item. */
|
|
10
|
+
icon?: Component;
|
|
11
|
+
/** A platform key: its ItPlatformLogo stands in for the icon. */
|
|
12
|
+
platform?: string;
|
|
13
|
+
/** The kind, in one word at the row's end: "Page", "Asset", "Rule". */
|
|
14
|
+
badge?: string;
|
|
15
|
+
/** A route (vue-router, an optional peer) to open. */
|
|
16
|
+
to?: ItRouteLocation;
|
|
17
|
+
/** A URL to open when there is no `to`. */
|
|
18
|
+
href?: string;
|
|
19
|
+
/** Runs instead of navigating (switch org, toggle a setting). */
|
|
20
|
+
run?: () => void | Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
/** One group of results: a section with a heading. */
|
|
23
|
+
export interface ItCommandSource {
|
|
24
|
+
key: string;
|
|
25
|
+
/** The section heading: "Pages", "Assets". */
|
|
26
|
+
label: string;
|
|
27
|
+
/** Most rows shown. Default 5. */
|
|
28
|
+
limit?: number;
|
|
29
|
+
/**
|
|
30
|
+
* A server search: the palette waits `debounce` ms after typing, shows
|
|
31
|
+
* skeleton rows while it runs, drops an answer to an older query, and stops
|
|
32
|
+
* asking once a query found nothing and the person keeps typing past it.
|
|
33
|
+
*/
|
|
34
|
+
remote?: boolean;
|
|
35
|
+
/** Characters needed before this source searches. Default 1. */
|
|
36
|
+
minLength?: number;
|
|
37
|
+
search: (query: string, context: {
|
|
38
|
+
signal: AbortSignal;
|
|
39
|
+
}) => readonly ItCommandItem[] | Promise<readonly ItCommandItem[]>;
|
|
40
|
+
}
|
|
41
|
+
/** A starter shown under "Ask the assistant" when the query is empty. */
|
|
42
|
+
export interface ItAssistantStarter {
|
|
43
|
+
label: string;
|
|
44
|
+
/** The question it asks. Shown as the row's meta. */
|
|
45
|
+
prompt: string;
|
|
46
|
+
}
|
|
47
|
+
/** A draft the assistant made, for the app to review and save (a rule, an audit, a label change). */
|
|
48
|
+
export interface ItAssistantAction {
|
|
49
|
+
/** "Governance rule: Consent mode on EU containers". */
|
|
50
|
+
title: string;
|
|
51
|
+
/** Why, in one or two sentences. */
|
|
52
|
+
reasoning?: string;
|
|
53
|
+
/** The app's own payload. */
|
|
54
|
+
data?: unknown;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* What a streaming assistant reports. An app maps its own stream (NDJSON, SSE) onto these.
|
|
58
|
+
*
|
|
59
|
+
* One answer can take several turns of the model (it reads, runs tools, reads
|
|
60
|
+
* again): `message` closes the current reply bubble and starts the next one,
|
|
61
|
+
* so each turn's steps sit above its own words. `text-set` replaces the
|
|
62
|
+
* current bubble's text, for a stream that sends a final, cleaned-up text.
|
|
63
|
+
* `error` may carry `details` for the app's own error view (the `error` slot).
|
|
64
|
+
*/
|
|
65
|
+
export type ItAssistantEvent = {
|
|
66
|
+
type: 'thinking';
|
|
67
|
+
} | {
|
|
68
|
+
type: 'message';
|
|
69
|
+
} | {
|
|
70
|
+
type: 'text';
|
|
71
|
+
delta: string;
|
|
72
|
+
} | {
|
|
73
|
+
type: 'text-set';
|
|
74
|
+
text: string;
|
|
75
|
+
} | {
|
|
76
|
+
type: 'tool-start';
|
|
77
|
+
id: string;
|
|
78
|
+
label: string;
|
|
79
|
+
} | {
|
|
80
|
+
type: 'tool-done';
|
|
81
|
+
id: string;
|
|
82
|
+
summary?: string;
|
|
83
|
+
} | {
|
|
84
|
+
type: 'tool-error';
|
|
85
|
+
id: string;
|
|
86
|
+
error: string;
|
|
87
|
+
} | {
|
|
88
|
+
type: 'attachment';
|
|
89
|
+
attachment: unknown;
|
|
90
|
+
} | {
|
|
91
|
+
type: 'action';
|
|
92
|
+
action: ItAssistantAction;
|
|
93
|
+
} | {
|
|
94
|
+
type: 'error';
|
|
95
|
+
message: string;
|
|
96
|
+
details?: unknown;
|
|
97
|
+
};
|
|
98
|
+
export interface ItAssistantMessage {
|
|
99
|
+
role: 'user' | 'assistant';
|
|
100
|
+
content: string;
|
|
101
|
+
}
|
|
102
|
+
/** The app's assistant: it streams one answer, and may route an unclear query. */
|
|
103
|
+
export interface ItAssistantClient {
|
|
104
|
+
/** Streams the answer to the last user message through `emit`. Resolve when it ends; honor `signal` (Stop, close). */
|
|
105
|
+
send(request: {
|
|
106
|
+
messages: ItAssistantMessage[];
|
|
107
|
+
conversationId: string;
|
|
108
|
+
signal: AbortSignal;
|
|
109
|
+
}, emit: (event: ItAssistantEvent) => void): Promise<void>;
|
|
110
|
+
/** A query the local rules cannot place: search or ask? (The Suite asks a small model, with a 4 s budget.) */
|
|
111
|
+
route?: (query: string, signal: AbortSignal) => Promise<'search' | 'ask'>;
|
|
112
|
+
}
|
|
113
|
+
export type ItQueryIntent = 'search' | 'ask' | 'ambiguous';
|
|
114
|
+
/**
|
|
115
|
+
* Search or ask, from the words alone (no model, no cost): an id or two words
|
|
116
|
+
* is a search; a question, seven words, or "draft a …" is a question for the
|
|
117
|
+
* assistant; the rest is unclear (the app's `route` may decide it).
|
|
118
|
+
*/
|
|
119
|
+
export declare function itClassifyQuery(query: string): ItQueryIntent;
|
|
120
|
+
/** Case-insensitive match on any of the words: "label" in "Labels" or its meta. */
|
|
121
|
+
export declare function itMatchesQuery(query: string, ...texts: (string | undefined)[]): boolean;
|
|
122
|
+
/**
|
|
123
|
+
* How much of each reply the thread has typed out, by message id. The palette
|
|
124
|
+
* provides it, so the count outlives the thread: a reopened palette shows a
|
|
125
|
+
* reply where the person left it instead of typing it again.
|
|
126
|
+
*/
|
|
127
|
+
export declare const IT_THREAD_SHOWN: InjectionKey<Ref<Record<string, number>>>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export type ItMdInline = {
|
|
2
|
+
type: 'text';
|
|
3
|
+
text: string;
|
|
4
|
+
} | {
|
|
5
|
+
type: 'strong';
|
|
6
|
+
children: ItMdInline[];
|
|
7
|
+
} | {
|
|
8
|
+
type: 'em';
|
|
9
|
+
children: ItMdInline[];
|
|
10
|
+
} | {
|
|
11
|
+
type: 'code';
|
|
12
|
+
text: string;
|
|
13
|
+
} | {
|
|
14
|
+
type: 'link';
|
|
15
|
+
href: string;
|
|
16
|
+
children: ItMdInline[];
|
|
17
|
+
};
|
|
18
|
+
export type ItMdBlock = {
|
|
19
|
+
type: 'heading';
|
|
20
|
+
level: 1 | 2 | 3 | 4;
|
|
21
|
+
children: ItMdInline[];
|
|
22
|
+
} | {
|
|
23
|
+
type: 'paragraph';
|
|
24
|
+
children: ItMdInline[];
|
|
25
|
+
} | {
|
|
26
|
+
type: 'list';
|
|
27
|
+
ordered: boolean;
|
|
28
|
+
start: number;
|
|
29
|
+
items: ItMdInline[][];
|
|
30
|
+
} | {
|
|
31
|
+
type: 'quote';
|
|
32
|
+
children: ItMdBlock[];
|
|
33
|
+
} | {
|
|
34
|
+
type: 'code';
|
|
35
|
+
language: string;
|
|
36
|
+
code: string;
|
|
37
|
+
closed: boolean;
|
|
38
|
+
} | {
|
|
39
|
+
type: 'table';
|
|
40
|
+
head: ItMdInline[][];
|
|
41
|
+
rows: ItMdInline[][][];
|
|
42
|
+
} | {
|
|
43
|
+
type: 'rule';
|
|
44
|
+
};
|
|
45
|
+
/** Links that may be followed: the web, mail, and paths inside the app. Anything else (javascript:, data:) stays text. */
|
|
46
|
+
export declare function itSafeHref(href: string): string | null;
|
|
47
|
+
export declare function itParseInline(text: string): ItMdInline[];
|
|
48
|
+
export declare function itParseMarkdown(source: string): ItMdBlock[];
|
|
49
|
+
/**
|
|
50
|
+
* itParseMarkdown for text that grows at its end (a streaming reply): each
|
|
51
|
+
* call reads again only from the last blocks, and returns the earlier blocks
|
|
52
|
+
* as the same objects, so their drawing can be kept. Any other change reads
|
|
53
|
+
* the whole text. The result always equals itParseMarkdown(source).
|
|
54
|
+
*/
|
|
55
|
+
export declare function itMarkdownReader(): (source: string) => ItMdBlock[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ItDocsSection } from './docs';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
sections: readonly ItDocsSection[];
|
|
4
|
+
loading?: boolean;
|
|
5
|
+
/** Names the zoom dialog when a screenshot has no alt text. */
|
|
6
|
+
imageLabel?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
navigate: (href: string, event: MouseEvent) => any;
|
|
10
|
+
"copy-link": (id: string) => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
onNavigate?: ((href: string, event: MouseEvent) => any) | undefined;
|
|
13
|
+
"onCopy-link"?: ((id: string) => any) | undefined;
|
|
14
|
+
}>, {
|
|
15
|
+
loading: boolean;
|
|
16
|
+
imageLabel: string;
|
|
17
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
export default _default;
|