@activecollab/components 2.0.459 → 2.0.461
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.
- package/dist/cjs/components/Button/Button.js +16 -6
- package/dist/cjs/components/Button/Button.js.map +1 -1
- package/dist/cjs/components/CaretButton/CaretButton.js +52 -0
- package/dist/cjs/components/CaretButton/CaretButton.js.map +1 -0
- package/dist/cjs/components/CaretButton/Styles.js +20 -0
- package/dist/cjs/components/CaretButton/Styles.js.map +1 -0
- package/dist/cjs/components/CaretButton/index.js +17 -0
- package/dist/cjs/components/CaretButton/index.js.map +1 -0
- package/dist/cjs/components/Tables/Styles.js +68 -6
- package/dist/cjs/components/Tables/Styles.js.map +1 -1
- package/dist/cjs/components/Tables/Table.js +9 -4
- package/dist/cjs/components/Tables/Table.js.map +1 -1
- package/dist/cjs/components/index.js +11 -0
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/presentation/shared/SourceCodeSection.js +204 -24
- package/dist/cjs/presentation/shared/SourceCodeSection.js.map +1 -1
- package/dist/esm/components/Button/Button.d.ts +10 -2
- package/dist/esm/components/Button/Button.d.ts.map +1 -1
- package/dist/esm/components/Button/Button.js +16 -6
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/CaretButton/CaretButton.d.ts +22 -0
- package/dist/esm/components/CaretButton/CaretButton.d.ts.map +1 -0
- package/dist/esm/components/CaretButton/CaretButton.js +43 -0
- package/dist/esm/components/CaretButton/CaretButton.js.map +1 -0
- package/dist/esm/components/CaretButton/Styles.d.ts +4 -0
- package/dist/esm/components/CaretButton/Styles.d.ts.map +1 -0
- package/dist/esm/components/CaretButton/Styles.js +14 -0
- package/dist/esm/components/CaretButton/Styles.js.map +1 -0
- package/dist/esm/components/CaretButton/index.d.ts +2 -0
- package/dist/esm/components/CaretButton/index.d.ts.map +1 -0
- package/dist/esm/components/CaretButton/index.js +2 -0
- package/dist/esm/components/CaretButton/index.js.map +1 -0
- package/dist/esm/components/Tables/Styles.d.ts +9 -1
- package/dist/esm/components/Tables/Styles.d.ts.map +1 -1
- package/dist/esm/components/Tables/Styles.js +65 -7
- package/dist/esm/components/Tables/Styles.js.map +1 -1
- package/dist/esm/components/Tables/Table.d.ts +7 -2
- package/dist/esm/components/Tables/Table.d.ts.map +1 -1
- package/dist/esm/components/Tables/Table.js +9 -4
- package/dist/esm/components/Tables/Table.js.map +1 -1
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/presentation/shared/SourceCodeSection.d.ts.map +1 -1
- package/dist/esm/presentation/shared/SourceCodeSection.js +173 -26
- package/dist/esm/presentation/shared/SourceCodeSection.js.map +1 -1
- package/dist/index.js +4835 -4709
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SourceCodeSection.d.ts","sourceRoot":"","sources":["../../../../src/presentation/shared/SourceCodeSection.tsx"],"names":[],"mappings":"AAAA,OAAc,
|
|
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;AA+Gf,KAAK,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;AAU1D,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,UAAU,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,UAAU,YAAY;IACpB,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,MAAM,CAAC,EAAE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AAC,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,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
const _excluded = ["size", "bg", "initials", "alt"];
|
|
4
|
-
import React, { useState } from "react";
|
|
4
|
+
import React, { useEffect, useState } from "react";
|
|
5
5
|
import styled, { css } from "styled-components";
|
|
6
6
|
import { LinkBranchOrPullRequestDialog } from "./LinkBranchOrPullRequestDialog";
|
|
7
7
|
import { LinkingCommandsButton } from "./LinkingCommandsButton";
|
|
@@ -10,13 +10,15 @@ import { AVATAR_COLORS } from "./tokens";
|
|
|
10
10
|
import { AvatarGroup } from "../../components/AvatarGroup";
|
|
11
11
|
import { Button } from "../../components/Button";
|
|
12
12
|
import { AddToListButton } from "../../components/Button/AddToListButton";
|
|
13
|
+
import { Checkbox } from "../../components/Checkbox";
|
|
13
14
|
import { Chip } from "../../components/Chip";
|
|
14
15
|
import { Dialog } from "../../components/Dialog";
|
|
15
16
|
import { IconButton } from "../../components/IconButton";
|
|
16
17
|
import { ArrowRightIcon, CancelCrossIcon, CheckboxBlankTogglerIcon, CheckIcon, CircleDotIcon, CloseIcon, CloudDeployFailedIcon, CloudDeployIcon, EyeIcon, GearFailedIcon, GearIcon, GitBranchIcon, GitCommitIcon, GitMergeIcon, GitPullRequestClosedIcon, GitPullRequestDraftIcon, GitPullRequestIcon, GitRepositoryIcon, InfoSmallIcon, MessageIcon, MessageSmallIcon, TrashIcon } from "../../components/Icons";
|
|
18
|
+
import { Label } from "../../components/Label";
|
|
17
19
|
import { StepSequence } from "../../components/StepSequence";
|
|
18
20
|
import { Tooltip } from "../../components/Tooltip";
|
|
19
|
-
import { Body1, Caption1, Header3 } from "../../components/Typography";
|
|
21
|
+
import { Body1, Body2, Caption1, Header3 } from "../../components/Typography";
|
|
20
22
|
import { colors } from "../../utils";
|
|
21
23
|
|
|
22
24
|
/**
|
|
@@ -938,7 +940,7 @@ const HistoryDialog = _ref4 => {
|
|
|
938
940
|
const StyledSourceCode = styled.div.withConfig({
|
|
939
941
|
displayName: "SourceCodeSection__StyledSourceCode",
|
|
940
942
|
componentId: "sc-rvqbh5-2"
|
|
941
|
-
})(["font-family:", ";margin:0 0 16px;padding-bottom:16px;border-bottom:1px solid var(--border-primary);", " .sc-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:4px;}.sc-completed-row{display:flex;align-items:center;margin-top:8px;padding-top:8px;border-top:1px solid var(--border-primary);}.sc-add{margin-top:8px;padding-top:12px;border-top:1px solid var(--border-primary);}.sc-add .c--add-to-list-btn svg{box-sizing:content-box;}.sc-item{padding:12px 0;}.sc-item + .sc-item{border-top:1px solid var(--border-primary);}.sc-row{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;}.sc-main{flex:1 1 0%;min-width:0;}.sc-name{display:flex;align-items:center;gap:8px;flex-wrap:nowrap;min-width:0;}.sc-lead{flex-shrink:0;display:inline-flex;color:var(--color-theme-600);}.sc-title{flex:0 1 auto;min-width:0;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}.sc-title.strike{text-decoration:line-through;}.sc-title.strike-link{text-decoration:line-through;}.sc-title.strike-link:hover{text-decoration:none;}.sc-sigs{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:10px;font-size:12px;color:var(--color-theme-600);}.sc-sig{display:inline-flex;align-items:center;gap:4px;}.sc-closing{display:inline-flex;align-items:center;flex-shrink:0;cursor:default;}.sc-sha{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;}.sc-muted{color:var(--color-theme-600);}.sc-refs{display:inline-flex;align-items:center;gap:6px;}.sc-refs .ref-link{color:var(--color-primary);font-weight:500;}"], SANS, p => p.$flush && css(["margin:0;padding-bottom:0;border-bottom:none;"]));
|
|
943
|
+
})(["font-family:", ";margin:0 0 16px;padding-bottom:16px;border-bottom:1px solid var(--border-primary);", " .sc-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:4px;}.sc-header-actions{display:flex;align-items:center;gap:8px;flex-shrink:0;}.sc-completed-row{display:flex;align-items:center;margin-top:8px;padding-top:8px;border-top:1px solid var(--border-primary);}.sc-add{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:8px;padding-top:12px;border-top:1px solid var(--border-primary);}.sc-add .c--add-to-list-btn svg{box-sizing:content-box;}.sc-item{padding:12px 0;}.sc-item + .sc-item{border-top:1px solid var(--border-primary);}.sc-row{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;}.sc-main{flex:1 1 0%;min-width:0;}.sc-name{display:flex;align-items:center;gap:8px;flex-wrap:nowrap;min-width:0;}.sc-lead{flex-shrink:0;display:inline-flex;color:var(--color-theme-600);}.sc-title{flex:0 1 auto;min-width:0;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}.sc-title.strike{text-decoration:line-through;}.sc-title.strike-link{text-decoration:line-through;}.sc-title.strike-link:hover{text-decoration:none;}.sc-sigs{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:10px;font-size:12px;color:var(--color-theme-600);}.sc-sig{display:inline-flex;align-items:center;gap:4px;}.sc-closing{display:inline-flex;align-items:center;flex-shrink:0;cursor:default;}.sc-sha{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;}.sc-muted{color:var(--color-theme-600);}.sc-refs{display:inline-flex;align-items:center;gap:6px;}.sc-refs .ref-link{color:var(--color-primary);font-weight:500;}"], SANS, p => p.$flush && css(["margin:0;padding-bottom:0;border-bottom:none;"]));
|
|
942
944
|
|
|
943
945
|
/* Element name — a link that opens the object in a new tab. Keeps the row's
|
|
944
946
|
typography (inherits color + weight), turns primary on hover, link cursor. */
|
|
@@ -1225,28 +1227,140 @@ const CompletedHeader = _ref1 => {
|
|
|
1225
1227
|
}
|
|
1226
1228
|
}, expanded ? "Hide completed elements" : "Show " + count + " more completed elements"));
|
|
1227
1229
|
};
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1230
|
+
|
|
1231
|
+
/* ---- Unlink ---------------------------------------------------------- */
|
|
1232
|
+
|
|
1233
|
+
/** Stable per-element keys, shared by the Unlink dialog list and the section's
|
|
1234
|
+
removal set so a checked element maps back to the row it hides. */
|
|
1235
|
+
const issueElementKey = i => "issue:" + i.ref;
|
|
1236
|
+
const codeElementKey = e => "code:" + e.repo + "-" + e.title;
|
|
1237
|
+
/* Squared secondary button — the DS secondary/small button is a pill by
|
|
1238
|
+
default; a 6px radius matches the Linking and Commands trigger beside it. */
|
|
1239
|
+
const UnlinkTriggerButton = styled(Button).withConfig({
|
|
1240
|
+
displayName: "SourceCodeSection__UnlinkTriggerButton",
|
|
1241
|
+
componentId: "sc-rvqbh5-5"
|
|
1242
|
+
})(["&&{border-radius:var(--ac-br-6);}"]);
|
|
1243
|
+
const StyledUnlink = styled.div.withConfig({
|
|
1244
|
+
displayName: "SourceCodeSection__StyledUnlink",
|
|
1245
|
+
componentId: "sc-rvqbh5-6"
|
|
1246
|
+
})([".unlink-error{display:block;margin-bottom:12px;}.unlink-list{list-style:none;margin:0;padding:0;}.unlink-item{display:flex;align-items:center;gap:8px;padding:8px 0;}.unlink-label{min-width:0;cursor:pointer;}"]);
|
|
1247
|
+
|
|
1248
|
+
/** Stands in for the unlink request. Production replaces it with the real call
|
|
1249
|
+
and rejects on failure, which surfaces the error message in the dialog. */
|
|
1250
|
+
const mockUnlinkRequest = () => new Promise(resolve => setTimeout(resolve, 700));
|
|
1251
|
+
|
|
1252
|
+
/**
|
|
1253
|
+
* Unlink dialog — an action dialog with an explicit footer that also closes on
|
|
1254
|
+
* Esc or a click outside. Lists every
|
|
1255
|
+
* linked element with a checkbox, all unchecked by default; the user selects any
|
|
1256
|
+
* number and the primary action is always enabled. While the request is in
|
|
1257
|
+
* flight the buttons are disabled; on success the parent removes the selected
|
|
1258
|
+
* elements and closes the dialog with no toast; on failure the dialog shows
|
|
1259
|
+
* "Unable to unlink selected items" and re-enables the buttons.
|
|
1260
|
+
*/
|
|
1261
|
+
const UnlinkDialog = _ref10 => {
|
|
1262
|
+
let open = _ref10.open,
|
|
1263
|
+
elements = _ref10.elements,
|
|
1264
|
+
onClose = _ref10.onClose,
|
|
1265
|
+
onConfirm = _ref10.onConfirm;
|
|
1266
|
+
const _useState = useState(new Set()),
|
|
1267
|
+
selected = _useState[0],
|
|
1268
|
+
setSelected = _useState[1];
|
|
1242
1269
|
const _useState2 = useState(false),
|
|
1243
|
-
|
|
1244
|
-
|
|
1270
|
+
submitting = _useState2[0],
|
|
1271
|
+
setSubmitting = _useState2[1];
|
|
1245
1272
|
const _useState3 = useState(false),
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1273
|
+
error = _useState3[0],
|
|
1274
|
+
setError = _useState3[1];
|
|
1275
|
+
useEffect(() => {
|
|
1276
|
+
if (open) {
|
|
1277
|
+
setSelected(new Set());
|
|
1278
|
+
setSubmitting(false);
|
|
1279
|
+
setError(false);
|
|
1280
|
+
}
|
|
1281
|
+
}, [open]);
|
|
1282
|
+
const toggle = key => setSelected(prev => {
|
|
1283
|
+
const next = new Set(Array.from(prev));
|
|
1284
|
+
if (next.has(key)) {
|
|
1285
|
+
next.delete(key);
|
|
1286
|
+
} else {
|
|
1287
|
+
next.add(key);
|
|
1288
|
+
}
|
|
1289
|
+
return next;
|
|
1290
|
+
});
|
|
1291
|
+
const handleUnlink = async () => {
|
|
1292
|
+
setSubmitting(true);
|
|
1293
|
+
setError(false);
|
|
1294
|
+
try {
|
|
1295
|
+
await onConfirm(Array.from(selected));
|
|
1296
|
+
} catch (_unused) {
|
|
1297
|
+
setError(true);
|
|
1298
|
+
setSubmitting(false);
|
|
1299
|
+
}
|
|
1300
|
+
};
|
|
1301
|
+
return /*#__PURE__*/React.createElement(Dialog, {
|
|
1302
|
+
open: open,
|
|
1303
|
+
onClose: onClose,
|
|
1304
|
+
enableBackgroundClick: true
|
|
1305
|
+
}, /*#__PURE__*/React.createElement(Dialog.Title, null, "Unlink"), /*#__PURE__*/React.createElement(Dialog.ContentDivider, null), /*#__PURE__*/React.createElement(Dialog.Content, null, /*#__PURE__*/React.createElement(StyledUnlink, null, error && /*#__PURE__*/React.createElement(Body2, {
|
|
1306
|
+
color: "alert",
|
|
1307
|
+
className: "unlink-error"
|
|
1308
|
+
}, "Unable to unlink selected items"), /*#__PURE__*/React.createElement("ul", {
|
|
1309
|
+
className: "unlink-list"
|
|
1310
|
+
}, elements.map((el, i) => {
|
|
1311
|
+
const id = "source-unlink-" + i;
|
|
1312
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
1313
|
+
className: "unlink-item",
|
|
1314
|
+
key: el.key
|
|
1315
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
1316
|
+
id: id,
|
|
1317
|
+
checked: selected.has(el.key),
|
|
1318
|
+
onChange: () => toggle(el.key)
|
|
1319
|
+
}), /*#__PURE__*/React.createElement(Label, {
|
|
1320
|
+
htmlFor: id,
|
|
1321
|
+
weight: "regular",
|
|
1322
|
+
className: "unlink-label"
|
|
1323
|
+
}, el.label));
|
|
1324
|
+
})))), /*#__PURE__*/React.createElement(Dialog.ContentDivider, null), /*#__PURE__*/React.createElement(Dialog.Actions, null, /*#__PURE__*/React.createElement(Button, {
|
|
1325
|
+
type: "button",
|
|
1326
|
+
variant: "primary",
|
|
1327
|
+
disabled: submitting,
|
|
1328
|
+
onClick: handleUnlink
|
|
1329
|
+
}, "Unlink"), /*#__PURE__*/React.createElement(Button, {
|
|
1330
|
+
type: "button",
|
|
1331
|
+
variant: "secondary",
|
|
1332
|
+
disabled: submitting,
|
|
1333
|
+
onClick: onClose
|
|
1334
|
+
}, "Cancel")));
|
|
1335
|
+
};
|
|
1336
|
+
const SourceCodeSection = _ref11 => {
|
|
1337
|
+
let _ref11$variant = _ref11.variant,
|
|
1338
|
+
variant = _ref11$variant === void 0 ? "mix" : _ref11$variant,
|
|
1339
|
+
issues = _ref11.issues,
|
|
1340
|
+
code = _ref11.code,
|
|
1341
|
+
_ref11$showHeader = _ref11.showHeader,
|
|
1342
|
+
showHeader = _ref11$showHeader === void 0 ? true : _ref11$showHeader,
|
|
1343
|
+
_ref11$showLink = _ref11.showLink,
|
|
1344
|
+
showLink = _ref11$showLink === void 0 ? true : _ref11$showLink,
|
|
1345
|
+
_ref11$flush = _ref11.flush,
|
|
1346
|
+
flush = _ref11$flush === void 0 ? false : _ref11$flush;
|
|
1347
|
+
const _useState4 = useState(null),
|
|
1348
|
+
openEntry = _useState4[0],
|
|
1349
|
+
setOpenEntry = _useState4[1];
|
|
1350
|
+
const _useState5 = useState(false),
|
|
1351
|
+
completedExpanded = _useState5[0],
|
|
1352
|
+
setCompletedExpanded = _useState5[1];
|
|
1353
|
+
const _useState6 = useState(false),
|
|
1354
|
+
linkOpen = _useState6[0],
|
|
1355
|
+
setLinkOpen = _useState6[1];
|
|
1356
|
+
const _useState7 = useState(false),
|
|
1357
|
+
unlinkOpen = _useState7[0],
|
|
1358
|
+
setUnlinkOpen = _useState7[1];
|
|
1359
|
+
const _useState8 = useState(new Set()),
|
|
1360
|
+
removed = _useState8[0],
|
|
1361
|
+
setRemoved = _useState8[1];
|
|
1362
|
+
const issuesData = (issues != null ? issues : ISSUES).filter(i => !removed.has(issueElementKey(i)));
|
|
1363
|
+
const codeData = (code != null ? code : CODE_ENTRIES).filter(e => !removed.has(codeElementKey(e)));
|
|
1250
1364
|
const openIssues = issuesData.filter(i => !issueCompleted(i)).sort(byRecency);
|
|
1251
1365
|
const openCode = codeData.filter(e => !codeCompleted(e)).sort(byRecency);
|
|
1252
1366
|
const completed = [...issuesData.filter(issueCompleted).map(issue => ({
|
|
@@ -1268,13 +1382,41 @@ const SourceCodeSection = _ref10 => {
|
|
|
1268
1382
|
// In the "completed" variant there is no collapsible header and everything is
|
|
1269
1383
|
// shown; in "mix" the section is collapsed by default.
|
|
1270
1384
|
const completedVisible = variant === "completed" ? true : completedExpanded;
|
|
1385
|
+
const hasRows = openIssues.length > 0 || openCode.length > 0 || completed.length > 0;
|
|
1386
|
+
|
|
1387
|
+
// Every linked element, sorted by name, for the Unlink dialog.
|
|
1388
|
+
const unlinkElements = [...issuesData.map(i => ({
|
|
1389
|
+
key: issueElementKey(i),
|
|
1390
|
+
label: i.title
|
|
1391
|
+
})), ...codeData.map(e => ({
|
|
1392
|
+
key: codeElementKey(e),
|
|
1393
|
+
label: e.title
|
|
1394
|
+
}))].sort((a, b) => a.label.localeCompare(b.label));
|
|
1395
|
+
const handleUnlinkConfirm = async keys => {
|
|
1396
|
+
await mockUnlinkRequest();
|
|
1397
|
+
if (keys.length > 0) {
|
|
1398
|
+
setRemoved(prev => {
|
|
1399
|
+
const next = new Set(Array.from(prev));
|
|
1400
|
+
keys.forEach(key => next.add(key));
|
|
1401
|
+
return next;
|
|
1402
|
+
});
|
|
1403
|
+
}
|
|
1404
|
+
setUnlinkOpen(false);
|
|
1405
|
+
};
|
|
1271
1406
|
return /*#__PURE__*/React.createElement(StyledSourceCode, {
|
|
1272
1407
|
$flush: flush
|
|
1273
|
-
}, showHeader && /*#__PURE__*/React.createElement("div", {
|
|
1408
|
+
}, showHeader && hasRows && /*#__PURE__*/React.createElement("div", {
|
|
1274
1409
|
className: "sc-header"
|
|
1275
1410
|
}, /*#__PURE__*/React.createElement(Body1, {
|
|
1276
1411
|
weight: "bold"
|
|
1277
|
-
}, "Source Code"), /*#__PURE__*/React.createElement(
|
|
1412
|
+
}, "Source Code"), /*#__PURE__*/React.createElement("div", {
|
|
1413
|
+
className: "sc-header-actions"
|
|
1414
|
+
}, /*#__PURE__*/React.createElement(LinkingCommandsButton, null), showLink && /*#__PURE__*/React.createElement(UnlinkTriggerButton, {
|
|
1415
|
+
type: "button",
|
|
1416
|
+
variant: "secondary",
|
|
1417
|
+
size: "small",
|
|
1418
|
+
onClick: () => setUnlinkOpen(true)
|
|
1419
|
+
}, "Unlink"))), showOpen && openIssues.map(issue => /*#__PURE__*/React.createElement("div", {
|
|
1278
1420
|
className: "sc-item",
|
|
1279
1421
|
key: issue.ref
|
|
1280
1422
|
}, /*#__PURE__*/React.createElement(IssueRow, {
|
|
@@ -1300,12 +1442,17 @@ const SourceCodeSection = _ref10 => {
|
|
|
1300
1442
|
marginLeft: -4
|
|
1301
1443
|
},
|
|
1302
1444
|
onClick: () => setLinkOpen(true)
|
|
1303
|
-
})), /*#__PURE__*/React.createElement(HistoryDialog, {
|
|
1445
|
+
}), showHeader && !hasRows && /*#__PURE__*/React.createElement(LinkingCommandsButton, null)), /*#__PURE__*/React.createElement(HistoryDialog, {
|
|
1304
1446
|
entry: openEntry,
|
|
1305
1447
|
onClose: () => setOpenEntry(null)
|
|
1306
1448
|
}), /*#__PURE__*/React.createElement(LinkBranchOrPullRequestDialog, {
|
|
1307
1449
|
open: linkOpen,
|
|
1308
1450
|
onClose: () => setLinkOpen(false)
|
|
1451
|
+
}), /*#__PURE__*/React.createElement(UnlinkDialog, {
|
|
1452
|
+
open: unlinkOpen,
|
|
1453
|
+
elements: unlinkElements,
|
|
1454
|
+
onClose: () => setUnlinkOpen(false),
|
|
1455
|
+
onConfirm: handleUnlinkConfirm
|
|
1309
1456
|
}));
|
|
1310
1457
|
};
|
|
1311
1458
|
export { Spine, HistoryDialog, IssueRow, CodeRow, CompletedHeader, SourceCodeSection };
|