@activecollab/components 2.0.468 → 2.0.470

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 (34) hide show
  1. package/dist/cjs/components/StackedCard/StackedCard.js.map +1 -1
  2. package/dist/cjs/components/StackedCard/Styles.js.map +1 -1
  3. package/dist/cjs/components/StackedCard/resizePolicy.js +141 -60
  4. package/dist/cjs/components/StackedCard/resizePolicy.js.map +1 -1
  5. package/dist/cjs/components/StackedCard/resizePolicy.test.js +362 -15
  6. package/dist/cjs/components/StackedCard/resizePolicy.test.js.map +1 -1
  7. package/dist/cjs/components/StackedCard/useStackedCardResize.js +35 -14
  8. package/dist/cjs/components/StackedCard/useStackedCardResize.js.map +1 -1
  9. package/dist/cjs/presentation/shared/SourceCodeSection.js +88 -82
  10. package/dist/cjs/presentation/shared/SourceCodeSection.js.map +1 -1
  11. package/dist/esm/components/StackedCard/StackedCard.d.ts +5 -5
  12. package/dist/esm/components/StackedCard/StackedCard.d.ts.map +1 -1
  13. package/dist/esm/components/StackedCard/StackedCard.js.map +1 -1
  14. package/dist/esm/components/StackedCard/Styles.d.ts +2 -2
  15. package/dist/esm/components/StackedCard/Styles.d.ts.map +1 -1
  16. package/dist/esm/components/StackedCard/Styles.js.map +1 -1
  17. package/dist/esm/components/StackedCard/resizePolicy.d.ts +85 -40
  18. package/dist/esm/components/StackedCard/resizePolicy.d.ts.map +1 -1
  19. package/dist/esm/components/StackedCard/resizePolicy.js +139 -60
  20. package/dist/esm/components/StackedCard/resizePolicy.js.map +1 -1
  21. package/dist/esm/components/StackedCard/resizePolicy.test.js +359 -16
  22. package/dist/esm/components/StackedCard/resizePolicy.test.js.map +1 -1
  23. package/dist/esm/components/StackedCard/useStackedCardResize.d.ts +25 -13
  24. package/dist/esm/components/StackedCard/useStackedCardResize.d.ts.map +1 -1
  25. package/dist/esm/components/StackedCard/useStackedCardResize.js +35 -14
  26. package/dist/esm/components/StackedCard/useStackedCardResize.js.map +1 -1
  27. package/dist/esm/presentation/shared/SourceCodeSection.d.ts.map +1 -1
  28. package/dist/esm/presentation/shared/SourceCodeSection.js +88 -82
  29. package/dist/esm/presentation/shared/SourceCodeSection.js.map +1 -1
  30. package/dist/index.js +179 -74
  31. package/dist/index.js.map +1 -1
  32. package/dist/index.min.js +1 -1
  33. package/dist/index.min.js.map +1 -1
  34. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { StackedCardContentMin, StackedCardResizeAxis, StackedCardResizePolicy, StackedCardResizeSource, StackedCardSize } from "./resizePolicy";
2
+ import { ResizeAnchor, ResizeAxis, ResizeBox, ResizeContentMin, ResizePolicy, ResizePosition, ResizeSize, ResizeSource } from "./resizePolicy";
3
3
  /**
4
4
  * The one place pointer and keyboard input meet the resize policy.
5
5
  *
@@ -10,25 +10,37 @@ import { StackedCardContentMin, StackedCardResizeAxis, StackedCardResizePolicy,
10
10
  * gesture. It returns the props to spread on the grip, including the live
11
11
  * separator ARIA.
12
12
  *
13
+ * One hook instance drives one handle. A card has one, in the bottom-right
14
+ * corner; a shape mounts one per handle and passes each its `anchor`, and the
15
+ * previews then carry the position as well as the size, so a top-left handle
16
+ * moves the element while it grows.
17
+ *
13
18
  * Preview versus commit (spec §7e): the continuous stream is live feedback
14
19
  * only. A host creates an undo entry on the COMMIT, never on a preview — and a
15
- * gesture that never changed the size commits nothing at all, so a bare click
20
+ * gesture that never changed the box commits nothing at all, so a bare click
16
21
  * on the grip is not a change.
17
22
  *
18
- * The hook never touches the card's content: the intrinsic minimum is read
23
+ * The hook never touches the element's content: the intrinsic minimum is read
19
24
  * through `contentMin`, which may be a getter so a card that measures its own
20
25
  * footer can answer at the moment it is asked.
21
26
  */
22
27
  export interface UseStackedCardResizeArgs {
23
- /** The card's current size, owned by the host. */
24
- size: StackedCardSize;
25
- policy: StackedCardResizePolicy;
28
+ /** The element's current size, owned by the host. */
29
+ size: ResizeSize;
30
+ /**
31
+ * The element's current position, owned by the host. A host that only tracks
32
+ * a size (a card in a flow layout) leaves it out and reads the size alone.
33
+ */
34
+ position?: ResizePosition;
35
+ policy: ResizePolicy;
26
36
  /** Id of the element the grip resizes — becomes `aria-controls`. */
27
37
  cardId: string;
28
- /** The card's intrinsic minimum; a getter is read at the moment it is needed. */
29
- contentMin: StackedCardContentMin | (() => StackedCardContentMin);
38
+ /** The element's intrinsic minimum; a getter is read at the moment it is needed. */
39
+ contentMin: ResizeContentMin | (() => ResizeContentMin);
30
40
  /** `width` locks the vertical axis (auto-height cards). Defaults to `both`. */
31
- axis?: StackedCardResizeAxis;
41
+ axis?: ResizeAxis;
42
+ /** The handle this instance drives. Defaults to the card's bottom-right grip. */
43
+ anchor?: ResizeAnchor;
32
44
  /**
33
45
  * Pointer deltas are divided by this before they reach the policy, so a grip
34
46
  * inside a zoomed canvas tracks the cursor exactly. Keyboard nudges are
@@ -38,9 +50,9 @@ export interface UseStackedCardResizeArgs {
38
50
  /** Accessible name for the grip. Defaults to "Resize card". */
39
51
  label?: string;
40
52
  /** Live feedback during the gesture. Never an undoable change. */
41
- onResize: (next: StackedCardSize, source: StackedCardResizeSource) => void;
42
- /** Fires once per gesture, and only if the size actually changed. */
43
- onResizeCommit: (final: StackedCardSize, source: StackedCardResizeSource) => void;
53
+ onResize: (next: ResizeBox, source: ResizeSource) => void;
54
+ /** Fires once per gesture, and only if the box actually changed. */
55
+ onResizeCommit: (final: ResizeBox, source: ResizeSource) => void;
44
56
  }
45
57
  /** The props to spread on the grip — `StackedCard`'s `resizeHandleProps`. */
46
58
  export interface StackedCardResizeHandleProps {
@@ -58,5 +70,5 @@ export interface StackedCardResizeHandleProps {
58
70
  onKeyDown: (e: React.KeyboardEvent) => void;
59
71
  onKeyUp: (e: React.KeyboardEvent) => void;
60
72
  }
61
- export declare const useStackedCardResize: ({ size, policy, cardId, contentMin, axis, scale, label, onResize, onResizeCommit, }: UseStackedCardResizeArgs) => StackedCardResizeHandleProps;
73
+ export declare const useStackedCardResize: ({ size, position, policy, cardId, contentMin, axis, anchor, scale, label, onResize, onResizeCommit, }: UseStackedCardResizeArgs) => StackedCardResizeHandleProps;
62
74
  //# sourceMappingURL=useStackedCardResize.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useStackedCardResize.d.ts","sourceRoot":"","sources":["../../../../src/components/StackedCard/useStackedCardResize.ts"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EAEvB,eAAe,EAMhB,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,WAAW,wBAAwB;IACvC,kDAAkD;IAClD,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EAAE,uBAAuB,CAAC;IAChC,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,UAAU,EAAE,qBAAqB,GAAG,CAAC,MAAM,qBAAqB,CAAC,CAAC;IAClE,+EAA+E;IAC/E,IAAI,CAAC,EAAE,qBAAqB,CAAC;IAC7B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,QAAQ,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAC3E,qEAAqE;IACrE,cAAc,EAAE,CACd,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,uBAAuB,KAC5B,IAAI,CAAC;CACX;AAED,6EAA6E;AAC7E,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,CAAC,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,YAAY,KAAK,IAAI,CAAC;IAC/C,aAAa,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,YAAY,KAAK,IAAI,CAAC;IAC/C,WAAW,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,YAAY,KAAK,IAAI,CAAC;IAC7C,oBAAoB,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,YAAY,KAAK,IAAI,CAAC;IACtD,SAAS,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;IAC5C,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;CAC3C;AAKD,eAAO,MAAM,oBAAoB,GAAI,qFAUlC,wBAAwB,KAAG,4BA6H7B,CAAC"}
1
+ {"version":3,"file":"useStackedCardResize.d.ts","sourceRoot":"","sources":["../../../../src/components/StackedCard/useStackedCardResize.ts"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAEL,YAAY,EACZ,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,UAAU,EACV,YAAY,EAOb,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,MAAM,WAAW,wBAAwB;IACvC,qDAAqD;IACrD,IAAI,EAAE,UAAU,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,MAAM,EAAE,YAAY,CAAC;IACrB,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,UAAU,EAAE,gBAAgB,GAAG,CAAC,MAAM,gBAAgB,CAAC,CAAC;IACxD,+EAA+E;IAC/E,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,iFAAiF;IACjF,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IAC1D,oEAAoE;IACpE,cAAc,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;CAClE;AAED,6EAA6E;AAC7E,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,CAAC,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,YAAY,KAAK,IAAI,CAAC;IAC/C,aAAa,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,YAAY,KAAK,IAAI,CAAC;IAC/C,WAAW,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,YAAY,KAAK,IAAI,CAAC;IAC7C,oBAAoB,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,YAAY,KAAK,IAAI,CAAC;IACtD,SAAS,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;IAC5C,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;CAC3C;AAYD,eAAO,MAAM,oBAAoB,GAAI,uGAYlC,wBAAwB,KAAG,4BAuI7B,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { useCallback, useRef } from "react";
2
- import { applyResize, isResizeKey, keyboardResize, makeStart, measurePercent } from "./resizePolicy";
2
+ import { DEFAULT_RESIZE_ANCHOR, applyResize, isResizeKey, keyboardResize, makeStart, measurePercent } from "./resizePolicy";
3
3
 
4
4
  /**
5
5
  * The one place pointer and keyboard input meet the resize policy.
@@ -11,49 +11,68 @@ import { applyResize, isResizeKey, keyboardResize, makeStart, measurePercent } f
11
11
  * gesture. It returns the props to spread on the grip, including the live
12
12
  * separator ARIA.
13
13
  *
14
+ * One hook instance drives one handle. A card has one, in the bottom-right
15
+ * corner; a shape mounts one per handle and passes each its `anchor`, and the
16
+ * previews then carry the position as well as the size, so a top-left handle
17
+ * moves the element while it grows.
18
+ *
14
19
  * Preview versus commit (spec §7e): the continuous stream is live feedback
15
20
  * only. A host creates an undo entry on the COMMIT, never on a preview — and a
16
- * gesture that never changed the size commits nothing at all, so a bare click
21
+ * gesture that never changed the box commits nothing at all, so a bare click
17
22
  * on the grip is not a change.
18
23
  *
19
- * The hook never touches the card's content: the intrinsic minimum is read
24
+ * The hook never touches the element's content: the intrinsic minimum is read
20
25
  * through `contentMin`, which may be a getter so a card that measures its own
21
26
  * footer can answer at the moment it is asked.
22
27
  */
23
28
 
24
29
  /** The props to spread on the grip — `StackedCard`'s `resizeHandleProps`. */
25
30
 
26
- const sameSize = (a, b) => a.w === b.w && a.h === b.h;
31
+ const sameBox = (a, b) => a.w === b.w && a.h === b.h && a.x === b.x && a.y === b.y;
32
+ const toBox = (size, position) => {
33
+ var _position$x, _position$y;
34
+ return {
35
+ w: size.w,
36
+ h: size.h,
37
+ x: (_position$x = position == null ? void 0 : position.x) != null ? _position$x : 0,
38
+ y: (_position$y = position == null ? void 0 : position.y) != null ? _position$y : 0
39
+ };
40
+ };
27
41
  export const useStackedCardResize = _ref => {
28
42
  let size = _ref.size,
43
+ position = _ref.position,
29
44
  policy = _ref.policy,
30
45
  cardId = _ref.cardId,
31
46
  contentMin = _ref.contentMin,
32
47
  _ref$axis = _ref.axis,
33
48
  axis = _ref$axis === void 0 ? "both" : _ref$axis,
49
+ _ref$anchor = _ref.anchor,
50
+ anchor = _ref$anchor === void 0 ? DEFAULT_RESIZE_ANCHOR : _ref$anchor,
34
51
  _ref$scale = _ref.scale,
35
52
  scale = _ref$scale === void 0 ? 1 : _ref$scale,
36
53
  _ref$label = _ref.label,
37
54
  label = _ref$label === void 0 ? "Resize card" : _ref$label,
38
55
  onResize = _ref.onResize,
39
56
  onResizeCommit = _ref.onResizeCommit;
40
- // The pointer gesture's anchor: the size + content-min captured on pointer
57
+ // The pointer gesture's anchor: the box + content-min captured on pointer
41
58
  // down, plus the pointer origin the delta is measured from.
42
59
  const pointerStart = useRef(null);
43
- // Mirrors the latest emitted size so pointer-up / key-up can commit exactly
60
+ // Mirrors the latest emitted box so pointer-up / key-up can commit exactly
44
61
  // what preview last showed, without a stale closure.
45
- const latest = useRef(size);
46
- latest.current = size;
47
- // Whether this gesture actually moved the card. A bare click, or a Home on an
48
- // axis with no floor, leaves it false and commits nothing.
62
+ const latest = useRef(toBox(size, position));
63
+ latest.current = toBox(size, position);
64
+ // Whether this gesture actually moved the element. A bare click, or a Home on
65
+ // an axis with no floor, leaves it false and commits nothing.
49
66
  const dirty = useRef(false);
50
67
 
51
68
  // Read through refs so the handlers below can stay stable across renders
52
- // while still seeing the current policy, axis and zoom.
69
+ // while still seeing the current policy, axis, anchor and zoom.
53
70
  const policyRef = useRef(policy);
54
71
  policyRef.current = policy;
55
72
  const axisRef = useRef(axis);
56
73
  axisRef.current = axis;
74
+ const anchorRef = useRef(anchor);
75
+ anchorRef.current = anchor;
57
76
  const scaleRef = useRef(scale);
58
77
  scaleRef.current = scale;
59
78
  const contentMinRef = useRef(contentMin);
@@ -64,7 +83,7 @@ export const useStackedCardResize = _ref => {
64
83
  }, []);
65
84
  const emitPreview = useCallback((next, source) => {
66
85
  // Nothing changed — not a preview, and not something to commit later.
67
- if (sameSize(next, latest.current)) return;
86
+ if (sameBox(next, latest.current)) return;
68
87
  latest.current = next;
69
88
  dirty.current = true;
70
89
  onResize(next, source);
@@ -90,7 +109,8 @@ export const useStackedCardResize = _ref => {
90
109
  // Shift held during a free-form drag = temporary proportional lock.
91
110
  {
92
111
  constrain: e.shiftKey,
93
- axis: axisRef.current
112
+ axis: axisRef.current,
113
+ anchor: anchorRef.current
94
114
  });
95
115
  emitPreview(next, "pointer");
96
116
  }, [emitPreview]);
@@ -103,7 +123,8 @@ export const useStackedCardResize = _ref => {
103
123
  const handleKeyDown = useCallback(e => {
104
124
  const next = keyboardResize(e.key, latest.current, policyRef.current, readContentMin(), {
105
125
  shiftKey: e.shiftKey,
106
- axis: axisRef.current
126
+ axis: axisRef.current,
127
+ anchor: anchorRef.current
107
128
  });
108
129
  if (!next) return;
109
130
  // The key is ours even when it resolves to no movement (already pinned at
@@ -1 +1 @@
1
- {"version":3,"file":"useStackedCardResize.js","names":["useCallback","useRef","applyResize","isResizeKey","keyboardResize","makeStart","measurePercent","sameSize","a","b","w","h","useStackedCardResize","_ref","size","policy","cardId","contentMin","_ref$axis","axis","_ref$scale","scale","_ref$label","label","onResize","onResizeCommit","pointerStart","latest","current","dirty","policyRef","axisRef","scaleRef","contentMinRef","readContentMin","source","emitPreview","next","handlePointerDown","e","start","x","clientX","y","clientY","target","setPointerCapture","pointerId","preventDefault","handlePointerMove","ps","z","dx","dy","constrain","shiftKey","endPointer","handleKeyDown","key","handleKeyUp","role","tabIndex","onPointerDown","onPointerMove","onPointerUp","onLostPointerCapture","onKeyDown","onKeyUp"],"sources":["../../../../src/components/StackedCard/useStackedCardResize.ts"],"sourcesContent":["import React, { useCallback, useRef } from \"react\";\n\nimport {\n StackedCardContentMin,\n StackedCardResizeAxis,\n StackedCardResizePolicy,\n StackedCardResizeSource,\n StackedCardResizeStart,\n StackedCardSize,\n applyResize,\n isResizeKey,\n keyboardResize,\n makeStart,\n measurePercent,\n} from \"./resizePolicy\";\n\n/**\n * The one place pointer and keyboard input meet the resize policy.\n *\n * `StackedCard`'s built-in grip reports raw deltas and knows no policy — enough\n * for a host that just tracks a width. This hook is the full contract: it\n * captures the gesture start, funnels both inputs through the pure policy in\n * `resizePolicy.ts`, streams preview events and fires exactly ONE commit per\n * gesture. It returns the props to spread on the grip, including the live\n * separator ARIA.\n *\n * Preview versus commit (spec §7e): the continuous stream is live feedback\n * only. A host creates an undo entry on the COMMIT, never on a preview — and a\n * gesture that never changed the size commits nothing at all, so a bare click\n * on the grip is not a change.\n *\n * The hook never touches the card's content: the intrinsic minimum is read\n * through `contentMin`, which may be a getter so a card that measures its own\n * footer can answer at the moment it is asked.\n */\n\nexport interface UseStackedCardResizeArgs {\n /** The card's current size, owned by the host. */\n size: StackedCardSize;\n policy: StackedCardResizePolicy;\n /** Id of the element the grip resizes — becomes `aria-controls`. */\n cardId: string;\n /** The card's intrinsic minimum; a getter is read at the moment it is needed. */\n contentMin: StackedCardContentMin | (() => StackedCardContentMin);\n /** `width` locks the vertical axis (auto-height cards). Defaults to `both`. */\n axis?: StackedCardResizeAxis;\n /**\n * Pointer deltas are divided by this before they reach the policy, so a grip\n * inside a zoomed canvas tracks the cursor exactly. Keyboard nudges are\n * already in the host's units and pass straight through. Defaults to 1.\n */\n scale?: number;\n /** Accessible name for the grip. Defaults to \"Resize card\". */\n label?: string;\n /** Live feedback during the gesture. Never an undoable change. */\n onResize: (next: StackedCardSize, source: StackedCardResizeSource) => void;\n /** Fires once per gesture, and only if the size actually changed. */\n onResizeCommit: (\n final: StackedCardSize,\n source: StackedCardResizeSource\n ) => void;\n}\n\n/** The props to spread on the grip — `StackedCard`'s `resizeHandleProps`. */\nexport interface StackedCardResizeHandleProps {\n role: \"separator\";\n tabIndex: 0;\n \"aria-label\": string;\n \"aria-controls\": string;\n \"aria-valuemin\": number;\n \"aria-valuemax\": number;\n \"aria-valuenow\": number;\n onPointerDown: (e: React.PointerEvent) => void;\n onPointerMove: (e: React.PointerEvent) => void;\n onPointerUp: (e: React.PointerEvent) => void;\n onLostPointerCapture: (e: React.PointerEvent) => void;\n onKeyDown: (e: React.KeyboardEvent) => void;\n onKeyUp: (e: React.KeyboardEvent) => void;\n}\n\nconst sameSize = (a: StackedCardSize, b: StackedCardSize): boolean =>\n a.w === b.w && a.h === b.h;\n\nexport const useStackedCardResize = ({\n size,\n policy,\n cardId,\n contentMin,\n axis = \"both\",\n scale = 1,\n label = \"Resize card\",\n onResize,\n onResizeCommit,\n}: UseStackedCardResizeArgs): StackedCardResizeHandleProps => {\n // The pointer gesture's anchor: the size + content-min captured on pointer\n // down, plus the pointer origin the delta is measured from.\n const pointerStart = useRef<{\n start: StackedCardResizeStart;\n x: number;\n y: number;\n } | null>(null);\n // Mirrors the latest emitted size so pointer-up / key-up can commit exactly\n // what preview last showed, without a stale closure.\n const latest = useRef<StackedCardSize>(size);\n latest.current = size;\n // Whether this gesture actually moved the card. A bare click, or a Home on an\n // axis with no floor, leaves it false and commits nothing.\n const dirty = useRef(false);\n\n // Read through refs so the handlers below can stay stable across renders\n // while still seeing the current policy, axis and zoom.\n const policyRef = useRef(policy);\n policyRef.current = policy;\n const axisRef = useRef(axis);\n axisRef.current = axis;\n const scaleRef = useRef(scale);\n scaleRef.current = scale;\n const contentMinRef = useRef(contentMin);\n contentMinRef.current = contentMin;\n\n const readContentMin = useCallback((): StackedCardContentMin => {\n const source = contentMinRef.current;\n return typeof source === \"function\" ? source() : source;\n }, []);\n\n const emitPreview = useCallback(\n (next: StackedCardSize, source: StackedCardResizeSource) => {\n // Nothing changed — not a preview, and not something to commit later.\n if (sameSize(next, latest.current)) return;\n latest.current = next;\n dirty.current = true;\n onResize(next, source);\n },\n [onResize]\n );\n\n const handlePointerDown = useCallback(\n (e: React.PointerEvent) => {\n pointerStart.current = {\n start: makeStart(latest.current, readContentMin()),\n x: e.clientX,\n y: e.clientY,\n };\n dirty.current = false;\n (e.target as HTMLElement).setPointerCapture?.(e.pointerId);\n e.preventDefault();\n },\n [readContentMin]\n );\n\n const handlePointerMove = useCallback(\n (e: React.PointerEvent) => {\n const ps = pointerStart.current;\n if (!ps) return;\n const z = scaleRef.current || 1;\n const next = applyResize(\n ps.start,\n { dx: (e.clientX - ps.x) / z, dy: (e.clientY - ps.y) / z },\n policyRef.current,\n // Shift held during a free-form drag = temporary proportional lock.\n { constrain: e.shiftKey, axis: axisRef.current }\n );\n emitPreview(next, \"pointer\");\n },\n [emitPreview]\n );\n\n const endPointer = useCallback(() => {\n if (!pointerStart.current) return;\n pointerStart.current = null;\n if (dirty.current) onResizeCommit(latest.current, \"pointer\");\n dirty.current = false;\n }, [onResizeCommit]);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n const next = keyboardResize(\n e.key,\n latest.current,\n policyRef.current,\n readContentMin(),\n { shiftKey: e.shiftKey, axis: axisRef.current }\n );\n if (!next) return;\n // The key is ours even when it resolves to no movement (already pinned at\n // a bound), so the browser must not also scroll the surface.\n e.preventDefault();\n emitPreview(next, \"keyboard\");\n },\n [emitPreview, readContentMin]\n );\n\n const handleKeyUp = useCallback(\n (e: React.KeyboardEvent) => {\n if (!isResizeKey(e.key)) return;\n // The gesture end for the keyboard is the key release: one commit per\n // hold, mirroring pointer-up after a stream of moves.\n if (dirty.current) onResizeCommit(latest.current, \"keyboard\");\n dirty.current = false;\n },\n [onResizeCommit]\n );\n\n return {\n role: \"separator\",\n tabIndex: 0,\n \"aria-label\": label,\n \"aria-controls\": cardId,\n \"aria-valuemin\": 0,\n \"aria-valuemax\": 100,\n \"aria-valuenow\": measurePercent(size, policy, readContentMin()),\n onPointerDown: handlePointerDown,\n onPointerMove: handlePointerMove,\n onPointerUp: endPointer,\n onLostPointerCapture: endPointer,\n onKeyDown: handleKeyDown,\n onKeyUp: handleKeyUp,\n };\n};\n"],"mappings":"AAAA,SAAgBA,WAAW,EAAEC,MAAM,QAAQ,OAAO;AAElD,SAOEC,WAAW,EACXC,WAAW,EACXC,cAAc,EACdC,SAAS,EACTC,cAAc,QACT,gBAAgB;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA6BA;;AAiBA,MAAMC,QAAQ,GAAGA,CAACC,CAAkB,EAA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F,cAAc,CAC9B,CAAC;EAED,MAAMyB,WAAW,GAAG3D,WAAW,CAC5BuC,CAAsB,IAAK;IAC1B,IAAI,CAACpC,WAAW,CAACoC,CAAC,CAACmB,GAAG,CAAC,EAAE;IACzB;IACA;IACA,IAAI7B,KAAK,CAACD,OAAO,EAAEH,cAAc,CAACE,MAAM,CAACC,OAAO,EAAE,UAAU,CAAC;IAC7DC,KAAK,CAACD,OAAO,GAAG,KAAK;EACvB,CAAC,EACD,CAACH,cAAc,CACjB,CAAC;EAED,OAAO;IACLmC,IAAI,EAAE,WAAW;IACjBC,QAAQ,EAAE,CAAC;IACX,YAAY,EAAEtC,KAAK;IACnB,eAAe,EAAEP,MAAM;IACvB,eAAe,EAAE,CAAC;IAClB,eAAe,EAAE,GAAG;IACpB,eAAe,EAAEV,cAAc,CAACQ,IAAI,EAAEC,MAAM,EAAEmB,cAAc,CAAC,CAAC,CAAC;IAC/D4B,aAAa,EAAExB,iBAAiB;IAChCyB,aAAa,EAAEd,iBAAiB;IAChCe,WAAW,EAAER,UAAU;IACvBS,oBAAoB,EAAET,UAAU;IAChCU,SAAS,EAAET,aAAa;IACxBU,OAAO,EAAER;EACX,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"useStackedCardResize.js","names":["useCallback","useRef","DEFAULT_RESIZE_ANCHOR","applyResize","isResizeKey","keyboardResize","makeStart","measurePercent","sameBox","a","b","w","h","x","y","toBox","size","position","_position$x","_position$y","useStackedCardResize","_ref","policy","cardId","contentMin","_ref$axis","axis","_ref$anchor","anchor","_ref$scale","scale","_ref$label","label","onResize","onResizeCommit","pointerStart","latest","current","dirty","policyRef","axisRef","anchorRef","scaleRef","contentMinRef","readContentMin","source","emitPreview","next","handlePointerDown","e","start","clientX","clientY","target","setPointerCapture","pointerId","preventDefault","handlePointerMove","ps","z","dx","dy","constrain","shiftKey","endPointer","handleKeyDown","key","handleKeyUp","role","tabIndex","onPointerDown","onPointerMove","onPointerUp","onLostPointerCapture","onKeyDown","onKeyUp"],"sources":["../../../../src/components/StackedCard/useStackedCardResize.ts"],"sourcesContent":["import React, { useCallback, useRef } from \"react\";\n\nimport {\n DEFAULT_RESIZE_ANCHOR,\n ResizeAnchor,\n ResizeAxis,\n ResizeBox,\n ResizeContentMin,\n ResizePolicy,\n ResizePosition,\n ResizeSize,\n ResizeSource,\n ResizeStart,\n applyResize,\n isResizeKey,\n keyboardResize,\n makeStart,\n measurePercent,\n} from \"./resizePolicy\";\n\n/**\n * The one place pointer and keyboard input meet the resize policy.\n *\n * `StackedCard`'s built-in grip reports raw deltas and knows no policy — enough\n * for a host that just tracks a width. This hook is the full contract: it\n * captures the gesture start, funnels both inputs through the pure policy in\n * `resizePolicy.ts`, streams preview events and fires exactly ONE commit per\n * gesture. It returns the props to spread on the grip, including the live\n * separator ARIA.\n *\n * One hook instance drives one handle. A card has one, in the bottom-right\n * corner; a shape mounts one per handle and passes each its `anchor`, and the\n * previews then carry the position as well as the size, so a top-left handle\n * moves the element while it grows.\n *\n * Preview versus commit (spec §7e): the continuous stream is live feedback\n * only. A host creates an undo entry on the COMMIT, never on a preview — and a\n * gesture that never changed the box commits nothing at all, so a bare click\n * on the grip is not a change.\n *\n * The hook never touches the element's content: the intrinsic minimum is read\n * through `contentMin`, which may be a getter so a card that measures its own\n * footer can answer at the moment it is asked.\n */\n\nexport interface UseStackedCardResizeArgs {\n /** The element's current size, owned by the host. */\n size: ResizeSize;\n /**\n * The element's current position, owned by the host. A host that only tracks\n * a size (a card in a flow layout) leaves it out and reads the size alone.\n */\n position?: ResizePosition;\n policy: ResizePolicy;\n /** Id of the element the grip resizes — becomes `aria-controls`. */\n cardId: string;\n /** The element's intrinsic minimum; a getter is read at the moment it is needed. */\n contentMin: ResizeContentMin | (() => ResizeContentMin);\n /** `width` locks the vertical axis (auto-height cards). Defaults to `both`. */\n axis?: ResizeAxis;\n /** The handle this instance drives. Defaults to the card's bottom-right grip. */\n anchor?: ResizeAnchor;\n /**\n * Pointer deltas are divided by this before they reach the policy, so a grip\n * inside a zoomed canvas tracks the cursor exactly. Keyboard nudges are\n * already in the host's units and pass straight through. Defaults to 1.\n */\n scale?: number;\n /** Accessible name for the grip. Defaults to \"Resize card\". */\n label?: string;\n /** Live feedback during the gesture. Never an undoable change. */\n onResize: (next: ResizeBox, source: ResizeSource) => void;\n /** Fires once per gesture, and only if the box actually changed. */\n onResizeCommit: (final: ResizeBox, source: ResizeSource) => void;\n}\n\n/** The props to spread on the grip — `StackedCard`'s `resizeHandleProps`. */\nexport interface StackedCardResizeHandleProps {\n role: \"separator\";\n tabIndex: 0;\n \"aria-label\": string;\n \"aria-controls\": string;\n \"aria-valuemin\": number;\n \"aria-valuemax\": number;\n \"aria-valuenow\": number;\n onPointerDown: (e: React.PointerEvent) => void;\n onPointerMove: (e: React.PointerEvent) => void;\n onPointerUp: (e: React.PointerEvent) => void;\n onLostPointerCapture: (e: React.PointerEvent) => void;\n onKeyDown: (e: React.KeyboardEvent) => void;\n onKeyUp: (e: React.KeyboardEvent) => void;\n}\n\nconst sameBox = (a: ResizeBox, b: ResizeBox): boolean =>\n a.w === b.w && a.h === b.h && a.x === b.x && a.y === b.y;\n\nconst toBox = (size: ResizeSize, position?: ResizePosition): ResizeBox => ({\n w: size.w,\n h: size.h,\n x: position?.x ?? 0,\n y: position?.y ?? 0,\n});\n\nexport const useStackedCardResize = ({\n size,\n position,\n policy,\n cardId,\n contentMin,\n axis = \"both\",\n anchor = DEFAULT_RESIZE_ANCHOR,\n scale = 1,\n label = \"Resize card\",\n onResize,\n onResizeCommit,\n}: UseStackedCardResizeArgs): StackedCardResizeHandleProps => {\n // The pointer gesture's anchor: the box + content-min captured on pointer\n // down, plus the pointer origin the delta is measured from.\n const pointerStart = useRef<{\n start: ResizeStart;\n x: number;\n y: number;\n } | null>(null);\n // Mirrors the latest emitted box so pointer-up / key-up can commit exactly\n // what preview last showed, without a stale closure.\n const latest = useRef<ResizeBox>(toBox(size, position));\n latest.current = toBox(size, position);\n // Whether this gesture actually moved the element. A bare click, or a Home on\n // an axis with no floor, leaves it false and commits nothing.\n const dirty = useRef(false);\n\n // Read through refs so the handlers below can stay stable across renders\n // while still seeing the current policy, axis, anchor and zoom.\n const policyRef = useRef(policy);\n policyRef.current = policy;\n const axisRef = useRef(axis);\n axisRef.current = axis;\n const anchorRef = useRef(anchor);\n anchorRef.current = anchor;\n const scaleRef = useRef(scale);\n scaleRef.current = scale;\n const contentMinRef = useRef(contentMin);\n contentMinRef.current = contentMin;\n\n const readContentMin = useCallback((): ResizeContentMin => {\n const source = contentMinRef.current;\n return typeof source === \"function\" ? source() : source;\n }, []);\n\n const emitPreview = useCallback(\n (next: ResizeBox, source: ResizeSource) => {\n // Nothing changed — not a preview, and not something to commit later.\n if (sameBox(next, latest.current)) return;\n latest.current = next;\n dirty.current = true;\n onResize(next, source);\n },\n [onResize]\n );\n\n const handlePointerDown = useCallback(\n (e: React.PointerEvent) => {\n pointerStart.current = {\n start: makeStart(latest.current, readContentMin()),\n x: e.clientX,\n y: e.clientY,\n };\n dirty.current = false;\n (e.target as HTMLElement).setPointerCapture?.(e.pointerId);\n e.preventDefault();\n },\n [readContentMin]\n );\n\n const handlePointerMove = useCallback(\n (e: React.PointerEvent) => {\n const ps = pointerStart.current;\n if (!ps) return;\n const z = scaleRef.current || 1;\n const next = applyResize(\n ps.start,\n { dx: (e.clientX - ps.x) / z, dy: (e.clientY - ps.y) / z },\n policyRef.current,\n // Shift held during a free-form drag = temporary proportional lock.\n {\n constrain: e.shiftKey,\n axis: axisRef.current,\n anchor: anchorRef.current,\n }\n );\n emitPreview(next, \"pointer\");\n },\n [emitPreview]\n );\n\n const endPointer = useCallback(() => {\n if (!pointerStart.current) return;\n pointerStart.current = null;\n if (dirty.current) onResizeCommit(latest.current, \"pointer\");\n dirty.current = false;\n }, [onResizeCommit]);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n const next = keyboardResize(\n e.key,\n latest.current,\n policyRef.current,\n readContentMin(),\n {\n shiftKey: e.shiftKey,\n axis: axisRef.current,\n anchor: anchorRef.current,\n }\n );\n if (!next) return;\n // The key is ours even when it resolves to no movement (already pinned at\n // a bound), so the browser must not also scroll the surface.\n e.preventDefault();\n emitPreview(next, \"keyboard\");\n },\n [emitPreview, readContentMin]\n );\n\n const handleKeyUp = useCallback(\n (e: React.KeyboardEvent) => {\n if (!isResizeKey(e.key)) return;\n // The gesture end for the keyboard is the key release: one commit per\n // hold, mirroring pointer-up after a stream of moves.\n if (dirty.current) onResizeCommit(latest.current, \"keyboard\");\n dirty.current = false;\n },\n [onResizeCommit]\n );\n\n return {\n role: \"separator\",\n tabIndex: 0,\n \"aria-label\": label,\n \"aria-controls\": cardId,\n \"aria-valuemin\": 0,\n \"aria-valuemax\": 100,\n \"aria-valuenow\": measurePercent(size, policy, readContentMin()),\n onPointerDown: handlePointerDown,\n onPointerMove: handlePointerMove,\n onPointerUp: endPointer,\n onLostPointerCapture: endPointer,\n onKeyDown: handleKeyDown,\n onKeyUp: handleKeyUp,\n };\n};\n"],"mappings":"AAAA,SAAgBA,WAAW,EAAEC,MAAM,QAAQ,OAAO;AAElD,SACEC,qBAAqB,EAUrBC,WAAW,EACXC,WAAW,EACXC,cAAc,EACdC,SAAS,EACTC,cAAc,QACT,gBAAgB;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiCA;;AAiBA,MAAMC,OAAO,GAAGA,CAACC,CAAY,EAAEC,CAAY,KACzCD,CAAC,CAACE,CAAC,KAAKD,CAAC,CAACC,CAAC,IAAIF,CAAC,CAACG,CAAC,KAAKF,CAAC,CAACE,CAAC,IAAIH,CAAC,CAACI,CAAC,KAAKH,CAAC,CAACG,CAAC,IAAIJ,CAAC,CAACK,CAAC,KAAKJ,CAAC,CAACI,CAAC;AAE1D,MAAMC,KAAK,GAAGA,CAACC,IAAgB,EAAEC,QAAy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AER,UAAU;IACvBS,oBAAoB,EAAET,UAAU;IAChCU,SAAS,EAAET,aAAa;IACxBU,OAAO,EAAER;EACX,CAAC;AACH,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"SourceCodeSection.d.ts","sourceRoot":"","sources":["../../../../src/presentation/shared/SourceCodeSection.tsx"],"names":[],"mappings":"AAAA,OAAc,EACZ,WAAW,EACX,YAAY,EAIb,MAAM,OAAO,CAAC;AA0Gf,KAAK,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;AAa1D,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,UAAU,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAKD,UAAU,YAAY;IACpB,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;+CAC2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;CACtD;AAiDD;;;;;;;GAOG;AACH,UAAU,UAAU;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC;IACzB;0CACsC;IACtC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,KAAK,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE3D;;;;;;;;;GASG;AACH,UAAU,SAAS;IACjB,IAAI,EAAE,IAAI,GAAG,QAAQ,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IAC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,KAAG,YA8CpD,CAAC;AAwCF,QAAA,MAAM,OAAO,GAAI,2BAGd;IACD,KAAK,EAAE,SAAS,CAAC;IACjB,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,KAAG,YA0GH,CAAC;AAEF,QAAA,MAAM,eAAe,GAAI,gCAItB;IACD,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,KAAG,YAcH,CAAC;AA+JF,KAAK,cAAc,GAAG,KAAK,GAAG,MAAM,GAAG,WAAW,CAAC;AAEnD,QAAA,MAAM,iBAAiB,GAAI,yDAOxB;IACD,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB;;6DAEyD;IACzD,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC;IACnB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,KAAG,YA0IH,CAAC;AAEF,YAAY,EACV,UAAU,EACV,KAAK,EACL,YAAY,EACZ,UAAU,EACV,UAAU,EACV,SAAS,EACT,cAAc,GACf,CAAC;AAEF,OAAO,EACL,KAAK,EACL,aAAa,EACb,QAAQ,EACR,OAAO,EACP,eAAe,EACf,iBAAiB,GAClB,CAAC"}
1
+ {"version":3,"file":"SourceCodeSection.d.ts","sourceRoot":"","sources":["../../../../src/presentation/shared/SourceCodeSection.tsx"],"names":[],"mappings":"AAAA,OAAc,EACZ,WAAW,EACX,YAAY,EAIb,MAAM,OAAO,CAAC;AA0Gf,KAAK,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;AAa1D,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,UAAU,CAAC;IA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Ac,CAAC;IACzB;;6DAEyD;IACzD,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC;IACnB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,KAAG,YA0IH,CAAC;AAEF,YAAY,EACV,UAAU,EACV,KAAK,EACL,YAAY,EACZ,UAAU,EACV,UAAU,EACV,SAAS,EACT,cAAc,GACf,CAAC;AAEF,OAAO,EACL,KAAK,EACL,aAAa,EACb,QAAQ,EACR,OAAO,EACP,eAAe,EACf,iBAAiB,GAClB,CAAC"}
@@ -850,88 +850,94 @@ const StyledHistory = styled.div.withConfig({
850
850
  const HistoryDialog = _ref4 => {
851
851
  let entry = _ref4.entry,
852
852
  onClose = _ref4.onClose;
853
- return /*#__PURE__*/React.createElement(Dialog, {
854
- open: !!entry,
855
- onClose: onClose,
856
- enableBackgroundClick: true
857
- }, /*#__PURE__*/React.createElement(Dialog.Title, {
858
- onClose: onClose
859
- }, (entry == null ? void 0 : entry.kind) === "branch" ? "Branch History" : "Pull Request History"), /*#__PURE__*/React.createElement(Dialog.ContentDivider, null), /*#__PURE__*/React.createElement(Dialog.Content, null, entry && /*#__PURE__*/React.createElement(StyledHistory, null, /*#__PURE__*/React.createElement("div", {
860
- className: "hist-header"
861
- }, /*#__PURE__*/React.createElement("div", {
862
- className: "hist-name"
863
- }, /*#__PURE__*/React.createElement(Body1, {
864
- weight: "medium"
865
- }, entry.status === "deleted" ? entry.title : /*#__PURE__*/React.createElement(TitleLink, {
866
- href: codeUrl(entry),
867
- target: "_blank",
868
- rel: "noopener noreferrer"
869
- }, entry.title)), /*#__PURE__*/React.createElement(CodeStatusChip, {
870
- entry: entry
871
- })), entry.kind === "pr" && entry.sourceBranch && entry.targetBranch && /*#__PURE__*/React.createElement("div", {
872
- className: "hist-branches"
873
- }, /*#__PURE__*/React.createElement("span", {
874
- className: "hist-branch"
875
- }, /*#__PURE__*/React.createElement(GitBranchIcon, {
876
- width: 14,
877
- height: 14
878
- }), entry.sourceBranch), /*#__PURE__*/React.createElement(ArrowRightIcon, {
879
- width: 14,
880
- height: 14
881
- }), /*#__PURE__*/React.createElement("span", {
882
- className: "hist-branch"
883
- }, /*#__PURE__*/React.createElement(GitBranchIcon, {
884
- width: 14,
885
- height: 14
886
- }), entry.targetBranch)), /*#__PURE__*/React.createElement("span", {
887
- className: "hist-repo"
888
- }, /*#__PURE__*/React.createElement(GitRepositoryIcon, {
889
- width: 14,
890
- height: 14
891
- }), entry.repoFull)), [...entry.history].sort((a, b) => a.minutesAgo - b.minutesAgo).map((ev, i) => /*#__PURE__*/React.createElement("div", {
892
- className: "hist-event",
893
- key: ev.title + "-" + i
894
- }, /*#__PURE__*/React.createElement("span", {
895
- className: "hist-icon"
896
- }, /*#__PURE__*/React.createElement(ev.icon, _extends({
897
- width: 22,
898
- height: 22
899
- }, iconColorProps(ev.icon)))), /*#__PURE__*/React.createElement("div", {
900
- className: "hist-body"
901
- }, /*#__PURE__*/React.createElement("div", {
902
- className: "hist-title"
903
- }, /*#__PURE__*/React.createElement(Body1, {
904
- weight: "medium"
905
- }, ev.title), ev.tone === "success" && /*#__PURE__*/React.createElement("span", {
906
- className: "hist-status"
907
- }, /*#__PURE__*/React.createElement(CheckIcon, {
908
- width: 16,
909
- height: 16,
910
- fill: "var(--color-sucess-green)"
911
- })), ev.tone === "danger" && /*#__PURE__*/React.createElement(StatusChip, {
912
- label: "Failed",
913
- tone: "fail",
914
- glyph: /*#__PURE__*/React.createElement(CloseIcon, {
915
- width: 12,
916
- height: 12,
917
- fill: "var(--red-alert)"
918
- })
919
- })), ev.detail && /*#__PURE__*/React.createElement("span", {
920
- className: "hist-line"
921
- }, ev.detail), ev.author && /*#__PURE__*/React.createElement("span", {
922
- className: "hist-line"
923
- }, ev.author)), /*#__PURE__*/React.createElement("div", {
924
- className: "hist-meta"
925
- }, /*#__PURE__*/React.createElement("span", {
926
- className: "hist-line"
927
- }, formatAgo(ev.minutesAgo))))), !entry.pipelineSupported && /*#__PURE__*/React.createElement("div", {
928
- className: "hist-note"
929
- }, /*#__PURE__*/React.createElement(InfoSmallIcon, {
930
- width: 15,
931
- height: 15
932
- }), /*#__PURE__*/React.createElement(Caption1, {
933
- color: "secondary"
934
- }, "No CI or deployment pipeline is configured for this repository.")))));
853
+ return (
854
+ /*#__PURE__*/
855
+ /* Same width as the Source Code dialog, so the two read alike when one opens
856
+ from the other. */
857
+ React.createElement(Dialog, {
858
+ open: !!entry,
859
+ onClose: onClose,
860
+ enableBackgroundClick: true,
861
+ size: "l"
862
+ }, /*#__PURE__*/React.createElement(Dialog.Title, {
863
+ onClose: onClose
864
+ }, (entry == null ? void 0 : entry.kind) === "branch" ? "Branch History" : "Pull Request History"), /*#__PURE__*/React.createElement(Dialog.ContentDivider, null), /*#__PURE__*/React.createElement(Dialog.Content, null, entry && /*#__PURE__*/React.createElement(StyledHistory, null, /*#__PURE__*/React.createElement("div", {
865
+ className: "hist-header"
866
+ }, /*#__PURE__*/React.createElement("div", {
867
+ className: "hist-name"
868
+ }, /*#__PURE__*/React.createElement(Body1, {
869
+ weight: "medium"
870
+ }, entry.status === "deleted" ? entry.title : /*#__PURE__*/React.createElement(TitleLink, {
871
+ href: codeUrl(entry),
872
+ target: "_blank",
873
+ rel: "noopener noreferrer"
874
+ }, entry.title)), /*#__PURE__*/React.createElement(CodeStatusChip, {
875
+ entry: entry
876
+ })), entry.kind === "pr" && entry.sourceBranch && entry.targetBranch && /*#__PURE__*/React.createElement("div", {
877
+ className: "hist-branches"
878
+ }, /*#__PURE__*/React.createElement("span", {
879
+ className: "hist-branch"
880
+ }, /*#__PURE__*/React.createElement(GitBranchIcon, {
881
+ width: 14,
882
+ height: 14
883
+ }), entry.sourceBranch), /*#__PURE__*/React.createElement(ArrowRightIcon, {
884
+ width: 14,
885
+ height: 14
886
+ }), /*#__PURE__*/React.createElement("span", {
887
+ className: "hist-branch"
888
+ }, /*#__PURE__*/React.createElement(GitBranchIcon, {
889
+ width: 14,
890
+ height: 14
891
+ }), entry.targetBranch)), /*#__PURE__*/React.createElement("span", {
892
+ className: "hist-repo"
893
+ }, /*#__PURE__*/React.createElement(GitRepositoryIcon, {
894
+ width: 14,
895
+ height: 14
896
+ }), entry.repoFull)), [...entry.history].sort((a, b) => a.minutesAgo - b.minutesAgo).map((ev, i) => /*#__PURE__*/React.createElement("div", {
897
+ className: "hist-event",
898
+ key: ev.title + "-" + i
899
+ }, /*#__PURE__*/React.createElement("span", {
900
+ className: "hist-icon"
901
+ }, /*#__PURE__*/React.createElement(ev.icon, _extends({
902
+ width: 22,
903
+ height: 22
904
+ }, iconColorProps(ev.icon)))), /*#__PURE__*/React.createElement("div", {
905
+ className: "hist-body"
906
+ }, /*#__PURE__*/React.createElement("div", {
907
+ className: "hist-title"
908
+ }, /*#__PURE__*/React.createElement(Body1, {
909
+ weight: "medium"
910
+ }, ev.title), ev.tone === "success" && /*#__PURE__*/React.createElement("span", {
911
+ className: "hist-status"
912
+ }, /*#__PURE__*/React.createElement(CheckIcon, {
913
+ width: 16,
914
+ height: 16,
915
+ fill: "var(--color-sucess-green)"
916
+ })), ev.tone === "danger" && /*#__PURE__*/React.createElement(StatusChip, {
917
+ label: "Failed",
918
+ tone: "fail",
919
+ glyph: /*#__PURE__*/React.createElement(CloseIcon, {
920
+ width: 12,
921
+ height: 12,
922
+ fill: "var(--red-alert)"
923
+ })
924
+ })), ev.detail && /*#__PURE__*/React.createElement("span", {
925
+ className: "hist-line"
926
+ }, ev.detail), ev.author && /*#__PURE__*/React.createElement("span", {
927
+ className: "hist-line"
928
+ }, ev.author)), /*#__PURE__*/React.createElement("div", {
929
+ className: "hist-meta"
930
+ }, /*#__PURE__*/React.createElement("span", {
931
+ className: "hist-line"
932
+ }, formatAgo(ev.minutesAgo))))), !entry.pipelineSupported && /*#__PURE__*/React.createElement("div", {
933
+ className: "hist-note"
934
+ }, /*#__PURE__*/React.createElement(InfoSmallIcon, {
935
+ width: 15,
936
+ height: 15
937
+ }), /*#__PURE__*/React.createElement(Caption1, {
938
+ color: "secondary"
939
+ }, "No CI or deployment pipeline is configured for this repository.")))))
940
+ );
935
941
  };
936
942
 
937
943
  /* ================================================================== */