@adecore/ui 0.31.12 → 0.32.0

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 (163) hide show
  1. package/dist/AccentSwatches.js +290 -13
  2. package/dist/Banner.js +90 -9
  3. package/dist/Button.js +114 -22
  4. package/dist/ButtonGroup.js +62 -8
  5. package/dist/Checkbox.js +73 -4
  6. package/dist/ChoiceCards.js +205 -11
  7. package/dist/CloseButton.js +87 -7
  8. package/dist/ColorSwatch.js +132 -15
  9. package/dist/ColorWheelPicker.js +305 -71
  10. package/dist/ColumnResizeHandle.js +43 -8
  11. package/dist/DisabledReason.js +27 -8
  12. package/dist/DockShell.js +144 -37
  13. package/dist/EmptyState.js +95 -6
  14. package/dist/ErrorBoundary.js +254 -31
  15. package/dist/Field.js +349 -31
  16. package/dist/FileIcon.js +67 -6
  17. package/dist/Icon.js +38 -6
  18. package/dist/IconButton.js +176 -20
  19. package/dist/IconPicker.js +344 -73
  20. package/dist/Input.js +233 -14
  21. package/dist/Kbd.js +150 -10
  22. package/dist/LazyBoundary.js +14 -5
  23. package/dist/ListRow.js +75 -15
  24. package/dist/Meter.js +108 -5
  25. package/dist/MiddleTruncate.js +126 -45
  26. package/dist/PanelEmpty.js +64 -5
  27. package/dist/PanelHeader.js +95 -13
  28. package/dist/Pill.js +114 -19
  29. package/dist/ProjectSwitcher.js +225 -12
  30. package/dist/PromptDialog.js +352 -37
  31. package/dist/SectionLabel.js +62 -8
  32. package/dist/SegmentBar.js +197 -36
  33. package/dist/Segmented.js +130 -23
  34. package/dist/Select.js +310 -19
  35. package/dist/SelectSearch.js +344 -29
  36. package/dist/Separator.js +35 -4
  37. package/dist/ShortcutHints.js +146 -76
  38. package/dist/Skeleton.js +31 -4
  39. package/dist/Slider.js +172 -10
  40. package/dist/SlidingColumn.js +194 -34
  41. package/dist/Spinner.js +100 -3
  42. package/dist/Stepper.js +232 -11
  43. package/dist/Surface.js +62 -8
  44. package/dist/Switch.js +60 -6
  45. package/dist/TextMenu.js +212 -17
  46. package/dist/Tile.js +149 -5
  47. package/dist/Toasts.js +391 -33
  48. package/dist/Tooltip.js +153 -16
  49. package/dist/UIProvider.js +62 -15
  50. package/dist/Waveform.js +362 -93
  51. package/dist/Wipe.js +259 -34
  52. package/dist/ZoomControls.js +356 -14
  53. package/dist/class-name.js +1 -1
  54. package/dist/clipboard.js +15 -17
  55. package/dist/context-menu/index.parts.js +1 -1
  56. package/dist/dialog/index.parts.js +1 -1
  57. package/dist/dialog/parts.js +378 -29
  58. package/dist/dialog-layer.js +51 -18
  59. package/dist/error-boundary.js +19 -19
  60. package/dist/error-message.js +1 -1
  61. package/dist/field-context.js +7 -5
  62. package/dist/file-icon.js +23 -21
  63. package/dist/file-tree/helpers.js +133 -119
  64. package/dist/file-tree/index.parts.js +3 -3
  65. package/dist/file-tree/parts.js +418 -127
  66. package/dist/file-tree/style.js +1 -1
  67. package/dist/file-tree/use-file-tree-shift.js +43 -30
  68. package/dist/file-tree/use-file-tree.js +60 -18
  69. package/dist/file-tree/use-slots.js +220 -192
  70. package/dist/floating.js +2 -2
  71. package/dist/format/datetime.js +88 -38
  72. package/dist/format/duration.js +59 -53
  73. package/dist/format/index.js +1 -1
  74. package/dist/format/locale.js +76 -56
  75. package/dist/format/number.js +77 -61
  76. package/dist/format/regions.js +4 -2
  77. package/dist/format/time-zone.js +1 -1
  78. package/dist/icon-button-size.js +12 -2
  79. package/dist/icon-picker.js +70 -61
  80. package/dist/index.js +57 -57
  81. package/dist/key-value-list/index.parts.js +1 -1
  82. package/dist/key-value-list/parts.js +256 -22
  83. package/dist/lazy-landings.js +10 -10
  84. package/dist/lazy.js +84 -71
  85. package/dist/locales/en.js +80 -80
  86. package/dist/locales/nl.js +80 -80
  87. package/dist/locales.js +10 -7
  88. package/dist/menu/index.parts.js +1 -1
  89. package/dist/menu/parts.js +882 -44
  90. package/dist/merge-refs.js +8 -9
  91. package/dist/middle-truncate.js +24 -25
  92. package/dist/modality.js +27 -19
  93. package/dist/placement.js +11 -20
  94. package/dist/platform.js +6 -6
  95. package/dist/popover/index.parts.js +1 -1
  96. package/dist/popover/parts.js +173 -11
  97. package/dist/popup-layer.js +38 -17
  98. package/dist/prefetch.js +78 -79
  99. package/dist/preview-card/index.parts.js +1 -1
  100. package/dist/project-switcher-row.js +153 -12
  101. package/dist/select-row.js +69 -5
  102. package/dist/select-shared.js +6 -6
  103. package/dist/selection.js +16 -16
  104. package/dist/seti-icons.js +413 -413
  105. package/dist/settings/ConfirmDialog.js +55 -8
  106. package/dist/settings/DetailHeader.js +72 -4
  107. package/dist/settings/MasterDetail.js +119 -7
  108. package/dist/settings/SettingsDialog.js +820 -80
  109. package/dist/settings/SettingsRow.js +205 -18
  110. package/dist/settings/SettingsSection.js +96 -6
  111. package/dist/settings/index.js +7 -7
  112. package/dist/settings/target.js +7 -2
  113. package/dist/shortcut-hints.js +73 -55
  114. package/dist/shortcut.js +140 -104
  115. package/dist/step-places.js +1 -1
  116. package/dist/tabs/index.parts.js +1 -1
  117. package/dist/tabs/overflow.js +18 -18
  118. package/dist/tabs/parts.js +780 -166
  119. package/dist/testing/dedupe.js +82 -75
  120. package/dist/testing/fake-source.js +12 -12
  121. package/dist/testing/index.js +1 -1
  122. package/dist/toast-store.js +65 -46
  123. package/dist/tree/index.parts.js +1 -1
  124. package/dist/tree/parts.js +721 -94
  125. package/dist/tree/shift.js +28 -22
  126. package/dist/tree/style.js +2 -2
  127. package/dist/tree/use-tree-shift.js +178 -117
  128. package/dist/useAsyncAction.js +23 -19
  129. package/dist/useColumnResize.js +36 -34
  130. package/dist/useContentSize.js +62 -18
  131. package/dist/useMeasuredWidth.js +14 -3
  132. package/dist/useNow.js +73 -30
  133. package/dist/wipe-split.js +14 -14
  134. package/dist/workspace/DropPreview.js +60 -7
  135. package/dist/workspace/SplitView.js +1025 -441
  136. package/dist/workspace/TabStrip.js +810 -191
  137. package/dist/workspace/Workspace.js +276 -26
  138. package/dist/workspace/context.js +8 -3
  139. package/dist/workspace/geometry.js +173 -150
  140. package/dist/workspace/model.js +313 -250
  141. package/dist/workspace/preview.js +61 -61
  142. package/dist/zoom.js +2 -2
  143. package/package.json +1 -1
  144. package/src/ErrorBoundary.tsx +1 -1
  145. package/src/Field.tsx +4 -3
  146. package/src/IconPicker.tsx +3 -3
  147. package/src/LazyBoundary.tsx +2 -0
  148. package/src/MiddleTruncate.tsx +2 -2
  149. package/src/SegmentBar.tsx +2 -2
  150. package/src/Toasts.tsx +3 -1
  151. package/src/Tooltip.tsx +7 -10
  152. package/src/Waveform.tsx +3 -3
  153. package/src/file-tree/parts.tsx +6 -9
  154. package/src/file-tree/use-file-tree-shift.tsx +6 -9
  155. package/src/lazy.tsx +4 -0
  156. package/src/locales/en.ts +4 -4
  157. package/src/locales/nl.ts +5 -5
  158. package/src/settings/SettingsDialog.tsx +1 -1
  159. package/src/tree/parts.tsx +5 -8
  160. package/src/useContentSize.ts +3 -3
  161. package/src/workspace/SplitView.tsx +2 -2
  162. package/src/workspace/TabStrip.tsx +2 -3
  163. package/src/workspace/Workspace.tsx +2 -5
package/dist/useNow.js CHANGED
@@ -1,41 +1,84 @@
1
+ import { c as _c } from "react/compiler-runtime";
1
2
  import { useCallback, useEffect, useRef, useState } from 'react';
2
3
  /*
3
4
  * The clock a surface reads to say how long something has been running. One timer for the whole
4
5
  * surface, ticking only while there is something to count, and starting at the time it was mounted
5
6
  * so a panel that comes back mid-session does not read zero for a second first.
6
7
  */
7
- export const useNow = (intervalMs, ticking = true) => {
8
- const [now, setNow] = useState(Date.now);
9
- useEffect(() => {
10
- if (!ticking) {
11
- return;
12
- }
13
- const timer = window.setInterval(() => setNow(Date.now()), intervalMs);
14
- return () => window.clearInterval(timer);
15
- }, [intervalMs, ticking]);
16
- return now;
8
+ export const useNow = (intervalMs, t0) => {
9
+ const $ = _c(4);
10
+ const ticking = t0 === undefined ? true : t0;
11
+ const [now, setNow] = useState(Date.now);
12
+ let t1;
13
+ let t2;
14
+ if ($[0] !== intervalMs || $[1] !== ticking) {
15
+ t1 = () => {
16
+ if (!ticking) {
17
+ return;
18
+ }
19
+ const timer = window.setInterval(() => setNow(Date.now()), intervalMs);
20
+ return () => window.clearInterval(timer);
21
+ };
22
+ t2 = [intervalMs, ticking];
23
+ $[0] = intervalMs;
24
+ $[1] = ticking;
25
+ $[2] = t1;
26
+ $[3] = t2;
27
+ } else {
28
+ t1 = $[2];
29
+ t2 = $[3];
30
+ }
31
+ useEffect(t1, t2);
32
+ return now;
17
33
  };
18
34
  /*
19
35
  * A timer on one line of a long thread. The text is written straight into the node, because a chat
20
36
  * that re-renders every second while an agent works re-renders every row it is drawing with it.
21
37
  */
22
- export const useTickingText = (render, intervalMs = 1000) => {
23
- const ref = useRef(null);
24
- const latest = useRef(render);
25
- const tick = useCallback(() => {
26
- if (ref.current !== null) {
27
- ref.current.textContent = latest.current();
28
- }
29
- }, []);
30
- useEffect(() => {
31
- const timer = window.setInterval(tick, intervalMs);
32
- return () => window.clearInterval(timer);
33
- }, [intervalMs, tick]);
34
- /* After every render as well, so the first one writes the line and a language or region change
35
- lands on it without waiting for the next tick. */
36
- useEffect(() => {
37
- latest.current = render;
38
- tick();
39
- });
40
- return ref;
41
- };
38
+ export const useTickingText = (render, t0) => {
39
+ const $ = _c(6);
40
+ const intervalMs = t0 === undefined ? 1000 : t0;
41
+ const ref = useRef(null);
42
+ const latest = useRef(render);
43
+ let t1;
44
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
45
+ t1 = () => {
46
+ if (ref.current !== null) {
47
+ ref.current.textContent = latest.current();
48
+ }
49
+ };
50
+ $[0] = t1;
51
+ } else {
52
+ t1 = $[0];
53
+ }
54
+ const tick = t1;
55
+ let t2;
56
+ let t3;
57
+ if ($[1] !== intervalMs) {
58
+ t2 = () => {
59
+ const timer = window.setInterval(tick, intervalMs);
60
+ return () => window.clearInterval(timer);
61
+ };
62
+ t3 = [intervalMs, tick];
63
+ $[1] = intervalMs;
64
+ $[2] = t2;
65
+ $[3] = t3;
66
+ } else {
67
+ t2 = $[2];
68
+ t3 = $[3];
69
+ }
70
+ useEffect(t2, t3);
71
+ let t4;
72
+ if ($[4] !== render) {
73
+ t4 = () => {
74
+ latest.current = render;
75
+ tick();
76
+ };
77
+ $[4] = render;
78
+ $[5] = t4;
79
+ } else {
80
+ t4 = $[5];
81
+ }
82
+ useEffect(t4);
83
+ return ref;
84
+ };
@@ -1,20 +1,20 @@
1
1
  /* One press of an arrow moves the handle this share of the frame. */
2
2
  export const WIPE_KEY_STEP = 0.02;
3
- export const clampSplit = (split) => Math.min(1, Math.max(0, split));
3
+ export const clampSplit = split => Math.min(1, Math.max(0, split));
4
4
  /* A frame without a width has no place to point at, so the split stays where it is. */
5
5
  export const splitAt = (clientX, frame) => frame.width > 0 ? clampSplit((clientX - frame.left) / frame.width) : null;
6
6
  /* Null for a key the handle does not answer, so it goes on to whatever is around it. */
7
7
  export const splitForKey = (split, key) => {
8
- switch (key) {
9
- case 'ArrowLeft':
10
- return clampSplit(split - WIPE_KEY_STEP);
11
- case 'ArrowRight':
12
- return clampSplit(split + WIPE_KEY_STEP);
13
- case 'Home':
14
- return 0;
15
- case 'End':
16
- return 1;
17
- default:
18
- return null;
19
- }
20
- };
8
+ switch (key) {
9
+ case 'ArrowLeft':
10
+ return clampSplit(split - WIPE_KEY_STEP);
11
+ case 'ArrowRight':
12
+ return clampSplit(split + WIPE_KEY_STEP);
13
+ case 'Home':
14
+ return 0;
15
+ case 'End':
16
+ return 1;
17
+ default:
18
+ return null;
19
+ }
20
+ };
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import clsx from 'clsx';
3
3
  import { dropPreviewPath } from './preview.js';
4
4
  /*
@@ -6,9 +6,62 @@ import { dropPreviewPath } from './preview.js';
6
6
  * fills its nearest positioned ancestor. One shape moves into the next as a transition of its path,
7
7
  * and the first shape after a null appears in place.
8
8
  */
9
- export function DropPreview({ shape, className, ref }) {
10
- if (shape === null) {
11
- return null;
12
- }
13
- return (_jsx("svg", { ref: ref, className: clsx('ade-drop-preview', className), width: "100%", height: "100%", "aria-hidden": "true", children: _jsx("path", { style: { d: `path("${dropPreviewPath(shape)}")` } }) }));
14
- }
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ export function DropPreview(t0) {
11
+ const $ = _c(10);
12
+ const {
13
+ shape,
14
+ className,
15
+ ref
16
+ } = t0;
17
+ if (shape === null) {
18
+ return null;
19
+ }
20
+ let t1;
21
+ if ($[0] !== className) {
22
+ t1 = clsx("ade-drop-preview", className);
23
+ $[0] = className;
24
+ $[1] = t1;
25
+ } else {
26
+ t1 = $[1];
27
+ }
28
+ let t2;
29
+ if ($[2] !== shape) {
30
+ t2 = dropPreviewPath(shape);
31
+ $[2] = shape;
32
+ $[3] = t2;
33
+ } else {
34
+ t2 = $[3];
35
+ }
36
+ const t3 = `path("${t2}")`;
37
+ let t4;
38
+ if ($[4] !== t3) {
39
+ t4 = /*#__PURE__*/_jsx("path", {
40
+ style: {
41
+ d: t3
42
+ }
43
+ });
44
+ $[4] = t3;
45
+ $[5] = t4;
46
+ } else {
47
+ t4 = $[5];
48
+ }
49
+ let t5;
50
+ if ($[6] !== ref || $[7] !== t1 || $[8] !== t4) {
51
+ t5 = /*#__PURE__*/_jsx("svg", {
52
+ ref: ref,
53
+ className: t1,
54
+ width: "100%",
55
+ height: "100%",
56
+ "aria-hidden": "true",
57
+ children: t4
58
+ });
59
+ $[6] = ref;
60
+ $[7] = t1;
61
+ $[8] = t4;
62
+ $[9] = t5;
63
+ } else {
64
+ t5 = $[9];
65
+ }
66
+ return t5;
67
+ }