@revolist/ui 4.0.3-rc → 4.0.5-rc
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/OWNERSHIP.md +1 -1
- package/README.md +16 -0
- package/_chunks/arrow-up-Cw8hW9vp.js +4 -0
- package/_chunks/badge.view-D30pMUfi.js +14 -0
- package/_chunks/calculator-CDWOuAcp.js +4 -0
- package/_chunks/{calendar-xpZ0v3xf.js → calendar-DsXIhybL.js} +19 -19
- package/_chunks/chart-frame-CuZABXVI.js +141 -0
- package/_chunks/check-BwI7iCAm.js +4 -0
- package/_chunks/choice-chips-BhP8MZjs.js +126 -0
- package/_chunks/{color-palette-D8vyPfld.js → color-palette-DMJUChWC.js} +20 -22
- package/_chunks/color-picker-B4TQvxxB.js +143 -0
- package/_chunks/{component-C_T2VN5u.js → component-qKctqdzk.js} +281 -265
- package/_chunks/configurator-actions-C19O1rda.js +155 -0
- package/_chunks/configurator-field-icon-CmcM_sPs.js +53 -0
- package/_chunks/{control-AHKXD5Eu.js → control-BkWukVt9.js} +13 -13
- package/_chunks/{controls-DsNi8V8I.js → controls-BLQnWEd7.js} +147 -155
- package/_chunks/{date-control-DrVFX13g.js → date-control-Cgw5PwlZ.js} +1 -1
- package/_chunks/date-time-B8rK5gpC.js +784 -0
- package/_chunks/{dialog.parts-CKGkC5zP.js → dialog.parts-BSbvnEwX.js} +21 -21
- package/_chunks/{duration-CL68Em0o.js → duration-DwFXonEV.js} +1 -4
- package/_chunks/editor-popup-BaaxL89T.js +81 -0
- package/_chunks/field-configurator-1eQP0tKy.js +223 -0
- package/_chunks/icon-toolbar-xbqa0hu9.js +128 -0
- package/_chunks/magnifying-glass-CvrTDSkB.js +4 -0
- package/_chunks/minus-BOAR3A1C.js +4 -0
- package/_chunks/mount-D1i5DLRn.js +266 -0
- package/_chunks/native-control-DO0d1kgx.js +636 -0
- package/_chunks/{number-input-BKwA5FnM.js → number-input-s9ddPwX6.js} +7 -7
- package/_chunks/{picker-h1P5RUgp.js → picker-AY05b41W.js} +2 -2
- package/_chunks/plus-CbGRkIGl.js +4 -0
- package/_chunks/popover-controller-D-AvKQ7B.js +102 -0
- package/_chunks/{popup-CT2uD3go.js → popup-UXGCiv3n.js} +97 -97
- package/_chunks/{rating-choice-DZgmaic0.js → rating-choice-BEs_QFZC.js} +1 -1
- package/_chunks/{reorder-list-CSlqAGHw.js → reorder-list-A49l172e.js} +1 -1
- package/_chunks/request-trail-DCOfa5zw.js +753 -0
- package/_chunks/rich-text-xfMWadGi.js +842 -0
- package/_chunks/rotate-left-BF6G883o.js +4 -0
- package/_chunks/title-tooltip-Cw6LOZhb.js +11 -0
- package/_chunks/tooltip-D4xkio5G.js +54 -0
- package/_chunks/tooltip-owner-DjdvqKzz.js +19 -0
- package/_chunks/tooltip-session-B6X6x8G_.js +110 -0
- package/_chunks/tooltip-text-BXsUEmBH.js +12 -0
- package/_chunks/top-layer-popup-CNSDdfJV.js +59 -0
- package/ai/_chat.scss +28 -3
- package/ai/_style.scss +55 -2
- package/ai/chat.d.ts +3 -1
- package/ai/components.d.ts +13 -2
- package/ai/index.d.ts +1 -0
- package/ai/index.js +3 -3
- package/ai/mount.d.ts +17 -1
- package/ai/results/_style.scss +80 -0
- package/ai/results/index.d.ts +11 -0
- package/ai/results/metrics.d.ts +5 -0
- package/ai/results/table.d.ts +5 -0
- package/ai/results/text.d.ts +5 -0
- package/ai/results/types.d.ts +29 -0
- package/ai/transcript.d.ts +2 -0
- package/ai/translations.d.ts +1 -1
- package/assignee/index.js +2 -2
- package/avatar/index.js +32 -31
- package/badge.view.d.ts +8 -0
- package/brush-range/component.js +28 -27
- package/buttons/svg-button.d.ts +1 -1
- package/buttons/svg-button.js +16 -16
- package/calendar/_calendar.scss +2 -2
- package/calendar/calendar.js +1 -1
- package/calendar/index.js +2 -2
- package/choice-chips/index.d.ts +3 -1
- package/choice-chips/index.js +1 -1
- package/color-palette/color-palette.js +1 -1
- package/color-palette/color-palette.style.scss +1 -1
- package/color-palette/color-picker.js +2 -2
- package/component-catalog.d.ts +6 -1
- package/configurator-actions.d.ts +67 -0
- package/configurator-actions.js +1 -0
- package/configurator-aggregation-list.d.ts +14 -0
- package/configurator-aggregation-list.js +61 -0
- package/configurator-drop-zone.d.ts +38 -0
- package/configurator-drop-zone.js +64 -0
- package/configurator-field-icon.d.ts +10 -0
- package/configurator-field-icon.js +1 -0
- package/configurator-focus.d.ts +4 -0
- package/configurator-focus.js +39 -0
- package/configurator-sections.d.ts +42 -0
- package/configurator-sections.js +71 -0
- package/control-presentation.js +24 -19
- package/controls.d.ts +1 -2
- package/controls.js +4 -3
- package/core/editor-popup.js +1 -1
- package/core/popover-controller.d.ts +35 -0
- package/core/popup-ownership.d.ts +2 -0
- package/core/title-tooltip.d.ts +2 -0
- package/core/tooltip-session.d.ts +29 -0
- package/core/tooltip-surface.d.ts +13 -0
- package/core/tooltip-text.d.ts +6 -0
- package/core/tooltip.d.ts +35 -0
- package/core/top-layer-popup.d.ts +4 -0
- package/core/top-layer-popup.js +1 -23
- package/date-time/index.js +1 -1
- package/date-time/style.scss +50 -7
- package/date-time/time-selection.d.ts +3 -1
- package/dialog/dialog.dom.js +8 -8
- package/dialog/dialog.parts.js +1 -1
- package/distribution-chart/_distribution-chart.scss +1 -57
- package/distribution-chart/area-chart.js +1 -1
- package/distribution-chart/bar-chart.js +1 -1
- package/distribution-chart/line-chart.js +1 -1
- package/dropdown/content.js +1 -1
- package/dropdown/control.js +1 -1
- package/dropdown/index.js +2 -2
- package/dropdown/lookup-field.js +2 -1
- package/dropdown/popup.d.ts +2 -2
- package/dropdown/popup.js +1 -1
- package/duration/index.js +1 -1
- package/editor-actions.js +1 -1
- package/field-configurator.d.ts +19 -0
- package/field-configurator.js +4 -170
- package/field-expansion.d.ts +9 -0
- package/filter/filters/slider/_slider.scss +0 -17
- package/filter/filters/slider/control.js +2 -0
- package/filter/filters/slider/runtime.js +49 -22
- package/filter/filters/slider/single.js +1 -1
- package/filter-badge.js +1 -1
- package/filter-controls.js +1 -1
- package/form-controls/index.js +6 -6
- package/form-controls/presentation.js +12 -12
- package/formatting/control-tooltip.d.ts +2 -27
- package/formatting/index.js +22 -21
- package/formatting/styles.scss +2 -47
- package/framework.js +215 -208
- package/history-controls.js +27 -1
- package/icon-toolbar.d.ts +58 -0
- package/icon-toolbar.js +1 -0
- package/masked-input/index.js +1 -1
- package/native-control.d.ts +1 -2
- package/native-control.js +1 -1
- package/native-styles.css +1 -1
- package/native.js +45 -42
- package/number-input/index.js +1 -1
- package/package.json +71 -2
- package/pagination.js +1 -1
- package/pdf-viewer/index.js +1 -1
- package/pickers.d.ts +5 -1
- package/preact-mount.js +1 -1
- package/preact.d.ts +7 -0
- package/preact.js +68 -61
- package/rating-choice.js +1 -1
- package/react.d.ts +5 -0
- package/react.js +67 -65
- package/reorder-list.js +1 -1
- package/resource-picker/resource-picker-popup.js +1 -1
- package/resource-picker/resource-picker.js +4 -4
- package/rich-text/engine.d.ts +1 -0
- package/rich-text/format-html.d.ts +2 -0
- package/rich-text/index.d.ts +4 -0
- package/rich-text/index.js +1 -1
- package/rich-text/model.d.ts +2 -0
- package/rich-text/style.scss +165 -70
- package/rich-text/syntax.d.ts +5 -0
- package/rich-text/translations.d.ts +2 -0
- package/select.d.ts +3 -1
- package/select.js +1 -1
- package/status-feedback/exit-snapshot.js +4 -4
- package/status-feedback/popover.js +4 -4
- package/styles/_compositions.scss +3 -3
- package/styles/_field-configurator.scss +146 -0
- package/styles/_fields-grid.scss +35 -0
- package/styles/_primitives.scss +25 -18
- package/styles/configurator-actions.scss +141 -0
- package/styles/legacy-pagination.css +19 -2
- package/styles.css +1 -1
- package/surfaces.d.ts +3 -0
- package/surfaces.js +34 -131
- package/surfaces.view.d.ts +4 -34
- package/svelte.js +1 -1
- package/switch/index.js +15 -14
- package/time-grid.js +37 -36
- package/timeline-track/index.js +2 -2
- package/ui.css +1 -1
- package/vue.d.ts +24 -9
- package/vue.js +118 -116
- package/_chunks/chart-frame-Cmc7xU1i.js +0 -130
- package/_chunks/choice-chips-CHQTUdLs.js +0 -110
- package/_chunks/color-picker-CudqPYZo.js +0 -138
- package/_chunks/control-tooltip-uscKfAnV.js +0 -100
- package/_chunks/date-time-qIhp5vaX.js +0 -768
- package/_chunks/editor-popup-WDdtVDNA.js +0 -81
- package/_chunks/history-controls-B3u3INEK.js +0 -27
- package/_chunks/mount-DQ1cpppK.js +0 -257
- package/_chunks/native-control-C_yok8_-.js +0 -605
- package/_chunks/request-trail-DSlFix6i.js +0 -618
- package/_chunks/rich-text-CH7gIqOS.js +0 -636
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@fortawesome+fontawesome-free@7.3.1/node_modules/@fortawesome/fontawesome-free/svgs/solid/rotate-left.svg?raw
|
|
2
|
+
var e = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M24 192l144 0c9.7 0 18.5-5.8 22.2-14.8s1.7-19.3-5.2-26.2l-46.7-46.7c75.3-58.6 184.3-53.3 253.5 15.9 75 75 75 196.5 0 271.5s-196.5 75-271.5 0c-10.2-10.2-19-21.3-26.4-33-9.5-14.9-29.3-19.3-44.2-9.8s-19.3 29.3-9.8 44.2C49.7 408.7 61.4 423.5 75 437 175 537 337 537 437 437S537 175 437 75C342.8-19.3 193.3-24.7 92.7 58.8L41 7C34.1 .2 23.8-1.9 14.8 1.8S0 14.3 0 24L0 168c0 13.3 10.7 24 24 24z\"/></svg>";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as t };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { r as e, t } from "./hooks.module-CG3gN83z.js";
|
|
2
|
+
import { n } from "./popover-controller-D-AvKQ7B.js";
|
|
3
|
+
//#region src/core/title-tooltip.ts
|
|
4
|
+
function r(r, i) {
|
|
5
|
+
let a = t(null), o = t(i);
|
|
6
|
+
return o.current = i, e(() => {
|
|
7
|
+
if (a.current && r) return new n().bind(a.current, r, { onEscape: () => o.current?.() });
|
|
8
|
+
}, [r]), a;
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { r as t };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { i as e, o as t, r as n } from "./hooks.module-CG3gN83z.js";
|
|
2
|
+
import { t as r } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
3
|
+
import { t as i } from "./tooltip-session-B6X6x8G_.js";
|
|
4
|
+
import { createControlId as a } from "../core/control-id.js";
|
|
5
|
+
//#region src/core/tooltip.tsx
|
|
6
|
+
function o(o, s = !0, c) {
|
|
7
|
+
let [l] = e(() => a("rv-format-control-tooltip")), [u] = e(() => new i());
|
|
8
|
+
u.delay = c?.delay ?? 0;
|
|
9
|
+
let d = t(() => u.hide(), [u]), f = t((e) => {
|
|
10
|
+
e || u.hide(), u.setSurface(e);
|
|
11
|
+
}, [u]);
|
|
12
|
+
return n(() => {
|
|
13
|
+
u.hide();
|
|
14
|
+
}, [o, c?.delay]), n(() => () => u.destroy(), [u]), {
|
|
15
|
+
id: l,
|
|
16
|
+
hide: d,
|
|
17
|
+
triggerProps: {
|
|
18
|
+
"aria-describedby": l,
|
|
19
|
+
onFocus: (e) => u.focus(e.currentTarget),
|
|
20
|
+
onBlur: () => u.blur(),
|
|
21
|
+
onMouseEnter: (e) => u.show(e.currentTarget),
|
|
22
|
+
onMouseLeave: (e) => u.leave(e?.currentTarget),
|
|
23
|
+
onPointerDown: (e) => u.pointerDown(),
|
|
24
|
+
onPointerCancel: () => u.hide(),
|
|
25
|
+
onKeyDown: (e) => u.keyDown(e)
|
|
26
|
+
},
|
|
27
|
+
tooltip: /* @__PURE__ */ r("span", {
|
|
28
|
+
ref: f,
|
|
29
|
+
id: l,
|
|
30
|
+
class: `rv-tooltip ${c?.className ?? "rv-format-control-tooltip"}`,
|
|
31
|
+
role: "tooltip",
|
|
32
|
+
"data-visible": "false",
|
|
33
|
+
hidden: !0,
|
|
34
|
+
children: c?.content ?? o
|
|
35
|
+
})
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function s({ id: a, text: o, content: s, visible: c, anchor: l = null, className: u = "rv-format-control-tooltip" }) {
|
|
39
|
+
let [d] = e(() => new i()), f = t((e) => {
|
|
40
|
+
e || d.hide(), d.setSurface(e);
|
|
41
|
+
}, [d]);
|
|
42
|
+
return n(() => (c && l ? d.show(l) : d.hide(), () => d.hide()), [c, l]), n(() => () => d.destroy(), [d]), /* @__PURE__ */ r("span", {
|
|
43
|
+
ref: f,
|
|
44
|
+
id: a,
|
|
45
|
+
class: `rv-tooltip ${u}`,
|
|
46
|
+
role: "tooltip",
|
|
47
|
+
"data-visible": c,
|
|
48
|
+
hidden: !c,
|
|
49
|
+
children: s ?? o
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
var c = o;
|
|
53
|
+
//#endregion
|
|
54
|
+
export { o as n, c as r, s as t };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region ../chart-utils/src/tooltip-owner.ts
|
|
2
|
+
var e = Symbol.for("@revolist/tooltip-owner");
|
|
3
|
+
function t(t, n, r) {
|
|
4
|
+
let i = t, a = i[e];
|
|
5
|
+
a?.owner !== n && (Object.defineProperty(i, e, {
|
|
6
|
+
configurable: !0,
|
|
7
|
+
writable: !0,
|
|
8
|
+
value: {
|
|
9
|
+
owner: n,
|
|
10
|
+
dismiss: r
|
|
11
|
+
}
|
|
12
|
+
}), a?.dismiss());
|
|
13
|
+
}
|
|
14
|
+
function n(t, n) {
|
|
15
|
+
let r = t;
|
|
16
|
+
r[e]?.owner === n && delete r[e];
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { n, t };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { c as e, o as t, r as n, t as r } from "./top-layer-popup-CNSDdfJV.js";
|
|
2
|
+
import { n as i, t as a } from "./tooltip-owner-DjdvqKzz.js";
|
|
3
|
+
//#region src/core/tooltip-session.ts
|
|
4
|
+
var o = class {
|
|
5
|
+
anchor;
|
|
6
|
+
surface;
|
|
7
|
+
timer;
|
|
8
|
+
mode;
|
|
9
|
+
cleanup;
|
|
10
|
+
mounted = !1;
|
|
11
|
+
pointerFocus = !1;
|
|
12
|
+
open = !1;
|
|
13
|
+
addedDescription = !1;
|
|
14
|
+
onHide;
|
|
15
|
+
onEscape;
|
|
16
|
+
delay = 0;
|
|
17
|
+
get isOpen() {
|
|
18
|
+
return this.open;
|
|
19
|
+
}
|
|
20
|
+
get isPending() {
|
|
21
|
+
return this.timer !== void 0;
|
|
22
|
+
}
|
|
23
|
+
setSurface(e) {
|
|
24
|
+
this.surface = e ?? void 0;
|
|
25
|
+
}
|
|
26
|
+
show(e) {
|
|
27
|
+
this.anchor === e && this.open || (this.hide(), this.anchor = e, this.listen(e), this.delay > 0 ? this.timer = setTimeout(() => {
|
|
28
|
+
this.timer = void 0, this.present();
|
|
29
|
+
}, this.delay) : this.present());
|
|
30
|
+
}
|
|
31
|
+
present() {
|
|
32
|
+
let r = this.anchor, i = this.surface;
|
|
33
|
+
if (!r || !i || !r.isConnected) {
|
|
34
|
+
this.hide();
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
a(r.ownerDocument, this, () => this.hide()), e(i), this.mounted = !i.isConnected, this.mounted && r.ownerDocument.body.append(i), i.hidden = !1, i.dataset.visible = "true", Object.assign(i.style, {
|
|
38
|
+
position: "fixed",
|
|
39
|
+
inset: "auto",
|
|
40
|
+
margin: "0",
|
|
41
|
+
transform: "none",
|
|
42
|
+
visibility: "visible",
|
|
43
|
+
positionAnchor: "auto",
|
|
44
|
+
positionArea: "none"
|
|
45
|
+
}), this.mode = n(i, "block");
|
|
46
|
+
let o = r.ownerDocument.defaultView, s = t(r.getBoundingClientRect(), i.getBoundingClientRect(), {
|
|
47
|
+
width: o?.innerWidth ?? 0,
|
|
48
|
+
height: o?.innerHeight ?? 0
|
|
49
|
+
});
|
|
50
|
+
Object.assign(i.style, {
|
|
51
|
+
left: `${s.left}px`,
|
|
52
|
+
top: `${s.top}px`
|
|
53
|
+
});
|
|
54
|
+
let c = new Set((r.getAttribute("aria-describedby") ?? "").split(/\s+/).filter(Boolean));
|
|
55
|
+
this.addedDescription = !c.has(i.id), c.add(i.id), r.setAttribute("aria-describedby", [...c].join(" ")), this.open = !0;
|
|
56
|
+
}
|
|
57
|
+
hide() {
|
|
58
|
+
clearTimeout(this.timer), this.timer = void 0, this.cleanup?.(), this.cleanup = void 0;
|
|
59
|
+
let e = this.anchor, t = this.surface;
|
|
60
|
+
if (e && i(e.ownerDocument, this), t && this.open) {
|
|
61
|
+
if (r(t, this.mode), t.hidden = !0, t.dataset.visible = "false", e && this.addedDescription) {
|
|
62
|
+
let n = (e.getAttribute("aria-describedby") ?? "").split(/\s+/).filter((e) => e && e !== t.id);
|
|
63
|
+
n.length ? e.setAttribute("aria-describedby", n.join(" ")) : e.removeAttribute("aria-describedby");
|
|
64
|
+
}
|
|
65
|
+
this.mounted && t.remove();
|
|
66
|
+
}
|
|
67
|
+
let n = this.open;
|
|
68
|
+
this.open = !1, n && this.onHide?.(), this.mode = void 0, this.mounted = !1;
|
|
69
|
+
}
|
|
70
|
+
focus(e) {
|
|
71
|
+
this.show(e);
|
|
72
|
+
}
|
|
73
|
+
blur() {
|
|
74
|
+
this.pointerFocus = !1, this.hide();
|
|
75
|
+
}
|
|
76
|
+
pointerDown() {
|
|
77
|
+
this.pointerFocus = !0;
|
|
78
|
+
}
|
|
79
|
+
leave(e) {
|
|
80
|
+
(!e || this.pointerFocus || e.ownerDocument.activeElement !== e) && this.hide();
|
|
81
|
+
}
|
|
82
|
+
keyDown(e) {
|
|
83
|
+
e.key === "Escape" && (this.open || this.isPending) && !e.defaultPrevented ? (e.preventDefault(), e.stopPropagation(), this.hide(), this.onEscape?.()) : (e.key === "Enter" || e.key === " ") && this.hide();
|
|
84
|
+
}
|
|
85
|
+
destroy() {
|
|
86
|
+
this.hide(), this.surface = void 0, this.anchor = void 0;
|
|
87
|
+
}
|
|
88
|
+
listen(e) {
|
|
89
|
+
let t = e.ownerDocument, n = t.defaultView, r = e.closest("[popover]"), i = () => this.hide(), a = (t) => {
|
|
90
|
+
t.composedPath().includes(e) || this.hide();
|
|
91
|
+
}, o = (n) => {
|
|
92
|
+
let r = n.target;
|
|
93
|
+
(r === t || r?.contains?.(e)) && this.hide();
|
|
94
|
+
}, s = () => {
|
|
95
|
+
r?.matches(":popover-open") || this.hide();
|
|
96
|
+
}, c = (e) => {
|
|
97
|
+
e.key === "Escape" && this.keyDown(e);
|
|
98
|
+
}, l = n?.MutationObserver, u = l ? new l(() => {
|
|
99
|
+
e.isConnected || this.hide();
|
|
100
|
+
}) : void 0;
|
|
101
|
+
u?.observe(t, {
|
|
102
|
+
childList: !0,
|
|
103
|
+
subtree: !0
|
|
104
|
+
}), t.addEventListener("keydown", c, !0), t.addEventListener("pointerdown", a, !0), t.addEventListener("scroll", o, !0), t.addEventListener("visibilitychange", i), n?.addEventListener("resize", i), n?.addEventListener("blur", i), r?.addEventListener("toggle", s), this.cleanup = () => {
|
|
105
|
+
u?.disconnect(), t.removeEventListener("keydown", c, !0), t.removeEventListener("pointerdown", a, !0), t.removeEventListener("scroll", o, !0), t.removeEventListener("visibilitychange", i), n?.removeEventListener("resize", i), n?.removeEventListener("blur", i), r?.removeEventListener("toggle", s);
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
//#endregion
|
|
110
|
+
export { o as t };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { c as e } from "./preact.module-BBM36DnO.js";
|
|
2
|
+
import { t } from "./title-tooltip-Cw6LOZhb.js";
|
|
3
|
+
//#region src/core/tooltip-text.tsx
|
|
4
|
+
function n({ as: n = "span", title: r, children: i, ...a }) {
|
|
5
|
+
let o = t(r);
|
|
6
|
+
return e(n, {
|
|
7
|
+
...a,
|
|
8
|
+
ref: o
|
|
9
|
+
}, i);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as t };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { calculateAnchoredPopoverPosition as e } from "../core/anchored-popover.js";
|
|
2
|
+
import { c as t } from "./preact.module-BBM36DnO.js";
|
|
3
|
+
import { createPreactElement as n } from "../preact-mount.js";
|
|
4
|
+
//#region src/core/tooltip-surface.ts
|
|
5
|
+
var r = "\n.rv-tooltip.rv-tooltip {\n box-sizing: border-box;\n position: fixed;\n z-index: 100000;\n margin: 0;\n inset: auto;\n transform: none;\n opacity: 1;\n visibility: visible;\n padding: 6px 10px;\n border: 0;\n border-radius: 6px;\n background: var(--rv-tooltip-bg, #191919);\n color: var(--rv-tooltip-fg, #fff);\n box-shadow: 0 4px 14px var(--rv-ui-shadow, rgb(0 0 0 / 18%));\n font: 12px/1.4 var(--rv-ui-font-family, Inter, ui-sans-serif, system-ui, sans-serif);\n font-weight: 400;\n text-align: start;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n max-width: min(360px, calc(100vw - 16px));\n max-height: calc(100dvh - 16px);\n overflow: auto;\n pointer-events: none;\n}\n.rv-tooltip[hidden], .rv-tooltip[data-visible=\"false\"] { display: none; }\n.rv-tooltip[data-overflow] { pointer-events: auto; }\n@media (forced-colors: active) {\n .rv-tooltip.rv-tooltip { color: CanvasText; background: Canvas; border: 1px solid CanvasText; }\n}\n";
|
|
6
|
+
function i(e) {
|
|
7
|
+
if (e.querySelector("style[data-rv-tooltip-styles]")) return;
|
|
8
|
+
let i = e.nodeType === 9 ? e : e.ownerDocument, a = n(i, t("style", { "data-rv-tooltip-styles": "" }, r));
|
|
9
|
+
e.nodeType === 9 ? i.head.append(a) : e.append(a);
|
|
10
|
+
}
|
|
11
|
+
function a(e) {
|
|
12
|
+
e.classList.add("rv-tooltip"), e.setAttribute("role", "tooltip");
|
|
13
|
+
let t = e.getRootNode();
|
|
14
|
+
i(t.nodeType === 11 && "host" in t ? t : e.ownerDocument);
|
|
15
|
+
}
|
|
16
|
+
function o(t, n, r) {
|
|
17
|
+
let i = e(t, n, r), a = t.top - n.height - 8;
|
|
18
|
+
return a >= 8 ? {
|
|
19
|
+
left: Math.max(8, Math.min(t.left + (t.width - n.width) / 2, r.width - n.width - 8)),
|
|
20
|
+
top: a
|
|
21
|
+
} : i;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/core/popup-ownership.ts
|
|
25
|
+
function s(e, t) {
|
|
26
|
+
if (!e || !t) return !1;
|
|
27
|
+
let n = /* @__PURE__ */ new Set(), r = (e) => !n.has(e) && (n.add(e), e.contains(t) ? !0 : [...e.querySelectorAll("[aria-controls]")].some((t) => (t.getAttribute("aria-controls") ?? "").split(/\s+/).some((t) => {
|
|
28
|
+
let n = e.ownerDocument.getElementById(t);
|
|
29
|
+
return !!n && r(n);
|
|
30
|
+
})));
|
|
31
|
+
return r(e);
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/core/top-layer-popup.ts
|
|
35
|
+
var c = /* @__PURE__ */ new WeakMap();
|
|
36
|
+
function l(e, t = "flex") {
|
|
37
|
+
if (c.has(e) || c.set(e, e.getAttribute("data-rv-ui-surface")), e.setAttribute("data-rv-ui-surface", ""), e.style.display = t, typeof e.showPopover == "function") {
|
|
38
|
+
e.setAttribute("popover", "manual");
|
|
39
|
+
try {
|
|
40
|
+
return e.showPopover(), "popover";
|
|
41
|
+
} catch {
|
|
42
|
+
e.removeAttribute("popover");
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return e.style.display = t, "fallback";
|
|
46
|
+
}
|
|
47
|
+
function u(e, t) {
|
|
48
|
+
let n = c.get(e);
|
|
49
|
+
if (n !== void 0 && (n === null ? e.removeAttribute("data-rv-ui-surface") : e.setAttribute("data-rv-ui-surface", n), c.delete(e)), t === "popover" && typeof e.hidePopover == "function") try {
|
|
50
|
+
e.hidePopover(), e.style.removeProperty("display");
|
|
51
|
+
return;
|
|
52
|
+
} catch {}
|
|
53
|
+
e.style.display = "none";
|
|
54
|
+
}
|
|
55
|
+
function d(e, t) {
|
|
56
|
+
return t ? e.contains(t) ? !0 : [...e.querySelectorAll("[aria-controls]")].some((n) => n.getAttribute("aria-controls")?.split(/\s+/).some((n) => e.ownerDocument.getElementById(n)?.contains(t))) : !1;
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { r as a, a as c, s as i, d as n, o, l as r, i as s, u as t };
|
package/ai/_chat.scss
CHANGED
|
@@ -45,13 +45,31 @@
|
|
|
45
45
|
color: var(--rv-ui-text-muted);
|
|
46
46
|
margin-block: 0.5rem;
|
|
47
47
|
}
|
|
48
|
+
.rv-ai-chat-empty > strong {
|
|
49
|
+
font-size: calc(1em + 2px);
|
|
50
|
+
}
|
|
51
|
+
.rv-ai-chat-empty img {
|
|
52
|
+
max-width: 100%;
|
|
53
|
+
height: auto;
|
|
54
|
+
}
|
|
55
|
+
.rv-ai-mounted-chat .rv-ai-chat-content:has(> .rv-ai-chat-empty:only-child) {
|
|
56
|
+
box-sizing: border-box;
|
|
57
|
+
min-height: 100%;
|
|
58
|
+
}
|
|
48
59
|
.rv-ai-chat-jump.rv-btn {
|
|
49
60
|
position: absolute;
|
|
50
61
|
inset-block-end: 0.75rem;
|
|
51
62
|
inset-inline-start: 50%;
|
|
52
63
|
transform: translateX(-50%);
|
|
53
|
-
|
|
54
|
-
|
|
64
|
+
width: 2rem;
|
|
65
|
+
min-width: 2rem;
|
|
66
|
+
height: 2rem;
|
|
67
|
+
padding: 0.375rem;
|
|
68
|
+
border: 1px solid var(--rv-ui-border);
|
|
69
|
+
border-radius: 50%;
|
|
70
|
+
background: var(--rv-ui-surface);
|
|
71
|
+
color: var(--rv-ui-text);
|
|
72
|
+
box-shadow: none;
|
|
55
73
|
}
|
|
56
74
|
.rv-ai-chat-composer {
|
|
57
75
|
flex: none;
|
|
@@ -65,6 +83,10 @@
|
|
|
65
83
|
max-width: 100%;
|
|
66
84
|
align-self: flex-start;
|
|
67
85
|
}
|
|
86
|
+
.rv-ai-message--assistant {
|
|
87
|
+
align-self: stretch;
|
|
88
|
+
width: 100%;
|
|
89
|
+
}
|
|
68
90
|
.rv-ai-message-content {
|
|
69
91
|
white-space: pre-wrap;
|
|
70
92
|
overflow-wrap: anywhere;
|
|
@@ -127,7 +149,7 @@
|
|
|
127
149
|
}
|
|
128
150
|
.rv-ai-task-icon {
|
|
129
151
|
display: inline-flex;
|
|
130
|
-
width:
|
|
152
|
+
width: 1.25rem;
|
|
131
153
|
height: 1.25rem;
|
|
132
154
|
flex: none;
|
|
133
155
|
align-items: center;
|
|
@@ -182,6 +204,9 @@
|
|
|
182
204
|
.rv-ai-chat-composer {
|
|
183
205
|
padding: 0.75rem 0 0;
|
|
184
206
|
}
|
|
207
|
+
.rv-ai-result-actions {
|
|
208
|
+
margin-block-start: 0.75rem;
|
|
209
|
+
}
|
|
185
210
|
}
|
|
186
211
|
.rv-ai-chat-result {
|
|
187
212
|
max-width: 100%;
|
package/ai/_style.scss
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@use './chat';
|
|
2
|
+
@use './results/style';
|
|
2
3
|
.rv-ai-assistant {
|
|
3
4
|
box-sizing: border-box;
|
|
4
5
|
width: 100%;
|
|
@@ -89,7 +90,8 @@
|
|
|
89
90
|
.rv-ai-request-trail .rv-ai-trail-trigger {
|
|
90
91
|
color: var(--rv-ui-accent-text);
|
|
91
92
|
background: var(--rv-ui-selected-bg);
|
|
92
|
-
&:hover:not(:disabled),
|
|
93
|
+
&:hover:not(:disabled),
|
|
94
|
+
&:focus-visible {
|
|
93
95
|
color: var(--rv-ui-accent-text);
|
|
94
96
|
background: var(--rv-ui-selected-bg);
|
|
95
97
|
}
|
|
@@ -161,7 +163,11 @@
|
|
|
161
163
|
background: var(--rv-ui-surface-hover);
|
|
162
164
|
}
|
|
163
165
|
.rv-ai-step[data-current] .rv-ai-step-chip {
|
|
164
|
-
background: color-mix(
|
|
166
|
+
background: color-mix(
|
|
167
|
+
in srgb,
|
|
168
|
+
var(--rv-ui-selected-bg) 55%,
|
|
169
|
+
var(--rv-ui-surface)
|
|
170
|
+
);
|
|
165
171
|
}
|
|
166
172
|
.rv-ai-step-number {
|
|
167
173
|
position: relative;
|
|
@@ -321,3 +327,50 @@
|
|
|
321
327
|
overflow-wrap: anywhere;
|
|
322
328
|
font-size: 0.875em;
|
|
323
329
|
}
|
|
330
|
+
.rv-ai-preview-changes {
|
|
331
|
+
max-width: 100%;
|
|
332
|
+
overflow-x: auto;
|
|
333
|
+
table {
|
|
334
|
+
width: 100%;
|
|
335
|
+
border-collapse: collapse;
|
|
336
|
+
font-size: 0.875rem;
|
|
337
|
+
}
|
|
338
|
+
th,
|
|
339
|
+
td {
|
|
340
|
+
padding: 0.5rem 0.625rem;
|
|
341
|
+
border-bottom: 1px solid var(--rv-ui-border);
|
|
342
|
+
text-align: start;
|
|
343
|
+
vertical-align: top;
|
|
344
|
+
overflow-wrap: anywhere;
|
|
345
|
+
}
|
|
346
|
+
th {
|
|
347
|
+
font-weight: 500;
|
|
348
|
+
}
|
|
349
|
+
thead th {
|
|
350
|
+
color: var(--rv-ui-text-muted);
|
|
351
|
+
}
|
|
352
|
+
td {
|
|
353
|
+
min-width: 4rem;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
.rv-ai-preview-item {
|
|
357
|
+
display: block;
|
|
358
|
+
font-weight: 600;
|
|
359
|
+
margin-bottom: 0.125rem;
|
|
360
|
+
}
|
|
361
|
+
.rv-ai-preview-notice {
|
|
362
|
+
margin: 0;
|
|
363
|
+
color: var(--rv-ui-text-muted);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// Opt-in bounded chat surfaces; toolbar mounts keep their natural height.
|
|
367
|
+
.rv-ai-assistant--fill {
|
|
368
|
+
padding: 0;
|
|
369
|
+
flex: 1;
|
|
370
|
+
min-height: 0;
|
|
371
|
+
height: 100%;
|
|
372
|
+
> .rv-ai-mounted-chat { flex: 1; min-height: 0; }
|
|
373
|
+
.rv-ai-chat-viewport { max-height: none; }
|
|
374
|
+
.rv-ai-result-actions, .rv-ai-assistant-footer { flex: none; }
|
|
375
|
+
.rv-ai-chat-content { min-height: 100%; box-sizing: border-box; }
|
|
376
|
+
}
|
package/ai/chat.d.ts
CHANGED
|
@@ -24,8 +24,10 @@ export declare function AiChatContent({ children, className, autoScroll, busy, l
|
|
|
24
24
|
export interface AiChatEmptyStateProps extends AiChatPartProps {
|
|
25
25
|
title?: string;
|
|
26
26
|
description?: string;
|
|
27
|
+
/** Framework-owned image/text content. Return cleanup for listeners or mounted views. */
|
|
28
|
+
renderContent?(host: HTMLElement): void | (() => void);
|
|
27
29
|
}
|
|
28
|
-
export declare function AiChatEmptyState({ title, description, children, className, translations, }: AiChatEmptyStateProps): h.JSX.Element;
|
|
30
|
+
export declare function AiChatEmptyState({ title, description, children, className, translations, renderContent, }: AiChatEmptyStateProps): h.JSX.Element;
|
|
29
31
|
/** Existing composer behavior, with chat-specific defaults. */
|
|
30
32
|
export declare function AiChatComposer(props: AiPromptInputProps): h.JSX.Element;
|
|
31
33
|
export interface AiMessageProps extends AiChatPartProps {
|
package/ai/components.d.ts
CHANGED
|
@@ -55,6 +55,8 @@ export interface AiResultProps {
|
|
|
55
55
|
}
|
|
56
56
|
export declare function AiResult({ translations, summary, matchedRows, countLabel, actions, children, }: AiResultProps): h.JSX.Element;
|
|
57
57
|
export interface AiAssistantProps {
|
|
58
|
+
/** Fill a bounded parent, with messages scrolling above the composer. */
|
|
59
|
+
layout?: 'flow' | 'fill';
|
|
58
60
|
translations?: AiUiTranslations;
|
|
59
61
|
label?: string;
|
|
60
62
|
children?: ComponentChildren;
|
|
@@ -62,14 +64,23 @@ export interface AiAssistantProps {
|
|
|
62
64
|
busy?: boolean;
|
|
63
65
|
}
|
|
64
66
|
/** Neutral composition; grid/model/query policy remains in the consuming product. */
|
|
65
|
-
export declare function AiAssistant({ translations, label, children, footer, busy, }: AiAssistantProps): h.JSX.Element;
|
|
67
|
+
export declare function AiAssistant({ layout, translations, label, children, footer, busy, }: AiAssistantProps): h.JSX.Element;
|
|
68
|
+
export interface AiPreviewChange {
|
|
69
|
+
/** User-facing record, task or chart name. */
|
|
70
|
+
item?: string;
|
|
71
|
+
label: string;
|
|
72
|
+
before?: string;
|
|
73
|
+
after?: string;
|
|
74
|
+
}
|
|
66
75
|
export interface AiChangePreviewProps {
|
|
67
76
|
translations?: AiUiTranslations;
|
|
68
77
|
summary: string;
|
|
69
78
|
details?: string;
|
|
79
|
+
changes?: readonly AiPreviewChange[];
|
|
80
|
+
notice?: string;
|
|
70
81
|
disabled?: boolean;
|
|
71
82
|
onApply(): void;
|
|
72
83
|
onCancel(): void;
|
|
73
84
|
}
|
|
74
85
|
/** Generic approval surface; the host retains the prepared command and its mutation policy. */
|
|
75
|
-
export declare function AiChangePreview({ translations, summary, details, disabled, onApply, onCancel, }: AiChangePreviewProps): h.JSX.Element;
|
|
86
|
+
export declare function AiChangePreview({ translations, summary, details, changes, notice, disabled, onApply, onCancel, }: AiChangePreviewProps): h.JSX.Element;
|
package/ai/index.d.ts
CHANGED
package/ai/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as e } from "../_chunks/mount-
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
1
|
+
import { t as e } from "../_chunks/mount-D1i5DLRn.js";
|
|
2
|
+
import { C as t, E as n, S as r, T as i, _ as a, a as o, b as s, c, d as l, f as u, g as d, h as f, i as p, l as m, m as h, n as g, o as _, p as v, r as y, s as b, t as x, u as S, w as C, x as w, y as T } from "../_chunks/request-trail-DCOfa5zw.js";
|
|
3
|
+
export { i as AI_UI_MESSAGES, u as AiActionStatus, v as AiAssistant, h as AiChangePreview, g as AiChat, y as AiChatComposer, p as AiChatContent, o as AiChatEmptyState, _ as AiMessage, b as AiMessageActions, c as AiMessageContent, f as AiPromptInput, m as AiReasoning, x as AiRequestTrail, d as AiResult, w as AiResultMetrics, r as AiResultTable, s as AiResultText, T as AiResultView, a as AiSuggestions, S as AiTask, l as AiTaskItem, C as AiTranslationProvider, t as formatAiResultValue, e as mountAiAssistant, n as translateAiText };
|
package/ai/mount.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { AiResultContent, AiTableRenderer } from './results';
|
|
2
|
+
import { AiChatEmptyStateProps } from './chat';
|
|
1
3
|
import { AiUiTranslations } from './translations';
|
|
2
|
-
import { AiActionPhase, AiPromptInputProps, AiSuggestionChoice } from './components';
|
|
4
|
+
import { AiActionPhase, AiPromptInputProps, AiPreviewChange, AiSuggestionChoice } from './components';
|
|
3
5
|
import { AiRequestTrailItem, AiRequestTrailProps } from './request-trail';
|
|
4
6
|
import { AiPromptHistoryOptions } from './prompt-history';
|
|
5
7
|
export interface AiAssistantMountState {
|
|
@@ -14,9 +16,12 @@ export interface AiAssistantMountState {
|
|
|
14
16
|
message: string;
|
|
15
17
|
/** Plain text from a bounded host-owned action result. */
|
|
16
18
|
resultDetails?: string;
|
|
19
|
+
result?: AiResultContent;
|
|
17
20
|
pendingAction?: {
|
|
18
21
|
summary: string;
|
|
19
22
|
details?: string;
|
|
23
|
+
changes?: readonly AiPreviewChange[];
|
|
24
|
+
notice?: string;
|
|
20
25
|
};
|
|
21
26
|
canUndoData?: boolean;
|
|
22
27
|
canRedoData?: boolean;
|
|
@@ -28,7 +33,18 @@ export interface AiAssistantMountState {
|
|
|
28
33
|
canEditSteps?: boolean;
|
|
29
34
|
}
|
|
30
35
|
export interface AiAssistantMountOptions {
|
|
36
|
+
/** Trusted host renderer for tabular results; never supplied by model output. */
|
|
37
|
+
renderTable?: AiTableRenderer;
|
|
31
38
|
mode?: 'toolbar' | 'chat';
|
|
39
|
+
layout?: 'flow' | 'fill';
|
|
40
|
+
/** Optional host for reactive undo/redo and view controls. Cleaned up on destroy. */
|
|
41
|
+
controlsMountTo?: HTMLElement;
|
|
42
|
+
/** Hide the chat-clearing control while preserving the transcript. Defaults to true. */
|
|
43
|
+
showClearChat?: boolean;
|
|
44
|
+
/** Hide Restore/Reset, Clear chat and data history controls without disabling their controller methods. */
|
|
45
|
+
showHistoryControls?: boolean;
|
|
46
|
+
/** Optional welcome content shown only while the local chat transcript is empty. */
|
|
47
|
+
emptyState?: AiChatEmptyStateProps | false;
|
|
32
48
|
onClearChat?(): void;
|
|
33
49
|
/** Local input recall and optional host persistence; never sent to the model automatically. */
|
|
34
50
|
promptHistory?: AiPromptHistoryOptions;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
.rv-ai-result-content {
|
|
2
|
+
min-width: 0;
|
|
3
|
+
border: 1px solid var(--rv-ui-border);
|
|
4
|
+
border-radius: 0.75rem;
|
|
5
|
+
padding: 1rem;
|
|
6
|
+
background: var(--rv-ui-surface);
|
|
7
|
+
overflow-wrap: anywhere;
|
|
8
|
+
}
|
|
9
|
+
.rv-ai-result-table-scroll {
|
|
10
|
+
max-width: 100%;
|
|
11
|
+
overflow: auto;
|
|
12
|
+
}
|
|
13
|
+
.rv-ai-result-content--grid {
|
|
14
|
+
border: 0;
|
|
15
|
+
border-radius: 0;
|
|
16
|
+
padding: 0;
|
|
17
|
+
background: transparent;
|
|
18
|
+
}
|
|
19
|
+
.rv-ai-result-table {
|
|
20
|
+
width: 100%;
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
overflow-wrap: normal;
|
|
23
|
+
border-collapse: collapse;
|
|
24
|
+
font: inherit;
|
|
25
|
+
caption {
|
|
26
|
+
text-align: start;
|
|
27
|
+
padding-block-end: 0.75rem;
|
|
28
|
+
}
|
|
29
|
+
caption span {
|
|
30
|
+
display: block;
|
|
31
|
+
color: var(--rv-ui-text-muted);
|
|
32
|
+
font-size: 0.8125rem;
|
|
33
|
+
margin-block-start: 0.25rem;
|
|
34
|
+
}
|
|
35
|
+
th,
|
|
36
|
+
td {
|
|
37
|
+
min-width: 6rem;
|
|
38
|
+
padding: 0.625rem;
|
|
39
|
+
text-align: start;
|
|
40
|
+
border-block-end: 1px solid var(--rv-ui-border);
|
|
41
|
+
}
|
|
42
|
+
th {
|
|
43
|
+
color: var(--rv-ui-text-muted);
|
|
44
|
+
font-weight: 500;
|
|
45
|
+
}
|
|
46
|
+
tbody tr:last-child td {
|
|
47
|
+
border: 0;
|
|
48
|
+
}
|
|
49
|
+
.rv-ai-result-number {
|
|
50
|
+
min-width: 4rem;
|
|
51
|
+
text-align: end;
|
|
52
|
+
font-variant-numeric: tabular-nums;
|
|
53
|
+
white-space: nowrap;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
.rv-ai-result-description,
|
|
57
|
+
.rv-ai-result-empty {
|
|
58
|
+
color: var(--rv-ui-text-muted);
|
|
59
|
+
margin-block: 0.25rem 0;
|
|
60
|
+
}
|
|
61
|
+
.rv-ai-result-metrics {
|
|
62
|
+
display: grid;
|
|
63
|
+
grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
|
|
64
|
+
gap: 1rem;
|
|
65
|
+
margin-block: 1rem 0;
|
|
66
|
+
dt {
|
|
67
|
+
color: var(--rv-ui-text-muted);
|
|
68
|
+
font-size: 0.8125rem;
|
|
69
|
+
}
|
|
70
|
+
dd {
|
|
71
|
+
margin: 0.25rem 0 0;
|
|
72
|
+
font-size: 1.25rem;
|
|
73
|
+
font-weight: 600;
|
|
74
|
+
font-variant-numeric: tabular-nums;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
.rv-ai-result-text {
|
|
78
|
+
margin-block-end: 0;
|
|
79
|
+
white-space: pre-wrap;
|
|
80
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentChildren } from '../../_vendor/preact/src/index';
|
|
2
|
+
import { AiResultContent, AiTableResult } from './types';
|
|
3
|
+
export type AiTableRenderer = (result: AiTableResult) => ComponentChildren;
|
|
4
|
+
export * from './types';
|
|
5
|
+
export * from './table';
|
|
6
|
+
export * from './metrics';
|
|
7
|
+
export * from './text';
|
|
8
|
+
export declare function AiResultView({ result, renderTable }: {
|
|
9
|
+
result: AiResultContent;
|
|
10
|
+
renderTable?: AiTableRenderer;
|
|
11
|
+
}): ComponentChildren;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Presentation-only values. No HTML, grid records or executable render callbacks. */
|
|
2
|
+
export type AiResultValue = string | number | boolean | null;
|
|
3
|
+
interface ResultBase {
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface AiTableResult extends ResultBase {
|
|
8
|
+
kind: 'table';
|
|
9
|
+
columns: readonly {
|
|
10
|
+
label: string;
|
|
11
|
+
numeric?: boolean;
|
|
12
|
+
}[];
|
|
13
|
+
rows: readonly (readonly AiResultValue[])[];
|
|
14
|
+
}
|
|
15
|
+
export interface AiMetricsResult extends ResultBase {
|
|
16
|
+
kind: 'metrics';
|
|
17
|
+
items: readonly {
|
|
18
|
+
label: string;
|
|
19
|
+
value: AiResultValue;
|
|
20
|
+
}[];
|
|
21
|
+
}
|
|
22
|
+
export interface AiTextResult extends ResultBase {
|
|
23
|
+
kind: 'text';
|
|
24
|
+
text: string;
|
|
25
|
+
}
|
|
26
|
+
/** Add new result kinds here and their renderer in AiResultView. */
|
|
27
|
+
export type AiResultContent = AiTableResult | AiMetricsResult | AiTextResult;
|
|
28
|
+
export declare function formatAiResultValue(value: AiResultValue): string;
|
|
29
|
+
export {};
|