@revolist/ui 4.0.4-rc → 4.0.6-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/MIGRATION.md +36 -0
- package/OWNERSHIP.md +10 -10
- package/README.md +22 -4
- 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-QWDyYzdo.js} +19 -19
- package/_chunks/chart-frame-hcOlnQ1K.js +145 -0
- package/_chunks/check-BwI7iCAm.js +4 -0
- package/_chunks/choice-chips-A6WR-WJe.js +126 -0
- package/_chunks/{color-palette-D8vyPfld.js → color-palette-DMJUChWC.js} +20 -22
- package/_chunks/color-picker-BK4W1nd6.js +143 -0
- package/_chunks/{component-C_T2VN5u.js → component-CMkF17YZ.js} +281 -265
- package/_chunks/{component-metadata-BMOOmqx5.js → component-metadata-BKd7U8OW.js} +0 -8
- package/_chunks/configurator-actions-By8WSL2m.js +155 -0
- package/_chunks/configurator-field-icon-CmcM_sPs.js +53 -0
- package/_chunks/{control-AHKXD5Eu.js → control-mlH7l0Uq.js} +42 -17
- package/_chunks/{controls-DsNi8V8I.js → controls-FUU-MUKC.js} +171 -186
- package/_chunks/{date-control-DrVFX13g.js → date-control-Dup_P3w5.js} +1 -1
- package/_chunks/{date-time-qIhp5vaX.js → date-time-9z6pAG5T.js} +317 -278
- package/_chunks/dialog.parts-Bi7YbXqS.js +131 -0
- package/_chunks/{duration-CL68Em0o.js → duration-D7oRjsmP.js} +5 -5
- package/_chunks/editor-popup-ByU7qiub.js +82 -0
- package/_chunks/field-configurator-BCINdXpU.js +223 -0
- package/_chunks/{framework-mount--RTLIqE-.js → framework-mount-Bk4O_T7T.js} +1 -1
- package/_chunks/icon-toolbar-DSjOdwM7.js +134 -0
- package/_chunks/magnifying-glass-CvrTDSkB.js +4 -0
- package/_chunks/minus-BOAR3A1C.js +4 -0
- package/_chunks/mount-Cw2zk58T.js +266 -0
- package/_chunks/{native.view-ByyZ1CT5.js → native-Blr3byjO.js} +1 -1
- package/_chunks/native-control-pFMuHf3G.js +644 -0
- package/_chunks/{number-input-BKwA5FnM.js → number-input-DqXV6vgP.js} +7 -7
- package/_chunks/{picker-h1P5RUgp.js → picker-gEGTu1Ki.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-C35Isk7p.js} +115 -104
- package/_chunks/{rating-choice-DZgmaic0.js → rating-choice-DbxdUJr-.js} +1 -1
- package/_chunks/{reorder-list-CSlqAGHw.js → reorder-list-B0_13Sja.js} +1 -1
- package/_chunks/request-trail-CCSK6TJA.js +753 -0
- package/_chunks/rich-text-5rnc8lpI.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/_variables.scss +33 -32
- 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 +83 -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/assignee.scss +5 -1
- package/assignee/index.js +2 -2
- package/avatar/index.d.ts +25 -2
- package/avatar/index.js +33 -32
- package/badge.view.d.ts +8 -0
- package/brush-range/component.d.ts +1 -3
- package/brush-range/component.js +27 -27
- package/buttons/remove-button.d.ts +1 -1
- package/buttons/remove-button.style.scss +1 -1
- 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/checkbox/checkbox.scss +1 -22
- 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/color-palette/common-palettes.d.ts +1 -1
- package/color-palette/common-palettes.js +1 -1
- package/color-palette/native.d.ts +15 -2
- package/component-catalog.d.ts +9 -7
- 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.d.ts +8 -2
- package/control-presentation.js +25 -20
- package/controls.d.ts +1 -2
- package/controls.js +4 -3
- package/core/editor-popup-position.d.ts +6 -2
- package/core/editor-popup.d.ts +4 -0
- 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/attach.d.ts +1 -1
- package/date-time/field.d.ts +3 -2
- package/date-time/index.js +1 -1
- package/date-time/style.scss +64 -7
- package/date-time/time-selection.d.ts +3 -1
- package/date-time/types.d.ts +5 -1
- package/dialog/dialog-action-footer.d.ts +17 -2
- package/dialog/dialog.dom.d.ts +15 -2
- package/dialog/dialog.dom.js +9 -9
- package/dialog/dialog.parts.d.ts +1 -1
- package/dialog/dialog.parts.js +1 -1
- package/distribution-chart/_distribution-chart.scss +12 -54
- package/distribution-chart/area-chart.js +1 -1
- package/distribution-chart/bar-chart.js +1 -1
- package/distribution-chart/index.d.ts +1 -1
- package/distribution-chart/line-chart.js +1 -1
- package/dropdown/content.js +1 -1
- package/dropdown/control.js +1 -1
- package/dropdown/editor-dropdown.style.scss +5 -0
- package/dropdown/index.js +2 -2
- package/dropdown/lookup-field.d.ts +5 -0
- 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 +27 -0
- package/field-configurator.js +4 -170
- package/field-expansion.d.ts +9 -0
- package/filter/filters/slider/_slider.scss +8 -25
- 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.d.ts +0 -1
- package/filter-controls.js +5 -6
- package/form-controls/index.d.ts +10 -2
- package/form-controls/index.js +7 -7
- package/form-controls/presentation.js +12 -12
- package/formatting/index.d.ts +1 -1
- package/formatting/index.js +22 -21
- package/formatting/styles.scss +2 -47
- package/framework.js +226 -222
- package/history-controls.js +27 -1
- package/icon-toolbar.d.ts +62 -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-controls.d.ts +54 -2
- package/native-styles.css +1 -1
- package/native.js +46 -43
- package/number-input/index.js +1 -1
- package/package.json +36 -1
- package/pagination.js +11 -11
- package/pdf-viewer/index.js +1 -1
- package/pickers.d.ts +5 -1
- package/preact-mount.js +1 -1
- package/preact.d.ts +8 -6
- package/preact.js +71 -64
- package/rating-choice.js +1 -1
- package/react-control.d.ts +2 -0
- package/react-control.js +2 -2
- package/react.d.ts +5 -6
- package/react.js +68 -66
- 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/search-input/index.js +1 -1
- package/search-input/native.d.ts +21 -2
- 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/_alert.scss +18 -4
- package/styles/_compositions.scss +3 -3
- package/styles/_editor-slider.scss +0 -2
- package/styles/_field-configurator.scss +147 -0
- package/styles/_fields-grid.scss +37 -0
- package/styles/_palette.scss +0 -24
- package/styles/_primitives.scss +28 -19
- package/styles/configurator-actions.scss +141 -0
- package/styles/{legacy-pagination.css → pagination.css} +19 -2
- package/styles.css +1 -1
- package/styles.scss +2 -2
- package/surfaces.d.ts +36 -2
- package/surfaces.js +35 -132
- package/svelte.js +3 -3
- package/switch/index.js +15 -14
- package/time-grid.d.ts +0 -1
- package/time-grid.js +38 -37
- package/timeline-track/index.js +2 -2
- package/ui.css +1 -1
- package/vue.d.ts +26 -30
- package/vue.js +117 -121
- 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/dialog.parts-CKGkC5zP.js +0 -134
- 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
- package/avatar/index.view.d.ts +0 -25
- package/color-palette/native.view.d.ts +0 -15
- package/control-presentation.view.d.ts +0 -8
- package/dialog/dialog-action-footer.view.d.ts +0 -20
- package/dialog/dialog.dom.view.d.ts +0 -15
- package/form-controls/index.view.d.ts +0 -10
- package/formatting/control-tooltip.d.ts +0 -27
- package/native-controls.view.d.ts +0 -54
- package/search-input/native.view.d.ts +0 -21
- package/surfaces.view.d.ts +0 -63
- /package/styles/{legacy-rating.css → rating.css} +0 -0
|
@@ -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, r as i, t as a } from "./hooks.module-CG3gN83z.js";
|
|
3
|
+
import { E as o, _ as s, a as c, c as l, i as u, m as d, n as f, o as p, p as m, r as h, t as g, u as _, v, y } from "./request-trail-CCSK6TJA.js";
|
|
4
|
+
import { t as b } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
5
|
+
import { n as x } from "./popup-C35Isk7p.js";
|
|
6
|
+
import { t as S } from "./controls-FUU-MUKC.js";
|
|
7
|
+
import { HistoryControls as C } from "../history-controls.js";
|
|
8
|
+
import { n as w } from "./render-m5eMMwFR.js";
|
|
9
|
+
//#region src/ai/transcript.ts
|
|
10
|
+
var T = (e) => new TextEncoder().encode(JSON.stringify(e)).byteLength, E = (e) => {
|
|
11
|
+
if (!e) return "";
|
|
12
|
+
if (T(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
|
+
T(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
|
+
}, D = 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 && T(e.result) <= 16384 ? structuredClone(e.result) : void 0, i = {
|
|
37
|
+
text: E(e.message),
|
|
38
|
+
phase: e.phase,
|
|
39
|
+
details: e.phase === "completed" && !r && e.resultDetails ? E(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: E(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 || T(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 O(T, E) {
|
|
88
|
+
let O = (e) => o(e, E.translations), k = !1, A = E.suggestions ?? [], j, M = v(E.promptHistory?.items ?? []), N = new D(), P = E.mode === "chat", F = [], I = 0, L = !1, R = "";
|
|
89
|
+
function z(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 === R) return;
|
|
98
|
+
let r = F.at(-1), i = {
|
|
99
|
+
id: L && r ? r.id : String(++I),
|
|
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 ? E.countLabel?.(e.matchedRows) ?? O("{count} matching rows").replace("{count}", e.matchedRows.toLocaleString()) : void 0,
|
|
104
|
+
detail: e.phase === "completed" && !e.result ? e.resultDetails : void 0
|
|
105
|
+
};
|
|
106
|
+
F = [...L && r ? F.slice(0, -1) : F, i].slice(-50), L = t, R = n;
|
|
107
|
+
}
|
|
108
|
+
function B({ state: t }) {
|
|
109
|
+
let [o, D] = r(""), [k, j] = r(M), [I, L] = r(!1), R = a();
|
|
110
|
+
i(() => {
|
|
111
|
+
D(""), R.current = void 0;
|
|
112
|
+
}, [t.chatKey]);
|
|
113
|
+
let z = t.phase === "understanding" || t.phase === "applying", B = !!t.pendingAction, H = t.steps ?? [], U = a(!1);
|
|
114
|
+
n(() => {
|
|
115
|
+
U.current && !B && !z && T.querySelector("textarea")?.focus(), U.current = B || z && U.current;
|
|
116
|
+
}, [B, z]), n(() => {
|
|
117
|
+
if (z || B || t.phase === "idle" || R.current === void 0) return;
|
|
118
|
+
let e = R.current;
|
|
119
|
+
R.current = void 0, t.phase === "completed" && D((t) => t.trim() === e ? "" : t);
|
|
120
|
+
}, [t]);
|
|
121
|
+
let W = (e) => {
|
|
122
|
+
R.current = e.trim(), E.promptHistory && (M = v([...M, e]), j(M), E.promptHistory.onChange?.([...M])), E.onSubmit(e);
|
|
123
|
+
}, G = /* @__PURE__ */ b(s, {
|
|
124
|
+
items: t.choices?.length ? t.choices : t.suggestions?.length ? t.suggestions : A,
|
|
125
|
+
onSelect: (e) => {
|
|
126
|
+
z || B || (D(e), W(e));
|
|
127
|
+
},
|
|
128
|
+
disabled: z || B
|
|
129
|
+
}), K = /* @__PURE__ */ b(h, {
|
|
130
|
+
label: E.prompt?.label ?? "Ask AI to change this view",
|
|
131
|
+
...E.prompt,
|
|
132
|
+
value: o,
|
|
133
|
+
onValueChange: D,
|
|
134
|
+
onSubmit: W,
|
|
135
|
+
onStop: E.onStop,
|
|
136
|
+
busy: z,
|
|
137
|
+
promptHistory: E.promptHistory ? k : void 0,
|
|
138
|
+
disabled: B,
|
|
139
|
+
hint: H.length ? "" : E.prompt?.hint,
|
|
140
|
+
footer: G,
|
|
141
|
+
actions: /* @__PURE__ */ b(g, {
|
|
142
|
+
...E.trail,
|
|
143
|
+
items: H,
|
|
144
|
+
onRemove: (e) => E.onRemoveStep?.(e),
|
|
145
|
+
onClear: E.onReset,
|
|
146
|
+
onEmpty: () => T.querySelector("textarea")?.focus(),
|
|
147
|
+
disabled: z || B,
|
|
148
|
+
removalsDisabled: !E.onRemoveStep || t.canEditSteps === !1,
|
|
149
|
+
clearDescription: E.trail?.clearDescription ?? "Restore the starting view",
|
|
150
|
+
clearLabel: E.trail?.clearLabel ?? E.resetLabel ?? "Clear all",
|
|
151
|
+
changedMessage: !z && H.length > 0 && t.canEditSteps === !1 ? E.trail?.changedMessage ?? "The view changed manually. Start a new request to continue." : void 0
|
|
152
|
+
})
|
|
153
|
+
}), q = t.pendingAction && /* @__PURE__ */ b(d, {
|
|
154
|
+
...t.pendingAction,
|
|
155
|
+
disabled: z || !E.onApplyAction,
|
|
156
|
+
onApply: () => E.onApplyAction?.(),
|
|
157
|
+
onCancel: () => E.onCancelAction?.()
|
|
158
|
+
}), J = /* @__PURE__ */ b("div", {
|
|
159
|
+
class: "rv-ai-result-actions",
|
|
160
|
+
children: [
|
|
161
|
+
(E.onUndoData || E.onRedoData) && /* @__PURE__ */ b(C, {
|
|
162
|
+
onUndo: E.onUndoData,
|
|
163
|
+
onRedo: E.onRedoData,
|
|
164
|
+
canUndo: !z && !B && !!t.canUndoData,
|
|
165
|
+
canRedo: !z && !B && !!t.canRedoData,
|
|
166
|
+
undoLabel: O("Undo data change"),
|
|
167
|
+
redoLabel: O("Redo data change"),
|
|
168
|
+
label: O("Data history")
|
|
169
|
+
}),
|
|
170
|
+
/* @__PURE__ */ b(S, {
|
|
171
|
+
disabled: z || B || !t.canRestore,
|
|
172
|
+
onClick: E.onRestore,
|
|
173
|
+
size: "compact",
|
|
174
|
+
children: O(E.restoreLabel ?? "Restore previous view")
|
|
175
|
+
}),
|
|
176
|
+
!H.length && /* @__PURE__ */ b(S, {
|
|
177
|
+
disabled: z || B,
|
|
178
|
+
onClick: E.onReset,
|
|
179
|
+
size: "compact",
|
|
180
|
+
variant: "ghost",
|
|
181
|
+
children: O(E.resetLabel ?? "Reset view")
|
|
182
|
+
}),
|
|
183
|
+
P && E.showClearChat !== !1 && /* @__PURE__ */ b(S, {
|
|
184
|
+
size: "compact",
|
|
185
|
+
variant: "ghost",
|
|
186
|
+
disabled: z || B || !E.onClearChat || !N.messages.length,
|
|
187
|
+
onClick: () => E.onClearChat?.(),
|
|
188
|
+
children: O("Clear chat")
|
|
189
|
+
})
|
|
190
|
+
]
|
|
191
|
+
}), Y = E.showHistoryControls === !1 ? null : E.controlsMountTo ? x(J, E.controlsMountTo) : J;
|
|
192
|
+
return /* @__PURE__ */ b(m, {
|
|
193
|
+
layout: E.layout,
|
|
194
|
+
translations: E.translations,
|
|
195
|
+
label: E.label,
|
|
196
|
+
busy: z,
|
|
197
|
+
footer: E.footer,
|
|
198
|
+
children: P ? /* @__PURE__ */ b(f, {
|
|
199
|
+
className: "rv-ai-mounted-chat",
|
|
200
|
+
children: [
|
|
201
|
+
/* @__PURE__ */ b(u, {
|
|
202
|
+
busy: z,
|
|
203
|
+
children: [!N.messages.length && E.emptyState && /* @__PURE__ */ b(c, { ...E.emptyState }), N.messages.map((e) => /* @__PURE__ */ b(p, {
|
|
204
|
+
from: e.from,
|
|
205
|
+
isStreaming: e.phase === "understanding" || e.phase === "applying",
|
|
206
|
+
children: [
|
|
207
|
+
e.from === "user" ? /* @__PURE__ */ b(l, { children: e.text }) : e.phase === "preview" && e.pending && e.id === N.messages.at(-1)?.id && t.pendingAction ? null : /* @__PURE__ */ b(l, { children: e.phase === "understanding" || e.phase === "applying" || e.phase === "error" || e.phase === "cancelled" ? /* @__PURE__ */ b(_, {
|
|
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__ */ b(y, {
|
|
212
|
+
result: e.result,
|
|
213
|
+
renderTable: E.renderTable
|
|
214
|
+
}) : e.details && /* @__PURE__ */ b("pre", {
|
|
215
|
+
class: "rv-ai-chat-result",
|
|
216
|
+
children: e.details
|
|
217
|
+
}),
|
|
218
|
+
e.id === N.messages.at(-1)?.id && e.pending && q
|
|
219
|
+
]
|
|
220
|
+
}, e.id))]
|
|
221
|
+
}),
|
|
222
|
+
K,
|
|
223
|
+
Y
|
|
224
|
+
]
|
|
225
|
+
}) : /* @__PURE__ */ b(e, { children: [
|
|
226
|
+
K,
|
|
227
|
+
q,
|
|
228
|
+
t.phase === "completed" && t.result && /* @__PURE__ */ b(y, {
|
|
229
|
+
result: t.result,
|
|
230
|
+
renderTable: E.renderTable
|
|
231
|
+
}),
|
|
232
|
+
!!F.length && /* @__PURE__ */ b(w, {
|
|
233
|
+
className: "rv-ai-activity",
|
|
234
|
+
title: O("Activity"),
|
|
235
|
+
compact: !0,
|
|
236
|
+
autoDismissMs: E.activityDurationMs,
|
|
237
|
+
onDismissItem: (e) => {
|
|
238
|
+
F = F.filter((t) => t.id !== e), V();
|
|
239
|
+
},
|
|
240
|
+
collapsed: I,
|
|
241
|
+
onCollapsedChange: L,
|
|
242
|
+
collapseLabel: O("Collapse activity"),
|
|
243
|
+
expandLabel: O("Expand activity"),
|
|
244
|
+
items: F
|
|
245
|
+
}),
|
|
246
|
+
Y
|
|
247
|
+
] })
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
let V = () => {
|
|
251
|
+
!k && j && t(/* @__PURE__ */ b(B, { state: j }), T);
|
|
252
|
+
};
|
|
253
|
+
return {
|
|
254
|
+
update(e) {
|
|
255
|
+
P ? N.update(e) : z(e), j = e, V();
|
|
256
|
+
},
|
|
257
|
+
setSuggestions(e) {
|
|
258
|
+
A = [...e], V();
|
|
259
|
+
},
|
|
260
|
+
destroy() {
|
|
261
|
+
k || (k = !0, M = [], N.clear(), t(null, T));
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
//#endregion
|
|
266
|
+
export { O as t };
|
|
@@ -3,7 +3,7 @@ import { t } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
|
3
3
|
import { createPreactElement as n } from "../preact-mount.js";
|
|
4
4
|
import { controlClassName as r } from "../control-attributes.js";
|
|
5
5
|
import { renderControl as i } from "../control-presentation.js";
|
|
6
|
-
//#region src/search-input/native.
|
|
6
|
+
//#region src/search-input/native.tsx
|
|
7
7
|
function a(e, t) {
|
|
8
8
|
let { shortcut: n, hideIcon: a, inputAttributes: o = {} } = t;
|
|
9
9
|
return e("div", {
|