@revolist/ui 4.0.2-rc → 4.0.3-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/LICENSE +21 -0
- package/README.md +345 -263
- package/_chunks/{calendar-CpaUK7w1.js → calendar-xpZ0v3xf.js} +39 -29
- package/_chunks/{chart-frame-BC99KjGa.js → chart-frame-Cmc7xU1i.js} +16 -13
- package/_chunks/{choice-chips-Cs4D-3nH.js → choice-chips-CHQTUdLs.js} +10 -10
- package/_chunks/clock-BOhPNlW3.js +4 -0
- package/_chunks/{color-palette-BBMFmUNA.js → color-palette-D8vyPfld.js} +1 -1
- package/_chunks/{color-picker-D90Jg-M8.js → color-picker-CudqPYZo.js} +10 -10
- package/_chunks/{component-YDcfoOLz.js → component-C_T2VN5u.js} +182 -178
- package/_chunks/{component-metadata-BENbgTjU.js → component-metadata-BMOOmqx5.js} +0 -4
- package/_chunks/control-AHKXD5Eu.js +93 -0
- package/_chunks/{control-tooltip-ztgmsG7H.js → control-tooltip-uscKfAnV.js} +15 -15
- package/_chunks/{controls-DIum-E66.js → controls-DsNi8V8I.js} +144 -129
- package/_chunks/{date-control-BJSzu79z.js → date-control-DrVFX13g.js} +1 -1
- package/_chunks/{date-time-BxPJusp9.js → date-time-qIhp5vaX.js} +143 -145
- package/_chunks/{delete-button-Bblyah10.js → delete-button-CW9vjLnk.js} +6 -6
- package/_chunks/{dialog.parts-DBqo3Qwb.js → dialog.parts-CKGkC5zP.js} +20 -20
- package/_chunks/{duration-87U2EoMS.js → duration-CL68Em0o.js} +16 -15
- package/_chunks/{editor-popup-D3JdS8l3.js → editor-popup-WDdtVDNA.js} +5 -5
- package/_chunks/field-context-D57PnBbH.js +5 -0
- package/_chunks/{framework-mount-C-Zwm44H.js → framework-mount--RTLIqE-.js} +1 -1
- package/_chunks/history-controls-B3u3INEK.js +27 -0
- package/_chunks/mount-DQ1cpppK.js +257 -0
- package/_chunks/native-control-C_yok8_-.js +605 -0
- package/_chunks/{number-input-BeIadZuL.js → number-input-BKwA5FnM.js} +2 -2
- package/_chunks/{picker-DpP7iQLA.js → picker-h1P5RUgp.js} +2 -2
- package/_chunks/popup-CT2uD3go.js +367 -0
- package/_chunks/{rating-choice-Ca8ZBty3.js → rating-choice-DZgmaic0.js} +1 -1
- package/_chunks/render-m5eMMwFR.js +83 -0
- package/_chunks/{reorder-list-Cc3KmfAN.js → reorder-list-CSlqAGHw.js} +1 -1
- package/_chunks/request-trail-DSlFix6i.js +618 -0
- package/_chunks/rich-text-CH7gIqOS.js +636 -0
- package/_chunks/rotate-right-Iha5ScJ1.js +4 -0
- package/_form.scss +1 -1
- package/ai/_chat.scss +195 -0
- package/ai/_style.scss +105 -34
- package/ai/chat.d.ts +63 -0
- package/ai/components.d.ts +19 -3
- package/ai/index.d.ts +2 -0
- package/ai/index.js +3 -3
- package/ai/mount.d.ts +30 -1
- package/ai/prompt-history.d.ts +13 -0
- package/ai/transcript.d.ts +25 -0
- package/ai/translations.d.ts +1 -1
- package/angular/angular.js +0 -3
- package/assignee/index.js +34 -35
- package/buttons/delete-button.d.ts +2 -1
- package/buttons/delete-button.js +1 -1
- package/buttons/remove-button.js +1 -1
- package/buttons/svg-button.d.ts +1 -0
- package/buttons/svg-button.js +5 -5
- package/calendar/_calendar.scss +7 -2
- package/calendar/calendar.js +1 -1
- package/calendar/index.js +2 -2
- package/choice-chips/index.js +1 -1
- package/color-palette/color-palette.js +1 -1
- package/color-palette/color-picker.js +2 -2
- package/component-catalog.d.ts +16 -5
- package/control-attributes.js +7 -7
- package/controls.d.ts +8 -6
- package/controls.js +3 -3
- package/core/editor-popup.js +1 -1
- package/date-time/index.js +1 -1
- package/date-time/style.scss +4 -4
- package/dialog/dialog.dom.js +8 -8
- package/dialog/dialog.parts.js +1 -1
- package/distribution-chart/area-chart.js +1 -1
- package/distribution-chart/bar-chart.d.ts +5 -2
- package/distribution-chart/bar-chart.js +7 -3
- package/distribution-chart/chart-frame.d.ts +2 -1
- package/distribution-chart/line-chart.js +1 -1
- package/dropdown/content.d.ts +2 -1
- package/dropdown/content.js +1 -142
- package/dropdown/control.d.ts +14 -0
- package/dropdown/control.js +1 -0
- package/dropdown/control.view.d.ts +6 -0
- package/dropdown/dropdown.types.d.ts +4 -0
- package/dropdown/editor-dropdown.style.scss +37 -9
- package/dropdown/index.d.ts +1 -1
- package/dropdown/index.js +3 -4
- package/dropdown/lookup-field.js +1 -1
- package/dropdown/popup.js +1 -141
- package/duration/index.js +1 -1
- package/duration/style.scss +1 -1
- package/editor-actions.js +1 -1
- package/field-configurator.js +6 -6
- package/fieldset.d.ts +3 -0
- package/filter/filters/slider/single.js +1 -1
- package/filter-badge.js +1 -1
- package/filter-controls.js +7 -7
- package/form-controls/field-context.d.ts +5 -0
- package/form-controls/index.js +7 -12
- package/form-controls/index.view.d.ts +2 -4
- package/form-controls/presentation.js +51 -43
- package/formatting/index.js +25 -21
- package/framework.js +215 -207
- package/history-controls.d.ts +14 -0
- package/history-controls.js +1 -0
- package/masked-input/index.js +1 -1
- package/native-control.d.ts +6 -4
- package/native-control.js +3 -26
- package/native-styles.css +1 -1
- package/native.js +31 -30
- package/number-input/index.js +1 -1
- package/package.json +18 -13
- package/pagination.d.ts +3 -0
- package/pagination.js +43 -33
- package/pdf-viewer/index.js +1 -1
- package/pdf-viewer/style.scss +3 -4
- package/preact.d.ts +2 -0
- package/preact.js +62 -62
- package/rating-choice.js +1 -1
- package/react-control.d.ts +0 -1
- package/react-control.js +2 -2
- package/react.d.ts +13 -3
- package/react.js +71 -88
- package/reorder-list.js +1 -1
- package/resource-picker/resource-picker-popup.js +1 -1
- package/resource-picker/resource-picker.js +4 -4
- package/resource-picker/resource-picker.scss +6 -3
- package/rich-text/engine.d.ts +16 -19
- package/rich-text/index.d.ts +7 -7
- package/rich-text/index.js +1 -1
- package/rich-text/model.d.ts +4 -3
- package/rich-text/render-model.d.ts +4 -5
- package/rich-text/style.scss +3 -12
- package/rich-text/toolbar.d.ts +6 -6
- package/rich-text/translations.d.ts +3 -15
- package/select.d.ts +20 -0
- package/select.js +1 -0
- package/status-feedback/exit-snapshot.js +4 -4
- package/status-feedback/index.js +2 -2
- package/status-feedback/popover.js +10 -10
- package/status-feedback/render.js +3 -44
- package/status-feedback/status-feedback.scss +7 -0
- package/status-feedback/types.d.ts +4 -0
- package/status-feedback/use-auto-dismiss.d.ts +3 -0
- package/styles/_compositions.scss +3 -1
- package/styles/_control.scss +12 -4
- package/styles/_primitives.scss +9 -8
- package/styles.css +1 -1
- package/surfaces.js +45 -45
- package/svelte/UiComponent.server.js +1 -48
- package/svelte/UiComponent.svelte +0 -21
- package/svelte.js +33 -68
- package/time-grid.js +1 -1
- package/timeline-track/component.d.ts +5 -1
- package/timeline-track/index.js +71 -54
- package/timeline-track/model.d.ts +9 -0
- package/timeline-track/model.js +10 -1
- package/ui.css +1 -1
- package/vue.d.ts +24 -5
- package/vue.js +140 -164
- package/_chunks/compat.module-DDB2pm9O.js +0 -229
- package/_chunks/dropdown-voWqmwAe.js +0 -357
- package/_chunks/mount-DZe_6VtR.js +0 -90
- package/_chunks/request-trail-IdNiFvKH.js +0 -347
- package/_chunks/rich-text-BzI1DyfF.js +0 -477
- package/react-native-select.d.ts +0 -6
- package/rich-text/syntax.d.ts +0 -2
- package/vue-native-select.d.ts +0 -9
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { t as e } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
2
2
|
//#region src/icons/cancel.svg?raw
|
|
3
|
-
var t = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path fill=\"currentColor\" d=\"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z\"/></svg>", n = ({ onClick: n, disabled: r,
|
|
3
|
+
var t = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path fill=\"currentColor\" d=\"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z\"/></svg>", n = ({ onClick: n, disabled: r, rounded: i, className: a, onMouseDown: o, onDblClick: s, locale: c = {
|
|
4
4
|
title: "Remove",
|
|
5
5
|
ariaLabel: "Remove"
|
|
6
6
|
} }) => /* @__PURE__ */ e("button", {
|
|
7
|
-
onMouseDown:
|
|
8
|
-
onDblClick:
|
|
7
|
+
onMouseDown: o,
|
|
8
|
+
onDblClick: s,
|
|
9
9
|
onClick: n,
|
|
10
10
|
disabled: r,
|
|
11
11
|
type: "button",
|
|
12
|
-
title:
|
|
13
|
-
"aria-label":
|
|
14
|
-
className: `rounded-lg flex focus:outline-none remove-btn rv-chip-remove${i ? ` ${
|
|
12
|
+
title: c.title,
|
|
13
|
+
"aria-label": c.ariaLabel,
|
|
14
|
+
className: `rounded-lg flex focus:outline-none remove-btn rv-chip-remove${i ? " rv-btn-rounded" : ""}${a ? ` ${a}` : ""}`,
|
|
15
15
|
dangerouslySetInnerHTML: { __html: t }
|
|
16
16
|
});
|
|
17
17
|
//#endregion
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { c as e, i as t } from "./preact.module-BBM36DnO.js";
|
|
2
2
|
import { t as n } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
3
|
-
import { n as r } from "./
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { n as r, t as i } from "./native-control-C_yok8_-.js";
|
|
4
|
+
import { r as a } from "./popup-CT2uD3go.js";
|
|
5
|
+
import { createPreactElement as o, releasePreactElement as s } from "../preact-mount.js";
|
|
6
6
|
import { t as c } from "./xmark-DD_PBvZI.js";
|
|
7
7
|
//#region src/dialog/dialog-action-footer.view.tsx
|
|
8
|
-
function l({ cancel: e = {}, save: t = {}, deleteAction: r = !1, reset:
|
|
9
|
-
let f = (e, t, r,
|
|
8
|
+
function l({ cancel: e = {}, save: t = {}, deleteAction: r = !1, reset: a = !1, start: o, end: s, children: c, actionsClass: l = "", class: u = "", ...d }) {
|
|
9
|
+
let f = (e, t, r, a = "", o = "button") => {
|
|
10
10
|
if (t === !1) return null;
|
|
11
11
|
let { label: s = r, class: c = "", ...l } = t;
|
|
12
|
-
return /* @__PURE__ */ n(
|
|
13
|
-
type:
|
|
12
|
+
return /* @__PURE__ */ n(i, {
|
|
13
|
+
type: o,
|
|
14
14
|
...l,
|
|
15
|
-
class: `rv-btn ${
|
|
15
|
+
class: `rv-btn ${a} ${c}`,
|
|
16
16
|
"data-dialog-action": e,
|
|
17
17
|
children: s
|
|
18
18
|
});
|
|
@@ -25,9 +25,9 @@ function l({ cancel: e = {}, save: t = {}, deleteAction: r = !1, reset: i = !1,
|
|
|
25
25
|
children: [/* @__PURE__ */ n("div", {
|
|
26
26
|
class: "rv-dialog__action-start",
|
|
27
27
|
children: [
|
|
28
|
-
|
|
28
|
+
o,
|
|
29
29
|
f("delete", r, "Delete", "rv-btn-danger-outline"),
|
|
30
|
-
f("reset",
|
|
30
|
+
f("reset", a, "Reset")
|
|
31
31
|
]
|
|
32
32
|
}), /* @__PURE__ */ n("div", {
|
|
33
33
|
class: `rv-dialog__actions ${l}`,
|
|
@@ -44,14 +44,14 @@ function u(e, t) {
|
|
|
44
44
|
return /* @__PURE__ */ n(l, { ...t });
|
|
45
45
|
}
|
|
46
46
|
function d(e, t) {
|
|
47
|
-
let r =
|
|
47
|
+
let r = o(e.ownerDocument, /* @__PURE__ */ n(l, { ...t }));
|
|
48
48
|
return e.append(r), { destroy() {
|
|
49
|
-
|
|
49
|
+
s(r);
|
|
50
50
|
} };
|
|
51
51
|
}
|
|
52
52
|
//#endregion
|
|
53
53
|
//#region src/dialog/dialog.parts.tsx
|
|
54
|
-
var f =
|
|
54
|
+
var f = a(({ class: e = "", ...t }, r) => /* @__PURE__ */ n("header", {
|
|
55
55
|
...t,
|
|
56
56
|
ref: r,
|
|
57
57
|
class: `rv-dialog__header ${e}`
|
|
@@ -62,21 +62,21 @@ function p({ class: e = "", ...t }) {
|
|
|
62
62
|
class: `rv-dialog__surface ${e}`
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
var m =
|
|
65
|
+
var m = a(({ class: e = "", ...t }, r) => /* @__PURE__ */ n("div", {
|
|
66
66
|
...t,
|
|
67
67
|
ref: r,
|
|
68
68
|
class: `rv-dialog__body ${e}`
|
|
69
|
-
})), h =
|
|
69
|
+
})), h = a(({ class: e = "", ...t }, r) => /* @__PURE__ */ n("footer", {
|
|
70
70
|
...t,
|
|
71
71
|
ref: r,
|
|
72
72
|
class: `rv-dialog__footer ${e}`
|
|
73
|
-
})), g =
|
|
73
|
+
})), g = a(({ class: e = "", ...t }, r) => /* @__PURE__ */ n("div", {
|
|
74
74
|
...t,
|
|
75
75
|
ref: r,
|
|
76
76
|
class: `rv-dialog__actions ${e}`
|
|
77
77
|
}));
|
|
78
78
|
function _({ class: e = "", iconClass: t = "", ...r }) {
|
|
79
|
-
return /* @__PURE__ */ n(
|
|
79
|
+
return /* @__PURE__ */ n(i, {
|
|
80
80
|
...r,
|
|
81
81
|
unstyled: !0,
|
|
82
82
|
type: "button",
|
|
@@ -88,11 +88,11 @@ function _({ class: e = "", iconClass: t = "", ...r }) {
|
|
|
88
88
|
})
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
|
-
var v =
|
|
91
|
+
var v = a(({ class: e = "", ...t }, i) => /* @__PURE__ */ n(r, {
|
|
92
92
|
...t,
|
|
93
|
-
ref:
|
|
93
|
+
ref: i,
|
|
94
94
|
class: `rv-dialog__title-input ${e}`
|
|
95
|
-
})), y =
|
|
95
|
+
})), y = a(({ titleId: e, title: r, name: i, description: a, inputLabel: o, titleHidden: s, headingClass: c = "", kickerClass: l = "", titleClass: u = "", inputProps: d, closeLabel: p, closeProps: m, onClose: h, class: g = "", ...y }, b) => /* @__PURE__ */ n(f, {
|
|
96
96
|
...y,
|
|
97
97
|
ref: b,
|
|
98
98
|
class: `rv-dialog__header--editable ${g}`,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as e } from "./preact.module-BBM36DnO.js";
|
|
2
2
|
import { c as t, i as n, t as r } from "./hooks.module-CG3gN83z.js";
|
|
3
3
|
import { t as i } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
4
|
-
import {
|
|
4
|
+
import { l as a, n as o } from "./native-control-C_yok8_-.js";
|
|
5
5
|
import { SegmentedSwitch as s } from "../segmented-switch/index.js";
|
|
6
6
|
import { SingleValueSlider as c } from "../filter/filters/slider/single.js";
|
|
7
7
|
import { n as l } from "./editor-commit-Bq3wSgvr.js";
|
|
@@ -112,7 +112,7 @@ var v = {
|
|
|
112
112
|
year: "year"
|
|
113
113
|
};
|
|
114
114
|
function y(t) {
|
|
115
|
-
let { unit: n, amount: r } = t,
|
|
115
|
+
let { unit: n, amount: r } = t, o = t.onCommit ?? t.onChange, l = [...new Set(t.allowedUnits ?? Object.keys(v))], u = typeof t.slider == "object" ? t.slider : {}, d = Number.isFinite(t.min) ? Math.max(0, t.min) : 0, f = Math.max(d + 100, r), p = Number.isFinite(t.max) ? t.max : Number.isFinite(u.max) ? u.max : f, m = Number.isFinite(u.step) && u.step > 0 ? u.step : 1;
|
|
116
116
|
return /* @__PURE__ */ i(e, { children: [t.slider && /* @__PURE__ */ i("span", {
|
|
117
117
|
class: "rv-duration-field__slider",
|
|
118
118
|
children: [/* @__PURE__ */ i(c, {
|
|
@@ -136,15 +136,16 @@ function y(t) {
|
|
|
136
136
|
})]
|
|
137
137
|
}), t.unitButtons && /* @__PURE__ */ i("span", {
|
|
138
138
|
class: "rv-duration-field__modes",
|
|
139
|
-
children: [l.length === 0 ? null : l.length > 5 ? /* @__PURE__ */ i(
|
|
140
|
-
|
|
139
|
+
children: [l.length === 0 ? null : l.length > 5 ? /* @__PURE__ */ i(a, {
|
|
140
|
+
className: "rv-select",
|
|
141
|
+
config: { ariaLabel: t.unitLabel ?? "Duration unit" },
|
|
142
|
+
source: l.map((e) => ({
|
|
143
|
+
value: e,
|
|
144
|
+
label: t.unitLabels?.[e] ?? v[e]
|
|
145
|
+
})),
|
|
141
146
|
value: n,
|
|
142
147
|
disabled: t.disabled,
|
|
143
|
-
onChange: (e) =>
|
|
144
|
-
children: l.map((e) => /* @__PURE__ */ i("option", {
|
|
145
|
-
value: e,
|
|
146
|
-
children: t.unitLabels?.[e] ?? v[e]
|
|
147
|
-
}, e))
|
|
148
|
+
onChange: (e) => o(r, e)
|
|
148
149
|
}) : /* @__PURE__ */ i(s, {
|
|
149
150
|
role: "radiogroup",
|
|
150
151
|
ariaLabel: t.unitLabel ?? "Duration unit",
|
|
@@ -155,7 +156,7 @@ function y(t) {
|
|
|
155
156
|
ariaLabel: t.unitLabels?.[e] ?? e
|
|
156
157
|
})),
|
|
157
158
|
disabled: t.disabled,
|
|
158
|
-
onChange: (e) =>
|
|
159
|
+
onChange: (e) => o(r, e)
|
|
159
160
|
}), t.allowElapsed && /* @__PURE__ */ i(s, {
|
|
160
161
|
role: "radiogroup",
|
|
161
162
|
ariaLabel: t.modeLabel ?? "Duration mode",
|
|
@@ -168,19 +169,19 @@ function y(t) {
|
|
|
168
169
|
label: t.elapsedLabel ?? "Elapsed"
|
|
169
170
|
}],
|
|
170
171
|
disabled: t.disabled,
|
|
171
|
-
onChange: (e) =>
|
|
172
|
+
onChange: (e) => o(r, n, e === "elapsed")
|
|
172
173
|
})]
|
|
173
174
|
})] });
|
|
174
175
|
}
|
|
175
176
|
//#endregion
|
|
176
177
|
//#region src/duration/index.tsx
|
|
177
178
|
function b(e) {
|
|
178
|
-
let
|
|
179
|
+
let a = (t) => t && typeof t == "object" ? g(t.value, t.unit, {
|
|
179
180
|
elapsed: t.elapsed,
|
|
180
181
|
maximumFractionDigits: e.maximumFractionDigits ?? 10
|
|
181
|
-
}) : t === null ? "" : String(t), [s, c] = n(() => _(e.value, e).value?.unit ?? e.defaultUnit), [l, u] = n(() =>
|
|
182
|
+
}) : t === null ? "" : String(t), [s, c] = n(() => _(e.value, e).value?.unit ?? e.defaultUnit), [l, u] = n(() => a(e.value)), d = r(e.value);
|
|
182
183
|
t(() => {
|
|
183
|
-
e.value !== d.current && (d.current = e.value, u(
|
|
184
|
+
e.value !== d.current && (d.current = e.value, u(a(e.value)), c(_(e.value, e).value?.unit ?? e.defaultUnit));
|
|
184
185
|
}, [e.value]);
|
|
185
186
|
let f = {
|
|
186
187
|
...e,
|
|
@@ -204,7 +205,7 @@ function b(e) {
|
|
|
204
205
|
return /* @__PURE__ */ i("span", {
|
|
205
206
|
class: `rv-duration-field ${e.className ?? ""}`,
|
|
206
207
|
children: [
|
|
207
|
-
/* @__PURE__ */ i(
|
|
208
|
+
/* @__PURE__ */ i(o, {
|
|
208
209
|
type: "text",
|
|
209
210
|
"aria-label": e.label ?? "Duration",
|
|
210
211
|
"aria-invalid": !p.valid,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { calculateAnchoredPopoverPosition as e } from "../core/anchored-popover.js";
|
|
2
2
|
import { t } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { hideTopLayerPopup as n, showTopLayerPopup as r } from "../core/top-layer-popup.js";
|
|
4
|
+
import { createPreactElement as i, releasePreactElement as a } from "../preact-mount.js";
|
|
5
5
|
import { t as o } from "./editor-commit-Bq3wSgvr.js";
|
|
6
6
|
//#region src/core/editor-popup-position.ts
|
|
7
7
|
function s(t, n, r, i = 4, a = 8) {
|
|
@@ -22,7 +22,7 @@ function l(e, l, u) {
|
|
|
22
22
|
let p = !1, m, h = (e) => (m = e, () => {
|
|
23
23
|
m === e && (m = void 0);
|
|
24
24
|
}), g = () => {
|
|
25
|
-
p || (p = !0, T.disconnect(), w?.disconnect(), d.removeEventListener("pointerdown", v, !0), d.removeEventListener("keydown", y, !0), d.removeEventListener("scroll", b, !0), f.removeEventListener("resize", g),
|
|
25
|
+
p || (p = !0, T.disconnect(), w?.disconnect(), d.removeEventListener("pointerdown", v, !0), d.removeEventListener("keydown", y, !0), d.removeEventListener("scroll", b, !0), f.removeEventListener("resize", g), n(x, S), a(x), x.remove(), c.get(d)?.element === x && c.delete(d), u.onClose?.(), e.isConnected && e.focus({ preventScroll: !0 }));
|
|
26
26
|
}, _ = (e) => e ? x.contains(e) ? !0 : [...x.querySelectorAll("[aria-controls]")].some((t) => t.getAttribute("aria-controls")?.split(" ").some((t) => d.getElementById(t)?.contains(e))) : !1, v = (t) => {
|
|
27
27
|
_(t.target) || e.contains(t.target) || (u.isAvailable && !u.isAvailable() ? g() : m?.() === !1 ? (t.preventDefault(), t.stopPropagation()) : g());
|
|
28
28
|
}, y = (e) => {
|
|
@@ -37,7 +37,7 @@ function l(e, l, u) {
|
|
|
37
37
|
}, b = (t) => {
|
|
38
38
|
let n = t.target;
|
|
39
39
|
_(n) || n && (n.contains(e) || E?.contains(n)) && C();
|
|
40
|
-
}, x =
|
|
40
|
+
}, x = i(d, /* @__PURE__ */ t("div", {
|
|
41
41
|
class: `rv-editor-popup ${u.className ?? ""}`,
|
|
42
42
|
role: "dialog",
|
|
43
43
|
"aria-label": u.label,
|
|
@@ -51,7 +51,7 @@ function l(e, l, u) {
|
|
|
51
51
|
})
|
|
52
52
|
}));
|
|
53
53
|
x.style.direction = f.getComputedStyle(e).direction, (e.closest("dialog, [role=\"dialog\"], [role=\"menu\"]") ?? e.closest("revo-grid") ?? d.body).append(x);
|
|
54
|
-
let S =
|
|
54
|
+
let S = r(x, "block"), C = () => {
|
|
55
55
|
x.style.maxHeight = "";
|
|
56
56
|
let t = s(e.getBoundingClientRect(), x.getBoundingClientRect(), {
|
|
57
57
|
width: f.innerWidth,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as e, r as t } from "./preact.module-BBM36DnO.js";
|
|
2
2
|
import { r as n, t as r } from "./hooks.module-CG3gN83z.js";
|
|
3
|
-
import { n as i } from "./component-metadata-
|
|
3
|
+
import { n as i } from "./component-metadata-BMOOmqx5.js";
|
|
4
4
|
//#region src/framework-mount.ts
|
|
5
5
|
function a(i, a) {
|
|
6
6
|
let o = /* @__PURE__ */ new Map(), s = !1, c = 0;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { t as e } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
2
|
+
import { SvgButton as t } from "../buttons/svg-button.js";
|
|
3
|
+
import "./rotate-right-Iha5ScJ1.js";
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region src/history-controls.tsx
|
|
6
|
+
function n({ onUndo: n, onRedo: r, canUndo: i, canRedo: a, undoLabel: o = "Undo", redoLabel: s = "Redo", label: c = "History", undoCount: l, redoCount: u }) {
|
|
7
|
+
return /* @__PURE__ */ e("div", {
|
|
8
|
+
class: "rv-history-controls",
|
|
9
|
+
role: "group",
|
|
10
|
+
"aria-label": c,
|
|
11
|
+
children: [n && /* @__PURE__ */ e(t, {
|
|
12
|
+
icon: "<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>",
|
|
13
|
+
label: o,
|
|
14
|
+
badge: l,
|
|
15
|
+
disabled: !i,
|
|
16
|
+
onClick: n
|
|
17
|
+
}), r && /* @__PURE__ */ e(t, {
|
|
18
|
+
icon: "<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=\"M488 192l-144 0c-9.7 0-18.5-5.8-22.2-14.8s-1.7-19.3 5.2-26.2l46.7-46.7c-75.3-58.6-184.3-53.3-253.5 15.9-75 75-75 196.5 0 271.5s196.5 75 271.5 0c8.2-8.2 15.5-16.9 21.9-26.1 10.1-14.5 30.1-18 44.6-7.9s18 30.1 7.9 44.6c-8.5 12.2-18.2 23.8-29.1 34.7-100 100-262.1 100-362 0S-25 175 75 75c94.3-94.3 243.7-99.6 344.3-16.2L471 7c6.9-6.9 17.2-8.9 26.2-5.2S512 14.3 512 24l0 144c0 13.3-10.7 24-24 24z\"/></svg>",
|
|
19
|
+
label: s,
|
|
20
|
+
badge: u,
|
|
21
|
+
disabled: !a,
|
|
22
|
+
onClick: r
|
|
23
|
+
})]
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { n as t };
|
|
@@ -0,0 +1,257 @@
|
|
|
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 { t as a } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
4
|
+
import { n as o } from "./controls-DsNi8V8I.js";
|
|
5
|
+
import { _ as s, c, h 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, x as y } from "./request-trail-DSlFix6i.js";
|
|
6
|
+
import { t as b } from "./history-controls-B3u3INEK.js";
|
|
7
|
+
import { n as x } from "./render-m5eMMwFR.js";
|
|
8
|
+
//#region src/ai/transcript.ts
|
|
9
|
+
var S = (e) => new TextEncoder().encode(JSON.stringify(e)).byteLength, C = (e) => {
|
|
10
|
+
if (!e) return "";
|
|
11
|
+
if (S(e) <= 16384) return e;
|
|
12
|
+
let t = 0, n = Math.min(e.length, 16384);
|
|
13
|
+
for (; t < n;) {
|
|
14
|
+
let r = Math.ceil((t + n) / 2);
|
|
15
|
+
S(e.slice(0, r) + "…") <= 16384 ? t = r : n = r - 1;
|
|
16
|
+
}
|
|
17
|
+
return /[\uD800-\uDBFF]/.test(e.charAt(t - 1)) && t--, e.slice(0, t) + "…";
|
|
18
|
+
}, w = class {
|
|
19
|
+
messages = [];
|
|
20
|
+
epoch = 0;
|
|
21
|
+
initialized = !1;
|
|
22
|
+
requestId;
|
|
23
|
+
ignoredRequest;
|
|
24
|
+
currentId;
|
|
25
|
+
active = !1;
|
|
26
|
+
lastPhase;
|
|
27
|
+
key = "";
|
|
28
|
+
sequence = 0;
|
|
29
|
+
update(e) {
|
|
30
|
+
if (this.initialized ||= (this.epoch = e.chatKey ?? 0, !0), (e.chatKey ?? 0) !== this.epoch) {
|
|
31
|
+
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;
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (e.phase === "idle" || e.request?.id === this.ignoredRequest && this.ignoredRequest !== void 0) return;
|
|
35
|
+
let t = e.request, n = !!t && t.id !== this.requestId, r = {
|
|
36
|
+
text: C(e.message),
|
|
37
|
+
phase: e.phase,
|
|
38
|
+
details: e.phase === "completed" && e.resultDetails ? C(e.resultDetails) : void 0,
|
|
39
|
+
pending: !!e.pendingAction
|
|
40
|
+
}, i = JSON.stringify([t?.id, r]);
|
|
41
|
+
if (!n && i === this.key || !n && !r.text && !r.pending) return;
|
|
42
|
+
let a = this.messages.find((e) => e.id === this.currentId), o = this.lastPhase === "completed" && e.phase === "understanding" && a?.from === "assistant";
|
|
43
|
+
if (n) {
|
|
44
|
+
this.requestId = t.id, this.ignoredRequest = void 0;
|
|
45
|
+
let e = "turn:" + ++this.sequence;
|
|
46
|
+
this.currentId = e + ":assistant", this.messages = [
|
|
47
|
+
...this.messages,
|
|
48
|
+
{
|
|
49
|
+
id: e + ":user",
|
|
50
|
+
group: e,
|
|
51
|
+
from: "user",
|
|
52
|
+
text: C(t.prompt)
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: this.currentId,
|
|
56
|
+
group: e,
|
|
57
|
+
from: "assistant",
|
|
58
|
+
...r
|
|
59
|
+
}
|
|
60
|
+
];
|
|
61
|
+
} else if ((this.active || o) && a) this.messages = this.messages.map((e) => e.id === this.currentId ? {
|
|
62
|
+
...e,
|
|
63
|
+
...r
|
|
64
|
+
} : e);
|
|
65
|
+
else {
|
|
66
|
+
let e = "system:" + ++this.sequence;
|
|
67
|
+
this.currentId = e, this.messages = [...this.messages, {
|
|
68
|
+
id: e,
|
|
69
|
+
group: e,
|
|
70
|
+
from: "system",
|
|
71
|
+
...r
|
|
72
|
+
}];
|
|
73
|
+
}
|
|
74
|
+
for (this.active = e.phase === "understanding" || e.phase === "applying" || !!e.pendingAction, this.lastPhase = e.phase, this.key = i; this.messages.length > 50 || S(this.messages) > 65536;) {
|
|
75
|
+
let e = this.messages[0].group;
|
|
76
|
+
this.messages = this.messages.filter((t) => t.group !== e);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
clear() {
|
|
80
|
+
this.messages = [], this.requestId = void 0, this.currentId = void 0, this.active = !1, this.key = "";
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/ai/mount.tsx
|
|
85
|
+
function T(S, C) {
|
|
86
|
+
let T = (e) => y(e, C.translations), E = !1, D = C.suggestions ?? [], O, k = v(C.promptHistory?.items ?? []), A = new w(), j = C.mode === "chat", M = [], N = 0, P = !1, F = "";
|
|
87
|
+
function I(e) {
|
|
88
|
+
if (e.phase === "idle" || !e.message || e.pendingAction) return;
|
|
89
|
+
let t = e.phase === "understanding" || e.phase === "applying", n = JSON.stringify([
|
|
90
|
+
e.phase,
|
|
91
|
+
e.message,
|
|
92
|
+
e.matchedRows,
|
|
93
|
+
e.resultDetails
|
|
94
|
+
]);
|
|
95
|
+
if (n === F) return;
|
|
96
|
+
let r = M.at(-1), i = {
|
|
97
|
+
id: P && r ? r.id : String(++N),
|
|
98
|
+
title: e.message,
|
|
99
|
+
busy: t,
|
|
100
|
+
tone: e.phase === "error" ? "danger" : e.phase === "completed" ? "success" : "neutral",
|
|
101
|
+
description: e.phase === "completed" && e.matchedRows !== void 0 ? C.countLabel?.(e.matchedRows) ?? T("{count} matching rows").replace("{count}", e.matchedRows.toLocaleString()) : void 0,
|
|
102
|
+
detail: e.phase === "completed" ? e.resultDetails : void 0
|
|
103
|
+
};
|
|
104
|
+
M = [...P && r ? M.slice(0, -1) : M, i].slice(-50), P = t, F = n;
|
|
105
|
+
}
|
|
106
|
+
function L({ state: t }) {
|
|
107
|
+
let [y, w] = r(""), [E, O] = r(k), [N, P] = r(!1), F = i();
|
|
108
|
+
n(() => {
|
|
109
|
+
w(""), F.current = void 0;
|
|
110
|
+
}, [t.chatKey]);
|
|
111
|
+
let I = t.phase === "understanding" || t.phase === "applying", L = !!t.pendingAction, z = t.steps ?? [], B = i(!1);
|
|
112
|
+
n(() => {
|
|
113
|
+
B.current && !L && !I && S.querySelector("textarea")?.focus(), B.current = L || I && B.current;
|
|
114
|
+
}, [L, I]), n(() => {
|
|
115
|
+
if (I || L || t.phase === "idle" || F.current === void 0) return;
|
|
116
|
+
let e = F.current;
|
|
117
|
+
F.current = void 0, t.phase === "completed" && w((t) => t.trim() === e ? "" : t);
|
|
118
|
+
}, [t]);
|
|
119
|
+
let V = (e) => {
|
|
120
|
+
F.current = e.trim(), C.promptHistory && (k = v([...k, e]), O(k), C.promptHistory.onChange?.([...k])), C.onSubmit(e);
|
|
121
|
+
}, H = j ? h : l, U = /* @__PURE__ */ a(s, {
|
|
122
|
+
items: t.choices?.length ? t.choices : t.suggestions?.length ? t.suggestions : D,
|
|
123
|
+
onSelect: (e) => {
|
|
124
|
+
I || L || (w(e), V(e));
|
|
125
|
+
},
|
|
126
|
+
disabled: I || L
|
|
127
|
+
}), W = /* @__PURE__ */ a(H, {
|
|
128
|
+
label: C.prompt?.label ?? "Ask AI to change this view",
|
|
129
|
+
...C.prompt,
|
|
130
|
+
value: y,
|
|
131
|
+
onValueChange: w,
|
|
132
|
+
onSubmit: V,
|
|
133
|
+
onStop: C.onStop,
|
|
134
|
+
busy: I,
|
|
135
|
+
promptHistory: C.promptHistory ? E : void 0,
|
|
136
|
+
disabled: L,
|
|
137
|
+
hint: z.length ? "" : C.prompt?.hint,
|
|
138
|
+
actions: /* @__PURE__ */ a(g, {
|
|
139
|
+
...C.trail,
|
|
140
|
+
items: z,
|
|
141
|
+
onRemove: (e) => C.onRemoveStep?.(e),
|
|
142
|
+
onClear: C.onReset,
|
|
143
|
+
onEmpty: () => S.querySelector("textarea")?.focus(),
|
|
144
|
+
disabled: I || L,
|
|
145
|
+
removalsDisabled: !C.onRemoveStep || t.canEditSteps === !1,
|
|
146
|
+
clearDescription: C.trail?.clearDescription ?? "Restore the starting view",
|
|
147
|
+
clearLabel: C.trail?.clearLabel ?? C.resetLabel ?? "Clear all",
|
|
148
|
+
changedMessage: !I && z.length > 0 && t.canEditSteps === !1 ? C.trail?.changedMessage ?? "The view changed manually. Start a new request to continue." : void 0
|
|
149
|
+
})
|
|
150
|
+
}), G = t.pendingAction && /* @__PURE__ */ a(d, {
|
|
151
|
+
...t.pendingAction,
|
|
152
|
+
disabled: I || !C.onApplyAction,
|
|
153
|
+
onApply: () => C.onApplyAction?.(),
|
|
154
|
+
onCancel: () => C.onCancelAction?.()
|
|
155
|
+
}), K = /* @__PURE__ */ a("div", {
|
|
156
|
+
class: "rv-ai-result-actions",
|
|
157
|
+
children: [
|
|
158
|
+
(C.onUndoData || C.onRedoData) && /* @__PURE__ */ a(b, {
|
|
159
|
+
onUndo: C.onUndoData,
|
|
160
|
+
onRedo: C.onRedoData,
|
|
161
|
+
canUndo: !I && !L && !!t.canUndoData,
|
|
162
|
+
canRedo: !I && !L && !!t.canRedoData,
|
|
163
|
+
undoLabel: T("Undo data change"),
|
|
164
|
+
redoLabel: T("Redo data change"),
|
|
165
|
+
label: T("Data history")
|
|
166
|
+
}),
|
|
167
|
+
/* @__PURE__ */ a(o, {
|
|
168
|
+
disabled: I || L || !t.canRestore,
|
|
169
|
+
onClick: C.onRestore,
|
|
170
|
+
size: "compact",
|
|
171
|
+
children: T(C.restoreLabel ?? "Restore previous view")
|
|
172
|
+
}),
|
|
173
|
+
!z.length && /* @__PURE__ */ a(o, {
|
|
174
|
+
disabled: I || L,
|
|
175
|
+
onClick: C.onReset,
|
|
176
|
+
size: "compact",
|
|
177
|
+
variant: "ghost",
|
|
178
|
+
children: T(C.resetLabel ?? "Reset view")
|
|
179
|
+
}),
|
|
180
|
+
j && /* @__PURE__ */ a(o, {
|
|
181
|
+
size: "compact",
|
|
182
|
+
variant: "ghost",
|
|
183
|
+
disabled: I || L || !C.onClearChat || !A.messages.length,
|
|
184
|
+
onClick: () => C.onClearChat?.(),
|
|
185
|
+
children: T("Clear chat")
|
|
186
|
+
})
|
|
187
|
+
]
|
|
188
|
+
});
|
|
189
|
+
return /* @__PURE__ */ a(m, {
|
|
190
|
+
translations: C.translations,
|
|
191
|
+
label: C.label,
|
|
192
|
+
busy: I,
|
|
193
|
+
footer: C.footer,
|
|
194
|
+
children: j ? /* @__PURE__ */ a(f, {
|
|
195
|
+
className: "rv-ai-mounted-chat",
|
|
196
|
+
children: [
|
|
197
|
+
/* @__PURE__ */ a(u, {
|
|
198
|
+
busy: I,
|
|
199
|
+
children: A.messages.map((e) => /* @__PURE__ */ a(p, {
|
|
200
|
+
from: e.from,
|
|
201
|
+
isStreaming: e.phase === "understanding" || e.phase === "applying",
|
|
202
|
+
children: [
|
|
203
|
+
e.from === "user" ? /* @__PURE__ */ a(c, { children: e.text }) : /* @__PURE__ */ a(c, { children: e.phase === "understanding" || e.phase === "applying" || e.phase === "error" || e.phase === "cancelled" ? /* @__PURE__ */ a(_, {
|
|
204
|
+
title: e.text,
|
|
205
|
+
status: e.phase === "understanding" || e.phase === "applying" ? "running" : e.phase === "error" ? "error" : "cancelled"
|
|
206
|
+
}) : e.text }),
|
|
207
|
+
e.details && /* @__PURE__ */ a("pre", {
|
|
208
|
+
class: "rv-ai-chat-result",
|
|
209
|
+
children: e.details
|
|
210
|
+
}),
|
|
211
|
+
e.id === A.messages.at(-1)?.id && e.pending && G
|
|
212
|
+
]
|
|
213
|
+
}, e.id))
|
|
214
|
+
}),
|
|
215
|
+
U,
|
|
216
|
+
W,
|
|
217
|
+
K
|
|
218
|
+
]
|
|
219
|
+
}) : /* @__PURE__ */ a(e, { children: [
|
|
220
|
+
U,
|
|
221
|
+
W,
|
|
222
|
+
G,
|
|
223
|
+
!!M.length && /* @__PURE__ */ a(x, {
|
|
224
|
+
className: "rv-ai-activity",
|
|
225
|
+
title: T("Activity"),
|
|
226
|
+
compact: !0,
|
|
227
|
+
autoDismissMs: C.activityDurationMs,
|
|
228
|
+
onDismissItem: (e) => {
|
|
229
|
+
M = M.filter((t) => t.id !== e), R();
|
|
230
|
+
},
|
|
231
|
+
collapsed: N,
|
|
232
|
+
onCollapsedChange: P,
|
|
233
|
+
collapseLabel: T("Collapse activity"),
|
|
234
|
+
expandLabel: T("Expand activity"),
|
|
235
|
+
items: M
|
|
236
|
+
}),
|
|
237
|
+
K
|
|
238
|
+
] })
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
let R = () => {
|
|
242
|
+
!E && O && t(/* @__PURE__ */ a(L, { state: O }), S);
|
|
243
|
+
};
|
|
244
|
+
return {
|
|
245
|
+
update(e) {
|
|
246
|
+
j ? A.update(e) : I(e), O = e, R();
|
|
247
|
+
},
|
|
248
|
+
setSuggestions(e) {
|
|
249
|
+
D = [...e], R();
|
|
250
|
+
},
|
|
251
|
+
destroy() {
|
|
252
|
+
E || (E = !0, k = [], A.clear(), t(null, S));
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
//#endregion
|
|
257
|
+
export { T as t };
|