@revolist/ui 4.0.4-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 +36 -1
- 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,266 @@
|
|
|
1
|
+
import { i as e, r as t } from "./preact.module-BBM36DnO.js";
|
|
2
|
+
import { c as n, i as r, t as i } from "./hooks.module-CG3gN83z.js";
|
|
3
|
+
import { E as a, _ as o, a as s, c, i as l, m as u, n as d, o as f, p, r as m, t as h, u as g, v as _, y as v } from "./request-trail-DCOfa5zw.js";
|
|
4
|
+
import { t as y } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
5
|
+
import { n as b } from "./popup-UXGCiv3n.js";
|
|
6
|
+
import { t as x } from "./controls-BLQnWEd7.js";
|
|
7
|
+
import { HistoryControls as S } from "../history-controls.js";
|
|
8
|
+
import { n as C } from "./render-m5eMMwFR.js";
|
|
9
|
+
//#region src/ai/transcript.ts
|
|
10
|
+
var w = (e) => new TextEncoder().encode(JSON.stringify(e)).byteLength, T = (e) => {
|
|
11
|
+
if (!e) return "";
|
|
12
|
+
if (w(e) <= 16384) return e;
|
|
13
|
+
let t = 0, n = Math.min(e.length, 16384);
|
|
14
|
+
for (; t < n;) {
|
|
15
|
+
let r = Math.ceil((t + n) / 2);
|
|
16
|
+
w(e.slice(0, r) + "…") <= 16384 ? t = r : n = r - 1;
|
|
17
|
+
}
|
|
18
|
+
return /[\uD800-\uDBFF]/.test(e.charAt(t - 1)) && t--, e.slice(0, t) + "…";
|
|
19
|
+
}, E = class {
|
|
20
|
+
messages = [];
|
|
21
|
+
epoch = 0;
|
|
22
|
+
initialized = !1;
|
|
23
|
+
requestId;
|
|
24
|
+
ignoredRequest;
|
|
25
|
+
currentId;
|
|
26
|
+
active = !1;
|
|
27
|
+
lastPhase;
|
|
28
|
+
key = "";
|
|
29
|
+
sequence = 0;
|
|
30
|
+
update(e) {
|
|
31
|
+
if (this.initialized ||= (this.epoch = e.chatKey ?? 0, !0), (e.chatKey ?? 0) !== this.epoch) {
|
|
32
|
+
this.epoch = e.chatKey ?? 0, this.messages = [], this.requestId = void 0, this.ignoredRequest = e.request?.id, this.currentId = void 0, this.active = !1, this.key = "", this.lastPhase = void 0;
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (e.phase === "idle" || e.request?.id === this.ignoredRequest && this.ignoredRequest !== void 0) return;
|
|
36
|
+
let t = e.request, n = !!t && t.id !== this.requestId, r = e.phase === "completed" && e.result && w(e.result) <= 16384 ? structuredClone(e.result) : void 0, i = {
|
|
37
|
+
text: T(e.message),
|
|
38
|
+
phase: e.phase,
|
|
39
|
+
details: e.phase === "completed" && !r && e.resultDetails ? T(e.resultDetails) : void 0,
|
|
40
|
+
pending: !!e.pendingAction,
|
|
41
|
+
result: r
|
|
42
|
+
}, a = JSON.stringify([t?.id, i]);
|
|
43
|
+
if (!n && a === this.key || !n && !i.text && !i.pending) return;
|
|
44
|
+
let o = this.messages.find((e) => e.id === this.currentId), s = this.lastPhase === "completed" && e.phase === "understanding" && o?.from === "assistant", c = o?.from === "system" && o.phase === "completed" && (e.phase === "applying" || e.phase === "completed");
|
|
45
|
+
if (n) {
|
|
46
|
+
this.requestId = t.id, this.ignoredRequest = void 0;
|
|
47
|
+
let e = "turn:" + ++this.sequence;
|
|
48
|
+
this.currentId = e + ":assistant", this.messages = [
|
|
49
|
+
...this.messages,
|
|
50
|
+
{
|
|
51
|
+
id: e + ":user",
|
|
52
|
+
group: e,
|
|
53
|
+
from: "user",
|
|
54
|
+
text: T(t.prompt)
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: this.currentId,
|
|
58
|
+
group: e,
|
|
59
|
+
from: "assistant",
|
|
60
|
+
...i
|
|
61
|
+
}
|
|
62
|
+
];
|
|
63
|
+
} else if ((this.active || s || c) && o) this.messages = this.messages.map((e) => e.id === this.currentId ? {
|
|
64
|
+
...e,
|
|
65
|
+
...i
|
|
66
|
+
} : e);
|
|
67
|
+
else {
|
|
68
|
+
let e = "system:" + ++this.sequence;
|
|
69
|
+
this.currentId = e, this.messages = [...this.messages, {
|
|
70
|
+
id: e,
|
|
71
|
+
group: e,
|
|
72
|
+
from: "system",
|
|
73
|
+
...i
|
|
74
|
+
}];
|
|
75
|
+
}
|
|
76
|
+
for (this.active = e.phase === "understanding" || e.phase === "applying" || !!e.pendingAction, this.lastPhase = e.phase, this.key = a; this.messages.length > 50 || w(this.messages) > 65536;) {
|
|
77
|
+
let e = this.messages[0].group;
|
|
78
|
+
this.messages = this.messages.filter((t) => t.group !== e);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
clear() {
|
|
82
|
+
this.messages = [], this.requestId = void 0, this.currentId = void 0, this.active = !1, this.key = "";
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/ai/mount.tsx
|
|
87
|
+
function D(w, T) {
|
|
88
|
+
let D = (e) => a(e, T.translations), O = !1, k = T.suggestions ?? [], A, j = _(T.promptHistory?.items ?? []), M = new E(), N = T.mode === "chat", P = [], F = 0, I = !1, L = "";
|
|
89
|
+
function R(e) {
|
|
90
|
+
if (e.phase === "idle" || !e.message || e.pendingAction) return;
|
|
91
|
+
let t = e.phase === "understanding" || e.phase === "applying", n = JSON.stringify([
|
|
92
|
+
e.phase,
|
|
93
|
+
e.message,
|
|
94
|
+
e.matchedRows,
|
|
95
|
+
e.resultDetails
|
|
96
|
+
]);
|
|
97
|
+
if (n === L) return;
|
|
98
|
+
let r = P.at(-1), i = {
|
|
99
|
+
id: I && r ? r.id : String(++F),
|
|
100
|
+
title: e.message,
|
|
101
|
+
busy: t,
|
|
102
|
+
tone: e.phase === "error" ? "danger" : e.phase === "completed" ? "success" : "neutral",
|
|
103
|
+
description: e.phase === "completed" && e.matchedRows !== void 0 ? T.countLabel?.(e.matchedRows) ?? D("{count} matching rows").replace("{count}", e.matchedRows.toLocaleString()) : void 0,
|
|
104
|
+
detail: e.phase === "completed" && !e.result ? e.resultDetails : void 0
|
|
105
|
+
};
|
|
106
|
+
P = [...I && r ? P.slice(0, -1) : P, i].slice(-50), I = t, L = n;
|
|
107
|
+
}
|
|
108
|
+
function z({ state: t }) {
|
|
109
|
+
let [a, E] = r(""), [O, A] = r(j), [F, I] = r(!1), L = i();
|
|
110
|
+
n(() => {
|
|
111
|
+
E(""), L.current = void 0;
|
|
112
|
+
}, [t.chatKey]);
|
|
113
|
+
let R = t.phase === "understanding" || t.phase === "applying", z = !!t.pendingAction, V = t.steps ?? [], H = i(!1);
|
|
114
|
+
n(() => {
|
|
115
|
+
H.current && !z && !R && w.querySelector("textarea")?.focus(), H.current = z || R && H.current;
|
|
116
|
+
}, [z, R]), n(() => {
|
|
117
|
+
if (R || z || t.phase === "idle" || L.current === void 0) return;
|
|
118
|
+
let e = L.current;
|
|
119
|
+
L.current = void 0, t.phase === "completed" && E((t) => t.trim() === e ? "" : t);
|
|
120
|
+
}, [t]);
|
|
121
|
+
let U = (e) => {
|
|
122
|
+
L.current = e.trim(), T.promptHistory && (j = _([...j, e]), A(j), T.promptHistory.onChange?.([...j])), T.onSubmit(e);
|
|
123
|
+
}, W = /* @__PURE__ */ y(o, {
|
|
124
|
+
items: t.choices?.length ? t.choices : t.suggestions?.length ? t.suggestions : k,
|
|
125
|
+
onSelect: (e) => {
|
|
126
|
+
R || z || (E(e), U(e));
|
|
127
|
+
},
|
|
128
|
+
disabled: R || z
|
|
129
|
+
}), G = /* @__PURE__ */ y(m, {
|
|
130
|
+
label: T.prompt?.label ?? "Ask AI to change this view",
|
|
131
|
+
...T.prompt,
|
|
132
|
+
value: a,
|
|
133
|
+
onValueChange: E,
|
|
134
|
+
onSubmit: U,
|
|
135
|
+
onStop: T.onStop,
|
|
136
|
+
busy: R,
|
|
137
|
+
promptHistory: T.promptHistory ? O : void 0,
|
|
138
|
+
disabled: z,
|
|
139
|
+
hint: V.length ? "" : T.prompt?.hint,
|
|
140
|
+
footer: W,
|
|
141
|
+
actions: /* @__PURE__ */ y(h, {
|
|
142
|
+
...T.trail,
|
|
143
|
+
items: V,
|
|
144
|
+
onRemove: (e) => T.onRemoveStep?.(e),
|
|
145
|
+
onClear: T.onReset,
|
|
146
|
+
onEmpty: () => w.querySelector("textarea")?.focus(),
|
|
147
|
+
disabled: R || z,
|
|
148
|
+
removalsDisabled: !T.onRemoveStep || t.canEditSteps === !1,
|
|
149
|
+
clearDescription: T.trail?.clearDescription ?? "Restore the starting view",
|
|
150
|
+
clearLabel: T.trail?.clearLabel ?? T.resetLabel ?? "Clear all",
|
|
151
|
+
changedMessage: !R && V.length > 0 && t.canEditSteps === !1 ? T.trail?.changedMessage ?? "The view changed manually. Start a new request to continue." : void 0
|
|
152
|
+
})
|
|
153
|
+
}), K = t.pendingAction && /* @__PURE__ */ y(u, {
|
|
154
|
+
...t.pendingAction,
|
|
155
|
+
disabled: R || !T.onApplyAction,
|
|
156
|
+
onApply: () => T.onApplyAction?.(),
|
|
157
|
+
onCancel: () => T.onCancelAction?.()
|
|
158
|
+
}), q = /* @__PURE__ */ y("div", {
|
|
159
|
+
class: "rv-ai-result-actions",
|
|
160
|
+
children: [
|
|
161
|
+
(T.onUndoData || T.onRedoData) && /* @__PURE__ */ y(S, {
|
|
162
|
+
onUndo: T.onUndoData,
|
|
163
|
+
onRedo: T.onRedoData,
|
|
164
|
+
canUndo: !R && !z && !!t.canUndoData,
|
|
165
|
+
canRedo: !R && !z && !!t.canRedoData,
|
|
166
|
+
undoLabel: D("Undo data change"),
|
|
167
|
+
redoLabel: D("Redo data change"),
|
|
168
|
+
label: D("Data history")
|
|
169
|
+
}),
|
|
170
|
+
/* @__PURE__ */ y(x, {
|
|
171
|
+
disabled: R || z || !t.canRestore,
|
|
172
|
+
onClick: T.onRestore,
|
|
173
|
+
size: "compact",
|
|
174
|
+
children: D(T.restoreLabel ?? "Restore previous view")
|
|
175
|
+
}),
|
|
176
|
+
!V.length && /* @__PURE__ */ y(x, {
|
|
177
|
+
disabled: R || z,
|
|
178
|
+
onClick: T.onReset,
|
|
179
|
+
size: "compact",
|
|
180
|
+
variant: "ghost",
|
|
181
|
+
children: D(T.resetLabel ?? "Reset view")
|
|
182
|
+
}),
|
|
183
|
+
N && T.showClearChat !== !1 && /* @__PURE__ */ y(x, {
|
|
184
|
+
size: "compact",
|
|
185
|
+
variant: "ghost",
|
|
186
|
+
disabled: R || z || !T.onClearChat || !M.messages.length,
|
|
187
|
+
onClick: () => T.onClearChat?.(),
|
|
188
|
+
children: D("Clear chat")
|
|
189
|
+
})
|
|
190
|
+
]
|
|
191
|
+
}), J = T.showHistoryControls === !1 ? null : T.controlsMountTo ? b(q, T.controlsMountTo) : q;
|
|
192
|
+
return /* @__PURE__ */ y(p, {
|
|
193
|
+
layout: T.layout,
|
|
194
|
+
translations: T.translations,
|
|
195
|
+
label: T.label,
|
|
196
|
+
busy: R,
|
|
197
|
+
footer: T.footer,
|
|
198
|
+
children: N ? /* @__PURE__ */ y(d, {
|
|
199
|
+
className: "rv-ai-mounted-chat",
|
|
200
|
+
children: [
|
|
201
|
+
/* @__PURE__ */ y(l, {
|
|
202
|
+
busy: R,
|
|
203
|
+
children: [!M.messages.length && T.emptyState && /* @__PURE__ */ y(s, { ...T.emptyState }), M.messages.map((e) => /* @__PURE__ */ y(f, {
|
|
204
|
+
from: e.from,
|
|
205
|
+
isStreaming: e.phase === "understanding" || e.phase === "applying",
|
|
206
|
+
children: [
|
|
207
|
+
e.from === "user" ? /* @__PURE__ */ y(c, { children: e.text }) : e.phase === "preview" && e.pending && e.id === M.messages.at(-1)?.id && t.pendingAction ? null : /* @__PURE__ */ y(c, { children: e.phase === "understanding" || e.phase === "applying" || e.phase === "error" || e.phase === "cancelled" ? /* @__PURE__ */ y(g, {
|
|
208
|
+
title: e.text,
|
|
209
|
+
status: e.phase === "understanding" || e.phase === "applying" ? "running" : e.phase === "error" ? "error" : "cancelled"
|
|
210
|
+
}) : e.text }),
|
|
211
|
+
e.result ? /* @__PURE__ */ y(v, {
|
|
212
|
+
result: e.result,
|
|
213
|
+
renderTable: T.renderTable
|
|
214
|
+
}) : e.details && /* @__PURE__ */ y("pre", {
|
|
215
|
+
class: "rv-ai-chat-result",
|
|
216
|
+
children: e.details
|
|
217
|
+
}),
|
|
218
|
+
e.id === M.messages.at(-1)?.id && e.pending && K
|
|
219
|
+
]
|
|
220
|
+
}, e.id))]
|
|
221
|
+
}),
|
|
222
|
+
G,
|
|
223
|
+
J
|
|
224
|
+
]
|
|
225
|
+
}) : /* @__PURE__ */ y(e, { children: [
|
|
226
|
+
G,
|
|
227
|
+
K,
|
|
228
|
+
t.phase === "completed" && t.result && /* @__PURE__ */ y(v, {
|
|
229
|
+
result: t.result,
|
|
230
|
+
renderTable: T.renderTable
|
|
231
|
+
}),
|
|
232
|
+
!!P.length && /* @__PURE__ */ y(C, {
|
|
233
|
+
className: "rv-ai-activity",
|
|
234
|
+
title: D("Activity"),
|
|
235
|
+
compact: !0,
|
|
236
|
+
autoDismissMs: T.activityDurationMs,
|
|
237
|
+
onDismissItem: (e) => {
|
|
238
|
+
P = P.filter((t) => t.id !== e), B();
|
|
239
|
+
},
|
|
240
|
+
collapsed: F,
|
|
241
|
+
onCollapsedChange: I,
|
|
242
|
+
collapseLabel: D("Collapse activity"),
|
|
243
|
+
expandLabel: D("Expand activity"),
|
|
244
|
+
items: P
|
|
245
|
+
}),
|
|
246
|
+
J
|
|
247
|
+
] })
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
let B = () => {
|
|
251
|
+
!O && A && t(/* @__PURE__ */ y(z, { state: A }), w);
|
|
252
|
+
};
|
|
253
|
+
return {
|
|
254
|
+
update(e) {
|
|
255
|
+
N ? M.update(e) : R(e), A = e, B();
|
|
256
|
+
},
|
|
257
|
+
setSuggestions(e) {
|
|
258
|
+
k = [...e], B();
|
|
259
|
+
},
|
|
260
|
+
destroy() {
|
|
261
|
+
O || (O = !0, j = [], M.clear(), t(null, w));
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
//#endregion
|
|
266
|
+
export { D as t };
|