@crewlethq/ui 0.128.1 → 0.129.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 (117) hide show
  1. package/README.md +14 -0
  2. package/dist/AgentHandoffPanel/index.js +5 -5
  3. package/dist/ArrangeList/index.js +2 -2
  4. package/dist/ArtifactBar/index.js +1 -1
  5. package/dist/AuthLayout/index.js +1 -1
  6. package/dist/AvatarPicker/index.js +2 -2
  7. package/dist/BriefCard/index.js +1 -1
  8. package/dist/Canvas/Canvas.d.ts +4 -0
  9. package/dist/Canvas/index.js +1 -1
  10. package/dist/CanvasBoard/index.js +3 -3
  11. package/dist/CanvasToolbar/index.js +2 -2
  12. package/dist/CodeBlock/index.js +3 -2
  13. package/dist/ColorSwatch/index.js +3 -2
  14. package/dist/Combobox/index.js +2 -2
  15. package/dist/CommandPalette/index.js +6 -6
  16. package/dist/CommentThread/index.js +7 -7
  17. package/dist/Composer/index.js +3 -3
  18. package/dist/ContrastBadge/index.js +2 -2
  19. package/dist/ContrastHelp/index.js +3 -3
  20. package/dist/Copyable/index.js +2 -1
  21. package/dist/DataGrid/index.js +6 -6
  22. package/dist/DataTable/index.js +5 -5
  23. package/dist/DataView/index.js +8 -8
  24. package/dist/DatasetSource/index.js +1 -1
  25. package/dist/DeepWorkCard/index.js +3 -3
  26. package/dist/DocTabsEditor/index.js +4 -4
  27. package/dist/EditingStatus/index.js +2 -2
  28. package/dist/EntityList/index.js +1 -1
  29. package/dist/GraphCanvas/GraphCanvas.d.ts +11 -5
  30. package/dist/GraphCanvas/index.d.ts +1 -1
  31. package/dist/GraphCanvas/index.js +2 -2
  32. package/dist/GraphCanvas/layout.d.ts +35 -1
  33. package/dist/InlineEditor/index.js +3 -3
  34. package/dist/KeyValueRows/index.js +3 -3
  35. package/dist/Link/Link.d.ts +5 -0
  36. package/dist/Link/index.js +1 -1
  37. package/dist/{Link-Z23PLCVS.css → Link-Y7RHTR6F.css} +14 -1
  38. package/dist/LinkInterstitial/index.js +2 -2
  39. package/dist/ListInput/index.js +6 -6
  40. package/dist/LogoSlot/index.js +3 -3
  41. package/dist/Modal/Modal.d.ts +5 -1
  42. package/dist/Modal/index.js +1 -1
  43. package/dist/{Modal-ENCXGQKV.css → Modal-45OKI6BE.css} +9 -0
  44. package/dist/ObjectHeader/index.js +2 -2
  45. package/dist/OpenInAppCard/index.js +1 -1
  46. package/dist/OrgTable/index.js +8 -8
  47. package/dist/PrincipalPicker/index.js +3 -3
  48. package/dist/PropertyList/index.js +3 -3
  49. package/dist/ProposalCard/index.js +3 -3
  50. package/dist/RailList/index.js +3 -3
  51. package/dist/RefusalCard/index.js +1 -1
  52. package/dist/ResultTableCard/index.js +1 -1
  53. package/dist/RichEditor/index.js +1 -1
  54. package/dist/Select/index.js +2 -2
  55. package/dist/SettingsTable/SettingsTable.d.ts +3 -2
  56. package/dist/SettingsTable/index.js +15 -1
  57. package/dist/{SettingsTable-6DUFAFXG.css → SettingsTable-CBB56SMP.css} +12 -8
  58. package/dist/SetupWizard/index.js +2 -2
  59. package/dist/ShareDialog/index.js +6 -5
  60. package/dist/SheetColumnEditor/index.js +7 -7
  61. package/dist/StatusCard/index.js +1 -1
  62. package/dist/Switcher/index.js +6 -6
  63. package/dist/TableCells/index.js +3 -3
  64. package/dist/TimeRangePicker/index.js +5 -5
  65. package/dist/TimeWindowPicker/index.js +5 -5
  66. package/dist/TreeCanvas/index.js +2 -2
  67. package/dist/TreeGrid/index.js +7 -7
  68. package/dist/ValueField/index.js +4 -4
  69. package/dist/chunk-2MEBMWNO.js +50 -0
  70. package/dist/{chunk-XWEHTYVM.js → chunk-32QLSXKL.js} +1 -1
  71. package/dist/{chunk-RA5FPMPE.js → chunk-36XKE7MH.js} +1 -1
  72. package/dist/{chunk-NZUOUIL6.js → chunk-3DGNF2EH.js} +3 -3
  73. package/dist/{chunk-YGURXCUZ.js → chunk-3P24SMTI.js} +2 -2
  74. package/dist/{chunk-OIC6S5ES.js → chunk-4Q7AWZ6O.js} +1 -1
  75. package/dist/{chunk-DQKNAQWN.js → chunk-D2KJ5GQC.js} +2 -2
  76. package/dist/{chunk-CVNJ6VHK.js → chunk-ELZSD6FJ.js} +8 -2
  77. package/dist/{chunk-AVK7RRQ4.js → chunk-FO4OY4RV.js} +3 -46
  78. package/dist/{chunk-Y7F23SAX.js → chunk-FPCTHIV6.js} +1 -1
  79. package/dist/{chunk-SOYPCCSJ.js → chunk-FRXOUBN2.js} +32 -2
  80. package/dist/{chunk-W7SOT7RS.js → chunk-GPEXCG5K.js} +2 -2
  81. package/dist/{chunk-ELV2BL4R.js → chunk-GQPKDPMS.js} +2 -2
  82. package/dist/{chunk-I2JRUQJ4.js → chunk-JKFA2F7J.js} +1 -1
  83. package/dist/{chunk-ICRFVQH5.js → chunk-KUECTV2P.js} +1 -1
  84. package/dist/{chunk-CAFDQEDT.js → chunk-MNACKUBB.js} +3 -3
  85. package/dist/{chunk-GVDV4X43.js → chunk-N47PA4V4.js} +1 -1
  86. package/dist/{chunk-7VBZDGOS.js → chunk-NNMI7FAI.js} +2 -2
  87. package/dist/{chunk-LETSZEMX.js → chunk-NSUMHNUS.js} +1 -1
  88. package/dist/{chunk-M5UZLZUM.js → chunk-Q6QKY7EZ.js} +1 -1
  89. package/dist/{chunk-PCSIMBUQ.js → chunk-QDXSBVZR.js} +2 -2
  90. package/dist/{chunk-556M2A4S.js → chunk-R7PMTSQD.js} +1 -1
  91. package/dist/{chunk-JZI7SIM6.js → chunk-RMGPZQVJ.js} +1 -1
  92. package/dist/{chunk-W25SEC3I.js → chunk-SG2M6SBD.js} +1 -1
  93. package/dist/{chunk-LPQF7Z44.js → chunk-SIL5WE55.js} +1 -1
  94. package/dist/{chunk-R4LHYCZN.js → chunk-UGEFJGJ7.js} +100 -6
  95. package/dist/{chunk-U3VDJ7QJ.js → chunk-VCFV7FTE.js} +1 -1
  96. package/dist/{chunk-E32PP25Z.js → chunk-VIS6DKGQ.js} +1 -1
  97. package/dist/{chunk-IU7QVXHA.js → chunk-VSD3536L.js} +5 -4
  98. package/dist/{chunk-WGJRD3PY.js → chunk-WMZ2MROV.js} +1 -1
  99. package/dist/{chunk-QCBITY5I.js → chunk-WZ5TDJ2K.js} +3 -3
  100. package/dist/{chunk-6RMR2YYQ.js → chunk-XYZA7OSE.js} +2 -2
  101. package/dist/{chunk-J74M64CN.js → chunk-Y7FPSBCN.js} +2 -2
  102. package/dist/generated/index.js +107 -106
  103. package/dist/index.js +107 -106
  104. package/dist/styles.css +38 -12
  105. package/package.json +3 -3
  106. package/dist/{Editor-RCFNNOLO.js → Editor-2TWJE7OR.js} +3 -3
  107. package/dist/{chunk-WLL3PFI3.js → chunk-2DZV4PHK.js} +1 -1
  108. package/dist/{chunk-F7NHMBGJ.js → chunk-3YOLD7WG.js} +1 -1
  109. package/dist/{chunk-YKCLV77Z.js → chunk-6ZFQ6TAM.js} +1 -1
  110. package/dist/{chunk-G3WSU5J7.js → chunk-BF3PFRBE.js} +1 -1
  111. package/dist/{chunk-D6I7HBZC.js → chunk-CPWSBK3F.js} +1 -1
  112. package/dist/{chunk-RSUZY3PI.js → chunk-JLOZE7QG.js} +1 -1
  113. package/dist/{chunk-6N53ZWRM.js → chunk-KRF3GQ63.js} +1 -1
  114. package/dist/{chunk-AQV5GYSX.js → chunk-O43SIR3W.js} +1 -1
  115. package/dist/{chunk-U56B2BAX.js → chunk-Q7WKCU2U.js} +1 -1
  116. package/dist/{chunk-CWGZE3JW.js → chunk-WUJ54OTI.js} +1 -1
  117. package/dist/{chunk-2ZO7WP3T.js → chunk-Z64KEJ3N.js} +2 -2
@@ -0,0 +1,50 @@
1
+ import { useClipboard } from './chunk-STJ7QBC3.js';
2
+ import { Button } from './chunk-M2M6ZD7P.js';
3
+ import { VisuallyHidden } from './chunk-RRRK2KB6.js';
4
+ import { useCallback } from 'react';
5
+ import { CheckGlyph, CircleAlertGlyph, CopyGlyph } from '@crewlethq/icons/glyphs';
6
+ import { jsx, jsxs } from 'react/jsx-runtime';
7
+
8
+ function copyGlyph(state) {
9
+ if (state === "copied") return /* @__PURE__ */ jsx(CheckGlyph, { size: "sm" });
10
+ if (state === "failed") return /* @__PURE__ */ jsx(CircleAlertGlyph, { size: "sm" });
11
+ return /* @__PURE__ */ jsx(CopyGlyph, { size: "sm" });
12
+ }
13
+ function CopyStatus({ state, copiedMessage, failedMessage, attempt = 0 }) {
14
+ return /* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx("span", { role: "status", children: /* @__PURE__ */ jsx("span", { children: state === "copied" ? copiedMessage : state === "failed" ? failedMessage : "" }, attempt) }) });
15
+ }
16
+ function CopyButton({
17
+ text,
18
+ label = "Copy",
19
+ copiedLabel = "Copied",
20
+ failedLabel = "Copy failed",
21
+ copiedMessage = "copied to the clipboard",
22
+ failedMessage = "the browser refused the clipboard",
23
+ size = "small",
24
+ variant = "ghost",
25
+ title,
26
+ resetMs,
27
+ failedResetMs = null,
28
+ className
29
+ }) {
30
+ const { state, attempt, copy } = useClipboard({ resetMs, failedResetMs });
31
+ const onClick = useCallback(() => {
32
+ void copy(text);
33
+ }, [copy, text]);
34
+ return /* @__PURE__ */ jsxs("span", { className, children: [
35
+ /* @__PURE__ */ jsx(
36
+ Button,
37
+ {
38
+ size,
39
+ variant,
40
+ leadingIcon: copyGlyph(state),
41
+ onClick,
42
+ title: state === "failed" ? failedMessage : title,
43
+ children: state === "copied" ? copiedLabel : state === "failed" ? failedLabel : label
44
+ }
45
+ ),
46
+ /* @__PURE__ */ jsx(CopyStatus, { state, attempt, copiedMessage, failedMessage })
47
+ ] });
48
+ }
49
+
50
+ export { CopyButton, CopyStatus, copyGlyph };
@@ -1,5 +1,5 @@
1
- import { Select } from './chunk-YKCLV77Z.js';
2
1
  import { SidebarNav, NavItem } from './chunk-SM2MM4DQ.js';
2
+ import { Select } from './chunk-6ZFQ6TAM.js';
3
3
  import { Card } from './chunk-RABEMWTA.js';
4
4
  import { Text } from './chunk-475DOAWF.js';
5
5
  import './RailList-N2ZBPRM2.css';
@@ -1,4 +1,4 @@
1
- import { ConfirmModal } from './chunk-IU7QVXHA.js';
1
+ import { ConfirmModal } from './chunk-VSD3536L.js';
2
2
  import { InlineCode } from './chunk-PPGDH32L.js';
3
3
  import { Callout } from './chunk-RCQLXOGS.js';
4
4
  import './LinkInterstitial-ET4MSVSV.css';
@@ -1,15 +1,15 @@
1
1
  import { PageHeader } from './chunk-FPDIHEM4.js';
2
2
  import { FilterPill } from './chunk-E4QX4VET.js';
3
3
  import { DateTimePicker } from './chunk-AQZPZYSY.js';
4
- import { DataTable } from './chunk-J74M64CN.js';
4
+ import { DataTable } from './chunk-Y7FPSBCN.js';
5
5
  import { useListbox, useOptionKeys } from './chunk-KW7T23RT.js';
6
6
  import { Toolbar } from './chunk-NPEI2QAN.js';
7
7
  import { Popover } from './chunk-KDRJZWE3.js';
8
- import { Menu } from './chunk-EGHOU7U2.js';
9
8
  import { RelativeTime } from './chunk-GBKBME7Q.js';
9
+ import { Menu } from './chunk-EGHOU7U2.js';
10
+ import { Input } from './chunk-NN44J7BP.js';
10
11
  import { Kbd } from './chunk-VBBLHS2Y.js';
11
12
  import { Button } from './chunk-M2M6ZD7P.js';
12
- import { Input } from './chunk-NN44J7BP.js';
13
13
  import { IconButton } from './chunk-X5YI6E5X.js';
14
14
  import { Count } from './chunk-Y5CMDLQM.js';
15
15
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
@@ -1,8 +1,8 @@
1
- import { Modal } from './chunk-IU7QVXHA.js';
1
+ import { Modal } from './chunk-VSD3536L.js';
2
2
  import { Callout } from './chunk-RCQLXOGS.js';
3
3
  import { SegmentedControl } from './chunk-V2FD4RPS.js';
4
- import { Button } from './chunk-M2M6ZD7P.js';
5
4
  import { FormField, Input } from './chunk-NN44J7BP.js';
5
+ import { Button } from './chunk-M2M6ZD7P.js';
6
6
  import { useState } from 'react';
7
7
  import { ClockGlyph } from '@crewlethq/icons/glyphs';
8
8
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
@@ -1,5 +1,5 @@
1
1
  import { FileDrop, FilePickButton } from './chunk-XF5PDUDH.js';
2
- import { contrastRatio } from './chunk-F7NHMBGJ.js';
2
+ import { contrastRatio } from './chunk-3YOLD7WG.js';
3
3
  import { normalizeHex } from './chunk-7W3LYIOC.js';
4
4
  import { Button } from './chunk-M2M6ZD7P.js';
5
5
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
@@ -1,5 +1,5 @@
1
- import { SetByLine } from './chunk-ICRFVQH5.js';
2
- import { Link } from './chunk-JZI7SIM6.js';
1
+ import { SetByLine } from './chunk-KUECTV2P.js';
2
+ import { Link } from './chunk-RMGPZQVJ.js';
3
3
  import { DescriptionList, DescriptionListItem } from './chunk-LH4OF7FI.js';
4
4
  import { EmptyValue } from './chunk-WGLOH33S.js';
5
5
  import { cx } from './chunk-ODEQTPFM.js';
@@ -161,6 +161,8 @@ function regionView(region, viewport, limits = CANVAS_ZOOM_LIMITS, context = CAN
161
161
  var LABELS = {
162
162
  zoomIn: "Zoom in",
163
163
  zoomOut: "Zoom out",
164
+ zoomOutHeld: "All of it is in view",
165
+ zoomInHeld: "Zoomed in as far as it goes",
164
166
  fit: "Fit to view",
165
167
  actualSize: "Zoom to 100%",
166
168
  zoom: (percent) => `Zoom is ${percent} percent. Set a zoom level`,
@@ -223,6 +225,8 @@ function Canvas({
223
225
  const limits = zoomLimits(content, room, largestItemWidth, CANVAS_FIT_PADDING, minZoom);
224
226
  const limitsNow = useRef(limits);
225
227
  limitsNow.current = limits;
228
+ const atFloor = view.k <= limits.min * (1 + 1e-9);
229
+ const atCeiling = view.k >= limits.max * (1 - 1e-9);
226
230
  const floorNow = useRef(minZoom);
227
231
  floorNow.current = minZoom;
228
232
  const fitOf = useCallback((bounds, viewportSize = sizeNow.current) => {
@@ -616,7 +620,8 @@ function Canvas({
616
620
  title: "",
617
621
  icon: /* @__PURE__ */ jsx(ZoomOutGlyph, {}),
618
622
  onClick: () => centreZoom(1 / CANVAS_ZOOM_STEP),
619
- disabled: !ready
623
+ disabled: !ready,
624
+ disabledReason: ready && atFloor ? text.zoomOutHeld : void 0
620
625
  }
621
626
  ) }),
622
627
  /* @__PURE__ */ jsx(
@@ -637,7 +642,8 @@ function Canvas({
637
642
  title: "",
638
643
  icon: /* @__PURE__ */ jsx(ZoomInGlyph, {}),
639
644
  onClick: () => centreZoom(CANVAS_ZOOM_STEP),
640
- disabled: !ready
645
+ disabled: !ready,
646
+ disabledReason: ready && atCeiling ? text.zoomInHeld : void 0
641
647
  }
642
648
  ) }),
643
649
  controlsActualSize && /* @__PURE__ */ jsx(ShortcutTip, { label: text.actualSize, keys: ["Shift", "0"], children: /* @__PURE__ */ jsx(
@@ -1,54 +1,11 @@
1
+ import { copyGlyph, CopyStatus } from './chunk-2MEBMWNO.js';
1
2
  import { useClipboard } from './chunk-STJ7QBC3.js';
2
- import { Button } from './chunk-M2M6ZD7P.js';
3
3
  import { IconButton } from './chunk-X5YI6E5X.js';
4
- import { VisuallyHidden } from './chunk-RRRK2KB6.js';
5
4
  import { cx } from './chunk-ODEQTPFM.js';
6
5
  import './Copyable-P5AMRHFX.css';
7
6
  import { useCallback } from 'react';
8
- import { CheckGlyph, CircleAlertGlyph, CopyGlyph } from '@crewlethq/icons/glyphs';
9
- import { jsx, jsxs } from 'react/jsx-runtime';
7
+ import { jsxs, jsx } from 'react/jsx-runtime';
10
8
 
11
- function copyGlyph(state) {
12
- if (state === "copied") return /* @__PURE__ */ jsx(CheckGlyph, { size: "sm" });
13
- if (state === "failed") return /* @__PURE__ */ jsx(CircleAlertGlyph, { size: "sm" });
14
- return /* @__PURE__ */ jsx(CopyGlyph, { size: "sm" });
15
- }
16
- function CopyStatus({ state, copiedMessage, failedMessage, attempt = 0 }) {
17
- return /* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx("span", { role: "status", children: /* @__PURE__ */ jsx("span", { children: state === "copied" ? copiedMessage : state === "failed" ? failedMessage : "" }, attempt) }) });
18
- }
19
- function CopyButton({
20
- text,
21
- label = "Copy",
22
- copiedLabel = "Copied",
23
- failedLabel = "Copy failed",
24
- copiedMessage = "copied to the clipboard",
25
- failedMessage = "the browser refused the clipboard",
26
- size = "small",
27
- variant = "ghost",
28
- title,
29
- resetMs,
30
- failedResetMs = null,
31
- className
32
- }) {
33
- const { state, attempt, copy } = useClipboard({ resetMs, failedResetMs });
34
- const onClick = useCallback(() => {
35
- void copy(text);
36
- }, [copy, text]);
37
- return /* @__PURE__ */ jsxs("span", { className, children: [
38
- /* @__PURE__ */ jsx(
39
- Button,
40
- {
41
- size,
42
- variant,
43
- leadingIcon: copyGlyph(state),
44
- onClick,
45
- title: state === "failed" ? failedMessage : title,
46
- children: state === "copied" ? copiedLabel : state === "failed" ? failedLabel : label
47
- }
48
- ),
49
- /* @__PURE__ */ jsx(CopyStatus, { state, attempt, copiedMessage, failedMessage })
50
- ] });
51
- }
52
9
  var truncateValue = (text, length, variant) => {
53
10
  if (text.length <= length) return text;
54
11
  if (variant === "chip") {
@@ -113,4 +70,4 @@ var Copyable = ({
113
70
  );
114
71
  };
115
72
 
116
- export { CopyButton, CopyStatus, Copyable, copyGlyph };
73
+ export { Copyable };
@@ -1,4 +1,4 @@
1
- import { CopyButton, copyGlyph, CopyStatus } from './chunk-AVK7RRQ4.js';
1
+ import { CopyButton, copyGlyph, CopyStatus } from './chunk-2MEBMWNO.js';
2
2
  import { useClipboard } from './chunk-STJ7QBC3.js';
3
3
  import { IconButton } from './chunk-X5YI6E5X.js';
4
4
  import { Tooltip } from './chunk-HXVMXH6U.js';
@@ -1,6 +1,9 @@
1
+ import { copyGlyph, CopyStatus } from './chunk-2MEBMWNO.js';
2
+ import { useClipboard } from './chunk-STJ7QBC3.js';
1
3
  import { StatusDot } from './chunk-QRE6JCHS.js';
4
+ import { IconButton } from './chunk-X5YI6E5X.js';
2
5
  import { cx } from './chunk-ODEQTPFM.js';
3
- import './SettingsTable-6DUFAFXG.css';
6
+ import './SettingsTable-CBB56SMP.css';
4
7
  import { jsxs, jsx } from 'react/jsx-runtime';
5
8
 
6
9
  var COLUMNS = { setting: "Setting", value: "Value", source: "Source" };
@@ -41,7 +44,7 @@ function SettingsTableRow({
41
44
  children: [
42
45
  /* @__PURE__ */ jsxs("span", { role: "rowheader", className: "crewlet-settings-table__setting", children: [
43
46
  /* @__PURE__ */ jsx("span", { className: "crewlet-settings-table__label", children: label }),
44
- settingKey === void 0 ? null : /* @__PURE__ */ jsx("code", { className: "crewlet-settings-table__key", children: settingKey })
47
+ settingKey === void 0 ? null : /* @__PURE__ */ jsx(SettingKey, { settingKey })
45
48
  ] }),
46
49
  /* @__PURE__ */ jsx("span", { role: "cell", className: "crewlet-settings-table__value", children }),
47
50
  /* @__PURE__ */ jsxs(
@@ -60,5 +63,32 @@ function SettingsTableRow({
60
63
  );
61
64
  }
62
65
  SettingsTable.Row = SettingsTableRow;
66
+ function SettingKey({ settingKey }) {
67
+ const { state, attempt, copy } = useClipboard({ failedResetMs: null });
68
+ return /* @__PURE__ */ jsxs("span", { className: "crewlet-settings-table__key", children: [
69
+ /* @__PURE__ */ jsx(
70
+ IconButton,
71
+ {
72
+ size: "sm",
73
+ variant: "ghost",
74
+ icon: copyGlyph(state),
75
+ label: `Copy the setting's key, ${settingKey}`,
76
+ tooltip: settingKey,
77
+ onClick: () => {
78
+ void copy(settingKey);
79
+ }
80
+ }
81
+ ),
82
+ /* @__PURE__ */ jsx(
83
+ CopyStatus,
84
+ {
85
+ state,
86
+ attempt,
87
+ copiedMessage: `${settingKey} copied to the clipboard`,
88
+ failedMessage: "the browser refused the clipboard"
89
+ }
90
+ )
91
+ ] });
92
+ }
63
93
 
64
94
  export { SettingsTable, SettingsTableRow };
@@ -1,11 +1,11 @@
1
- import { Modal } from './chunk-IU7QVXHA.js';
1
+ import { Modal } from './chunk-VSD3536L.js';
2
2
  import { useListbox, useOptionKeys } from './chunk-KW7T23RT.js';
3
3
  import { KeyChip, highlightMatch } from './chunk-HBDA76EZ.js';
4
4
  import { Popover } from './chunk-KDRJZWE3.js';
5
5
  import { Skeleton } from './chunk-WFAJYBLX.js';
6
6
  import { Text } from './chunk-475DOAWF.js';
7
- import { useMediaMatch } from './chunk-COS6LJ4K.js';
8
7
  import { Input } from './chunk-NN44J7BP.js';
8
+ import { useMediaMatch } from './chunk-COS6LJ4K.js';
9
9
  import { focusables, isComposing } from './chunk-EDPMHSLZ.js';
10
10
  import { returnFocus } from './chunk-4ITETIGZ.js';
11
11
  import { announce } from './chunk-WGMKERCR.js';
@@ -1,8 +1,8 @@
1
- import { Select } from './chunk-YKCLV77Z.js';
1
+ import { Select } from './chunk-6ZFQ6TAM.js';
2
2
  import { today, shiftMonth, CalendarGrid, compareDays } from './chunk-EE3DJMSQ.js';
3
3
  import { Popover } from './chunk-KDRJZWE3.js';
4
- import { Button } from './chunk-M2M6ZD7P.js';
5
4
  import { Input } from './chunk-NN44J7BP.js';
5
+ import { Button } from './chunk-M2M6ZD7P.js';
6
6
  import { IconButton } from './chunk-X5YI6E5X.js';
7
7
  import { isComposing } from './chunk-EDPMHSLZ.js';
8
8
  import { useFocusModality } from './chunk-4ITETIGZ.js';
@@ -1,4 +1,4 @@
1
- import { Link } from './chunk-JZI7SIM6.js';
1
+ import { Link } from './chunk-RMGPZQVJ.js';
2
2
  import { Tag } from './chunk-SJ3EUCFD.js';
3
3
  import { RelativeTime } from './chunk-GBKBME7Q.js';
4
4
  import { EmptyValue } from './chunk-WGLOH33S.js';
@@ -1,4 +1,4 @@
1
- import { Link } from './chunk-JZI7SIM6.js';
1
+ import { Link } from './chunk-RMGPZQVJ.js';
2
2
  import { Text } from './chunk-475DOAWF.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import './ObjectHeader-3YYG2BAF.css';
@@ -1,12 +1,12 @@
1
- import { Select } from './chunk-YKCLV77Z.js';
1
+ import { Select } from './chunk-6ZFQ6TAM.js';
2
2
  import { SHEET_LABELS, SHEET_COLUMN_TYPES, optionHue, retypeColumn } from './chunk-LFSIKGRQ.js';
3
3
  import { HueSwatch } from './chunk-PFTUWDZN.js';
4
4
  import { NODE_HUES, NODE_HUE_NAMES } from './chunk-AYKXMIOR.js';
5
- import { Menu } from './chunk-EGHOU7U2.js';
6
5
  import { Checkbox } from './chunk-KFTVPWG2.js';
6
+ import { Menu } from './chunk-EGHOU7U2.js';
7
+ import { FormField, Input } from './chunk-NN44J7BP.js';
7
8
  import { Kbd } from './chunk-VBBLHS2Y.js';
8
9
  import { Button } from './chunk-M2M6ZD7P.js';
9
- import { FormField, Input } from './chunk-NN44J7BP.js';
10
10
  import { IconButton } from './chunk-X5YI6E5X.js';
11
11
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
12
12
  import { cx } from './chunk-ODEQTPFM.js';
@@ -1,5 +1,5 @@
1
1
  import { Toolbar } from './chunk-NPEI2QAN.js';
2
- import { ShortcutTip } from './chunk-CVNJ6VHK.js';
2
+ import { ShortcutTip } from './chunk-ELZSD6FJ.js';
3
3
  import { IconButton } from './chunk-X5YI6E5X.js';
4
4
  import { cx } from './chunk-ODEQTPFM.js';
5
5
  import './CanvasToolbar-EM5EVZED.css';
@@ -1,6 +1,6 @@
1
1
  import { Note } from './chunk-YJPQJVRJ.js';
2
- import { CanvasToolbar, toolForKey } from './chunk-GVDV4X43.js';
3
- import { IDENTITY_VIEW, Canvas } from './chunk-CVNJ6VHK.js';
2
+ import { CanvasToolbar, toolForKey } from './chunk-N47PA4V4.js';
3
+ import { IDENTITY_VIEW, Canvas } from './chunk-ELZSD6FJ.js';
4
4
  import { IconButton } from './chunk-X5YI6E5X.js';
5
5
  import { cx } from './chunk-ODEQTPFM.js';
6
6
  import './CanvasBoard-U6LR5F6H.css';
@@ -1,4 +1,4 @@
1
- import { Combobox } from './chunk-CWGZE3JW.js';
1
+ import { Combobox } from './chunk-WUJ54OTI.js';
2
2
  import { PRINCIPAL_KINDS, PrincipalAvatar } from './chunk-HF5L56YQ.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import './PrincipalPicker-P6UYHDJR.css';
@@ -9,7 +9,7 @@ import { jsx } from 'react/jsx-runtime';
9
9
  var engine = null;
10
10
  var loading = null;
11
11
  function loadEngine() {
12
- loading ??= import('./Editor-RCFNNOLO.js').then(
12
+ loading ??= import('./Editor-2TWJE7OR.js').then(
13
13
  (module) => {
14
14
  engine = module.Editor;
15
15
  return engine;
@@ -1,5 +1,5 @@
1
- import { Select } from './chunk-YKCLV77Z.js';
2
- import { Combobox } from './chunk-CWGZE3JW.js';
1
+ import { Select } from './chunk-6ZFQ6TAM.js';
2
+ import { Combobox } from './chunk-WUJ54OTI.js';
3
3
  import { FormField, Textarea, InputAffix } from './chunk-NN44J7BP.js';
4
4
  import './Input-YVCNNTYT.css';
5
5
  import './VisuallyHidden-OUYVMKEH.css';
@@ -1,5 +1,5 @@
1
1
  import { useTreeState, useMeasuredSizes, layoutForest, treeAncestors, useLayoutAnchor, treeExpandable, layoutConnectors, treeItemAction, treeStep, treePosInSet, treeSetSize, treeLevel, placeGroups } from './chunk-MY374UUD.js';
2
- import { CANVAS_COMPOSE_CONTEXT, CANVAS_FIT_MAX_ZOOM, Canvas } from './chunk-CVNJ6VHK.js';
2
+ import { CANVAS_COMPOSE_CONTEXT, CANVAS_FIT_MAX_ZOOM, Canvas } from './chunk-ELZSD6FJ.js';
3
3
  import { useMediaMatch, REDUCED_MOTION_QUERY } from './chunk-COS6LJ4K.js';
4
4
  import { focusables } from './chunk-EDPMHSLZ.js';
5
5
  import { cx } from './chunk-ODEQTPFM.js';
@@ -1,6 +1,6 @@
1
1
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
2
2
  import { cx } from './chunk-ODEQTPFM.js';
3
- import './Link-Z23PLCVS.css';
3
+ import './Link-Y7RHTR6F.css';
4
4
  import { forwardRef, Children, isValidElement, cloneElement } from 'react';
5
5
  import { ExternalLinkGlyph } from '@crewlethq/icons/glyphs';
6
6
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
@@ -1,4 +1,4 @@
1
- import { Copyable } from './chunk-AVK7RRQ4.js';
1
+ import { Copyable } from './chunk-FO4OY4RV.js';
2
2
  import { normalizeHex } from './chunk-7W3LYIOC.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import './ColorSwatch-HBNYO6EK.css';
@@ -1,4 +1,4 @@
1
- import { ContrastLevelTag } from './chunk-F7NHMBGJ.js';
1
+ import { ContrastLevelTag } from './chunk-3YOLD7WG.js';
2
2
  import { Popover } from './chunk-KDRJZWE3.js';
3
3
  import { IconButton } from './chunk-X5YI6E5X.js';
4
4
  import { cx } from './chunk-ODEQTPFM.js';
@@ -1,7 +1,7 @@
1
1
  import { useMeasuredSizes, isTypeAheadKey, typeAheadBuffer } from './chunk-MY374UUD.js';
2
2
  import { FullscreenToggle } from './chunk-3JLG6KRU.js';
3
3
  import { FilterChip } from './chunk-L6HUVA33.js';
4
- import { CANVAS_FIT_PADDING, Canvas } from './chunk-CVNJ6VHK.js';
4
+ import { CANVAS_FIT_PADDING, Canvas } from './chunk-ELZSD6FJ.js';
5
5
  import { Text } from './chunk-475DOAWF.js';
6
6
  import { LayerHost } from './chunk-FIX72ZEC.js';
7
7
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
@@ -606,10 +606,56 @@ function graphTrunks(layout, edges, laneOf) {
606
606
  count,
607
607
  d: pathOf(points),
608
608
  label: { x: (x1 + x2) / 2, y: turn },
609
+ run: { x1, x2, y: turn, top: y1, bottom: y2 },
609
610
  box: boxOf(points)
610
611
  };
611
612
  });
612
613
  }
614
+ var LABEL_GAP = 4;
615
+ var ALONG = [0.5, 0.25, 0.75, 0, 1];
616
+ var ON_THE_CORNER = 8;
617
+ function placeTrunkLabels(trunks, sizes, obstacles) {
618
+ const out = /* @__PURE__ */ new Map();
619
+ const placed = [];
620
+ const free = (trunk) => trunk.run.x1 === trunk.run.x2 ? 0 : 1;
621
+ const order = [...trunks].sort((a, b) => free(a) - free(b) || b.count - a.count || byText(a.key, b.key));
622
+ for (const trunk of order) {
623
+ const size = sizes.get(trunk.key);
624
+ if (!size || size.width <= 0 || size.height <= 0) {
625
+ out.set(trunk.key, null);
626
+ continue;
627
+ }
628
+ const { x1, x2, y, top, bottom } = trunk.run;
629
+ const { width: w, height: h } = size;
630
+ const lo = Math.min(x1, x2);
631
+ const hi = Math.max(x1, x2);
632
+ const xs = [
633
+ ...x1 === x2 ? [x1] : ALONG.map((t) => x1 + (x2 - x1) * t),
634
+ lo - w / 2 + ON_THE_CORNER,
635
+ hi + w / 2 - ON_THE_CORNER
636
+ ];
637
+ const ys = [y, top + h / 2 + 1, bottom - h / 2 - 1];
638
+ const near = (box) => box.x < Math.max(x1, x2) + w && box.x + box.width > Math.min(x1, x2) - w && box.y < bottom + h && box.y + box.height > top - h;
639
+ const against = obstacles.filter(near);
640
+ let at = null;
641
+ for (const cx2 of xs) {
642
+ for (const cy of ys) {
643
+ const box = { x: cx2 - w / 2, y: cy - h / 2, width: w, height: h };
644
+ if (against.some((other) => overlaps(box, other, 0))) continue;
645
+ if (placed.some((other) => overlaps(box, other, LABEL_GAP))) continue;
646
+ at = { x: cx2, y: cy };
647
+ placed.push(box);
648
+ break;
649
+ }
650
+ if (at) break;
651
+ }
652
+ out.set(trunk.key, at);
653
+ }
654
+ return out;
655
+ }
656
+ function overlaps(a, b, gap) {
657
+ return a.x < b.x + b.width + gap && a.x + a.width + gap > b.x && a.y < b.y + b.height + gap && a.y + a.height + gap > b.y;
658
+ }
613
659
  function plan(key, from, to, edge, grid, columns, metrics) {
614
660
  const forward = to.col > from.col;
615
661
  const back = to.col < from.col;
@@ -977,6 +1023,8 @@ var relationWords = (list) => list.map((one) => `${one.relation ?? "depends on"}
977
1023
  var GRAPH_CANVAS_LABELS = {
978
1024
  zoomIn: "Zoom in",
979
1025
  zoomOut: "Zoom out",
1026
+ zoomOutHeld: "All of the map is in view",
1027
+ zoomInHeld: "Zoomed in as far as it goes",
980
1028
  fit: "Fit to view",
981
1029
  actualSize: "Zoom to 100%",
982
1030
  zoom: (percent) => `Zoom is ${percent} percent. Set a zoom level`,
@@ -1037,7 +1085,7 @@ var BAND_PROBE = "crewlet:graph-canvas-band";
1037
1085
  var PROBES = [CARD_PROBE, GAP_PROBE, PAD_PROBE, HEAD_PROBE, BAND_PROBE];
1038
1086
  var emptyProbe = (lane) => `crewlet:graph-canvas-empty:${lane}`;
1039
1087
  var NO_GROUPS = [];
1040
- var AT_REST = /* @__PURE__ */ new Set(["flow"]);
1088
+ var AT_REST = /* @__PURE__ */ new Set(["flow", "support"]);
1041
1089
  var FAMILY_RANK = { context: 0, support: 1, flow: 2 };
1042
1090
  var TONES = ["danger", "warning", "info"];
1043
1091
  var EDGE_STATES = ["dim", "rest", "lit"];
@@ -1099,7 +1147,13 @@ function GraphCanvas({
1099
1147
  },
1100
1148
  [shown, families, onFamiliesChange]
1101
1149
  );
1102
- const restEdges = useMemo(() => edges.filter((edge) => shown.has(edge.family ?? "flow")), [edges, shown]);
1150
+ const restEdges = useMemo(
1151
+ () => edges.filter((edge) => {
1152
+ const family = edge.family ?? "flow";
1153
+ return shown.has(family) && !(chrome && family === "support");
1154
+ }),
1155
+ [edges, shown, chrome]
1156
+ );
1103
1157
  const carrying = useMemo(() => edges.filter((edge) => (edge.family ?? "flow") !== "context"), [edges]);
1104
1158
  const groupOf = useCallback((id) => nodeById.get(id)?.group, [nodeById]);
1105
1159
  const [toggled, setToggled] = useState(() => /* @__PURE__ */ new Map());
@@ -1273,13 +1327,48 @@ function GraphCanvas({
1273
1327
  }, [layout, reach, edges, nodeDimmed, familyOf]);
1274
1328
  const laneOfNode = useCallback((id) => nodeById.get(id)?.lane, [nodeById]);
1275
1329
  const trunks = useMemo(() => {
1276
- if (!layout || !chrome || shown.has("support")) return [];
1330
+ if (!layout || !chrome || !shown.has("support")) return [];
1277
1331
  return graphTrunks(
1278
1332
  layout,
1279
1333
  edges.filter((edge) => edge.family === "support"),
1280
1334
  laneOfNode
1281
1335
  );
1282
1336
  }, [layout, chrome, shown, edges, laneOfNode]);
1337
+ const placeTrunksNow = useRef(() => {
1338
+ });
1339
+ placeTrunksNow.current = () => {
1340
+ const world2 = worldEl.current;
1341
+ if (!world2 || !layout || trunks.length === 0) return;
1342
+ const labels2 = [...world2.querySelectorAll(".crewlet-graph-canvas__trunk-label")];
1343
+ const sizes2 = /* @__PURE__ */ new Map();
1344
+ for (const el of labels2) sizes2.set(el.dataset.trunk ?? "", { width: el.offsetWidth, height: el.offsetHeight });
1345
+ if (labels2.every((el) => el.offsetWidth === 0)) return;
1346
+ const obstacles = [...layout.itemByKey.values()];
1347
+ const words = (el, x, y, centred) => {
1348
+ if (!(el instanceof HTMLElement) || el.offsetWidth === 0) return;
1349
+ const top = y + el.offsetTop - (centred ? el.offsetHeight / 2 : 0);
1350
+ obstacles.push({ x: x + el.offsetLeft, y: top, width: el.offsetWidth, height: el.offsetHeight });
1351
+ };
1352
+ for (const lane of layout.lanes) {
1353
+ const head = world2.querySelector(`.crewlet-graph-canvas__lane-head[data-lane="${CSS.escape(lane.id)}"]`);
1354
+ words(head?.firstElementChild ?? null, lane.head.x, lane.head.y, true);
1355
+ }
1356
+ for (const band of layout.bands) {
1357
+ if (!band.title) continue;
1358
+ const title = world2.querySelector(`.crewlet-graph-canvas__band-title[data-band="${CSS.escape(band.id)}"]`);
1359
+ words(title?.firstElementChild ?? null, band.title.x, band.title.y, false);
1360
+ }
1361
+ const at = placeTrunkLabels(trunks, sizes2, obstacles);
1362
+ for (const el of labels2) {
1363
+ const point2 = at.get(el.dataset.trunk ?? "");
1364
+ if (point2) {
1365
+ el.style.transform = `translate(${point2.x}px, ${point2.y}px) translate(-50%, -50%)`;
1366
+ el.style.removeProperty("visibility");
1367
+ } else {
1368
+ el.style.visibility = "hidden";
1369
+ }
1370
+ }
1371
+ };
1283
1372
  const relationsOf = useMemo(() => {
1284
1373
  const out = /* @__PURE__ */ new Map();
1285
1374
  const entry = (id) => {
@@ -1318,6 +1407,7 @@ function GraphCanvas({
1318
1407
  worldEl.current?.style.setProperty(ZOOM_PROPERTY, String(view.k));
1319
1408
  }
1320
1409
  placeCardNow.current();
1410
+ placeTrunksNow.current();
1321
1411
  const next = graphWindow(mountedNow.current, view, size);
1322
1412
  if (next !== mountedNow.current) setMounted(next);
1323
1413
  },
@@ -1353,6 +1443,7 @@ function GraphCanvas({
1353
1443
  el.style.transform = `translate(${Math.round(left)}px, ${Math.round(top)}px)`;
1354
1444
  };
1355
1445
  useLayoutEffect(() => placeCardNow.current());
1446
+ useLayoutEffect(() => placeTrunksNow.current(), [layout, trunks, mounted]);
1356
1447
  const root = useRef(null);
1357
1448
  const [sized, setSized] = useState(false);
1358
1449
  const [narrow, setNarrow] = useState(false);
@@ -1766,8 +1857,9 @@ function GraphCanvas({
1766
1857
  {
1767
1858
  className: "crewlet-graph-canvas__band-title",
1768
1859
  "aria-hidden": "true",
1860
+ "data-band": band.id,
1769
1861
  style: placedStyle(band.title),
1770
- children: bands[band.index].label
1862
+ children: /* @__PURE__ */ jsx("span", { children: bands[band.index].label })
1771
1863
  },
1772
1864
  band.id
1773
1865
  ) : null
@@ -1800,6 +1892,7 @@ function GraphCanvas({
1800
1892
  {
1801
1893
  className: "crewlet-graph-canvas__trunk-label",
1802
1894
  "aria-hidden": "true",
1895
+ "data-trunk": trunk.key,
1803
1896
  style: { transform: `translate(${trunk.label.x}px, ${trunk.label.y}px) translate(-50%, -50%)` },
1804
1897
  children: text.trunk(trunk.count)
1805
1898
  },
@@ -1812,6 +1905,7 @@ function GraphCanvas({
1812
1905
  {
1813
1906
  className: "crewlet-graph-canvas__lane-head",
1814
1907
  "aria-hidden": "true",
1908
+ "data-lane": lane.id,
1815
1909
  style: placedStyle(lane.head),
1816
1910
  children: /* @__PURE__ */ jsxs("span", { className: "crewlet-graph-canvas__lane-title", children: [
1817
1911
  /* @__PURE__ */ jsx("span", { className: "crewlet-graph-canvas__lane-label", children: laneOf.get(lane.id)?.label }),
@@ -2163,4 +2257,4 @@ function typeAhead(layout, from, text, nameOf) {
2163
2257
  return null;
2164
2258
  }
2165
2259
 
2166
- export { GRAPH_CANVAS_DETAIL_ZOOM, GRAPH_CANVAS_FIT_FLOOR, GRAPH_CANVAS_FLOW_LIMIT, GRAPH_CANVAS_FOCUS_ZOOM, GRAPH_CANVAS_LABELS, GRAPH_CANVAS_NARROW_WIDTH, GRAPH_CANVAS_TILE_ZOOM, GRAPH_EDGE_FAMILIES, GRAPH_ORDER_SWEEPS, GraphCanvas, graphDetail, graphFocusView, graphItemKey, graphNeighbourhood, graphReach, graphStep, graphTrunks, graphWindow, layoutGraph, routeGraphEdges };
2260
+ export { GRAPH_CANVAS_DETAIL_ZOOM, GRAPH_CANVAS_FIT_FLOOR, GRAPH_CANVAS_FLOW_LIMIT, GRAPH_CANVAS_FOCUS_ZOOM, GRAPH_CANVAS_LABELS, GRAPH_CANVAS_NARROW_WIDTH, GRAPH_CANVAS_TILE_ZOOM, GRAPH_EDGE_FAMILIES, GRAPH_ORDER_SWEEPS, GraphCanvas, graphDetail, graphFocusView, graphItemKey, graphNeighbourhood, graphReach, graphStep, graphTrunks, graphWindow, layoutGraph, placeTrunkLabels, routeGraphEdges };
@@ -1,4 +1,4 @@
1
- import { TreeGrid } from './chunk-E32PP25Z.js';
1
+ import { TreeGrid } from './chunk-VIS6DKGQ.js';
2
2
  import { OrgLabel } from './chunk-SYMLWDV6.js';
3
3
  import { createTreeModel, treeParent } from './chunk-MY374UUD.js';
4
4
  import { AddPill } from './chunk-5W3EYO5Q.js';
@@ -1,5 +1,5 @@
1
1
  import { useTreeState, treeExpandable, treeLevel, treePosInSet, treeSetSize, treeItemAction, treePrevious, treeNext, treeStep } from './chunk-MY374UUD.js';
2
- import { GRID_FOOT_LABELS, parseGridSort, overrunning, squeezedCells, fitGridColumns, tableTrack, GRID_ICON_TRACK, GridHeadCell, alignOf, rowLinkTitle, headerWord, GridFoot, droppedNames, nextGridSort, sortByValue } from './chunk-D6I7HBZC.js';
2
+ import { GRID_FOOT_LABELS, parseGridSort, overrunning, squeezedCells, fitGridColumns, tableTrack, GRID_ICON_TRACK, GridHeadCell, alignOf, rowLinkTitle, headerWord, GridFoot, droppedNames, nextGridSort, sortByValue } from './chunk-CPWSBK3F.js';
3
3
  import { LayerNodeBridge } from './chunk-X4HBZSXA.js';
4
4
  import { Checkbox } from './chunk-KFTVPWG2.js';
5
5
  import { EmptyState } from './chunk-PPUR46MK.js';