@revolist/ui 4.0.5-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.
Files changed (153) hide show
  1. package/MIGRATION.md +36 -0
  2. package/OWNERSHIP.md +10 -10
  3. package/README.md +6 -4
  4. package/_chunks/{calendar-DsXIhybL.js → calendar-QWDyYzdo.js} +1 -1
  5. package/_chunks/{chart-frame-CuZABXVI.js → chart-frame-hcOlnQ1K.js} +13 -9
  6. package/_chunks/{choice-chips-BhP8MZjs.js → choice-chips-A6WR-WJe.js} +1 -1
  7. package/_chunks/{color-picker-B4TQvxxB.js → color-picker-BK4W1nd6.js} +1 -1
  8. package/_chunks/{component-qKctqdzk.js → component-CMkF17YZ.js} +5 -5
  9. package/_chunks/{component-metadata-BMOOmqx5.js → component-metadata-BKd7U8OW.js} +0 -8
  10. package/_chunks/{configurator-actions-C19O1rda.js → configurator-actions-By8WSL2m.js} +3 -3
  11. package/_chunks/{control-BkWukVt9.js → control-mlH7l0Uq.js} +30 -5
  12. package/_chunks/{controls-BLQnWEd7.js → controls-FUU-MUKC.js} +26 -33
  13. package/_chunks/{date-control-Cgw5PwlZ.js → date-control-Dup_P3w5.js} +1 -1
  14. package/_chunks/{date-time-B8rK5gpC.js → date-time-9z6pAG5T.js} +304 -281
  15. package/_chunks/dialog.parts-Bi7YbXqS.js +131 -0
  16. package/_chunks/{duration-DwFXonEV.js → duration-D7oRjsmP.js} +5 -2
  17. package/_chunks/{editor-popup-BaaxL89T.js → editor-popup-ByU7qiub.js} +8 -7
  18. package/_chunks/{field-configurator-1eQP0tKy.js → field-configurator-BCINdXpU.js} +1 -1
  19. package/_chunks/{framework-mount--RTLIqE-.js → framework-mount-Bk4O_T7T.js} +1 -1
  20. package/_chunks/{icon-toolbar-xbqa0hu9.js → icon-toolbar-DSjOdwM7.js} +39 -33
  21. package/_chunks/mount-Cw2zk58T.js +266 -0
  22. package/_chunks/{native.view-ByyZ1CT5.js → native-Blr3byjO.js} +1 -1
  23. package/_chunks/{native-control-DO0d1kgx.js → native-control-pFMuHf3G.js} +106 -98
  24. package/_chunks/{number-input-s9ddPwX6.js → number-input-DqXV6vgP.js} +2 -2
  25. package/_chunks/{picker-AY05b41W.js → picker-gEGTu1Ki.js} +2 -2
  26. package/_chunks/{popup-UXGCiv3n.js → popup-C35Isk7p.js} +19 -8
  27. package/_chunks/{rating-choice-BEs_QFZC.js → rating-choice-DbxdUJr-.js} +1 -1
  28. package/_chunks/{reorder-list-A49l172e.js → reorder-list-B0_13Sja.js} +1 -1
  29. package/_chunks/{request-trail-DCOfa5zw.js → request-trail-CCSK6TJA.js} +2 -2
  30. package/_chunks/{rich-text-xfMWadGi.js → rich-text-5rnc8lpI.js} +3 -3
  31. package/_variables.scss +33 -32
  32. package/ai/index.js +2 -2
  33. package/ai/results/_style.scss +3 -0
  34. package/assignee/assignee.scss +5 -1
  35. package/assignee/index.js +2 -2
  36. package/avatar/index.d.ts +25 -2
  37. package/avatar/index.js +1 -1
  38. package/brush-range/component.d.ts +1 -3
  39. package/brush-range/component.js +8 -9
  40. package/buttons/remove-button.d.ts +1 -1
  41. package/buttons/remove-button.style.scss +1 -1
  42. package/buttons/svg-button.js +1 -1
  43. package/calendar/calendar.js +1 -1
  44. package/calendar/index.js +2 -2
  45. package/checkbox/checkbox.scss +1 -22
  46. package/choice-chips/index.js +1 -1
  47. package/color-palette/color-picker.js +1 -1
  48. package/color-palette/common-palettes.d.ts +1 -1
  49. package/color-palette/common-palettes.js +1 -1
  50. package/color-palette/native.d.ts +15 -2
  51. package/component-catalog.d.ts +3 -6
  52. package/configurator-actions.js +1 -1
  53. package/configurator-aggregation-list.js +1 -1
  54. package/configurator-drop-zone.d.ts +1 -1
  55. package/configurator-drop-zone.js +1 -1
  56. package/control-presentation.d.ts +8 -2
  57. package/control-presentation.js +1 -1
  58. package/controls.js +1 -1
  59. package/core/editor-popup-position.d.ts +6 -2
  60. package/core/editor-popup.d.ts +4 -0
  61. package/core/editor-popup.js +1 -1
  62. package/date-time/attach.d.ts +1 -1
  63. package/date-time/field.d.ts +3 -2
  64. package/date-time/index.js +1 -1
  65. package/date-time/style.scss +16 -2
  66. package/date-time/types.d.ts +5 -1
  67. package/dialog/dialog-action-footer.d.ts +17 -2
  68. package/dialog/dialog.dom.d.ts +15 -2
  69. package/dialog/dialog.dom.js +3 -3
  70. package/dialog/dialog.parts.d.ts +1 -1
  71. package/dialog/dialog.parts.js +1 -1
  72. package/distribution-chart/_distribution-chart.scss +14 -0
  73. package/distribution-chart/area-chart.js +1 -1
  74. package/distribution-chart/bar-chart.js +1 -1
  75. package/distribution-chart/index.d.ts +1 -1
  76. package/distribution-chart/line-chart.js +1 -1
  77. package/dropdown/content.js +1 -1
  78. package/dropdown/control.js +1 -1
  79. package/dropdown/editor-dropdown.style.scss +5 -0
  80. package/dropdown/index.js +2 -2
  81. package/dropdown/lookup-field.d.ts +5 -0
  82. package/dropdown/lookup-field.js +1 -1
  83. package/dropdown/popup.js +1 -1
  84. package/duration/index.js +1 -1
  85. package/editor-actions.js +1 -1
  86. package/field-configurator.d.ts +8 -0
  87. package/field-configurator.js +1 -1
  88. package/filter/filters/slider/_slider.scss +8 -8
  89. package/filter/filters/slider/single.js +1 -1
  90. package/filter-badge.js +1 -1
  91. package/filter-controls.d.ts +0 -1
  92. package/filter-controls.js +5 -6
  93. package/form-controls/index.d.ts +10 -2
  94. package/form-controls/index.js +3 -3
  95. package/formatting/index.d.ts +1 -1
  96. package/formatting/index.js +1 -1
  97. package/framework.js +202 -205
  98. package/icon-toolbar.d.ts +5 -1
  99. package/icon-toolbar.js +1 -1
  100. package/masked-input/index.js +1 -1
  101. package/native-control.js +1 -1
  102. package/native-controls.d.ts +54 -2
  103. package/native-styles.css +1 -1
  104. package/native.js +29 -29
  105. package/number-input/index.js +1 -1
  106. package/package.json +1 -1
  107. package/pagination.js +11 -11
  108. package/pdf-viewer/index.js +1 -1
  109. package/preact.d.ts +1 -6
  110. package/preact.js +60 -60
  111. package/rating-choice.js +1 -1
  112. package/react-control.d.ts +2 -0
  113. package/react-control.js +2 -2
  114. package/react.d.ts +0 -6
  115. package/react.js +54 -54
  116. package/reorder-list.js +1 -1
  117. package/resource-picker/resource-picker-popup.js +1 -1
  118. package/rich-text/index.js +1 -1
  119. package/search-input/index.js +1 -1
  120. package/search-input/native.d.ts +21 -2
  121. package/select.js +1 -1
  122. package/styles/_alert.scss +18 -4
  123. package/styles/_editor-slider.scss +0 -2
  124. package/styles/_field-configurator.scss +2 -1
  125. package/styles/_fields-grid.scss +2 -0
  126. package/styles/_palette.scss +0 -24
  127. package/styles/_primitives.scss +3 -1
  128. package/styles.css +1 -1
  129. package/styles.scss +2 -2
  130. package/surfaces.d.ts +34 -3
  131. package/surfaces.js +2 -2
  132. package/svelte.js +3 -3
  133. package/switch/index.js +1 -1
  134. package/time-grid.d.ts +0 -1
  135. package/time-grid.js +4 -4
  136. package/timeline-track/index.js +1 -1
  137. package/ui.css +1 -1
  138. package/vue.d.ts +2 -21
  139. package/vue.js +83 -89
  140. package/_chunks/dialog.parts-BSbvnEwX.js +0 -134
  141. package/_chunks/mount-D1i5DLRn.js +0 -266
  142. package/avatar/index.view.d.ts +0 -25
  143. package/color-palette/native.view.d.ts +0 -15
  144. package/control-presentation.view.d.ts +0 -8
  145. package/dialog/dialog-action-footer.view.d.ts +0 -20
  146. package/dialog/dialog.dom.view.d.ts +0 -15
  147. package/form-controls/index.view.d.ts +0 -10
  148. package/formatting/control-tooltip.d.ts +0 -2
  149. package/native-controls.view.d.ts +0 -54
  150. package/search-input/native.view.d.ts +0 -21
  151. package/surfaces.view.d.ts +0 -33
  152. /package/styles/{legacy-pagination.css → pagination.css} +0 -0
  153. /package/styles/{legacy-rating.css → rating.css} +0 -0
@@ -0,0 +1,131 @@
1
+ import { i as e } from "./preact.module-BBM36DnO.js";
2
+ import { t } from "./jsxRuntime.module-F6UFnpT-.js";
3
+ import { createPreactElement as n, releasePreactElement as r } from "../preact-mount.js";
4
+ import { n as i, t as a } from "./native-control-pFMuHf3G.js";
5
+ import { r as o } from "./popup-C35Isk7p.js";
6
+ import { t as s } from "./xmark-DD_PBvZI.js";
7
+ //#region src/dialog/dialog-action-footer.tsx
8
+ function c({ cancel: e = {}, save: n = {}, deleteAction: r = !1, reset: i = !1, start: o, end: s, children: c, actionsClass: l = "", class: u = "", ...d }) {
9
+ let f = (e, n, r, i = "", o = "button") => {
10
+ if (n === !1) return null;
11
+ let { label: s = r, class: c = "", ...l } = n;
12
+ return /* @__PURE__ */ t(a, {
13
+ type: o,
14
+ ...l,
15
+ class: `rv-btn ${i} ${c}`,
16
+ "data-dialog-action": e,
17
+ children: s
18
+ });
19
+ };
20
+ return /* @__PURE__ */ t("footer", {
21
+ ...d,
22
+ class: `rv-dialog__footer rv-dialog__action-footer ${u}`,
23
+ children: [c, /* @__PURE__ */ t("div", {
24
+ class: "rv-dialog__action-panel",
25
+ children: [/* @__PURE__ */ t("div", {
26
+ class: "rv-dialog__action-start",
27
+ children: [
28
+ o,
29
+ f("delete", r, "Delete", "rv-btn-danger-outline"),
30
+ f("reset", i, "Reset")
31
+ ]
32
+ }), /* @__PURE__ */ t("div", {
33
+ class: `rv-dialog__actions ${l}`,
34
+ children: [
35
+ s,
36
+ f("cancel", e, "Cancel"),
37
+ f("save", n, "Save", "rv-btn-primary", "submit")
38
+ ]
39
+ })]
40
+ })]
41
+ });
42
+ }
43
+ function l(e, i) {
44
+ let a = n(e.ownerDocument, /* @__PURE__ */ t(c, { ...i }));
45
+ return e.append(a), { destroy() {
46
+ r(a);
47
+ } };
48
+ }
49
+ //#endregion
50
+ //#region src/dialog/dialog.parts.tsx
51
+ var u = o(({ class: e = "", ...n }, r) => /* @__PURE__ */ t("header", {
52
+ ...n,
53
+ ref: r,
54
+ class: `rv-dialog__header ${e}`
55
+ }));
56
+ function d({ class: e = "", ...n }) {
57
+ return /* @__PURE__ */ t("form", {
58
+ ...n,
59
+ class: `rv-dialog__surface ${e}`
60
+ });
61
+ }
62
+ var f = o(({ class: e = "", ...n }, r) => /* @__PURE__ */ t("div", {
63
+ ...n,
64
+ ref: r,
65
+ class: `rv-dialog__body ${e}`
66
+ })), p = o(({ class: e = "", ...n }, r) => /* @__PURE__ */ t("footer", {
67
+ ...n,
68
+ ref: r,
69
+ class: `rv-dialog__footer ${e}`
70
+ })), m = o(({ class: e = "", ...n }, r) => /* @__PURE__ */ t("div", {
71
+ ...n,
72
+ ref: r,
73
+ class: `rv-dialog__actions ${e}`
74
+ }));
75
+ function h({ class: e = "", iconClass: n = "", ...r }) {
76
+ return /* @__PURE__ */ t(a, {
77
+ ...r,
78
+ unstyled: !0,
79
+ type: "button",
80
+ class: `rv-dialog__close ${e}`,
81
+ children: /* @__PURE__ */ t("span", {
82
+ class: `rv-dialog__close-icon ${n}`,
83
+ "aria-hidden": "true",
84
+ dangerouslySetInnerHTML: { __html: s }
85
+ })
86
+ });
87
+ }
88
+ var g = o(({ class: e = "", ...n }, r) => /* @__PURE__ */ t(i, {
89
+ ...n,
90
+ ref: r,
91
+ class: `rv-dialog__title-input ${e}`
92
+ })), _ = o(({ titleId: n, title: r, name: i, description: a, inputLabel: o, titleHidden: s, headingClass: c = "", kickerClass: l = "", titleClass: d = "", inputProps: f, closeLabel: p, closeProps: m, onClose: _, class: v = "", ...y }, b) => /* @__PURE__ */ t(u, {
93
+ ...y,
94
+ ref: b,
95
+ class: `rv-dialog__header--editable ${v}`,
96
+ children: [/* @__PURE__ */ t("div", {
97
+ class: `rv-dialog__heading ${c}`,
98
+ children: [
99
+ !s && i && /* @__PURE__ */ t("span", {
100
+ class: `rv-dialog__kicker ${l}`,
101
+ children: i
102
+ }),
103
+ !s && (f === !1 ? /* @__PURE__ */ t("h3", {
104
+ id: n,
105
+ class: `rv-dialog__title ${d}`,
106
+ children: r
107
+ }) : /* @__PURE__ */ t(e, { children: [/* @__PURE__ */ t("h3", {
108
+ id: n,
109
+ class: `rv-dialog__sr-only ${d}`,
110
+ children: r
111
+ }), /* @__PURE__ */ t(g, {
112
+ "aria-label": o,
113
+ value: r,
114
+ ...f
115
+ })] })),
116
+ a && /* @__PURE__ */ t("div", {
117
+ class: "rv-dialog__description",
118
+ children: a
119
+ })
120
+ ]
121
+ }), _ && /* @__PURE__ */ t(h, {
122
+ ...m,
123
+ "aria-label": p,
124
+ onClick: _
125
+ })]
126
+ }));
127
+ function v(e) {
128
+ return /* @__PURE__ */ t(c, { ...e });
129
+ }
130
+ //#endregion
131
+ export { p as a, g as c, l as d, h as i, _ as l, m as n, d as o, f as r, u as s, v as t, c as u };
@@ -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 { l as a, n as o } from "./native-control-DO0d1kgx.js";
4
+ import { l as a, n as o } from "./native-control-pFMuHf3G.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";
@@ -138,7 +138,10 @@ function y(t) {
138
138
  class: "rv-duration-field__modes",
139
139
  children: [l.length === 0 ? null : l.length > 5 ? /* @__PURE__ */ i(a, {
140
140
  className: "rv-select",
141
- config: { ariaLabel: t.unitLabel ?? "Duration unit" },
141
+ config: {
142
+ ariaLabel: t.unitLabel ?? "Duration unit",
143
+ topLayer: !0
144
+ },
142
145
  source: l.map((e) => ({
143
146
  value: e,
144
147
  label: t.unitLabels?.[e] ?? v[e]
@@ -4,13 +4,13 @@ import { createPreactElement as n, releasePreactElement as r } from "../preact-m
4
4
  import { i, r as a, t as o } from "./top-layer-popup-CNSDdfJV.js";
5
5
  import { t as s } from "./editor-commit-Bq3wSgvr.js";
6
6
  //#region src/core/editor-popup-position.ts
7
- function c(t, n, r, i = 4, a = 8) {
8
- let o = Math.max(0, r.height - a - t.bottom - i), s = Math.max(0, t.top - a - i), c = n.height <= o || o >= s ? "below" : "above", l = c === "below" ? o : s, u = Math.min(n.height, l);
7
+ function c(t, n, r, { gap: i = 4, inset: a = 8, fitViewport: o = !1 } = {}) {
8
+ let s = Math.max(0, r.height - a - t.bottom - i), c = Math.max(0, t.top - a - i), l = n.height <= s || s >= c ? "below" : "above", u = l === "below" ? s : c, d = o && n.height > u ? Math.max(u, r.height - 2 * a) : u, f = Math.min(n.height, d), p = l === "below" ? t.bottom + i : t.top - f - i;
9
9
  return {
10
10
  ...e(t, n, r, i, a),
11
- placementY: c,
12
- maxHeight: l,
13
- top: c === "below" ? t.bottom + i : t.top - u - i
11
+ placementY: l,
12
+ maxHeight: d,
13
+ top: d > u ? Math.max(a, Math.min(p, r.height - a - f)) : p
14
14
  };
15
15
  }
16
16
  //#endregion
@@ -24,7 +24,8 @@ function u(e, u, d) {
24
24
  }), _ = () => {
25
25
  m || (m = !0, E.disconnect(), T?.disconnect(), f.removeEventListener("pointerdown", y, !0), f.removeEventListener("keydown", b, !0), f.removeEventListener("scroll", x, !0), p.removeEventListener("resize", _), o(S, C), r(S), S.remove(), l.get(f)?.element === S && l.delete(f), d.onClose?.(), e.isConnected && e.focus({ preventScroll: !0 }));
26
26
  }, v = (e) => e ? i(S, e) : !1, y = (t) => {
27
- v(t.target) || e.contains(t.target) || (d.isAvailable && !d.isAvailable() ? _() : h?.() === !1 ? (t.preventDefault(), t.stopPropagation()) : _());
27
+ let n = t.target;
28
+ v(n) || e.contains(n) || d.trigger?.contains(n) || (d.isAvailable && !d.isAvailable() ? _() : h?.() === !1 ? (t.preventDefault(), t.stopPropagation()) : _());
28
29
  }, b = (e) => {
29
30
  if (e.key === "Escape") {
30
31
  if (S.querySelector("[aria-expanded=\"true\"]")) return;
@@ -56,7 +57,7 @@ function u(e, u, d) {
56
57
  let t = c(e.getBoundingClientRect(), S.getBoundingClientRect(), {
57
58
  width: p.innerWidth,
58
59
  height: p.innerHeight
59
- });
60
+ }, { fitViewport: d.fitViewport });
60
61
  S.style.maxHeight = `${t.maxHeight}px`, S.style.left = `${t.left}px`, S.style.top = `${t.top}px`, S.dataset.placement = t.placementY;
61
62
  };
62
63
  w();
@@ -2,7 +2,7 @@ import { c as e } from "./preact.module-BBM36DnO.js";
2
2
  import { t } from "./hooks.module-CG3gN83z.js";
3
3
  import { t as n } from "./jsxRuntime.module-F6UFnpT-.js";
4
4
  import { SvgIcon as r } from "../icons/icon.js";
5
- import { t as i } from "./native-control-DO0d1kgx.js";
5
+ import { t as i } from "./native-control-pFMuHf3G.js";
6
6
  import { n as a } from "./delete-button-CW9vjLnk.js";
7
7
  import { RemoveButton as o } from "../buttons/remove-button.js";
8
8
  import { t as s } from "./chevron-right-sxHQMSkq.js";
@@ -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-BMOOmqx5.js";
3
+ import { n as i } from "./component-metadata-BKd7U8OW.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;
@@ -17,76 +17,82 @@ var s = {
17
17
  }, c = "\n .rv-svg-toolbar-button { cursor: pointer; }\n .rv-svg-toolbar-button[aria-pressed=\"true\"] > rect { fill: currentColor; fill-opacity: .14; }\n .rv-svg-toolbar-button[aria-disabled=\"true\"] { opacity: .4; cursor: default; }\n .rv-svg-toolbar-button:not([aria-disabled=\"true\"]):hover > rect { fill: currentColor; fill-opacity: .1; }\n .rv-svg-toolbar-button:focus-visible { outline: none; }\n .rv-svg-toolbar-button:focus-visible > rect { stroke: currentColor; stroke-width: 2; }\n";
18
18
  function l(n) {
19
19
  let r = t(n.title ?? n.label, n.onEscape);
20
+ return /* @__PURE__ */ e(u, {
21
+ ...n,
22
+ buttonRef: r
23
+ });
24
+ }
25
+ function u(t) {
20
26
  return /* @__PURE__ */ e("g", {
21
- ref: r,
22
- ...n.attributes,
27
+ ref: t.buttonRef,
28
+ ...t.attributes,
23
29
  class: "rv-svg-toolbar-button",
24
30
  role: "button",
25
- tabindex: n.enabled ? 0 : -1,
26
- "aria-label": n.label,
27
- "aria-disabled": !n.enabled,
28
- "aria-pressed": n.pressed,
29
- "data-rv-svg-toolbar-button": n.action,
30
- onClick: n.onActivate ? () => {
31
- n.enabled && n.onActivate?.(n.action);
31
+ tabindex: t.enabled ? 0 : -1,
32
+ "aria-label": t.label,
33
+ "aria-disabled": !t.enabled,
34
+ "aria-pressed": t.pressed,
35
+ "data-rv-svg-toolbar-button": t.action,
36
+ onClick: t.onActivate ? () => {
37
+ t.enabled && t.onActivate?.(t.action);
32
38
  } : void 0,
33
- onKeyDown: n.onActivate ? (e) => {
34
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), n.enabled && n.onActivate?.(n.action));
39
+ onKeyDown: t.onActivate ? (e) => {
40
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), t.enabled && t.onActivate?.(t.action));
35
41
  } : void 0,
36
42
  children: [
37
43
  /* @__PURE__ */ e("rect", {
38
44
  ref: (e) => {
39
- e && n.onRectangle?.(e);
45
+ e && t.onRectangle?.(e);
40
46
  },
41
- x: n.x,
42
- y: n.y,
47
+ x: t.x,
48
+ y: t.y,
43
49
  width: 28,
44
50
  height: 28,
45
51
  rx: 6,
46
52
  fill: "transparent",
47
53
  stroke: "transparent"
48
54
  }),
49
- n.icon && /* @__PURE__ */ e("svg", {
55
+ t.icon && /* @__PURE__ */ e("svg", {
50
56
  "data-rv-toolbar-icon": "",
51
- x: n.x + (n.suffixIcon ? 5 : 8),
52
- y: n.y + 8,
57
+ x: t.x + (t.suffixIcon ? 5 : 8),
58
+ y: t.y + 8,
53
59
  width: 12,
54
60
  height: 12,
55
- visibility: n.showText ? "hidden" : void 0,
61
+ visibility: t.showText ? "hidden" : void 0,
56
62
  "aria-hidden": "true",
57
63
  focusable: "false",
58
64
  fill: "currentColor",
59
- style: { color: n.foreground ?? (n.pressed ? "var(--rv-ui-accent-text, Highlight)" : "var(--rv-ui-text, CanvasText)") },
60
- dangerouslySetInnerHTML: { __html: n.icon }
65
+ style: { color: t.foreground ?? (t.pressed ? "var(--rv-ui-accent-text, Highlight)" : "var(--rv-ui-text, CanvasText)") },
66
+ dangerouslySetInnerHTML: { __html: t.icon }
61
67
  }),
62
- n.suffixIcon && /* @__PURE__ */ e("svg", {
63
- x: n.x + 18,
64
- y: n.y + 12,
68
+ t.suffixIcon && /* @__PURE__ */ e("svg", {
69
+ x: t.x + 18,
70
+ y: t.y + 12,
65
71
  width: 6,
66
72
  height: 8,
67
73
  "aria-hidden": "true",
68
74
  focusable: "false",
69
75
  fill: "currentColor",
70
- style: { color: n.foreground ?? (n.pressed ? "var(--rv-ui-accent-text, Highlight)" : "var(--rv-ui-text, CanvasText)") },
71
- dangerouslySetInnerHTML: { __html: n.suffixIcon }
76
+ style: { color: t.foreground ?? (t.pressed ? "var(--rv-ui-accent-text, Highlight)" : "var(--rv-ui-text, CanvasText)") },
77
+ dangerouslySetInnerHTML: { __html: t.suffixIcon }
72
78
  }),
73
79
  /* @__PURE__ */ e("text", {
74
- visibility: n.icon && !n.showText ? "hidden" : void 0,
80
+ visibility: t.icon && !t.showText ? "hidden" : void 0,
75
81
  ref: (e) => {
76
- e && n.onText?.(e);
82
+ e && t.onText?.(e);
77
83
  },
78
- x: n.x + 14,
79
- y: n.y + 19,
80
- fill: n.foreground ?? "var(--rv-ui-text, currentColor)",
84
+ x: t.x + 14,
85
+ y: t.y + 19,
86
+ fill: t.foreground ?? "var(--rv-ui-text, currentColor)",
81
87
  "font-size": 16,
82
88
  "text-anchor": "middle",
83
89
  "aria-hidden": "true",
84
- children: n.text
90
+ children: t.text
85
91
  })
86
92
  ]
87
93
  });
88
94
  }
89
- function u({ actions: t, label: n = "Actions", onAction: r, onEscape: i }) {
95
+ function d({ actions: t, label: n = "Actions", onAction: r, onEscape: i }) {
90
96
  let a = Math.max(10, t.length * 33 + 5);
91
97
  return /* @__PURE__ */ e("svg", {
92
98
  class: "rv-icon-toolbar",
@@ -125,4 +131,4 @@ function u({ actions: t, label: n = "Actions", onAction: r, onEscape: i }) {
125
131
  });
126
132
  }
127
133
  //#endregion
128
- export { l as i, u as n, c as r, s as t };
134
+ export { u as a, l as i, d as n, c as r, s as t };
@@ -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.view.tsx
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", {