@revolist/ui 4.0.6 → 4.0.10

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 (187) hide show
  1. package/README.md +37 -1
  2. package/_chunks/{arrow-up-Cw8hW9vp.js → arrow-up-BSYhTAus.js} +1 -1
  3. package/_chunks/{calculator-CDWOuAcp.js → calculator-BG0Xd_Uw.js} +1 -1
  4. package/_chunks/{calendar-BQYQLu8Q.js → calendar-CQHVwHLW.js} +3 -3
  5. package/_chunks/{chart-frame-GprenwEg.js → chart-frame-pj5EQxXr.js} +5 -5
  6. package/_chunks/{check-BwI7iCAm.js → check-BFIC9pge.js} +1 -1
  7. package/_chunks/{chevron-down-GbplLa6s.js → chevron-down-BkrpxJYD.js} +1 -1
  8. package/_chunks/{chevron-right-CM3ljziP.js → chevron-right-DZ79RmYV.js} +1 -1
  9. package/_chunks/{chevron-up-BLuNMPDn.js → chevron-up-Dt846uIR.js} +1 -1
  10. package/_chunks/{choice-chips-C5OxD0GV.js → choice-chips-BIGT7gjO.js} +4 -4
  11. package/_chunks/{clock-BOhPNlW3.js → clock-DTfr4p2S.js} +1 -1
  12. package/_chunks/{color-palette-7siNch__.js → color-palette-DL0f3igd.js} +3 -3
  13. package/_chunks/{color-picker-Cfc9eqZb.js → color-picker-BWBM9GE1.js} +7 -7
  14. package/_chunks/{component-C3k_8uIq.js → component-B22CtP21.js} +58 -43
  15. package/_chunks/{component-metadata-DlVkpW3h.js → component-metadata-B_hLjtM0.js} +4 -1
  16. package/_chunks/{configurator-actions-vRnI54mO.js → configurator-actions-BhIk4oM_.js} +18 -18
  17. package/_chunks/{configurator-field-icon-CmcM_sPs.js → configurator-field-icon-B0S_208W.js} +2 -2
  18. package/_chunks/{control-BRfF5DWQ.js → control-zCLB1tGz.js} +2 -2
  19. package/_chunks/{controller-BbiQuRt-.js → controller-ChkqiANQ.js} +1 -1
  20. package/_chunks/{controls-B3EgM_DS.js → controls-Ip2E6jIu.js} +10 -9
  21. package/_chunks/{date-control-87dcA5br.js → date-control-UmJvxQ5C.js} +4 -4
  22. package/_chunks/{date-time-CfiFYodx.js → date-time-B9YGqree.js} +57 -57
  23. package/_chunks/{delete-button-jneO24wa.js → delete-button-DQSK6G-4.js} +1 -1
  24. package/_chunks/{dialog.parts-NqEEVc9P.js → dialog.parts-CpMwNhTM.js} +5 -5
  25. package/_chunks/{duration-BGZ_qJ99.js → duration-BrsE4QgL.js} +15 -15
  26. package/_chunks/{editor-commit-Dyo-FMgD.js → editor-commit-BXIUX0As.js} +2 -2
  27. package/_chunks/{editor-popup-NNP9Fh9U.js → editor-popup-Ds0GPAcn.js} +3 -3
  28. package/_chunks/{field-configurator-DPulsY3l.js → field-configurator-BMQnmWNd.js} +10 -9
  29. package/_chunks/{field-context-C4_WrO2z.js → field-context-0oUi-w-G.js} +1 -1
  30. package/_chunks/{framework-mount-D4I8HpVp.js → framework-mount-CX0oj05W.js} +3 -3
  31. package/_chunks/{hooks.module-CG3gN83z.js → hooks.module-CXpO2xq6.js} +2 -2
  32. package/_chunks/{icon-toolbar-BAAdEvr9.js → icon-toolbar-C4J_Wqph.js} +6 -6
  33. package/_chunks/{jsxRuntime.module-F6UFnpT-.js → jsxRuntime.module-ksX_VSbv.js} +2 -2
  34. package/_chunks/{magnifying-glass-CvrTDSkB.js → magnifying-glass-BFZrFs8M.js} +1 -1
  35. package/_chunks/{minus-BOAR3A1C.js → minus-DE8NPK_D.js} +1 -1
  36. package/_chunks/{mount-C8CnIW9k.js → mount-BgI_QV2H.js} +7 -7
  37. package/_chunks/native-C9tJWAXF.js +52 -0
  38. package/_chunks/{native-CJm3eq3-.js → native-RudS9C_q.js} +2 -2
  39. package/_chunks/{native-control-um1L1wgZ.js → native-control-DjJ8Na3T.js} +49 -44
  40. package/_chunks/{number-input-CKiA4d1N.js → number-input-Bb5guKP4.js} +4 -4
  41. package/_chunks/{picker-igNshTRC.js → picker-DDUmhT93.js} +5 -5
  42. package/_chunks/{plus-CbGRkIGl.js → plus-BaXticu7.js} +1 -1
  43. package/_chunks/{popup-DECYM9FI.js → popup-HEUnOeq-.js} +5 -5
  44. package/_chunks/{preact.module-BBM36DnO.js → preact.module-DzTStiZX.js} +1 -1
  45. package/_chunks/{rating-choice-CepVfGUq.js → rating-choice-CtrABPp-.js} +3 -3
  46. package/_chunks/{render-bTk3curw.js → render-C6PFWlqh.js} +2 -2
  47. package/_chunks/{reorder-list-B4w3aARt.js → reorder-list-DvwZcFPH.js} +4 -4
  48. package/_chunks/{request-trail-B1zVRPEf.js → request-trail-D5PKrBlC.js} +11 -11
  49. package/_chunks/{rich-text-Ci4d6dHn.js → rich-text-DW1vcBAY.js} +31 -31
  50. package/_chunks/{rotate-left-BF6G883o.js → rotate-left-CTHmcGBP.js} +1 -1
  51. package/_chunks/{rotate-right-Iha5ScJ1.js → rotate-right-BIfKgVun.js} +1 -1
  52. package/_chunks/{selection-list-tooltips-m00U3L6z.js → selection-list-tooltips-j84Wufjj.js} +8 -4
  53. package/_chunks/{title-tooltip-ncldbUwS.js → title-tooltip-DKiWhsL7.js} +1 -1
  54. package/_chunks/tooltip-BkuH0JdW.js +93 -0
  55. package/_chunks/tooltip-session-BBKkwhLZ.js +244 -0
  56. package/_chunks/{tooltip-text-BN5WdGHn.js → tooltip-text-CH_c2J-J.js} +2 -2
  57. package/_chunks/top-layer-popup-DU1r_2v5.js +107 -0
  58. package/_chunks/{xmark-DD_PBvZI.js → xmark-DQRQfXZI.js} +1 -1
  59. package/activity-message.js +1 -1
  60. package/ai/index.js +2 -2
  61. package/angular/angular.d.ts +2 -0
  62. package/angular/angular.js +1 -0
  63. package/assignee/index.js +28 -28
  64. package/avatar/index.js +3 -3
  65. package/browser/favicon.svg +9 -0
  66. package/browser/pdf-viewer.css +2 -0
  67. package/browser/pdf.worker.min.mjs +28 -0
  68. package/browser/pdfjs-LICENSE +177 -0
  69. package/browser/revo-ui.global.js +671 -0
  70. package/browser/revo-ui.js +35538 -0
  71. package/browser/robots.txt +4 -0
  72. package/browser.d.ts +3 -0
  73. package/browser.js +34 -0
  74. package/brush-range/component.js +2 -2
  75. package/buttons/delete-button.js +1 -1
  76. package/buttons/remove-button.js +2 -2
  77. package/buttons/svg-button.js +4 -4
  78. package/calendar/_calendar.scss +12 -4
  79. package/calendar/calendar.js +1 -1
  80. package/calendar/day.js +1 -1
  81. package/calendar/header.js +2 -2
  82. package/calendar/index.js +2 -2
  83. package/calendar/month-grid.js +1 -1
  84. package/calendar/year-grid.js +1 -1
  85. package/checkbox/index.js +1 -1
  86. package/choice-chips/index.js +1 -1
  87. package/color-palette/color-palette.js +1 -1
  88. package/color-palette/color-picker.js +2 -2
  89. package/configurator-actions.js +1 -1
  90. package/configurator-aggregation-list.js +6 -6
  91. package/configurator-drop-zone.js +3 -3
  92. package/configurator-field-icon.js +1 -1
  93. package/configurator-focus.js +1 -1
  94. package/configurator-sections.js +3 -3
  95. package/control-presentation.js +2 -2
  96. package/controls.js +2 -2
  97. package/core/editor-popup.js +1 -1
  98. package/core/popover-controller.d.ts +31 -6
  99. package/core/popover-controller.js +171 -46
  100. package/core/popup-ownership.d.ts +1 -1
  101. package/core/tooltip-options.d.ts +143 -0
  102. package/core/tooltip-options.js +20 -0
  103. package/core/tooltip-session.d.ts +32 -8
  104. package/core/tooltip-surface.d.ts +14 -3
  105. package/core/tooltip.d.ts +20 -19
  106. package/core/top-layer-popup.d.ts +2 -1
  107. package/core/top-layer-popup.js +1 -1
  108. package/date-time/index.js +1 -1
  109. package/dialog/dialog.dom.js +3 -3
  110. package/dialog/dialog.parts.js +1 -1
  111. package/dialog/dialog.preact.js +1 -1
  112. package/distribution-chart/area-chart.js +3 -3
  113. package/distribution-chart/bar-chart.js +2 -2
  114. package/distribution-chart/index.js +1 -1
  115. package/distribution-chart/line-chart.js +2 -2
  116. package/dropdown/content.d.ts +3 -1
  117. package/dropdown/content.js +1 -1
  118. package/dropdown/control.js +1 -1
  119. package/dropdown/dropdown.service.js +56 -56
  120. package/dropdown/index.js +2 -2
  121. package/dropdown/lookup-field.js +7 -7
  122. package/dropdown/popup.js +1 -1
  123. package/duration/index.js +1 -1
  124. package/editor-actions.js +3 -3
  125. package/editor-layout/index.js +3 -3
  126. package/field-configurator.js +1 -1
  127. package/field-reorder.hook.js +1 -1
  128. package/filter/filters/slider/preact.js +1 -1
  129. package/filter/filters/slider/runtime.js +1 -1
  130. package/filter/filters/slider/single.js +2 -2
  131. package/filter-badge.js +4 -4
  132. package/filter-controls.js +3 -3
  133. package/form-controls/index.js +3 -3
  134. package/form-controls/presentation.js +4 -4
  135. package/formatting/index.js +7 -7
  136. package/framework.js +135 -135
  137. package/history-controls.js +3 -3
  138. package/icon-toolbar.js +1 -1
  139. package/icons/icon.js +1 -1
  140. package/legend.js +1 -1
  141. package/masked-input/index.js +3 -3
  142. package/native-control.js +1 -1
  143. package/native.js +29 -79
  144. package/number-input/index.js +1 -1
  145. package/package.json +21 -1
  146. package/pagination.js +1 -1
  147. package/pdf-viewer/controller.js +1 -1
  148. package/pdf-viewer/index.js +3 -3
  149. package/pickers.d.ts +11 -4
  150. package/preact-mount.js +1 -1
  151. package/preact.d.ts +2 -0
  152. package/preact.js +66 -65
  153. package/rating-choice.js +1 -1
  154. package/react-adapter.d.ts +1 -1
  155. package/react.d.ts +2 -0
  156. package/react.js +64 -63
  157. package/reorder-list.js +1 -1
  158. package/resource-picker/resource-picker-avatar.js +2 -2
  159. package/resource-picker/resource-picker-option.js +1 -1
  160. package/resource-picker/resource-picker-popup.js +2 -2
  161. package/resource-picker/resource-picker.js +5 -5
  162. package/rich-text/index.js +1 -1
  163. package/search-input/index.js +3 -3
  164. package/segmented-switch/index.js +1 -1
  165. package/select.js +1 -1
  166. package/selection-list.js +1 -1
  167. package/status-feedback/exit-snapshot.js +1 -1
  168. package/status-feedback/header.js +3 -3
  169. package/status-feedback/index.js +1 -1
  170. package/status-feedback/popover.js +1 -1
  171. package/status-feedback/render.js +1 -1
  172. package/styles.css +1 -1
  173. package/surfaces.d.ts +1 -0
  174. package/surfaces.js +25 -24
  175. package/svelte.d.ts +2 -0
  176. package/svelte.js +30 -29
  177. package/switch/index.js +2 -2
  178. package/time-grid.js +4 -4
  179. package/timeline-track/_style.scss +33 -2
  180. package/timeline-track/component.d.ts +10 -1
  181. package/timeline-track/index.js +136 -74
  182. package/ui.css +1 -1
  183. package/vue.d.ts +11 -13
  184. package/vue.js +94 -90
  185. package/_chunks/tooltip-h-Z8yFBY.js +0 -54
  186. package/_chunks/tooltip-session-CBtRMBPr.js +0 -110
  187. package/_chunks/top-layer-popup-CKJ7VJOF.js +0 -59
package/surfaces.d.ts CHANGED
@@ -36,3 +36,4 @@ export declare function attachResizeHandle(handle: HTMLElement, options: ResizeO
36
36
  export { useTooltip, ControlTooltip } from './core/tooltip';
37
37
  export { prepareTooltipSurface, ensureTooltipStyles, } from './core/tooltip-surface';
38
38
  export { TooltipText } from './core/tooltip-text';
39
+ export * from './core/tooltip-options';
package/surfaces.js CHANGED
@@ -1,13 +1,14 @@
1
1
  import { releasePreactElement as e } from "./preact-mount.js";
2
- import { c as t, s as n } from "./_chunks/top-layer-popup-CKJ7VJOF.js";
2
+ import { l as t, s as n } from "./_chunks/top-layer-popup-DU1r_2v5.js";
3
3
  import { inheritUiMotion as r } from "./core/motion.js";
4
4
  import { PopoverController as i, TooltipController as a, createTooltipElement as o } from "./core/popover-controller.js";
5
- import { r as s, t as c } from "./_chunks/tooltip-h-Z8yFBY.js";
5
+ import { r as s, t as c } from "./_chunks/tooltip-BkuH0JdW.js";
6
6
  import { createDialogElements as l, getDialogFocusableElements as u, trapDialogFocus as d } from "./dialog/dialog.dom.js";
7
7
  import { attachDialogDrag as f } from "./dialog/dialog.drag.js";
8
- import { t as p } from "./_chunks/tooltip-text-BN5WdGHn.js";
8
+ import { t as p } from "./_chunks/tooltip-text-CH_c2J-J.js";
9
+ import { TooltipGroup as m, createTooltipGroup as h } from "./core/tooltip-options.js";
9
10
  //#region package/surfaces.tsx
10
- var m = /* @__PURE__ */ new WeakMap(), h = class {
11
+ var g = /* @__PURE__ */ new WeakMap(), _ = class {
11
12
  document;
12
13
  environment;
13
14
  active;
@@ -19,32 +20,32 @@ var m = /* @__PURE__ */ new WeakMap(), h = class {
19
20
  }
20
21
  open(t) {
21
22
  this.close();
22
- let n = this.document, i = n.activeElement, a = !1, o, s, c = m.get(n) ?? [];
23
- m.set(n, c);
23
+ let n = this.document, i = n.activeElement, a = !1, o, s, c = g.get(n) ?? [];
24
+ g.set(n, c);
24
25
  let p = () => {
25
26
  if (a) return;
26
- a = !0, o?.(), s?.(), e(h.root);
27
- let n = c.indexOf(h.root), r = n === c.length - 1;
28
- n !== -1 && c.splice(n, 1), this.active?.root === h.root && (this.active = void 0);
27
+ a = !0, o?.(), s?.(), e(m.root);
28
+ let n = c.indexOf(m.root), r = n === c.length - 1;
29
+ n !== -1 && c.splice(n, 1), this.active?.root === m.root && (this.active = void 0);
29
30
  try {
30
31
  t.onClose?.();
31
32
  } finally {
32
33
  r && (this.environment.restoreFocus ? this.environment.restoreFocus(t.returnFocus, i ?? void 0) : [t.returnFocus, i].find((e) => e?.isConnected)?.focus?.({ preventScroll: !0 }));
33
34
  }
34
- }, h = l(n, t, p), g = {
35
- ...h,
35
+ }, m = l(n, t, p), h = {
36
+ ...m,
36
37
  close: p
37
38
  };
38
- return this.environment.beforeMount?.(h.root), s = r(t.returnFocus ?? i, h.root), h.root.addEventListener("mousedown", (e) => {
39
- e.target === h.root && c.at(-1) === h.root && p();
40
- }), h.root.addEventListener("keydown", (e) => {
41
- c.at(-1) === h.root && (e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), p()) : e.key === "Tab" && d(h.root, e));
42
- }), n.body.append(h.root), c.push(h.root), t.draggable !== !1 && (o = f({
43
- target: h.surface,
44
- handle: h.header
45
- })), this.active = g, this.environment.onOpen?.(t), queueMicrotask(() => {
46
- !a && c.at(-1) === h.root && (u(h.root)[0] ?? h.root).focus({ preventScroll: !0 });
47
- }), g;
39
+ return this.environment.beforeMount?.(m.root), s = r(t.returnFocus ?? i, m.root), m.root.addEventListener("mousedown", (e) => {
40
+ e.target === m.root && c.at(-1) === m.root && p();
41
+ }), m.root.addEventListener("keydown", (e) => {
42
+ c.at(-1) === m.root && (e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), p()) : e.key === "Tab" && d(m.root, e));
43
+ }), n.body.append(m.root), c.push(m.root), t.draggable !== !1 && (o = f({
44
+ target: m.surface,
45
+ handle: m.header
46
+ })), this.active = h, this.environment.onOpen?.(t), queueMicrotask(() => {
47
+ !a && c.at(-1) === m.root && (u(m.root)[0] ?? m.root).focus({ preventScroll: !0 });
48
+ }), h;
48
49
  }
49
50
  close(e) {
50
51
  (!e || this.active?.root === e) && this.active?.close();
@@ -53,7 +54,7 @@ var m = /* @__PURE__ */ new WeakMap(), h = class {
53
54
  this.close();
54
55
  }
55
56
  };
56
- function g(e, t = () => {}, n = {}) {
57
+ function v(e, t = () => {}, n = {}) {
57
58
  let r = (r) => {
58
59
  let i = Array.from(e.querySelectorAll("[role=\"menuitem\"], [role=\"menuitemcheckbox\"], [role=\"menuitemradio\"]")).filter((t) => t.closest("[role=\"menu\"]") === e && t.getAttribute("aria-disabled") !== "true" && !t.hasAttribute("disabled") && !t.hidden), a = i.indexOf(e.ownerDocument.activeElement);
59
60
  [
@@ -65,7 +66,7 @@ function g(e, t = () => {}, n = {}) {
65
66
  };
66
67
  return e.addEventListener("keydown", r), () => e.removeEventListener("keydown", r);
67
68
  }
68
- function _(e, t) {
69
+ function y(e, t) {
69
70
  let n = typeof t == "function" ? t : () => t, r = n().value, i = r, a = () => {
70
71
  let e = n();
71
72
  return e.value !== i && (i = e.value, r = e.value), e;
@@ -98,4 +99,4 @@ function _(e, t) {
98
99
  };
99
100
  }
100
101
  //#endregion
101
- export { c as ControlTooltip, h as DialogController, i as PopoverController, a as TooltipController, p as TooltipText, g as attachMenuKeyboard, _ as attachResizeHandle, o as createTooltipElement, n as ensureTooltipStyles, t as prepareTooltipSurface, s as useTooltip };
102
+ export { c as ControlTooltip, _ as DialogController, i as PopoverController, a as TooltipController, m as TooltipGroup, p as TooltipText, v as attachMenuKeyboard, y as attachResizeHandle, o as createTooltipElement, h as createTooltipGroup, n as ensureTooltipStyles, t as prepareTooltipSurface, s as useTooltip };
package/svelte.d.ts CHANGED
@@ -7,3 +7,5 @@ export type { PdfViewerProps, PdfViewerText } from './pdf-viewer/component';
7
7
  export type { PdfViewerToolbarProps } from './pdf-viewer/toolbar';
8
8
  export type { PdfViewerButton, PdfViewerButtonOptions, PdfViewerToolbarOptions, PdfViewerToolbarConfig, } from './pdf-viewer/toolbar-options';
9
9
  export { defaultPdfViewerText } from './pdf-viewer/translations';
10
+ export { createTooltipGroup, TooltipGroup } from './core/tooltip-options';
11
+ export type { TooltipAnchor, TooltipSide, TooltipAlign, TooltipReason, TooltipContent, TooltipOffset, TooltipOffsetContext, TooltipGroupOptions, TooltipOptions, TooltipControllerOptions, TooltipChangeDetails, TooltipContentContext, TooltipPositionOptions, } from './core/tooltip-options';
package/svelte.js CHANGED
@@ -1,27 +1,28 @@
1
- import { i as e } from "./_chunks/component-C3k_8uIq.js";
2
- import { t } from "./_chunks/component-metadata-DlVkpW3h.js";
3
- import { n, t as r } from "./_chunks/framework-mount-D4I8HpVp.js";
4
- import { uiComponents as i } from "./framework.js";
1
+ import { TooltipGroup as e, createTooltipGroup as t } from "./core/tooltip-options.js";
2
+ import { i as n } from "./_chunks/component-B22CtP21.js";
3
+ import { t as r } from "./_chunks/component-metadata-B_hLjtM0.js";
4
+ import { n as i, t as a } from "./_chunks/framework-mount-CX0oj05W.js";
5
+ import { uiComponents as o } from "./framework.js";
5
6
  import "svelte/internal/disclose-version";
6
- import * as a from "svelte/internal/client";
7
- import { onMount as o, untrack as s } from "svelte";
7
+ import * as s from "svelte/internal/client";
8
+ import { onMount as c, untrack as l } from "svelte";
8
9
  //#region package/svelte/UiComponent.svelte
9
- var c = a.from_html("<span style=\"display: contents\" data-rv-svelte-content=\"\"><!></span>"), l = a.from_html("<span style=\"display: contents\"></span> <!>", 1);
10
- function u(e, u) {
11
- a.push(u, !0);
12
- let d = a.prop(u, "props", 19, () => ({})), f = a.prop(u, "slots", 19, () => ({})), p, m = a.state([]), h = a.state(void 0);
13
- o(() => {
14
- let e = r(p, (e) => {
15
- a.set(m, e);
10
+ var u = s.from_html("<span style=\"display: contents\" data-rv-svelte-content=\"\"><!></span>"), d = s.from_html("<span style=\"display: contents\"></span> <!>", 1);
11
+ function f(e, t) {
12
+ s.push(t, !0);
13
+ let n = s.prop(t, "props", 19, () => ({})), f = s.prop(t, "slots", 19, () => ({})), p, m = s.state([]), h = s.state(void 0);
14
+ c(() => {
15
+ let e = a(p, (e) => {
16
+ s.set(m, e);
16
17
  });
17
- return a.set(h, e), () => {
18
+ return s.set(h, e), () => {
18
19
  e.destroy();
19
20
  };
20
- }), a.user_effect(() => {
21
- let e = { ...d() }, r = u.component, o = {
21
+ }), s.user_effect(() => {
22
+ let e = { ...n() }, a = t.component, c = {
22
23
  ...f(),
23
- ...u.children ? { default: u.children } : {}
24
- }, c = u.onValueChange, l = u.onUiEvent, p = a.get(h), m = t[r], g = /* @__PURE__ */ new Set([
24
+ ...t.children ? { default: t.children } : {}
25
+ }, u = t.onValueChange, d = t.onUiEvent, p = s.get(h), m = r[a], g = /* @__PURE__ */ new Set([
25
26
  ...Object.keys(e).filter((e) => /^on[A-Z]/.test(e)),
26
27
  "onClose",
27
28
  ...m ? [m.callback] : []
@@ -30,29 +31,29 @@ function u(e, u) {
30
31
  let n = e[t];
31
32
  e[t] = (...e) => {
32
33
  let r = n?.(...e);
33
- return t === m?.callback && c?.(e[0]), l?.({
34
+ return t === m?.callback && u?.(e[0]), d?.({
34
35
  name: t,
35
36
  args: e
36
37
  }), r;
37
38
  };
38
39
  }
39
- s(() => p?.render(i[r], e, (e, t) => n(r, e, o, t)));
40
+ l(() => p?.render(o[a], e, (e, t) => i(a, e, c, t)));
40
41
  });
41
42
  function g(e, t) {
42
43
  return t.appendChild(e), { update(t) {
43
44
  t.appendChild(e);
44
45
  } };
45
46
  }
46
- var _ = l(), v = a.first_child(_);
47
- a.bind_this(v, (e) => p = e, () => p);
48
- var y = a.sibling(v, 2);
49
- a.each(y, 17, () => a.get(m), (e) => e.id, (e, t) => {
50
- var n = c(), r = a.child(n);
51
- a.snippet(r, () => a.get(t).content, () => a.get(t).scope), a.reset(n), a.action(n, (e, t) => g?.(e, t), () => a.get(t).element), a.append(e, n);
52
- }), a.template_effect(() => a.set_attribute(v, "data-rv-svelte-host", u.component)), a.append(e, _), a.pop();
47
+ var _ = d(), v = s.first_child(_);
48
+ s.bind_this(v, (e) => p = e, () => p);
49
+ var y = s.sibling(v, 2);
50
+ s.each(y, 17, () => s.get(m), (e) => e.id, (e, t) => {
51
+ var n = u(), r = s.child(n);
52
+ s.snippet(r, () => s.get(t).content, () => s.get(t).scope), s.reset(n), s.action(n, (e, t) => g?.(e, t), () => s.get(t).element), s.append(e, n);
53
+ }), s.template_effect(() => s.set_attribute(v, "data-rv-svelte-host", t.component)), s.append(e, _), s.pop();
53
54
  }
54
55
  //#endregion
55
56
  //#region package/svelte.ts
56
- var d = u;
57
+ var p = f;
57
58
  //#endregion
58
- export { d as UiComponent, e as defaultPdfViewerText };
59
+ export { e as TooltipGroup, p as UiComponent, t as createTooltipGroup, n as defaultPdfViewerText };
package/switch/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { t as e } from "../_chunks/jsxRuntime.module-F6UFnpT-.js";
2
- import { t } from "../_chunks/native-control-um1L1wgZ.js";
1
+ import { t as e } from "../_chunks/jsxRuntime.module-ksX_VSbv.js";
2
+ import { t } from "../_chunks/native-control-DjJ8Na3T.js";
3
3
  //#region package/switch/index.tsx
4
4
  function n({ checked: n, onChange: r, label: i, ariaLabel: a, className: o = "", disabled: s = !1, labelPosition: c = "before", title: l, testId: u }) {
5
5
  let d = /* @__PURE__ */ e("span", {
package/time-grid.js CHANGED
@@ -1,7 +1,7 @@
1
- import { r as e, t } from "./_chunks/hooks.module-CG3gN83z.js";
2
- import { t as n } from "./_chunks/jsxRuntime.module-F6UFnpT-.js";
3
- import { t as r } from "./_chunks/native-control-um1L1wgZ.js";
4
- import { t as i } from "./_chunks/tooltip-text-BN5WdGHn.js";
1
+ import { r as e, t } from "./_chunks/hooks.module-CXpO2xq6.js";
2
+ import { t as n } from "./_chunks/jsxRuntime.module-ksX_VSbv.js";
3
+ import { t as r } from "./_chunks/native-control-DjJ8Na3T.js";
4
+ import { t as i } from "./_chunks/tooltip-text-CH_c2J-J.js";
5
5
  //#region package/time-grid.tsx
6
6
  var a = (e, t) => `${e}:${t}`;
7
7
  function o(e) {
@@ -3,6 +3,8 @@
3
3
  position: relative;
4
4
  box-sizing: border-box;
5
5
  width: 100%;
6
+ min-width: 82px;
7
+ --rv-timeline-lane-size: max(42px, calc(1lh + 24px));
6
8
  height: 112px;
7
9
  margin: 0 0 12px;
8
10
  overflow: hidden;
@@ -64,8 +66,8 @@
64
66
  top: 39px;
65
67
  z-index: 1;
66
68
  box-sizing: border-box;
67
- min-width: 6px;
68
- height: 30px;
69
+ min-width: 56px;
70
+ height: max(30px, calc(1lh + 12px));
69
71
  border: 1px solid var(--timeline-event-color-end, #15803d);
70
72
  border-radius: 7px;
71
73
  background: var(--timeline-event-color, #16a34a);
@@ -191,3 +193,32 @@
191
193
  background: HighlightText;
192
194
  }
193
195
  }
196
+
197
+ .rv-timeline-control__actions {
198
+ margin-block: 8px;
199
+ summary {
200
+ cursor: pointer;
201
+ min-height: 24px;
202
+ }
203
+ fieldset {
204
+ min-width: 0;
205
+ margin-block: 8px;
206
+ border: 1px solid var(--rv-ui-border);
207
+ border-radius: 6px;
208
+ }
209
+ output {
210
+ display: block;
211
+ margin-bottom: 8px;
212
+ }
213
+ }
214
+ .rv-timeline-control__commands {
215
+ display: flex;
216
+ flex-wrap: wrap;
217
+ gap: 8px;
218
+ }
219
+ @media (forced-colors: active) {
220
+ .rv-timeline-control__track button:focus-visible {
221
+ outline: 2px solid Highlight;
222
+ outline-offset: -2px;
223
+ }
224
+ }
@@ -7,6 +7,13 @@ export interface TimelineTrackItem<T extends TimelineTrackEvent> {
7
7
  }
8
8
  export interface TimelineTrackLabels {
9
9
  readonly preview: string;
10
+ readonly editEvents?: string;
11
+ readonly moveEarlier?: string;
12
+ readonly moveLater?: string;
13
+ readonly startEarlier?: string;
14
+ readonly startLater?: string;
15
+ readonly endEarlier?: string;
16
+ readonly endLater?: string;
10
17
  readonly moveEvent: (index: number) => string;
11
18
  readonly resizeStart: (label: string) => string;
12
19
  readonly resizeEnd: (label: string) => string;
@@ -14,6 +21,8 @@ export interface TimelineTrackLabels {
14
21
  export interface TimelineTrackProps<T extends TimelineTrackEvent> {
15
22
  readonly rows: readonly TimelineTrackItem<T>[];
16
23
  readonly tooltip?: boolean;
24
+ /** Show click/tap alternatives to dragging. Hosts hiding these must supply equivalent controls. */
25
+ readonly showActions?: boolean;
17
26
  readonly formatValue?: (value: number) => string;
18
27
  readonly getTooltip?: (event: T) => string;
19
28
  readonly selected?: string | number;
@@ -24,4 +33,4 @@ export interface TimelineTrackProps<T extends TimelineTrackEvent> {
24
33
  readonly onEventChange: (id: string | number, event: T) => void;
25
34
  }
26
35
  /** Controlled numeric timeline. Changes preserve event metadata; consumers own commits. */
27
- export declare function TimelineTrack<T extends TimelineTrackEvent>({ rows, tooltip, formatValue, getTooltip, selected, range, labels, onSelect, onEventChange, }: TimelineTrackProps<T>): JSX.Element;
36
+ export declare function TimelineTrack<T extends TimelineTrackEvent>({ rows, tooltip, showActions, formatValue, getTooltip, selected, range, labels, onSelect, onEventChange, }: TimelineTrackProps<T>): JSX.Element;
@@ -1,156 +1,218 @@
1
- import { t as e } from "../_chunks/hooks.module-CG3gN83z.js";
2
- import { t } from "../_chunks/jsxRuntime.module-F6UFnpT-.js";
3
- import { t as n } from "../_chunks/native-control-um1L1wgZ.js";
4
- import { n as r } from "../_chunks/tooltip-h-Z8yFBY.js";
5
- import { eventOutsideRange as i, moveTimelineEvent as a, niceTimelineStep as o, resizeTimelineEvent as s, timelineEventBackground as c, timelineGeometry as l } from "./model.js";
1
+ import { i as e } from "../_chunks/preact.module-DzTStiZX.js";
2
+ import { t } from "../_chunks/hooks.module-CXpO2xq6.js";
3
+ import { t as n } from "../_chunks/jsxRuntime.module-ksX_VSbv.js";
4
+ import { t as r } from "../_chunks/native-control-DjJ8Na3T.js";
5
+ import { n as i } from "../_chunks/tooltip-BkuH0JdW.js";
6
+ import { eventOutsideRange as a, moveTimelineEvent as o, niceTimelineStep as s, resizeTimelineEvent as c, timelineEventBackground as l, timelineGeometry as u } from "./model.js";
6
7
  //#region package/timeline-track/component.tsx
7
- var u = {
8
+ var d = {
8
9
  preview: "Timeline preview",
10
+ editEvents: "Edit timeline events",
11
+ moveEarlier: "Move earlier",
12
+ moveLater: "Move later",
13
+ startEarlier: "Start earlier",
14
+ startLater: "Start later",
15
+ endEarlier: "End earlier",
16
+ endLater: "End later",
9
17
  moveEvent: (e) => `Move event ${e}`,
10
18
  resizeStart: (e) => `Resize start of ${e}`,
11
19
  resizeEnd: (e) => `Resize end of ${e}`
12
20
  };
13
- function d({ rows: r, tooltip: d = !0, formatValue: p = String, getTooltip: m, selected: h, range: g, labels: _, onSelect: v, onEventChange: y }) {
14
- let b = {
15
- ...u,
16
- ..._
17
- }, x = e(), S = (e, t, n) => {
21
+ function f({ rows: i, tooltip: f = !0, showActions: m = !0, formatValue: h = String, getTooltip: g, selected: _, range: v, labels: y, onSelect: b, onEventChange: x }) {
22
+ let S = {
23
+ ...d,
24
+ ...y
25
+ }, C = t(), w = (e, t, n) => {
18
26
  let r = e.currentTarget.closest(".rv-timeline-control__track");
19
- r && (e.preventDefault(), e.currentTarget.setPointerCapture?.(e.pointerId), x.current = {
27
+ r && (e.preventDefault(), e.currentTarget.setPointerCapture?.(e.pointerId), C.current = {
20
28
  id: t.id,
21
29
  mode: n,
22
30
  clientX: e.clientX,
23
31
  event: t.event,
24
32
  width: r.getBoundingClientRect().width
25
- }, v(t.id));
26
- }, C = (e) => {
27
- let t = x.current;
33
+ }, b(t.id));
34
+ }, T = (e) => {
35
+ let t = C.current;
28
36
  if (!t) return;
29
- let n = o(g), r = (e.clientX - t.clientX) / Math.max(1, t.width) * (g.end - g.start), i = Math.round(r / n) * n, c = t.mode === "move" ? a(t.event, i, g) : s(t.event, t.mode, i, g);
30
- y(t.id, c);
31
- }, w = () => {
32
- x.current = void 0;
33
- }, T = (e, t, n) => {
37
+ let n = s(v), r = (e.clientX - t.clientX) / Math.max(1, t.width) * (v.end - v.start), i = Math.round(r / n) * n, a = t.mode === "move" ? o(t.event, i, v) : c(t.event, t.mode, i, v);
38
+ x(t.id, a);
39
+ }, E = () => {
40
+ C.current = void 0;
41
+ }, D = (e, t, n) => {
34
42
  if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
35
43
  e.preventDefault();
36
- let r = o(g) * (e.key === "ArrowLeft" ? -1 : 1);
37
- y(t.id, n === "move" ? a(t.event, r, g) : s(t.event, n, r, g));
44
+ let r = s(v) * (e.key === "ArrowLeft" ? -1 : 1);
45
+ x(t.id, n === "move" ? o(t.event, r, v) : c(t.event, n, r, v));
38
46
  };
39
- return /* @__PURE__ */ t("div", {
47
+ return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ n("div", {
40
48
  class: "rv-timeline-editor__track rv-timeline-control__track",
41
49
  role: "group",
42
- "aria-label": b.preview,
50
+ "aria-label": S.preview,
51
+ style: { height: `max(112px, calc(70px + ${i.length} * var(--rv-timeline-lane-size)))` },
43
52
  children: [
44
- /* @__PURE__ */ t("span", {
53
+ /* @__PURE__ */ n("span", {
45
54
  class: "rv-timeline-editor__range rv-timeline-editor__range--start rv-timeline-control__range rv-timeline-control__range--start",
46
- children: g.start
55
+ children: v.start
47
56
  }),
48
- /* @__PURE__ */ t("span", {
57
+ /* @__PURE__ */ n("span", {
49
58
  class: "rv-timeline-editor__range rv-timeline-editor__range--end rv-timeline-control__range rv-timeline-control__range--end",
50
- children: g.end
59
+ children: v.end
51
60
  }),
52
- r.map((e, t) => ({
61
+ i.map((e, t) => ({
53
62
  row: e,
54
63
  index: t
55
- })).filter(({ row: e }) => Number.isFinite(e.event.start) && Number.isFinite(e.event.end) && e.event.end >= e.event.start).map(({ row: e, index: r }) => {
56
- let a = l(e.event, g), o = i(e.event, g), s = e.event.label || b.moveEvent(r + 1);
57
- return /* @__PURE__ */ t(f, {
58
- tooltipText: d ? m?.(e.event) ?? `${s}: ${p(e.event.start)} – ${p(e.event.end)}` : void 0,
64
+ })).filter(({ row: e }) => Number.isFinite(e.event.start) && Number.isFinite(e.event.end) && e.event.end >= e.event.start).map(({ row: e, index: t }) => {
65
+ let i = u(e.event, v), o = `clamp(56px, ${i.width}%, calc(100% - 24px))`, s = a(e.event, v), c = e.event.label || S.moveEvent(t + 1);
66
+ return /* @__PURE__ */ n(p, {
67
+ tooltipText: f ? g?.(e.event) ?? `${c}: ${h(e.event.start)} – ${h(e.event.end)}` : void 0,
59
68
  class: [
60
69
  "rv-timeline-editor__bar rv-timeline-control__bar",
61
- h === e.id ? "rv-timeline-editor__bar--selected rv-timeline-control__bar--selected" : "",
70
+ _ === e.id ? "rv-timeline-editor__bar--selected rv-timeline-control__bar--selected" : "",
62
71
  e.event.start === e.event.end ? "rv-timeline-editor__bar--milestone rv-timeline-control__bar--milestone" : "",
63
- o ? "rv-timeline-editor__bar--outside rv-timeline-control__bar--outside" : ""
72
+ s ? "rv-timeline-editor__bar--outside rv-timeline-control__bar--outside" : ""
64
73
  ].filter(Boolean).join(" "),
65
74
  style: {
66
- left: `${a.left}%`,
67
- width: `${a.width}%`,
68
- background: c(e.event),
75
+ top: `calc(39px + ${t} * var(--rv-timeline-lane-size))`,
76
+ left: `clamp(12px, ${i.left}%, calc(100% - ${o} - 12px))`,
77
+ width: o,
78
+ background: l(e.event),
69
79
  color: e.event.textColor,
70
80
  "--timeline-event-color": e.event.color,
71
81
  "--timeline-event-color-end": e.event.color
72
82
  },
73
83
  role: "group",
74
- "aria-label": s,
84
+ "aria-label": c,
75
85
  children: [
76
- /* @__PURE__ */ t(n, {
86
+ /* @__PURE__ */ n(r, {
77
87
  unstyled: !0,
78
88
  type: "button",
79
89
  class: "rv-timeline-editor__bar-move rv-timeline-control__bar-move",
80
- "data-autofocus": r === 0 ? "" : void 0,
81
- "aria-label": e.event.label ? `${b.moveEvent(r + 1)}: ${e.event.label}` : b.moveEvent(r + 1),
90
+ "data-autofocus": t === 0 ? "" : void 0,
91
+ "aria-label": e.event.label ? `${S.moveEvent(t + 1)}: ${e.event.label}` : S.moveEvent(t + 1),
82
92
  "aria-keyshortcuts": "ArrowLeft ArrowRight",
83
- onFocus: () => v(e.id),
84
- onPointerDown: (t) => S(t, e, "move"),
85
- onPointerMove: C,
86
- onPointerUp: w,
87
- onPointerCancel: w,
88
- onKeyDown: (t) => T(t, e, "move"),
89
- children: /* @__PURE__ */ t("span", {
93
+ onFocus: () => b(e.id),
94
+ onPointerDown: (t) => w(t, e, "move"),
95
+ onPointerMove: T,
96
+ onPointerUp: E,
97
+ onPointerCancel: E,
98
+ onKeyDown: (t) => D(t, e, "move"),
99
+ children: /* @__PURE__ */ n("span", {
90
100
  class: "rv-timeline-editor__bar-label rv-timeline-control__bar-label",
91
101
  children: e.event.label
92
102
  })
93
103
  }),
94
- /* @__PURE__ */ t(n, {
104
+ /* @__PURE__ */ n(r, {
95
105
  unstyled: !0,
96
106
  type: "button",
97
107
  class: "rv-timeline-editor__handle rv-timeline-editor__handle--start rv-timeline-control__handle rv-timeline-control__handle--start",
98
108
  role: "slider",
99
109
  "aria-orientation": "horizontal",
100
- "aria-label": b.resizeStart(s),
101
- "aria-valuemin": Math.min(g.start, e.event.start),
110
+ "aria-label": S.resizeStart(c),
111
+ "aria-valuemin": Math.min(v.start, e.event.start),
102
112
  "aria-valuemax": e.event.end,
103
113
  "aria-valuenow": e.event.start,
104
114
  "aria-keyshortcuts": "ArrowLeft ArrowRight",
105
- onFocus: () => v(e.id),
115
+ onFocus: () => b(e.id),
106
116
  onPointerDown: (t) => {
107
- t.stopPropagation(), S(t, e, "start");
117
+ t.stopPropagation(), w(t, e, "start");
108
118
  },
109
- onPointerMove: C,
110
- onPointerUp: w,
111
- onPointerCancel: w,
119
+ onPointerMove: T,
120
+ onPointerUp: E,
121
+ onPointerCancel: E,
112
122
  onKeyDown: (t) => {
113
- t.stopPropagation(), T(t, e, "start");
123
+ t.stopPropagation(), D(t, e, "start");
114
124
  }
115
125
  }),
116
- /* @__PURE__ */ t(n, {
126
+ /* @__PURE__ */ n(r, {
117
127
  unstyled: !0,
118
128
  type: "button",
119
129
  class: "rv-timeline-editor__handle rv-timeline-editor__handle--end rv-timeline-control__handle rv-timeline-control__handle--end",
120
130
  role: "slider",
121
131
  "aria-orientation": "horizontal",
122
- "aria-label": b.resizeEnd(s),
132
+ "aria-label": S.resizeEnd(c),
123
133
  "aria-valuemin": e.event.start,
124
- "aria-valuemax": Math.max(g.end, e.event.end),
134
+ "aria-valuemax": Math.max(v.end, e.event.end),
125
135
  "aria-valuenow": e.event.end,
126
136
  "aria-keyshortcuts": "ArrowLeft ArrowRight",
127
- onFocus: () => v(e.id),
137
+ onFocus: () => b(e.id),
128
138
  onPointerDown: (t) => {
129
- t.stopPropagation(), S(t, e, "end");
139
+ t.stopPropagation(), w(t, e, "end");
130
140
  },
131
- onPointerMove: C,
132
- onPointerUp: w,
133
- onPointerCancel: w,
141
+ onPointerMove: T,
142
+ onPointerUp: E,
143
+ onPointerCancel: E,
134
144
  onKeyDown: (t) => {
135
- t.stopPropagation(), T(t, e, "end");
145
+ t.stopPropagation(), D(t, e, "end");
136
146
  }
137
147
  })
138
148
  ]
139
149
  }, e.id);
140
150
  })
141
151
  ]
142
- });
152
+ }), m && /* @__PURE__ */ n("details", {
153
+ class: "rv-timeline-control__actions",
154
+ children: [/* @__PURE__ */ n("summary", { children: S.editEvents }), i.filter(({ event: e }) => Number.isFinite(e.start) && Number.isFinite(e.end) && e.end >= e.start).map((e, t) => /* @__PURE__ */ n("fieldset", { children: [
155
+ /* @__PURE__ */ n("legend", { children: e.event.label || S.moveEvent(t + 1) }),
156
+ /* @__PURE__ */ n("output", { children: [
157
+ h(e.event.start),
158
+ " – ",
159
+ h(e.event.end)
160
+ ] }),
161
+ /* @__PURE__ */ n("div", {
162
+ class: "rv-timeline-control__commands",
163
+ children: [
164
+ [
165
+ "move",
166
+ -1,
167
+ S.moveEarlier
168
+ ],
169
+ [
170
+ "move",
171
+ 1,
172
+ S.moveLater
173
+ ],
174
+ [
175
+ "start",
176
+ -1,
177
+ S.startEarlier
178
+ ],
179
+ [
180
+ "start",
181
+ 1,
182
+ S.startLater
183
+ ],
184
+ [
185
+ "end",
186
+ -1,
187
+ S.endEarlier
188
+ ],
189
+ [
190
+ "end",
191
+ 1,
192
+ S.endLater
193
+ ]
194
+ ].map(([t, i, a]) => /* @__PURE__ */ n(r, {
195
+ type: "button",
196
+ onClick: () => {
197
+ let n = s(v) * i;
198
+ b(e.id), x(e.id, t === "move" ? o(e.event, n, v) : c(e.event, t, n, v));
199
+ },
200
+ children: a
201
+ }))
202
+ })
203
+ ] }, e.id))]
204
+ })] });
143
205
  }
144
- function f({ tooltipText: e, children: n, ...i }) {
145
- let a = r(e ?? "", !0, {
206
+ function p({ tooltipText: e, children: t, ...r }) {
207
+ let a = i(e ?? "", !0, {
146
208
  className: "rv-control-tooltip",
147
209
  placement: "above"
148
210
  });
149
- return /* @__PURE__ */ t("div", {
150
- ...i,
211
+ return /* @__PURE__ */ n("div", {
212
+ ...r,
151
213
  ...e ? a.triggerProps : {},
152
- children: [n, e && a.tooltip]
214
+ children: [t, e && a.tooltip]
153
215
  });
154
216
  }
155
217
  //#endregion
156
- export { d as TimelineTrack, i as eventOutsideRange, a as moveTimelineEvent, o as niceTimelineStep, s as resizeTimelineEvent, c as timelineEventBackground, l as timelineGeometry };
218
+ export { f as TimelineTrack, a as eventOutsideRange, o as moveTimelineEvent, s as niceTimelineStep, c as resizeTimelineEvent, l as timelineEventBackground, u as timelineGeometry };