@revolist/ui 4.0.1-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 -262
- package/_chunks/calendar-xpZ0v3xf.js +258 -0
- package/_chunks/chart-frame-Cmc7xU1i.js +130 -0
- package/_chunks/choice-chips-CHQTUdLs.js +110 -0
- package/_chunks/clock-BOhPNlW3.js +4 -0
- package/_chunks/{color-palette-BmZ7kH9R.js → color-palette-D8vyPfld.js} +41 -41
- package/_chunks/color-picker-CudqPYZo.js +138 -0
- package/_chunks/component-C_T2VN5u.js +863 -0
- package/_chunks/{component-metadata-BENbgTjU.js → component-metadata-BMOOmqx5.js} +0 -4
- package/_chunks/control-AHKXD5Eu.js +93 -0
- package/_chunks/{control-tooltip-BCNzQCXE.js → control-tooltip-uscKfAnV.js} +29 -29
- package/_chunks/{controller-CmLo-Ajc.js → controller-hRBm_Lfz.js} +15 -15
- package/_chunks/{controls-NEL5tDaz.js → controls-DsNi8V8I.js} +229 -214
- package/_chunks/{date-control-CYCkb1aQ.js → date-control-DrVFX13g.js} +21 -21
- package/_chunks/date-time-qIhp5vaX.js +768 -0
- package/_chunks/{delete-button-DnpmDNEJ.js → delete-button-CW9vjLnk.js} +7 -7
- package/_chunks/dialog.parts-CKGkC5zP.js +134 -0
- package/_chunks/duration-CL68Em0o.js +272 -0
- package/_chunks/editor-commit-Bq3wSgvr.js +12 -0
- package/_chunks/{editor-popup-B7fu_A_T.js → editor-popup-WDdtVDNA.js} +8 -8
- package/_chunks/field-context-D57PnBbH.js +5 -0
- package/_chunks/framework-mount--RTLIqE-.js +54 -0
- package/_chunks/history-controls-B3u3INEK.js +27 -0
- package/_chunks/hooks.module-CG3gN83z.js +157 -0
- package/_chunks/jsxRuntime.module-F6UFnpT-.js +30 -0
- package/_chunks/mount-DQ1cpppK.js +257 -0
- package/_chunks/native-control-C_yok8_-.js +605 -0
- package/_chunks/native.view-ByyZ1CT5.js +32 -0
- package/_chunks/{number-input-NnH57J4j.js → number-input-BKwA5FnM.js} +89 -89
- package/_chunks/picker-h1P5RUgp.js +122 -0
- package/_chunks/popup-CT2uD3go.js +367 -0
- package/_chunks/preact.module-BBM36DnO.js +290 -0
- package/_chunks/{rating-choice-CWAsNQNS.js → rating-choice-DZgmaic0.js} +10 -10
- package/_chunks/render-m5eMMwFR.js +83 -0
- package/_chunks/reorder-list-CSlqAGHw.js +59 -0
- 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/_vendor/preact/LICENSE +21 -0
- package/_vendor/preact/compat/src/index.d.ts +353 -0
- package/_vendor/preact/compat/src/suspense-list.d.ts +16 -0
- package/_vendor/preact/compat/src/suspense.d.ts +19 -0
- package/_vendor/preact/hooks/src/index.d.ts +145 -0
- package/_vendor/preact/src/dom.d.ts +2548 -0
- package/_vendor/preact/src/index.d.ts +373 -0
- package/_vendor/preact/src/jsx.d.ts +2958 -0
- package/activity-message.d.ts +1 -1
- package/activity-message.js +16 -16
- package/ai/_chat.scss +195 -0
- package/ai/_style.scss +105 -34
- package/ai/chat.d.ts +63 -0
- package/ai/components.d.ts +20 -4
- 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/request-trail.d.ts +1 -1
- package/ai/transcript.d.ts +25 -0
- package/ai/translation-context.d.ts +1 -1
- package/ai/translations.d.ts +1 -1
- package/alert.d.ts +2 -2
- package/angular/angular.js +0 -3
- package/assignee/field.d.ts +2 -2
- package/assignee/index.js +86 -87
- package/assignee/layout.d.ts +2 -2
- package/assignee/picker.d.ts +1 -1
- package/avatar/index.js +25 -25
- package/avatar/index.view.d.ts +1 -1
- package/brush-range/component.d.ts +1 -1
- package/brush-range/component.js +30 -30
- package/buttons/delete-button.d.ts +2 -1
- package/buttons/delete-button.js +1 -1
- package/buttons/remove-button.d.ts +1 -1
- package/buttons/remove-button.js +3 -3
- package/buttons/svg-button.d.ts +2 -1
- package/buttons/svg-button.js +35 -35
- package/calendar/_calendar.scss +7 -2
- package/calendar/calendar.d.ts +1 -1
- package/calendar/calendar.js +1 -1
- package/calendar/caption.d.ts +1 -1
- package/calendar/day.d.ts +1 -1
- package/calendar/day.js +4 -4
- package/calendar/header.d.ts +1 -1
- package/calendar/header.js +35 -35
- package/calendar/index.js +2 -2
- package/calendar/month-grid.d.ts +1 -1
- package/calendar/month-grid.js +37 -37
- package/calendar/picker.d.ts +1 -1
- package/calendar/types.d.ts +1 -1
- package/calendar/year-grid.d.ts +1 -1
- package/calendar/year-grid.js +12 -12
- package/checkbox/index.d.ts +2 -2
- package/checkbox/index.js +9 -9
- package/choice-chips/index.d.ts +1 -1
- package/choice-chips/index.js +1 -1
- package/color-palette/color-palette.d.ts +1 -1
- package/color-palette/color-palette.js +1 -1
- package/color-palette/color-picker.d.ts +1 -1
- package/color-palette/color-picker.js +2 -2
- package/component-catalog.d.ts +34 -23
- package/control-attributes.js +7 -7
- package/control-presentation.js +18 -18
- package/controls.d.ts +12 -10
- package/controls.js +3 -3
- package/core/editor-commit.d.ts +1 -1
- package/core/editor-popup.d.ts +1 -1
- package/core/editor-popup.js +1 -1
- package/date-time/date-control.d.ts +1 -1
- package/date-time/field.d.ts +2 -2
- package/date-time/index.js +1 -1
- package/date-time/picker.d.ts +1 -1
- package/date-time/style.scss +4 -4
- package/date-time/time-control.d.ts +1 -1
- package/date-time/time-selection.d.ts +1 -1
- package/date-time/types.d.ts +1 -1
- package/dialog/dialog-action-footer.view.d.ts +1 -1
- package/dialog/dialog.dom.js +52 -52
- package/dialog/dialog.parts.d.ts +18 -18
- package/dialog/dialog.parts.js +1 -1
- package/dialog/dialog.preact.d.ts +1 -1
- package/dialog/dialog.preact.js +6 -6
- package/distribution-chart/area-chart.d.ts +1 -1
- package/distribution-chart/area-chart.js +25 -25
- package/distribution-chart/bar-chart.d.ts +6 -3
- package/distribution-chart/bar-chart.js +10 -6
- package/distribution-chart/chart-frame.d.ts +3 -2
- package/distribution-chart/index.d.ts +1 -1
- package/distribution-chart/index.js +6 -6
- package/distribution-chart/line-chart.d.ts +1 -1
- package/distribution-chart/line-chart.js +9 -9
- package/distribution-chart/types.d.ts +1 -1
- package/dropdown/content.d.ts +3 -2
- package/dropdown/content.js +1 -141
- package/dropdown/control.d.ts +14 -0
- package/dropdown/control.js +1 -0
- package/dropdown/control.view.d.ts +6 -0
- package/dropdown/dropdown.service.d.ts +1 -1
- package/dropdown/dropdown.service.js +9 -9
- 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.d.ts +1 -1
- package/dropdown/lookup-field.js +41 -41
- package/dropdown/popup.d.ts +1 -1
- package/dropdown/popup.js +1 -140
- package/duration/controls.d.ts +1 -1
- package/duration/index.d.ts +2 -2
- package/duration/index.js +1 -1
- package/duration/style.scss +1 -1
- package/editor-actions.d.ts +1 -1
- package/editor-actions.js +21 -20
- package/editor-layout/index.d.ts +1 -1
- package/editor-layout/index.js +27 -27
- package/field-configurator.d.ts +1 -1
- package/field-configurator.js +93 -93
- package/field-reorder.hook.js +32 -32
- package/fieldset.d.ts +3 -0
- package/filter/filters/slider/preact.js +3 -3
- package/filter/filters/slider/single.d.ts +1 -1
- package/filter/filters/slider/single.js +23 -23
- package/filter-badge.d.ts +1 -1
- package/filter-badge.js +23 -22
- package/filter-controls.d.ts +1 -1
- package/filter-controls.js +30 -30
- package/form-controls/field-context.d.ts +5 -0
- package/form-controls/index.js +16 -21
- package/form-controls/index.view.d.ts +2 -4
- package/form-controls/presentation.d.ts +1 -1
- package/form-controls/presentation.js +59 -51
- package/formatting/comparison-preview.d.ts +1 -1
- package/formatting/control-tooltip.d.ts +1 -1
- package/formatting/icon-controls.d.ts +1 -1
- package/formatting/index.js +105 -100
- package/formatting/inspector-section.d.ts +1 -1
- package/formatting/typography-controls.d.ts +1 -1
- package/framework-mount.d.ts +1 -1
- package/framework.js +215 -207
- package/history-controls.d.ts +14 -0
- package/history-controls.js +1 -0
- package/icons/icon.d.ts +1 -1
- package/icons/icon.js +1 -1
- package/legend.d.ts +1 -1
- package/legend.js +12 -12
- package/masked-input/index.d.ts +1 -1
- package/masked-input/index.js +109 -109
- package/native-control.d.ts +14 -12
- package/native-control.js +3 -26
- package/native-styles.css +1 -1
- package/native.js +40 -39
- package/number-input/index.d.ts +1 -1
- package/number-input/index.js +1 -1
- package/package.json +18 -14
- package/pagination.d.ts +3 -0
- package/pagination.js +43 -33
- package/pdf-viewer/component.d.ts +1 -1
- package/pdf-viewer/controller.js +1 -1
- package/pdf-viewer/header.d.ts +1 -1
- package/pdf-viewer/index.js +13 -13
- package/pdf-viewer/search-bar.d.ts +1 -1
- package/pdf-viewer/status.d.ts +1 -1
- package/pdf-viewer/style.scss +3 -4
- package/pdf-viewer/toolbar.d.ts +1 -1
- package/pickers.d.ts +1 -1
- package/preact-mount.d.ts +1 -1
- package/preact-mount.js +1 -1
- package/preact.d.ts +2 -0
- package/preact.js +62 -62
- package/rating-choice.d.ts +1 -1
- package/rating-choice.js +1 -1
- package/react-adapter.d.ts +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.d.ts +1 -1
- package/reorder-list.js +1 -1
- package/resource-picker/resource-picker-avatar.d.ts +1 -1
- package/resource-picker/resource-picker-avatar.js +14 -14
- package/resource-picker/resource-picker-option.d.ts +1 -1
- package/resource-picker/resource-picker-option.js +28 -28
- package/resource-picker/resource-picker-popup.d.ts +1 -1
- package/resource-picker/resource-picker-popup.js +3 -3
- package/resource-picker/resource-picker.d.ts +1 -1
- package/resource-picker/resource-picker.js +88 -88
- 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 +7 -7
- package/rich-text/translations.d.ts +3 -15
- package/search-input/index.js +12 -12
- package/segmented-switch/index.d.ts +1 -1
- package/segmented-switch/index.js +1 -1
- 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.d.ts +2 -2
- 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 +49 -49
- package/svelte/UiComponent.server.js +1 -48
- package/svelte/UiComponent.svelte +0 -21
- package/svelte.js +33 -68
- package/switch/index.js +15 -15
- package/time-grid.d.ts +1 -1
- package/time-grid.js +58 -58
- package/timeline-track/component.d.ts +5 -1
- package/timeline-track/index.js +91 -74
- package/timeline-track/model.d.ts +9 -0
- package/timeline-track/model.js +10 -1
- package/ui.css +1 -1
- package/vue-adapter.d.ts +1 -1
- package/vue.d.ts +138 -119
- package/vue.js +150 -174
- package/_chunks/calendar-BsDxCYhI.js +0 -248
- package/_chunks/chart-frame-BvxbmEU9.js +0 -126
- package/_chunks/choice-chips-0HfOnK_4.js +0 -110
- package/_chunks/color-picker-BRv-__AM.js +0 -138
- package/_chunks/component-D4PH5UZT.js +0 -859
- package/_chunks/date-time-DjucJmbc.js +0 -769
- package/_chunks/dialog.parts-Dt3KinUz.js +0 -134
- package/_chunks/dropdown-CkGQBm1Q.js +0 -357
- package/_chunks/duration-BCaktcvz.js +0 -270
- package/_chunks/editor-commit-D6Rf5rGz.js +0 -12
- package/_chunks/framework-mount-BKIOsvY-.js +0 -54
- package/_chunks/mount-0-8opf1j.js +0 -90
- package/_chunks/native.view-8q_nwQ7x.js +0 -32
- package/_chunks/picker-oazJ7sO_.js +0 -121
- package/_chunks/reorder-list-BV3kZXso.js +0 -59
- package/_chunks/request-trail-D0oVzdRd.js +0 -347
- package/_chunks/rich-text-2Rla349o.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
|
@@ -0,0 +1,618 @@
|
|
|
1
|
+
import { i as e, n as t, s as n } from "./preact.module-BBM36DnO.js";
|
|
2
|
+
import { c as r, i, r as a, s as o, t as s } from "./hooks.module-CG3gN83z.js";
|
|
3
|
+
import { t as c } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
4
|
+
import { SvgIcon as l } from "../icons/icon.js";
|
|
5
|
+
import { l as u } from "./native-control-C_yok8_-.js";
|
|
6
|
+
import { RemoveButton as d } from "../buttons/remove-button.js";
|
|
7
|
+
import { t as f } from "./chevron-down-GbplLa6s.js";
|
|
8
|
+
import { D as p, M as m, l as h, m as g, n as _, o as v } from "./controls-DsNi8V8I.js";
|
|
9
|
+
import { createControlId as y } from "../core/control-id.js";
|
|
10
|
+
import { PopoverController as b } from "../surfaces.js";
|
|
11
|
+
import { t as x } from "./clock-BOhPNlW3.js";
|
|
12
|
+
//#region ../../node_modules/.pnpm/@fortawesome+fontawesome-free@7.3.1/node_modules/@fortawesome/fontawesome-free/svgs/solid/circle-check.svg?raw
|
|
13
|
+
var S = "<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=\"M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zM374 145.7c-10.7-7.8-25.7-5.4-33.5 5.3L221.1 315.2 169 263.1c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l72 72c5 5 11.8 7.5 18.8 7s13.4-4.1 17.5-9.8L379.3 179.2c7.8-10.7 5.4-25.7-5.3-33.5z\"/></svg>", C = "<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=\"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM167 167c9.4-9.4 24.6-9.4 33.9 0l55 55 55-55c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-55 55 55 55c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-55-55-55 55c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l55-55-55-55c-9.4-9.4-9.4-24.6 0-33.9z\"/></svg>", w = "<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=\"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM192 160l128 0c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32z\"/></svg>", T = /* @__PURE__ */ "AI chat,Clear chat,Conversation messages,Jump to latest,You,Assistant,System,Message actions,Start a conversation,Ask a question to get started.,Message,Type a message…,Working…,Reasoning summary,Pending,Running,Completed,Failed,Cancelled,{seconds}s,Data history,Review changes,Apply changes,Cancel changes,Undo data change,Redo data change,Ask AI to change this view,Filter or sort your data…,Send,Stop,Enter to send · Shift+Enter for a new line,Suggested requests,More,Activity,Collapse activity,Expand activity,AI view assistant,View steps,Clear all,Restore the starting view,Restore previous view,Reset view,The view changed manually. Start a new request to continue.,Remove request: {label},{count} step,{count} steps,{count} applied request,{count} applied requests,{count} matching rows".split(",");
|
|
14
|
+
function E(e, t = {}, n = {}) {
|
|
15
|
+
return (t[e] ?? e).replace(/\{(\w+)\}/g, (e, t) => Object.hasOwn(n, t) ? String(n[t]) : e);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/ai/translation-context.tsx
|
|
19
|
+
var D = n({});
|
|
20
|
+
function O({ translations: e, children: t }) {
|
|
21
|
+
return /* @__PURE__ */ c(D.Provider, {
|
|
22
|
+
value: e,
|
|
23
|
+
children: t
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function k(e) {
|
|
27
|
+
let t = o(D), n = e ?? t;
|
|
28
|
+
return (e, t) => E(e, n, t);
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/ai/prompt-history.ts
|
|
32
|
+
function A(e) {
|
|
33
|
+
if (!Array.isArray(e)) return [];
|
|
34
|
+
let t = e.slice(-20).filter((e) => typeof e == "string" && !!e.trim() && e.length <= 4e3).map((e) => e.trim()).filter((e, t, n) => !t || e !== n[t - 1]), n = [];
|
|
35
|
+
for (let e = t.length - 1; e >= 0; e--) new TextEncoder().encode(JSON.stringify([t[e], ...n])).byteLength <= 8192 && n.unshift(t[e]);
|
|
36
|
+
return n;
|
|
37
|
+
}
|
|
38
|
+
var j = class {
|
|
39
|
+
state;
|
|
40
|
+
reset() {
|
|
41
|
+
this.state = void 0;
|
|
42
|
+
}
|
|
43
|
+
move(e, t, n) {
|
|
44
|
+
let r = JSON.stringify(n);
|
|
45
|
+
if (this.state && (this.state.selected !== e || this.state.key !== r) && this.reset(), !n.length || !this.state && t === "down") return;
|
|
46
|
+
this.state ||= {
|
|
47
|
+
index: n.length,
|
|
48
|
+
draft: e,
|
|
49
|
+
selected: e,
|
|
50
|
+
key: r
|
|
51
|
+
};
|
|
52
|
+
let i = this.state.index + (t === "up" ? -1 : 1);
|
|
53
|
+
if (i >= n.length) {
|
|
54
|
+
let e = this.state.draft;
|
|
55
|
+
return this.reset(), e;
|
|
56
|
+
}
|
|
57
|
+
return this.state.index = Math.max(0, i), this.state.selected = n[this.state.index], this.state.selected;
|
|
58
|
+
}
|
|
59
|
+
}, M = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 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=\"M214.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 109.3 160 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-370.7 105.4 105.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z\"/></svg>", N = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 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=\"M64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32z\"/></svg>";
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/ai/components.tsx
|
|
62
|
+
function P({ translations: e, value: t, onValueChange: n, onSubmit: r, onStop: i, busy: o = !1, disabled: l = !1, label: u = "Ask AI to change this view", placeholder: d = "Filter or sort your data…", submitLabel: f = "Send", stopLabel: p = "Stop", promptHistory: h, hint: _ = "", actions: v, footer: b, textareaProps: x }) {
|
|
63
|
+
let S = k(e), C = s(y("ai-prompt")), w = s(!1), T = s(new j()), E = s();
|
|
64
|
+
a(() => {
|
|
65
|
+
if (!E.current) return;
|
|
66
|
+
let { element: e, position: t } = E.current;
|
|
67
|
+
e.setSelectionRange(t, t), E.current = void 0;
|
|
68
|
+
});
|
|
69
|
+
let D = `${C.current}-hint`, O = !!_ && !t.length, P = o && !!i, F = () => {
|
|
70
|
+
!l && !o && t.trim() && r(t.trim());
|
|
71
|
+
};
|
|
72
|
+
return /* @__PURE__ */ c("form", {
|
|
73
|
+
class: "rv-ai-prompt",
|
|
74
|
+
"aria-busy": o || void 0,
|
|
75
|
+
onSubmit: (e) => {
|
|
76
|
+
e.preventDefault(), F();
|
|
77
|
+
},
|
|
78
|
+
children: [/* @__PURE__ */ c("label", {
|
|
79
|
+
for: C.current,
|
|
80
|
+
class: "rv-ai-prompt-label rv-visually-hidden",
|
|
81
|
+
children: S(u)
|
|
82
|
+
}), /* @__PURE__ */ c("div", {
|
|
83
|
+
class: "rv-ai-prompt-composer",
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ c(m, {
|
|
86
|
+
rows: 1,
|
|
87
|
+
...x,
|
|
88
|
+
id: C.current,
|
|
89
|
+
"aria-describedby": O ? D : void 0,
|
|
90
|
+
value: t,
|
|
91
|
+
onValueChange: (e) => {
|
|
92
|
+
T.current.reset(), E.current = void 0, n(e);
|
|
93
|
+
},
|
|
94
|
+
placeholder: S(d),
|
|
95
|
+
disabled: l || o,
|
|
96
|
+
maxLength: 4e3,
|
|
97
|
+
onCompositionStart: () => {
|
|
98
|
+
w.current = !0;
|
|
99
|
+
},
|
|
100
|
+
onCompositionEnd: () => {
|
|
101
|
+
w.current = !1;
|
|
102
|
+
},
|
|
103
|
+
onKeyDown: (e) => {
|
|
104
|
+
let r = e.currentTarget;
|
|
105
|
+
if (h && !o && !l && !w.current && !e.isComposing && e.keyCode !== 229 && !e.altKey && !e.ctrlKey && !e.metaKey && !e.shiftKey && r.selectionStart === r.selectionEnd && (e.key === "ArrowUp" && !t.slice(0, r.selectionStart).includes("\n") || e.key === "ArrowDown" && !t.slice(r.selectionEnd).includes("\n"))) {
|
|
106
|
+
let i = T.current.move(t, e.key === "ArrowUp" ? "up" : "down", A(h));
|
|
107
|
+
if (i !== void 0) {
|
|
108
|
+
if (e.preventDefault(), i === t) return;
|
|
109
|
+
E.current = {
|
|
110
|
+
element: r,
|
|
111
|
+
position: i.length
|
|
112
|
+
}, n(i);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
e.key === "Enter" && !e.shiftKey && !e.isComposing && !w.current && e.keyCode !== 229 && (e.preventDefault(), F());
|
|
117
|
+
}
|
|
118
|
+
}),
|
|
119
|
+
b && /* @__PURE__ */ c("div", {
|
|
120
|
+
class: "rv-ai-prompt-footer",
|
|
121
|
+
children: b
|
|
122
|
+
}),
|
|
123
|
+
/* @__PURE__ */ c("div", {
|
|
124
|
+
class: "rv-ai-prompt-toolbar",
|
|
125
|
+
children: [/* @__PURE__ */ c("div", {
|
|
126
|
+
class: "rv-ai-prompt-tools",
|
|
127
|
+
children: [v, O && /* @__PURE__ */ c("span", {
|
|
128
|
+
id: D,
|
|
129
|
+
class: "rv-ai-prompt-hint",
|
|
130
|
+
children: S(_)
|
|
131
|
+
})]
|
|
132
|
+
}), /* @__PURE__ */ c(g, {
|
|
133
|
+
className: "rv-ai-prompt-submit",
|
|
134
|
+
type: P ? "button" : "submit",
|
|
135
|
+
label: S(P ? p : f),
|
|
136
|
+
icon: P ? N : M,
|
|
137
|
+
onClick: P ? (e) => {
|
|
138
|
+
e.preventDefault(), i?.();
|
|
139
|
+
} : void 0,
|
|
140
|
+
disabled: l || !P && !t.trim(),
|
|
141
|
+
busy: o && !P,
|
|
142
|
+
variant: "solid",
|
|
143
|
+
size: "compact"
|
|
144
|
+
})]
|
|
145
|
+
})
|
|
146
|
+
]
|
|
147
|
+
})]
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
function F({ translations: e, items: t, onSelect: n, disabled: r, label: i = "Suggested requests" }) {
|
|
151
|
+
let a = k(e);
|
|
152
|
+
if (!t.length) return null;
|
|
153
|
+
let o = t.map((e) => typeof e == "string" ? {
|
|
154
|
+
label: e,
|
|
155
|
+
prompt: e
|
|
156
|
+
} : e);
|
|
157
|
+
return /* @__PURE__ */ c("div", {
|
|
158
|
+
class: "rv-ai-suggestions",
|
|
159
|
+
role: "group",
|
|
160
|
+
"aria-label": a(i),
|
|
161
|
+
children: [o.slice(0, 3).map((e, t) => /* @__PURE__ */ c(_, {
|
|
162
|
+
className: "rv-ai-suggestion",
|
|
163
|
+
size: "compact",
|
|
164
|
+
disabled: r,
|
|
165
|
+
onClick: () => n(e.prompt),
|
|
166
|
+
children: e.label
|
|
167
|
+
}, `${t}:${e.prompt}`)), o.length > 3 && /* @__PURE__ */ c(u, {
|
|
168
|
+
className: "rv-ai-examples",
|
|
169
|
+
source: o.slice(3).map((e) => ({
|
|
170
|
+
value: e.prompt,
|
|
171
|
+
label: e.label
|
|
172
|
+
})),
|
|
173
|
+
disabled: r,
|
|
174
|
+
placeholder: a("More"),
|
|
175
|
+
renderSelectedValue: () => /* @__PURE__ */ c(l, {
|
|
176
|
+
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 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=\"M0 256a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm168 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm224-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z\"/></svg>",
|
|
177
|
+
size: 14
|
|
178
|
+
}),
|
|
179
|
+
config: { ariaLabel: a("More") },
|
|
180
|
+
onChange: (e) => {
|
|
181
|
+
typeof e == "string" && n(e);
|
|
182
|
+
}
|
|
183
|
+
})]
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
function I({ translations: e, phase: t, message: n }) {
|
|
187
|
+
let r = k(e);
|
|
188
|
+
return /* @__PURE__ */ c("div", {
|
|
189
|
+
class: "rv-ai-status",
|
|
190
|
+
"data-state": t,
|
|
191
|
+
role: "status",
|
|
192
|
+
"aria-live": "polite",
|
|
193
|
+
"aria-atomic": "true",
|
|
194
|
+
children: [(t === "understanding" || t === "applying") && /* @__PURE__ */ c("span", {
|
|
195
|
+
"aria-hidden": "true",
|
|
196
|
+
children: /* @__PURE__ */ c(p, { label: "" })
|
|
197
|
+
}), /* @__PURE__ */ c("span", { children: r(n) })]
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
function L({ translations: e, summary: t, matchedRows: n, countLabel: r, actions: i, children: a }) {
|
|
201
|
+
let o = k(e);
|
|
202
|
+
return /* @__PURE__ */ c("div", {
|
|
203
|
+
class: "rv-ai-result",
|
|
204
|
+
role: "status",
|
|
205
|
+
"aria-live": "polite",
|
|
206
|
+
children: [
|
|
207
|
+
/* @__PURE__ */ c("p", {
|
|
208
|
+
class: "rv-ai-result-summary",
|
|
209
|
+
children: t
|
|
210
|
+
}),
|
|
211
|
+
n !== void 0 && /* @__PURE__ */ c("p", {
|
|
212
|
+
class: "rv-ai-result-count",
|
|
213
|
+
children: r ? r(n) : o("{count} matching rows", { count: n.toLocaleString() })
|
|
214
|
+
}),
|
|
215
|
+
a,
|
|
216
|
+
i && /* @__PURE__ */ c("div", {
|
|
217
|
+
class: "rv-ai-result-actions",
|
|
218
|
+
children: i
|
|
219
|
+
})
|
|
220
|
+
]
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
function R({ translations: e = {}, label: t = "AI view assistant", children: n, footer: r, busy: i }) {
|
|
224
|
+
return /* @__PURE__ */ c(O, {
|
|
225
|
+
translations: e,
|
|
226
|
+
children: /* @__PURE__ */ c("section", {
|
|
227
|
+
class: "rv-ai-assistant",
|
|
228
|
+
"aria-label": ((t) => E(t, e))(t),
|
|
229
|
+
"aria-busy": i || void 0,
|
|
230
|
+
onKeyDown: (e) => e.stopPropagation(),
|
|
231
|
+
onKeyUp: (e) => e.stopPropagation(),
|
|
232
|
+
children: [n, r && /* @__PURE__ */ c("div", {
|
|
233
|
+
class: "rv-ai-assistant-footer",
|
|
234
|
+
children: r
|
|
235
|
+
})]
|
|
236
|
+
})
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
function z({ translations: t, summary: n, details: i, disabled: a, onApply: o, onCancel: l }) {
|
|
240
|
+
let u = k(t), d = s(null);
|
|
241
|
+
return r(() => {
|
|
242
|
+
d.current?.focus();
|
|
243
|
+
}, []), /* @__PURE__ */ c("section", {
|
|
244
|
+
class: "rv-ai-change-preview",
|
|
245
|
+
"aria-label": u("Review changes"),
|
|
246
|
+
onKeyDown: (e) => {
|
|
247
|
+
e.key === "Escape" && !a && (e.preventDefault(), l());
|
|
248
|
+
},
|
|
249
|
+
children: /* @__PURE__ */ c(L, {
|
|
250
|
+
summary: n,
|
|
251
|
+
actions: /* @__PURE__ */ c(e, { children: [/* @__PURE__ */ c(_, {
|
|
252
|
+
ref: d,
|
|
253
|
+
disabled: a,
|
|
254
|
+
onClick: o,
|
|
255
|
+
children: u("Apply changes")
|
|
256
|
+
}), /* @__PURE__ */ c(_, {
|
|
257
|
+
disabled: a,
|
|
258
|
+
variant: "ghost",
|
|
259
|
+
onClick: l,
|
|
260
|
+
children: u("Cancel changes")
|
|
261
|
+
})] }),
|
|
262
|
+
children: i && /* @__PURE__ */ c("pre", {
|
|
263
|
+
class: "rv-ai-result-details",
|
|
264
|
+
children: i
|
|
265
|
+
})
|
|
266
|
+
})
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
//#endregion
|
|
270
|
+
//#region src/ai/chat.tsx
|
|
271
|
+
function B({ children: e, className: t = "", label: n = "AI chat", style: r, translations: i }) {
|
|
272
|
+
let a = k(i);
|
|
273
|
+
return /* @__PURE__ */ c("section", {
|
|
274
|
+
class: `rv-ai-chat ${t}`,
|
|
275
|
+
"aria-label": a(n),
|
|
276
|
+
style: r,
|
|
277
|
+
children: e
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
function V({ children: e, className: t = "", autoScroll: n = !0, busy: o = !1, label: l = "Conversation messages", jumpLabel: u = "Jump to latest", translations: d }) {
|
|
281
|
+
let f = k(d), p = s(null), m = s(null), h = s(n), [g, v] = i(!1), y = () => {
|
|
282
|
+
let e = p.current;
|
|
283
|
+
if (!e) return;
|
|
284
|
+
let t = e.scrollHeight - e.clientHeight - e.scrollTop <= 40;
|
|
285
|
+
h.current = t, v(!t);
|
|
286
|
+
}, b = () => {
|
|
287
|
+
let e = p.current;
|
|
288
|
+
e && (e.scrollTop = e.scrollHeight, h.current = !0, v(!1));
|
|
289
|
+
}, x = () => {
|
|
290
|
+
if (n && h.current) b();
|
|
291
|
+
else {
|
|
292
|
+
let e = p.current;
|
|
293
|
+
e && v(e.scrollHeight - e.clientHeight - e.scrollTop > 40);
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
return a(x, [e, n]), r(() => {
|
|
297
|
+
if (typeof ResizeObserver > "u") return;
|
|
298
|
+
let e = new ResizeObserver(x);
|
|
299
|
+
return p.current && e.observe(p.current), m.current && e.observe(m.current), () => e.disconnect();
|
|
300
|
+
}, [n]), /* @__PURE__ */ c("div", {
|
|
301
|
+
class: `rv-ai-chat-scroll ${t}`,
|
|
302
|
+
children: [/* @__PURE__ */ c("div", {
|
|
303
|
+
ref: p,
|
|
304
|
+
class: "rv-ai-chat-viewport",
|
|
305
|
+
role: "log",
|
|
306
|
+
"aria-label": f(l),
|
|
307
|
+
"aria-live": "polite",
|
|
308
|
+
"aria-relevant": "additions text",
|
|
309
|
+
"aria-busy": o || void 0,
|
|
310
|
+
tabIndex: 0,
|
|
311
|
+
onScroll: y,
|
|
312
|
+
children: /* @__PURE__ */ c("div", {
|
|
313
|
+
ref: m,
|
|
314
|
+
class: "rv-ai-chat-content",
|
|
315
|
+
children: e
|
|
316
|
+
})
|
|
317
|
+
}), g && /* @__PURE__ */ c(_, {
|
|
318
|
+
className: "rv-ai-chat-jump",
|
|
319
|
+
size: "compact",
|
|
320
|
+
onClick: b,
|
|
321
|
+
children: f(u)
|
|
322
|
+
})]
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
function H({ title: e = "Start a conversation", description: t = "Ask a question to get started.", children: n, className: r = "", translations: i }) {
|
|
326
|
+
let a = k(i);
|
|
327
|
+
return /* @__PURE__ */ c("div", {
|
|
328
|
+
class: `rv-ai-chat-empty ${r}`,
|
|
329
|
+
children: [
|
|
330
|
+
/* @__PURE__ */ c("strong", { children: a(e) }),
|
|
331
|
+
/* @__PURE__ */ c("p", { children: a(t) }),
|
|
332
|
+
n
|
|
333
|
+
]
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
function U(e) {
|
|
337
|
+
return /* @__PURE__ */ c("div", {
|
|
338
|
+
class: "rv-ai-chat-composer",
|
|
339
|
+
children: /* @__PURE__ */ c(P, {
|
|
340
|
+
label: "Message",
|
|
341
|
+
placeholder: "Type a message…",
|
|
342
|
+
...e
|
|
343
|
+
})
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
function W({ from: e, label: t, isStreaming: n = !1, children: r, className: i = "", translations: a }) {
|
|
347
|
+
let o = k(a);
|
|
348
|
+
return /* @__PURE__ */ c("article", {
|
|
349
|
+
class: `rv-ai-message rv-ai-message--${e} ${i}`,
|
|
350
|
+
"aria-label": o(t ?? {
|
|
351
|
+
user: "You",
|
|
352
|
+
assistant: "Assistant",
|
|
353
|
+
system: "System"
|
|
354
|
+
}[e]),
|
|
355
|
+
"aria-busy": n || void 0,
|
|
356
|
+
"data-streaming": n || void 0,
|
|
357
|
+
children: r
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
function G({ children: e, className: t = "" }) {
|
|
361
|
+
return /* @__PURE__ */ c("div", {
|
|
362
|
+
class: `rv-ai-message-content ${t}`,
|
|
363
|
+
children: e
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
function K({ children: e, className: t = "", label: n = "Message actions", translations: r }) {
|
|
367
|
+
let i = k(r);
|
|
368
|
+
return /* @__PURE__ */ c("div", {
|
|
369
|
+
class: `rv-ai-message-actions ${t}`,
|
|
370
|
+
role: "group",
|
|
371
|
+
"aria-label": i(n),
|
|
372
|
+
children: e
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
var q = {
|
|
376
|
+
pending: "Pending",
|
|
377
|
+
running: "Running",
|
|
378
|
+
completed: "Completed",
|
|
379
|
+
error: "Failed",
|
|
380
|
+
cancelled: "Cancelled"
|
|
381
|
+
};
|
|
382
|
+
function J({ status: e }) {
|
|
383
|
+
return /* @__PURE__ */ c("span", {
|
|
384
|
+
class: "rv-ai-task-icon",
|
|
385
|
+
"data-status": e,
|
|
386
|
+
"aria-hidden": "true",
|
|
387
|
+
children: e === "running" ? /* @__PURE__ */ c(p, { label: "" }) : /* @__PURE__ */ c(l, { svg: e === "completed" ? S : e === "error" ? C : e === "cancelled" ? w : x })
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
function Y({ title: e, status: n = "completed", open: r, defaultOpen: a, onOpenChange: o, children: u, className: d = "", translations: f }) {
|
|
391
|
+
let p = k(f), [m, g] = i(a), _ = r ?? m ?? n === "running", v = s({
|
|
392
|
+
expanded: _,
|
|
393
|
+
open: r,
|
|
394
|
+
onOpenChange: o
|
|
395
|
+
});
|
|
396
|
+
v.current = {
|
|
397
|
+
expanded: _,
|
|
398
|
+
open: r,
|
|
399
|
+
onOpenChange: o
|
|
400
|
+
};
|
|
401
|
+
let y = t(u).some((e) => typeof e != "string" || e.trim().length > 0), b = /* @__PURE__ */ c("span", {
|
|
402
|
+
class: "rv-ai-trace-heading",
|
|
403
|
+
children: [
|
|
404
|
+
/* @__PURE__ */ c(J, { status: n }),
|
|
405
|
+
/* @__PURE__ */ c("span", { children: e }),
|
|
406
|
+
/* @__PURE__ */ c("span", {
|
|
407
|
+
class: "rv-visually-hidden",
|
|
408
|
+
children: p(q[n])
|
|
409
|
+
}),
|
|
410
|
+
y && /* @__PURE__ */ c("span", {
|
|
411
|
+
class: "rv-ai-trace-chevron",
|
|
412
|
+
"aria-hidden": "true",
|
|
413
|
+
children: /* @__PURE__ */ c(l, {
|
|
414
|
+
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 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=\"M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z\"/></svg>",
|
|
415
|
+
size: 8
|
|
416
|
+
})
|
|
417
|
+
})
|
|
418
|
+
]
|
|
419
|
+
});
|
|
420
|
+
return y ? /* @__PURE__ */ c(h, {
|
|
421
|
+
className: `rv-ai-trace ${d}`,
|
|
422
|
+
open: _,
|
|
423
|
+
onToggle: (e) => {
|
|
424
|
+
let t = e.currentTarget.open, n = v.current;
|
|
425
|
+
t !== n.expanded && (n.open === void 0 ? g(t) : e.currentTarget.open = n.expanded, n.onOpenChange?.(t));
|
|
426
|
+
},
|
|
427
|
+
summary: b,
|
|
428
|
+
children: /* @__PURE__ */ c("div", {
|
|
429
|
+
class: "rv-ai-trace-content",
|
|
430
|
+
children: u
|
|
431
|
+
})
|
|
432
|
+
}) : /* @__PURE__ */ c("div", {
|
|
433
|
+
class: `rv-ai-trace rv-ai-trace-line ${d}`,
|
|
434
|
+
children: b
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
function X(e) {
|
|
438
|
+
return /* @__PURE__ */ c(Y, { ...e });
|
|
439
|
+
}
|
|
440
|
+
function Z({ status: e = "completed", children: t, className: n = "", translations: r }) {
|
|
441
|
+
let i = k(r);
|
|
442
|
+
return /* @__PURE__ */ c("div", {
|
|
443
|
+
class: `rv-ai-task-item ${n}`,
|
|
444
|
+
children: [
|
|
445
|
+
/* @__PURE__ */ c(J, { status: e }),
|
|
446
|
+
/* @__PURE__ */ c("span", {
|
|
447
|
+
class: "rv-visually-hidden",
|
|
448
|
+
children: [i(q[e]), ": "]
|
|
449
|
+
}),
|
|
450
|
+
/* @__PURE__ */ c("div", { children: t })
|
|
451
|
+
]
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
function Q({ title: e, isStreaming: t = !1, duration: n, children: r, translations: i, ...a }) {
|
|
455
|
+
let o = k(i), s = typeof n == "number" && Number.isFinite(n) && n >= 0 ? ` · ${o("{seconds}s", { seconds: Math.round(n) })}` : "";
|
|
456
|
+
return /* @__PURE__ */ c(Y, {
|
|
457
|
+
...a,
|
|
458
|
+
translations: i,
|
|
459
|
+
status: t ? "running" : "completed",
|
|
460
|
+
title: `${o(e ?? (t ? "Working…" : "Reasoning summary"))}${s}`,
|
|
461
|
+
children: r
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
//#endregion
|
|
465
|
+
//#region src/ai/request-trail.tsx
|
|
466
|
+
function $({ translations: e, items: t, onRemove: n, onClear: r, onEmpty: o, disabled: u, removalsDisabled: p, label: m = "View steps", triggerLabel: h, clearLabel: g = "Clear all", clearDescription: x, removeLabel: S, countLabel: C, changedMessage: w }) {
|
|
467
|
+
let T = k(e), E = C ?? ((e) => T(e === 1 ? "{count} applied request" : "{count} applied requests", { count: e })), D = S ?? ((e) => T("Remove request: {label}", { label: e.label })), O = s(null), A = s(null), j = s(null), [M] = i(() => y("rv-ai-steps")), [N, P] = i(!1), F = t.length > 0;
|
|
468
|
+
a(() => {
|
|
469
|
+
if (F || P(!1), !N || !F || !O.current || !A.current || !j.current) return;
|
|
470
|
+
let e = j.current, t = new b(), n = !0;
|
|
471
|
+
return t.open({
|
|
472
|
+
anchor: A.current,
|
|
473
|
+
content: e,
|
|
474
|
+
appendTo: O.current,
|
|
475
|
+
onClose: () => {
|
|
476
|
+
n && P(!1);
|
|
477
|
+
}
|
|
478
|
+
}), e.focus({ preventScroll: !0 }), () => {
|
|
479
|
+
n = !1, t.destroy(), e.hidden = !0;
|
|
480
|
+
};
|
|
481
|
+
}, [N, F]);
|
|
482
|
+
let I = s();
|
|
483
|
+
if (a(() => {
|
|
484
|
+
let e = I.current;
|
|
485
|
+
if (!e) return;
|
|
486
|
+
if (u) {
|
|
487
|
+
e.sawBusy = !0;
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
if (e.id ? t.some((t) => t.id === e.id) : t.length > 0) {
|
|
491
|
+
(e.sawBusy || e.id && p) && (I.current = void 0);
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
I.current = void 0;
|
|
495
|
+
let n = e.button.ownerDocument.activeElement;
|
|
496
|
+
if (n !== e.button && n !== e.button.ownerDocument.body) return;
|
|
497
|
+
let r = O.current?.querySelectorAll(".rv-remove-button");
|
|
498
|
+
r?.length && N ? r[Math.min(e.index, r.length - 1)]?.focus() : t.length || o?.();
|
|
499
|
+
}, [
|
|
500
|
+
t,
|
|
501
|
+
o,
|
|
502
|
+
u,
|
|
503
|
+
p,
|
|
504
|
+
N
|
|
505
|
+
]), !F) return null;
|
|
506
|
+
let L = 0, R = t.reduce((e, t) => e + (t.count ?? 1), 0);
|
|
507
|
+
return /* @__PURE__ */ c("div", {
|
|
508
|
+
class: "rv-ai-request-trail",
|
|
509
|
+
role: "group",
|
|
510
|
+
"aria-label": T(m),
|
|
511
|
+
ref: O,
|
|
512
|
+
onFocusOut: (e) => {
|
|
513
|
+
e.relatedTarget instanceof Node && !e.currentTarget.contains(e.relatedTarget) && P(!1);
|
|
514
|
+
},
|
|
515
|
+
children: [/* @__PURE__ */ c(_, {
|
|
516
|
+
ref: A,
|
|
517
|
+
className: "rv-ai-trail-trigger",
|
|
518
|
+
variant: "ghost",
|
|
519
|
+
size: "compact",
|
|
520
|
+
disabled: u,
|
|
521
|
+
"aria-haspopup": "dialog",
|
|
522
|
+
"aria-expanded": N,
|
|
523
|
+
"aria-controls": M,
|
|
524
|
+
onClick: () => P((e) => !e),
|
|
525
|
+
children: [h ? h(R) : T(R === 1 ? "{count} step" : "{count} steps", { count: R }), /* @__PURE__ */ c(l, {
|
|
526
|
+
svg: f,
|
|
527
|
+
size: 10
|
|
528
|
+
})]
|
|
529
|
+
}), /* @__PURE__ */ c("div", {
|
|
530
|
+
ref: j,
|
|
531
|
+
id: M,
|
|
532
|
+
class: "rv-popover rv-ai-trail-popover",
|
|
533
|
+
role: "dialog",
|
|
534
|
+
"aria-label": T(m),
|
|
535
|
+
tabIndex: -1,
|
|
536
|
+
hidden: !N,
|
|
537
|
+
children: [
|
|
538
|
+
/* @__PURE__ */ c("div", {
|
|
539
|
+
class: "rv-ai-trail-header",
|
|
540
|
+
children: /* @__PURE__ */ c("span", {
|
|
541
|
+
class: "rv-ai-trail-label",
|
|
542
|
+
children: [T(m), /* @__PURE__ */ c(v, {
|
|
543
|
+
count: R,
|
|
544
|
+
label: E(R)
|
|
545
|
+
})]
|
|
546
|
+
})
|
|
547
|
+
}),
|
|
548
|
+
/* @__PURE__ */ c("ol", {
|
|
549
|
+
class: "rv-ai-trail-steps",
|
|
550
|
+
"aria-label": E(R),
|
|
551
|
+
children: t.map((e, r) => {
|
|
552
|
+
let i = L + 1;
|
|
553
|
+
return L += e.count ?? 1, /* @__PURE__ */ c("li", {
|
|
554
|
+
class: "rv-ai-step",
|
|
555
|
+
"data-current": r === t.length - 1 || void 0,
|
|
556
|
+
onFocusCapture: (e) => e.currentTarget.scrollIntoView({
|
|
557
|
+
block: "nearest",
|
|
558
|
+
inline: "nearest"
|
|
559
|
+
}),
|
|
560
|
+
children: /* @__PURE__ */ c("span", {
|
|
561
|
+
class: "rv-ai-step-chip",
|
|
562
|
+
children: [
|
|
563
|
+
/* @__PURE__ */ c("span", {
|
|
564
|
+
class: "rv-ai-step-number",
|
|
565
|
+
"aria-hidden": "true",
|
|
566
|
+
children: i === L ? i : `${i}–${L}`
|
|
567
|
+
}),
|
|
568
|
+
/* @__PURE__ */ c("span", {
|
|
569
|
+
class: "rv-ai-step-label",
|
|
570
|
+
title: e.label,
|
|
571
|
+
children: e.label
|
|
572
|
+
}),
|
|
573
|
+
/* @__PURE__ */ c(d, {
|
|
574
|
+
compact: !0,
|
|
575
|
+
disabled: u || p,
|
|
576
|
+
locale: {
|
|
577
|
+
title: D(e),
|
|
578
|
+
ariaLabel: D(e)
|
|
579
|
+
},
|
|
580
|
+
onClick: (t) => {
|
|
581
|
+
t.preventDefault(), I.current = {
|
|
582
|
+
button: t.currentTarget,
|
|
583
|
+
index: r,
|
|
584
|
+
id: e.id
|
|
585
|
+
}, n(e.id);
|
|
586
|
+
}
|
|
587
|
+
})
|
|
588
|
+
]
|
|
589
|
+
})
|
|
590
|
+
}, e.id);
|
|
591
|
+
})
|
|
592
|
+
}),
|
|
593
|
+
w && /* @__PURE__ */ c("p", {
|
|
594
|
+
class: "rv-ai-trail-message",
|
|
595
|
+
children: T(w)
|
|
596
|
+
}),
|
|
597
|
+
/* @__PURE__ */ c("div", {
|
|
598
|
+
class: "rv-ai-trail-footer",
|
|
599
|
+
children: /* @__PURE__ */ c(_, {
|
|
600
|
+
variant: "ghost",
|
|
601
|
+
size: "compact",
|
|
602
|
+
disabled: u,
|
|
603
|
+
title: x ? T(x) : void 0,
|
|
604
|
+
onClick: (e) => {
|
|
605
|
+
e.preventDefault(), I.current = {
|
|
606
|
+
button: e.currentTarget,
|
|
607
|
+
index: 0
|
|
608
|
+
}, r();
|
|
609
|
+
},
|
|
610
|
+
children: T(g)
|
|
611
|
+
})
|
|
612
|
+
})
|
|
613
|
+
]
|
|
614
|
+
})]
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
//#endregion
|
|
618
|
+
export { F as _, H as a, T as b, G as c, Z as d, I as f, L as g, P as h, V as i, Q as l, z as m, B as n, W as o, R as p, U as r, K as s, $ as t, X as u, A as v, E as x, O as y };
|