@activecollab/components 2.0.392 → 2.0.394

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.
@@ -1,47 +1,151 @@
1
1
  import React, { useEffect, useState } from "react";
2
2
  import styled from "styled-components";
3
+ import { Button } from "../../components/Button";
3
4
  import { ChooseV2 } from "../../components/ChooseV2";
4
5
  import { Dialog } from "../../components/Dialog";
5
6
  import { IconButton } from "../../components/IconButton";
6
7
  import { CancelCrossIcon, CommandLineIcon, CopyIcon, HashIcon } from "../../components/Icons";
7
8
  import { SkeletonLoader } from "../../components/Loaders";
8
9
  import { Tooltip } from "../../components/Tooltip";
9
- import { Trigger } from "../../components/Trigger";
10
- import { Body2, Header3 } from "../../components/Typography";
10
+ import { Body2, Caption1, Header3 } from "../../components/Typography";
11
11
 
12
12
  /**
13
- * "Linking and Commands" button — same small outlined shape and placement as
14
- * the "Suggest Subtasks" button, but without an icon or the AI gradient (this
15
- * is not an AI feature). Clicking it opens a reference dialog: a short pitch
16
- * with a one-liner each for Linking and Commands, a centered ChooseV2 to switch
17
- * between the two conventions (Linking default), and the full instructions for
18
- * whichever is selected below it.
13
+ * "Linking and Commands" button — a plain design-system secondary button (small,
14
+ * rounded, no icon, no AI gradient: this is not an AI feature). Clicking it opens
15
+ * a read-only reference dialog.
16
+ *
17
+ * This mock mirrors the shipped `activecollab-next` implementation
18
+ * (`src/components/tasks/SourceCode/LinkingAndCommandsButton.jsx` +
19
+ * `LinkingAndCommandsDialog.jsx`, task #457754): a 640px dialog with a short
20
+ * pitch, a centered ChooseV2 to switch conventions (Linking default), and two
21
+ * tabs. Linking shows the reference forms for this task and a copyable
22
+ * `git checkout -b …` suggestion; Commands shows an API-shaped table of action
23
+ * words and slash commands, plus a fixed example commit. Both the reference
24
+ * guide and the suggested-branch request are represented by short skeleton
25
+ * loads, the way the real dialog fetches them once it is opened.
19
26
  */
20
27
  const SANS = '-apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", Arial, sans-serif';
21
28
  const MONO = "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace";
22
29
 
23
30
  /** The example task these instructions are written against. */
24
31
  const TASK_ID = 4231;
32
+ /** Task URL, in production built with `~/utils/urls` `getTaskUrl`. */
33
+ const TASK_URL = "https://app.activecollab.com/1/projects/2110/tasks/" + TASK_ID;
25
34
  /**
26
35
  * Suggested branch name for this task — in production it is resolved per repo
27
36
  * via GET .../tasks/{task_id}/source/suggest-branch-name. Mocked here.
28
37
  */
29
- const SUGGESTED_BRANCH = "ilija/4231-add-cacak-region-support";
38
+ const SUGGESTED_BRANCH = "ilija/" + TASK_ID + "-add-cacak-region-support";
30
39
 
31
40
  /** POSIX-safe single-quote escaping for a value dropped into a shell command. */
32
41
  const shellQuote = value => "'" + value.replace(/'/g, "'\\''") + "'";
33
- const StyledButton = styled(Trigger).withConfig({
34
- displayName: "LinkingCommandsButton__StyledButton",
42
+
43
+ /* ------------------------------------------------------------------ */
44
+ /* Reference-guide data — shaped like the GET .../source/reference-guide */
45
+ /* payload the real dialog is driven by: a map of action words plus a */
46
+ /* flat list of slash commands. Descriptions are localised server-side; */
47
+ /* tokens and examples never translate. */
48
+ /* ------------------------------------------------------------------ */
49
+
50
+ /** Action words act on the linked task from a title, commit, or PR body. */
51
+ const ACTION_WORDS = {
52
+ close: {
53
+ primary: "Close",
54
+ example: "Close #" + TASK_ID,
55
+ description: "Closes the task when its pull request is merged.",
56
+ aliases: ["Closes", "Fixes", "Fixed", "Resolves", "Resolved"]
57
+ }
58
+ };
59
+
60
+ /** Slash commands act on the task from a commit message or PR description. */
61
+ const COMMANDS = [{
62
+ name: "spend",
63
+ syntax: "/spend {duration} [of {job type}]",
64
+ example: "/spend 1h 30m of Design",
65
+ description: "Logs the time you spent on the task."
66
+ }, {
67
+ name: "estimate",
68
+ syntax: "/estimate {duration}",
69
+ example: "/estimate 4h",
70
+ description: "Sets the task's time estimate."
71
+ }, {
72
+ name: "comment",
73
+ syntax: "/comment {text}",
74
+ example: "/comment Deployed to staging",
75
+ description: "Posts a comment on the task."
76
+ }, {
77
+ name: "done",
78
+ syntax: "/done",
79
+ example: "/done",
80
+ description: "Marks the task complete.",
81
+ aliases: ["/complete"]
82
+ }, {
83
+ name: "reopen",
84
+ syntax: "/reopen",
85
+ example: "/reopen",
86
+ description: "Reopens a completed task."
87
+ }, {
88
+ name: "assign",
89
+ syntax: "/assign @{member}",
90
+ example: "/assign @ilija",
91
+ description: "Assigns the task to a team member."
92
+ }, {
93
+ name: "label",
94
+ syntax: "/label {name}",
95
+ example: "/label In Progress",
96
+ description: "Adds a label to the task."
97
+ }];
98
+ /** Action words first, then the slash commands — the shipped row order. */
99
+ const TABLE_ROWS = [...Object.values(ACTION_WORDS).map(word => ({
100
+ key: "action-" + word.primary,
101
+ example: word.example,
102
+ description: word.description,
103
+ aliases: word.aliases
104
+ })), ...COMMANDS.map(command => ({
105
+ key: "command-" + command.name,
106
+ example: command.example,
107
+ format: command.syntax,
108
+ description: command.description,
109
+ aliases: command.aliases
110
+ }))];
111
+
112
+ /**
113
+ * Illustrative commit message: closes the task on the subject line, logs time,
114
+ * leaves a note. Fixed sample text — only the task id is interpolated, and
115
+ * durations are printed verbatim (never reformatted).
116
+ */
117
+ const EXAMPLE_COMMIT = "Fix ranks reset when a contract is archived, closes #" + TASK_ID + "\n\n/spend 1h 30m\n/comment Verified on staging, ranks hold after archive";
118
+
119
+ /* ------------------------------------------------------------------ */
120
+ /* Trigger button — plain DS secondary button, rounded to the compact */
121
+ /* "Suggest Subtasks" shape (6px), no icon, no gradient. */
122
+ /* ------------------------------------------------------------------ */
123
+
124
+ const TriggerButton = styled(Button).withConfig({
125
+ displayName: "LinkingCommandsButton__TriggerButton",
35
126
  componentId: "sc-11q4kcm-0"
36
- })([".lc-btn{display:inline-flex;align-items:center;color:var(--color-theme-700);border:1px solid var(--color-theme-500);background-color:transparent;padding:3px 8px;font-weight:500;font-size:12px;letter-spacing:0.5px;line-height:16px;border-radius:6px;transition:border-color 0.2s ease,color 0.2s ease;}&:hover .lc-btn{border-color:var(--color-theme-700);color:var(--color-theme-900);}"]);
127
+ })(["&&{border-radius:6px;}"]);
128
+
129
+ /** Wider than the default 540px dialog, matching the shipped 640px width. */
130
+ const StyledDialog = styled(Dialog).withConfig({
131
+ displayName: "LinkingCommandsButton__StyledDialog",
132
+ componentId: "sc-11q4kcm-1"
133
+ })(["&&{width:640px;max-width:calc(100vw - 64px);}"]);
37
134
  const StyledTitleRow = styled.div.withConfig({
38
135
  displayName: "LinkingCommandsButton__StyledTitleRow",
39
- componentId: "sc-11q4kcm-1"
136
+ componentId: "sc-11q4kcm-2"
40
137
  })(["display:flex;align-items:center;justify-content:space-between;gap:12px;"]);
41
138
  const StyledBody = styled.div.withConfig({
42
139
  displayName: "LinkingCommandsButton__StyledBody",
43
- componentId: "sc-11q4kcm-2"
44
- })(["font-family:", ";.lc-intro{margin-bottom:18px;}.lc-lead{display:flex;gap:10px;align-items:flex-start;margin-top:12px;}.lc-lead svg{flex-shrink:0;width:18px;height:18px;margin-top:2px;}.lc-term{font-weight:600;color:var(--color-theme-900);}.lc-choosectl{margin-bottom:18px;}.lc-choosectl > div{justify-content:center;}.lc-list{margin:8px 0 0;padding-left:18px;}.lc-list li{margin-bottom:6px;}.lc-invite{margin-top:14px;}.code{font-family:", ";background:var(--color-theme-200);border-radius:4px;padding:1px 5px;font-size:12px;color:var(--color-theme-900);}.lc-copy{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px;padding:8px 10px;background:var(--color-theme-200);border:1px solid var(--border-primary);border-radius:6px;}.lc-copy code{font-family:", ";font-size:12px;color:var(--color-theme-900);overflow-x:auto;white-space:nowrap;}.lc-copy-btn{flex-shrink:0;display:inline-flex;align-items:center;border:none;background:transparent;cursor:pointer;padding:2px;color:var(--color-theme-600);transition:color 0.15s ease;}.lc-copy-btn:hover{color:var(--color-theme-900);}.lc-copy-btn svg{width:16px;height:16px;}.lc-copy-skel{height:37px;width:100%;margin-top:10px;border-radius:6px;}.lc-example{font-family:", ";font-size:12px;line-height:1.5;color:var(--color-theme-900);background:var(--color-theme-200);border:1px solid var(--border-primary);border-radius:6px;padding:10px 12px;margin-top:12px;white-space:pre-wrap;overflow-x:auto;}table{width:100%;border-collapse:collapse;margin-top:12px;}th,td{text-align:left;padding:8px 10px;border-bottom:1px solid var(--border-primary);vertical-align:top;}th{font-size:12px;font-weight:500;color:var(--color-theme-600);}"], SANS, MONO, MONO, MONO);
140
+ componentId: "sc-11q4kcm-3"
141
+ })(["font-family:", ";display:flex;flex-direction:column;gap:16px;max-height:60vh;overflow-y:auto;.code{font-family:", ";background:var(--color-theme-200);color:var(--color-theme-900);border-radius:4px;padding:2px 6px;font-size:12px;}.lc-term{font-weight:600;color:var(--color-theme-900);}.lc-leads{display:flex;flex-direction:column;gap:8px;}.lc-lead{display:flex;align-items:flex-start;gap:8px;}.lc-lead svg{flex-shrink:0;width:16px;height:16px;margin-top:2px;color:var(--color-theme-600);}.lc-choosectl > div{justify-content:center;}.lc-tabbody{display:flex;flex-direction:column;gap:20px;}.lc-commands{gap:16px;}.lc-block{display:flex;flex-direction:column;gap:8px;}.lc-list{display:flex;flex-direction:column;gap:6px;margin:0;padding-left:20px;list-style:disc;}.lc-table{display:grid;grid-template-columns:max-content 1fr;column-gap:24px;}.lc-th{padding-bottom:8px;border-bottom:1px solid var(--border-primary);}.lc-td{padding:12px 0;border-bottom:1px solid var(--border-primary);}.lc-format{display:block;margin-top:4px;font-family:", ";}.lc-aliases{margin-top:12px;}.lc-skeleton{display:flex;flex-direction:column;gap:12px;}.lc-skel{border-radius:6px;}.lc-skel-line{height:20px;}.lc-skel-block{height:36px;width:100%;}.lc-skel-2-3{width:66%;}.lc-skel-1-2{width:50%;}.lc-branch-skel{width:100%;height:36px;border-radius:6px;}"], SANS, MONO, MONO);
142
+
143
+ /* Copyable code snippet — mirrors the shared CopySnippet: a theme-200 <pre>
144
+ with a copy control that reveals on hover (hidden when hideCopyButton). */
145
+ const StyledSnippet = styled.div.withConfig({
146
+ displayName: "LinkingCommandsButton__StyledSnippet",
147
+ componentId: "sc-11q4kcm-4"
148
+ })(["position:relative;pre{margin:0;background:var(--color-theme-200);color:var(--color-theme-900);border-radius:6px;padding:12px 16px;overflow-x:auto;font-family:", ";font-size:13px;line-height:1.5;}.lc-copy-btn{position:absolute;top:6px;right:6px;opacity:0;transition:opacity 0.15s ease;}&:hover .lc-copy-btn{opacity:1;}.lc-copy-btn svg{width:16px;height:16px;}"], MONO);
45
149
  const TAB_OPTIONS = [{
46
150
  id: "linking",
47
151
  name: "Linking"
@@ -49,108 +153,114 @@ const TAB_OPTIONS = [{
49
153
  id: "commands",
50
154
  name: "Commands"
51
155
  }];
52
- const COMMANDS = [{
53
- cmd: "Closes #34",
54
- does: "Closes the task when the pull request merges"
55
- }, {
56
- cmd: "Fixes #34",
57
- does: "Same as Closes: closes on merge"
58
- }, {
59
- cmd: "Refs #34",
60
- does: "Links to the task without closing it"
61
- }, {
62
- cmd: "/spend 1:30",
63
- does: "Logs time against the task"
64
- }, {
65
- cmd: "/estimate 4:00",
66
- does: "Sets the task's time estimate"
67
- }, {
68
- cmd: "/done",
69
- does: "Marks the task complete"
70
- }, {
71
- cmd: "/reopen",
72
- does: "Reopens the task"
73
- }, {
74
- cmd: "/assign @ilija",
75
- does: "Assigns the task to a user"
76
- }, {
77
- cmd: "/label In Progress",
78
- does: "Adds a label to the task"
79
- }, {
80
- cmd: "/comment Deployed to staging",
81
- does: "Posts a comment on the task"
82
- }, {
83
- cmd: "/relate #35",
84
- does: "Relates this task to another task"
85
- }];
86
-
87
- /** Illustrative commit message: closes the task, logs time, leaves a note. */
88
- const EXAMPLE_COMMIT = "Fix ranks reset when a contract is archived\n\nCloses #" + TASK_ID + "\n/spend 1:30\n/comment Verified on staging, ranks hold after archive";
89
- const LinkingTab = _ref => {
90
- let loading = _ref.loading,
91
- branch = _ref.branch;
156
+ const CopySnippet = _ref => {
157
+ let code = _ref.code,
158
+ _ref$hideCopyButton = _ref.hideCopyButton,
159
+ hideCopyButton = _ref$hideCopyButton === void 0 ? false : _ref$hideCopyButton;
92
160
  const _useState = useState(false),
93
161
  copied = _useState[0],
94
162
  setCopied = _useState[1];
95
- const command = branch ? "git checkout -b " + shellQuote(branch) : "";
96
163
  const copy = () => {
97
164
  var _navigator$clipboard;
98
- if (!command) return;
99
165
  // eslint-disable-next-line compat/compat
100
- void ((_navigator$clipboard = navigator.clipboard) == null ? void 0 : _navigator$clipboard.writeText(command));
166
+ void ((_navigator$clipboard = navigator.clipboard) == null ? void 0 : _navigator$clipboard.writeText(code));
101
167
  setCopied(true);
102
168
  window.setTimeout(() => setCopied(false), 1500);
103
169
  };
170
+ return /*#__PURE__*/React.createElement(StyledSnippet, null, /*#__PURE__*/React.createElement("pre", null, /*#__PURE__*/React.createElement("code", null, code)), !hideCopyButton && /*#__PURE__*/React.createElement(Tooltip, {
171
+ title: copied ? "Copied!" : "Copy"
172
+ }, /*#__PURE__*/React.createElement("button", {
173
+ type: "button",
174
+ className: "lc-copy-btn",
175
+ onClick: copy,
176
+ "aria-label": "Copy command",
177
+ style: {
178
+ border: "none",
179
+ background: "transparent",
180
+ cursor: "pointer",
181
+ padding: 4,
182
+ display: "inline-flex",
183
+ color: "var(--color-theme-600)"
184
+ }
185
+ }, /*#__PURE__*/React.createElement(CopyIcon, null))));
186
+ };
187
+ const LinkingTab = _ref2 => {
188
+ let branchLoading = _ref2.branchLoading,
189
+ branch = _ref2.branch;
190
+ const command = branch ? "git checkout -b " + shellQuote(branch) : "";
104
191
  return /*#__PURE__*/React.createElement("div", {
105
192
  className: "lc-tabbody"
193
+ }, /*#__PURE__*/React.createElement("div", {
194
+ className: "lc-block"
106
195
  }, /*#__PURE__*/React.createElement(Body2, {
107
196
  color: "secondary"
108
197
  }, "Mention the task in your git activity and it links to this task on its own:"), /*#__PURE__*/React.createElement("ul", {
109
198
  className: "lc-list"
110
- }, /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Body2, null, /*#__PURE__*/React.createElement("span", {
199
+ }, /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Body2, {
200
+ color: "secondary"
201
+ }, /*#__PURE__*/React.createElement("span", {
111
202
  className: "lc-term"
112
203
  }, "In a branch name:"), " the raw task ID", " ", /*#__PURE__*/React.createElement("span", {
113
204
  className: "code"
114
- }, TASK_ID))), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Body2, null, /*#__PURE__*/React.createElement("span", {
205
+ }, TASK_ID))), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Body2, {
206
+ color: "secondary"
207
+ }, /*#__PURE__*/React.createElement("span", {
115
208
  className: "lc-term"
116
209
  }, "In a title, commit message, or description:"), " ", /*#__PURE__*/React.createElement("span", {
117
210
  className: "code"
118
211
  }, "#", TASK_ID), " or", " ", /*#__PURE__*/React.createElement("span", {
119
212
  className: "code"
120
- }, "AC-", TASK_ID))), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Body2, null, /*#__PURE__*/React.createElement("span", {
213
+ }, "AC-", TASK_ID))), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Body2, {
214
+ color: "secondary"
215
+ }, /*#__PURE__*/React.createElement("span", {
121
216
  className: "lc-term"
122
217
  }, "Anywhere:"), " the task URL", " ", /*#__PURE__*/React.createElement("span", {
123
218
  className: "code"
124
- }, "https://app.activecollab.com/1/projects/2110/tasks/", TASK_ID)))), /*#__PURE__*/React.createElement("div", {
125
- className: "lc-invite"
219
+ }, TASK_URL))))), branchLoading || command ? /*#__PURE__*/React.createElement("div", {
220
+ className: "lc-block"
126
221
  }, /*#__PURE__*/React.createElement(Body2, {
127
222
  color: "secondary"
128
- }, "Give the branch a name with the task number in it and it links the moment you push. Create one from the suggested name:"), loading ? /*#__PURE__*/React.createElement(SkeletonLoader, {
129
- className: "lc-copy-skel"
130
- }) : /*#__PURE__*/React.createElement("div", {
131
- className: "lc-copy"
132
- }, /*#__PURE__*/React.createElement("code", null, command), /*#__PURE__*/React.createElement(Tooltip, {
133
- title: copied ? "Copied!" : "Copy"
134
- }, /*#__PURE__*/React.createElement("button", {
135
- type: "button",
136
- className: "lc-copy-btn",
137
- onClick: copy,
138
- "aria-label": "Copy command"
139
- }, /*#__PURE__*/React.createElement(CopyIcon, null))))));
223
+ }, "Give the branch a name with the task number in it and it links the moment you push. Create one from the suggested name:"), branchLoading ? /*#__PURE__*/React.createElement(SkeletonLoader, {
224
+ className: "lc-branch-skel"
225
+ }) : /*#__PURE__*/React.createElement(CopySnippet, {
226
+ code: command
227
+ })) : null);
140
228
  };
141
229
  const CommandsTab = () => /*#__PURE__*/React.createElement("div", {
142
- className: "lc-tabbody"
230
+ className: "lc-tabbody lc-commands"
143
231
  }, /*#__PURE__*/React.createElement(Body2, {
144
232
  color: "secondary"
145
- }, "The table below lists action words and slash commands that you can use in a commit message or a pull request description to act on the linked task. Example:"), /*#__PURE__*/React.createElement("pre", {
146
- className: "lc-example"
147
- }, EXAMPLE_COMMIT), /*#__PURE__*/React.createElement("table", null, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", null, "Command"), /*#__PURE__*/React.createElement("th", null, "What it does"))), /*#__PURE__*/React.createElement("tbody", null, COMMANDS.map(c => /*#__PURE__*/React.createElement("tr", {
148
- key: c.cmd
149
- }, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("span", {
150
- className: "code"
151
- }, c.cmd)), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(Body2, {
152
- color: "secondary"
153
- }, c.does)))))));
233
+ }, "The table below lists action words and slash commands that you can use in a commit message or a pull request description to act on the linked task. Example:"), /*#__PURE__*/React.createElement(CopySnippet, {
234
+ code: EXAMPLE_COMMIT,
235
+ hideCopyButton: true
236
+ }), /*#__PURE__*/React.createElement("div", {
237
+ className: "lc-table"
238
+ }, /*#__PURE__*/React.createElement(Caption1, {
239
+ color: "tertiary",
240
+ className: "lc-th"
241
+ }, "Command"), /*#__PURE__*/React.createElement(Caption1, {
242
+ color: "tertiary",
243
+ className: "lc-th"
244
+ }, "What it does"), TABLE_ROWS.map(row => {
245
+ var _row$aliases;
246
+ return /*#__PURE__*/React.createElement(React.Fragment, {
247
+ key: row.key
248
+ }, /*#__PURE__*/React.createElement("div", {
249
+ className: "lc-td"
250
+ }, /*#__PURE__*/React.createElement("span", {
251
+ className: "code"
252
+ }, row.example), row.format ? /*#__PURE__*/React.createElement(Caption1, {
253
+ color: "tertiary",
254
+ className: "lc-format"
255
+ }, row.format) : null), /*#__PURE__*/React.createElement("div", {
256
+ className: "lc-td"
257
+ }, /*#__PURE__*/React.createElement(Body2, {
258
+ color: "secondary"
259
+ }, row.description), (_row$aliases = row.aliases) != null && _row$aliases.length ? /*#__PURE__*/React.createElement(Body2, {
260
+ color: "secondary",
261
+ className: "lc-aliases"
262
+ }, "Aliases: ", row.aliases.join(", ")) : null));
263
+ })));
154
264
  export const LinkingCommandsButton = () => {
155
265
  const _useState2 = useState(false),
156
266
  open = _useState2[0],
@@ -159,34 +269,43 @@ export const LinkingCommandsButton = () => {
159
269
  tab = _useState3[0],
160
270
  setTab = _useState3[1];
161
271
  const _useState4 = useState(true),
162
- branchLoading = _useState4[0],
163
- setBranchLoading = _useState4[1];
164
- const _useState5 = useState(null),
165
- suggestedBranch = _useState5[0],
166
- setSuggestedBranch = _useState5[1];
272
+ guideLoading = _useState4[0],
273
+ setGuideLoading = _useState4[1];
274
+ const _useState5 = useState(true),
275
+ branchLoading = _useState5[0],
276
+ setBranchLoading = _useState5[1];
277
+ const _useState6 = useState(null),
278
+ suggestedBranch = _useState6[0],
279
+ setSuggestedBranch = _useState6[1];
167
280
 
168
- // Mock the suggest-branch-name API load: ~1s skeleton whenever the dialog
169
- // opens, then reveal the copyable git command.
281
+ // Mock the two endpoint loads the real dialog fires once it opens: the
282
+ // reference guide resolves first (~0.6s), then the suggested branch name
283
+ // (~1.1s), each showing its own skeleton until it lands.
170
284
  useEffect(() => {
171
285
  if (!open) return undefined;
286
+ setGuideLoading(true);
172
287
  setBranchLoading(true);
173
288
  setSuggestedBranch(null);
174
- const timer = window.setTimeout(() => {
289
+ const guideTimer = window.setTimeout(() => setGuideLoading(false), 600);
290
+ const branchTimer = window.setTimeout(() => {
175
291
  setSuggestedBranch(SUGGESTED_BRANCH);
176
292
  setBranchLoading(false);
177
- }, 1000);
178
- return () => window.clearTimeout(timer);
293
+ }, 1100);
294
+ return () => {
295
+ window.clearTimeout(guideTimer);
296
+ window.clearTimeout(branchTimer);
297
+ };
179
298
  }, [open]);
180
299
  const openDialog = () => {
181
300
  setTab("linking");
182
301
  setOpen(true);
183
302
  };
184
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledButton, {
303
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TriggerButton, {
185
304
  type: "button",
305
+ variant: "secondary",
306
+ size: "small",
186
307
  onClick: openDialog
187
- }, /*#__PURE__*/React.createElement("span", {
188
- className: "lc-btn"
189
- }, "Linking and Commands")), /*#__PURE__*/React.createElement(Dialog, {
308
+ }, "Linking and Commands"), /*#__PURE__*/React.createElement(StyledDialog, {
190
309
  open: open,
191
310
  onClose: () => setOpen(false),
192
311
  enableBackgroundClick: true
@@ -195,10 +314,21 @@ export const LinkingCommandsButton = () => {
195
314
  }, /*#__PURE__*/React.createElement(StyledTitleRow, null, /*#__PURE__*/React.createElement(Header3, null, "Linking and Commands"), /*#__PURE__*/React.createElement(IconButton, {
196
315
  type: "button",
197
316
  variant: "text gray",
317
+ "aria-label": "Close",
198
318
  onClick: () => setOpen(false)
199
- }, /*#__PURE__*/React.createElement(CancelCrossIcon, null)))), /*#__PURE__*/React.createElement(Dialog.ContentDivider, null), /*#__PURE__*/React.createElement(Dialog.Content, null, /*#__PURE__*/React.createElement(StyledBody, null, /*#__PURE__*/React.createElement("div", {
200
- className: "lc-intro"
201
- }, /*#__PURE__*/React.createElement(Body2, null, "Keep a task in sync with your code without leaving your editor."), /*#__PURE__*/React.createElement("div", {
319
+ }, /*#__PURE__*/React.createElement(CancelCrossIcon, null)))), /*#__PURE__*/React.createElement(Dialog.ContentDivider, null), /*#__PURE__*/React.createElement(Dialog.Content, null, /*#__PURE__*/React.createElement(StyledBody, null, guideLoading ? /*#__PURE__*/React.createElement("div", {
320
+ className: "lc-skeleton"
321
+ }, /*#__PURE__*/React.createElement(SkeletonLoader, {
322
+ className: "lc-skel lc-skel-line lc-skel-2-3"
323
+ }), /*#__PURE__*/React.createElement(SkeletonLoader, {
324
+ className: "lc-skel lc-skel-block"
325
+ }), /*#__PURE__*/React.createElement(SkeletonLoader, {
326
+ className: "lc-skel lc-skel-block"
327
+ }), /*#__PURE__*/React.createElement(SkeletonLoader, {
328
+ className: "lc-skel lc-skel-line lc-skel-1-2"
329
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Body2, null, "Keep a task in sync with your code without leaving your editor."), /*#__PURE__*/React.createElement("div", {
330
+ className: "lc-leads"
331
+ }, /*#__PURE__*/React.createElement("div", {
202
332
  className: "lc-lead"
203
333
  }, /*#__PURE__*/React.createElement(HashIcon, null), /*#__PURE__*/React.createElement(Body2, {
204
334
  color: "secondary"
@@ -216,9 +346,9 @@ export const LinkingCommandsButton = () => {
216
346
  selected: [tab],
217
347
  onChange: ids => setTab(ids[0])
218
348
  }), tab === "linking" ? /*#__PURE__*/React.createElement(LinkingTab, {
219
- loading: branchLoading,
349
+ branchLoading: branchLoading,
220
350
  branch: suggestedBranch
221
- }) : /*#__PURE__*/React.createElement(CommandsTab, null)))));
351
+ }) : /*#__PURE__*/React.createElement(CommandsTab, null))))));
222
352
  };
223
353
  LinkingCommandsButton.displayName = "LinkingCommandsButton";
224
354
  //# sourceMappingURL=LinkingCommandsButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LinkingCommandsButton.js","names":["React","useEffect","useState","styled","ChooseV2","Dialog","IconButton","CancelCrossIcon","CommandLineIcon","CopyIcon","HashIcon","SkeletonLoader","Tooltip","Trigger","Body2","Header3","SANS","MONO","TASK_ID","SUGGESTED_BRANCH","shellQuote","value","replace","StyledButton","withConfig","displayName","componentId","StyledTitleRow","div","StyledBody","TAB_OPTIONS","id","name","COMMANDS","cmd","does","EXAMPLE_COMMIT","LinkingTab","_ref","loading","branch","_useState","copied","setCopied","command","copy","_navigator$clipboard","navigator","clipboard","writeText","window","setTimeout","createElement","className","color","title","type","onClick","CommandsTab","map","c","key","LinkingCommandsButton","_useState2","open","setOpen","_useState3","tab","setTab","_useState4","branchLoading","setBranchLoading","_useState5","suggestedBranch","setSuggestedBranch","undefined","timer","clearTimeout","openDialog","Fragment","onClose","enableBackgroundClick","Title","disableDefaultHeading","variant","ContentDivider","Content","options","selected","onChange","ids"],"sources":["../../../../src/presentation/shared/LinkingCommandsButton.tsx"],"sourcesContent":["import React, { ReactElement, useEffect, useState } from \"react\";\n\nimport styled from \"styled-components\";\n\nimport { ChooseV2, ChooseV2Option } from \"../../components/ChooseV2\";\nimport { Dialog } from \"../../components/Dialog\";\nimport { IconButton } from \"../../components/IconButton\";\nimport {\n CancelCrossIcon,\n CommandLineIcon,\n CopyIcon,\n HashIcon,\n} from \"../../components/Icons\";\nimport { SkeletonLoader } from \"../../components/Loaders\";\nimport { Tooltip } from \"../../components/Tooltip\";\nimport { Trigger } from \"../../components/Trigger\";\nimport { Body2, Header3 } from \"../../components/Typography\";\n\n/**\n * \"Linking and Commands\" button — same small outlined shape and placement as\n * the \"Suggest Subtasks\" button, but without an icon or the AI gradient (this\n * is not an AI feature). Clicking it opens a reference dialog: a short pitch\n * with a one-liner each for Linking and Commands, a centered ChooseV2 to switch\n * between the two conventions (Linking default), and the full instructions for\n * whichever is selected below it.\n */\nconst SANS =\n '-apple-system, BlinkMacSystemFont, \"Roboto\", \"Helvetica Neue\", Arial, sans-serif';\nconst MONO = \"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace\";\n\n/** The example task these instructions are written against. */\nconst TASK_ID = 4231;\n/**\n * Suggested branch name for this task — in production it is resolved per repo\n * via GET .../tasks/{task_id}/source/suggest-branch-name. Mocked here.\n */\nconst SUGGESTED_BRANCH = \"ilija/4231-add-cacak-region-support\";\n\n/** POSIX-safe single-quote escaping for a value dropped into a shell command. */\nconst shellQuote = (value: string): string =>\n `'${value.replace(/'/g, \"'\\\\''\")}'`;\n\nconst StyledButton = styled(Trigger)`\n .lc-btn {\n display: inline-flex;\n align-items: center;\n color: var(--color-theme-700);\n border: 1px solid var(--color-theme-500);\n background-color: transparent;\n padding: 3px 8px;\n font-weight: 500;\n font-size: 12px;\n letter-spacing: 0.5px;\n line-height: 16px;\n border-radius: 6px;\n transition: border-color 0.2s ease, color 0.2s ease;\n }\n &:hover .lc-btn {\n border-color: var(--color-theme-700);\n color: var(--color-theme-900);\n }\n`;\n\nconst StyledTitleRow = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n`;\n\nconst StyledBody = styled.div`\n font-family: ${SANS};\n\n .lc-intro {\n margin-bottom: 18px;\n }\n .lc-lead {\n display: flex;\n gap: 10px;\n align-items: flex-start;\n margin-top: 12px;\n }\n .lc-lead svg {\n flex-shrink: 0;\n width: 18px;\n height: 18px;\n margin-top: 2px;\n }\n .lc-term {\n font-weight: 600;\n color: var(--color-theme-900);\n }\n\n /* ChooseV2 root is passed .lc-choosectl; its inner flex row is centered. */\n .lc-choosectl {\n margin-bottom: 18px;\n }\n .lc-choosectl > div {\n justify-content: center;\n }\n\n .lc-list {\n margin: 8px 0 0;\n padding-left: 18px;\n }\n .lc-list li {\n margin-bottom: 6px;\n }\n .lc-invite {\n margin-top: 14px;\n }\n .code {\n font-family: ${MONO};\n background: var(--color-theme-200);\n border-radius: 4px;\n padding: 1px 5px;\n font-size: 12px;\n color: var(--color-theme-900);\n }\n .lc-copy {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 10px;\n margin-top: 10px;\n padding: 8px 10px;\n background: var(--color-theme-200);\n border: 1px solid var(--border-primary);\n border-radius: 6px;\n }\n .lc-copy code {\n font-family: ${MONO};\n font-size: 12px;\n color: var(--color-theme-900);\n overflow-x: auto;\n white-space: nowrap;\n }\n .lc-copy-btn {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n border: none;\n background: transparent;\n cursor: pointer;\n padding: 2px;\n color: var(--color-theme-600);\n transition: color 0.15s ease;\n }\n .lc-copy-btn:hover {\n color: var(--color-theme-900);\n }\n .lc-copy-btn svg {\n width: 16px;\n height: 16px;\n }\n .lc-copy-skel {\n height: 37px;\n width: 100%;\n margin-top: 10px;\n border-radius: 6px;\n }\n .lc-example {\n font-family: ${MONO};\n font-size: 12px;\n line-height: 1.5;\n color: var(--color-theme-900);\n background: var(--color-theme-200);\n border: 1px solid var(--border-primary);\n border-radius: 6px;\n padding: 10px 12px;\n margin-top: 12px;\n white-space: pre-wrap;\n overflow-x: auto;\n }\n table {\n width: 100%;\n border-collapse: collapse;\n margin-top: 12px;\n }\n th,\n td {\n text-align: left;\n padding: 8px 10px;\n border-bottom: 1px solid var(--border-primary);\n vertical-align: top;\n }\n th {\n font-size: 12px;\n font-weight: 500;\n color: var(--color-theme-600);\n }\n`;\n\ntype LcTab = \"linking\" | \"commands\";\n\nconst TAB_OPTIONS: ChooseV2Option[] = [\n { id: \"linking\", name: \"Linking\" },\n { id: \"commands\", name: \"Commands\" },\n];\n\ninterface Command {\n cmd: string;\n does: string;\n}\n\nconst COMMANDS: Command[] = [\n { cmd: \"Closes #34\", does: \"Closes the task when the pull request merges\" },\n { cmd: \"Fixes #34\", does: \"Same as Closes: closes on merge\" },\n { cmd: \"Refs #34\", does: \"Links to the task without closing it\" },\n { cmd: \"/spend 1:30\", does: \"Logs time against the task\" },\n { cmd: \"/estimate 4:00\", does: \"Sets the task's time estimate\" },\n { cmd: \"/done\", does: \"Marks the task complete\" },\n { cmd: \"/reopen\", does: \"Reopens the task\" },\n { cmd: \"/assign @ilija\", does: \"Assigns the task to a user\" },\n { cmd: \"/label In Progress\", does: \"Adds a label to the task\" },\n { cmd: \"/comment Deployed to staging\", does: \"Posts a comment on the task\" },\n { cmd: \"/relate #35\", does: \"Relates this task to another task\" },\n];\n\n/** Illustrative commit message: closes the task, logs time, leaves a note. */\nconst EXAMPLE_COMMIT = `Fix ranks reset when a contract is archived\n\nCloses #${TASK_ID}\n/spend 1:30\n/comment Verified on staging, ranks hold after archive`;\n\ninterface LinkingTabProps {\n loading: boolean;\n branch: string | null;\n}\n\nconst LinkingTab = ({ loading, branch }: LinkingTabProps): ReactElement => {\n const [copied, setCopied] = useState(false);\n const command = branch ? `git checkout -b ${shellQuote(branch)}` : \"\";\n\n const copy = (): void => {\n if (!command) return;\n // eslint-disable-next-line compat/compat\n void navigator.clipboard?.writeText(command);\n setCopied(true);\n window.setTimeout(() => setCopied(false), 1500);\n };\n\n return (\n <div className=\"lc-tabbody\">\n <Body2 color=\"secondary\">\n Mention the task in your git activity and it links to this task on its\n own:\n </Body2>\n <ul className=\"lc-list\">\n <li>\n <Body2>\n <span className=\"lc-term\">In a branch name:</span> the raw task ID{\" \"}\n <span className=\"code\">{TASK_ID}</span>\n </Body2>\n </li>\n <li>\n <Body2>\n <span className=\"lc-term\">\n In a title, commit message, or description:\n </span>{\" \"}\n <span className=\"code\">#{TASK_ID}</span> or{\" \"}\n <span className=\"code\">AC-{TASK_ID}</span>\n </Body2>\n </li>\n <li>\n <Body2>\n <span className=\"lc-term\">Anywhere:</span> the task URL{\" \"}\n <span className=\"code\">\n https://app.activecollab.com/1/projects/2110/tasks/{TASK_ID}\n </span>\n </Body2>\n </li>\n </ul>\n\n <div className=\"lc-invite\">\n <Body2 color=\"secondary\">\n Give the branch a name with the task number in it and it links the\n moment you push. Create one from the suggested name:\n </Body2>\n {loading ? (\n <SkeletonLoader className=\"lc-copy-skel\" />\n ) : (\n <div className=\"lc-copy\">\n <code>{command}</code>\n <Tooltip title={copied ? \"Copied!\" : \"Copy\"}>\n <button\n type=\"button\"\n className=\"lc-copy-btn\"\n onClick={copy}\n aria-label=\"Copy command\"\n >\n <CopyIcon />\n </button>\n </Tooltip>\n </div>\n )}\n </div>\n </div>\n );\n};\n\nconst CommandsTab = (): ReactElement => (\n <div className=\"lc-tabbody\">\n <Body2 color=\"secondary\">\n The table below lists action words and slash commands that you can use in\n a commit message or a pull request description to act on the linked task.\n Example:\n </Body2>\n <pre className=\"lc-example\">{EXAMPLE_COMMIT}</pre>\n <table>\n <thead>\n <tr>\n <th>Command</th>\n <th>What it does</th>\n </tr>\n </thead>\n <tbody>\n {COMMANDS.map((c) => (\n <tr key={c.cmd}>\n <td>\n <span className=\"code\">{c.cmd}</span>\n </td>\n <td>\n <Body2 color=\"secondary\">{c.does}</Body2>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n);\n\nexport const LinkingCommandsButton = (): ReactElement => {\n const [open, setOpen] = useState(false);\n const [tab, setTab] = useState<LcTab>(\"linking\");\n const [branchLoading, setBranchLoading] = useState(true);\n const [suggestedBranch, setSuggestedBranch] = useState<string | null>(null);\n\n // Mock the suggest-branch-name API load: ~1s skeleton whenever the dialog\n // opens, then reveal the copyable git command.\n useEffect(() => {\n if (!open) return undefined;\n setBranchLoading(true);\n setSuggestedBranch(null);\n const timer = window.setTimeout(() => {\n setSuggestedBranch(SUGGESTED_BRANCH);\n setBranchLoading(false);\n }, 1000);\n return () => window.clearTimeout(timer);\n }, [open]);\n\n const openDialog = (): void => {\n setTab(\"linking\");\n setOpen(true);\n };\n\n return (\n <>\n <StyledButton type=\"button\" onClick={openDialog}>\n <span className=\"lc-btn\">Linking and Commands</span>\n </StyledButton>\n\n <Dialog open={open} onClose={() => setOpen(false)} enableBackgroundClick>\n <Dialog.Title disableDefaultHeading>\n <StyledTitleRow>\n <Header3>Linking and Commands</Header3>\n <IconButton\n type=\"button\"\n variant=\"text gray\"\n onClick={() => setOpen(false)}\n >\n <CancelCrossIcon />\n </IconButton>\n </StyledTitleRow>\n </Dialog.Title>\n <Dialog.ContentDivider />\n <Dialog.Content>\n <StyledBody>\n <div className=\"lc-intro\">\n <Body2>\n Keep a task in sync with your code without leaving your editor.\n </Body2>\n <div className=\"lc-lead\">\n <HashIcon />\n <Body2 color=\"secondary\">\n <span className=\"lc-term\">Linking:</span> Mention a task in a\n branch, pull request, or commit and they will be connected\n automatically.\n </Body2>\n </div>\n <div className=\"lc-lead\">\n <CommandLineIcon />\n <Body2 color=\"secondary\">\n <span className=\"lc-term\">Commands:</span> Add short\n instructions in a commit or pull request description to act on\n the task: log time, close it, or leave a comment.\n </Body2>\n </div>\n </div>\n\n <ChooseV2\n className=\"lc-choosectl\"\n options={TAB_OPTIONS}\n selected={[tab]}\n onChange={(ids) => setTab(ids[0] as LcTab)}\n />\n\n {tab === \"linking\" ? (\n <LinkingTab loading={branchLoading} branch={suggestedBranch} />\n ) : (\n <CommandsTab />\n )}\n </StyledBody>\n </Dialog.Content>\n </Dialog>\n </>\n );\n};\n\nLinkingCommandsButton.displayName = \"LinkingCommandsButton\";\n"],"mappings":"AAAA,OAAOA,KAAK,IAAkBC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAEhE,OAAOC,MAAM,MAAM,mBAAmB;AAEtC,SAASC,QAAQ,QAAwB,2BAA2B;AACpE,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,UAAU,QAAQ,6BAA6B;AACxD,SACEC,eAAe,EACfC,eAAe,EACfC,QAAQ,EACRC,QAAQ,QACH,wBAAwB;AAC/B,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,OAAO,QAAQ,0BAA0B;AAClD,SAASC,OAAO,QAAQ,0BAA0B;AAClD,SAASC,KAAK,EAAEC,OAAO,QAAQ,6BAA6B;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,IAAI,GACR,kFAAkF;AACpF,MAAMC,IAAI,GAAG,0DAA0D;;AAEvE;AACA,MAAMC,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;IACPiD,SAAS,EAAC,cAAc;IACxBkC,OAAO,EAAEzD,WAAY;IACrB0D,QAAQ,EAAE,CAACrB,GAAG,CAAE;IAChBsB,QAAQ,EAAGC,GAAG,IAAKtB,MAAM,CAACsB,GAAG,CAAC,CAAC,CAAU;EAAE,CAC5C,CAAC,EAEDvB,GAAG,KAAK,SAAS,gBAChBnE,KAAA,CAAAoD,aAAA,CAACf,UAAU;IAACE,OAAO,EAAE+B,aAAc;IAAC9B,MAAM,EAAEiC;EAAgB,CAAE,CAAC,gBAE/DzE,KAAA,CAAAoD,aAAA,CAACM,WAAW,MAAE,CAEN,CACE,CACV,CACR,CAAC;AAEP,CAAC;AAEDI,qBAAqB,CAACrC,WAAW,GAAG,uBAAuB","ignoreList":[]}
1
+ {"version":3,"file":"LinkingCommandsButton.js","names":["React","useEffect","useState","styled","Button","ChooseV2","Dialog","IconButton","CancelCrossIcon","CommandLineIcon","CopyIcon","HashIcon","SkeletonLoader","Tooltip","Body2","Caption1","Header3","SANS","MONO","TASK_ID","TASK_URL","SUGGESTED_BRANCH","shellQuote","value","replace","ACTION_WORDS","close","primary","example","description","aliases","COMMANDS","name","syntax","TABLE_ROWS","Object","values","map","word","key","command","format","EXAMPLE_COMMIT","TriggerButton","withConfig","displayName","componentId","StyledDialog","StyledTitleRow","div","StyledBody","StyledSnippet","TAB_OPTIONS","id","CopySnippet","_ref","code","_ref$hideCopyButton","hideCopyButton","_useState","copied","setCopied","copy","_navigator$clipboard","navigator","clipboard","writeText","window","setTimeout","createElement","title","type","className","onClick","style","border","background","cursor","padding","display","color","LinkingTab","_ref2","branchLoading","branch","CommandsTab","row","_row$aliases","Fragment","length","join","LinkingCommandsButton","_useState2","open","setOpen","_useState3","tab","setTab","_useState4","guideLoading","setGuideLoading","_useState5","setBranchLoading","_useState6","suggestedBranch","setSuggestedBranch","undefined","guideTimer","branchTimer","clearTimeout","openDialog","variant","size","onClose","enableBackgroundClick","Title","disableDefaultHeading","ContentDivider","Content","options","selected","onChange","ids"],"sources":["../../../../src/presentation/shared/LinkingCommandsButton.tsx"],"sourcesContent":["import React, { ReactElement, useEffect, useState } from \"react\";\n\nimport styled from \"styled-components\";\n\nimport { Button } from \"../../components/Button\";\nimport { ChooseV2, ChooseV2Option } from \"../../components/ChooseV2\";\nimport { Dialog } from \"../../components/Dialog\";\nimport { IconButton } from \"../../components/IconButton\";\nimport {\n CancelCrossIcon,\n CommandLineIcon,\n CopyIcon,\n HashIcon,\n} from \"../../components/Icons\";\nimport { SkeletonLoader } from \"../../components/Loaders\";\nimport { Tooltip } from \"../../components/Tooltip\";\nimport { Body2, Caption1, Header3 } from \"../../components/Typography\";\n\n/**\n * \"Linking and Commands\" button — a plain design-system secondary button (small,\n * rounded, no icon, no AI gradient: this is not an AI feature). Clicking it opens\n * a read-only reference dialog.\n *\n * This mock mirrors the shipped `activecollab-next` implementation\n * (`src/components/tasks/SourceCode/LinkingAndCommandsButton.jsx` +\n * `LinkingAndCommandsDialog.jsx`, task #457754): a 640px dialog with a short\n * pitch, a centered ChooseV2 to switch conventions (Linking default), and two\n * tabs. Linking shows the reference forms for this task and a copyable\n * `git checkout -b …` suggestion; Commands shows an API-shaped table of action\n * words and slash commands, plus a fixed example commit. Both the reference\n * guide and the suggested-branch request are represented by short skeleton\n * loads, the way the real dialog fetches them once it is opened.\n */\nconst SANS =\n '-apple-system, BlinkMacSystemFont, \"Roboto\", \"Helvetica Neue\", Arial, sans-serif';\nconst MONO = \"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace\";\n\n/** The example task these instructions are written against. */\nconst TASK_ID = 4231;\n/** Task URL, in production built with `~/utils/urls` `getTaskUrl`. */\nconst TASK_URL = `https://app.activecollab.com/1/projects/2110/tasks/${TASK_ID}`;\n/**\n * Suggested branch name for this task — in production it is resolved per repo\n * via GET .../tasks/{task_id}/source/suggest-branch-name. Mocked here.\n */\nconst SUGGESTED_BRANCH = `ilija/${TASK_ID}-add-cacak-region-support`;\n\n/** POSIX-safe single-quote escaping for a value dropped into a shell command. */\nconst shellQuote = (value: string): string =>\n `'${value.replace(/'/g, \"'\\\\''\")}'`;\n\n/* ------------------------------------------------------------------ */\n/* Reference-guide data — shaped like the GET .../source/reference-guide */\n/* payload the real dialog is driven by: a map of action words plus a */\n/* flat list of slash commands. Descriptions are localised server-side; */\n/* tokens and examples never translate. */\n/* ------------------------------------------------------------------ */\n\ninterface ActionWord {\n primary: string;\n example: string;\n description: string;\n aliases?: string[];\n}\n\ninterface SlashCommand {\n name: string;\n syntax: string;\n example: string;\n description: string;\n aliases?: string[];\n}\n\n/** Action words act on the linked task from a title, commit, or PR body. */\nconst ACTION_WORDS: Record<string, ActionWord> = {\n close: {\n primary: \"Close\",\n example: `Close #${TASK_ID}`,\n description: \"Closes the task when its pull request is merged.\",\n aliases: [\"Closes\", \"Fixes\", \"Fixed\", \"Resolves\", \"Resolved\"],\n },\n};\n\n/** Slash commands act on the task from a commit message or PR description. */\nconst COMMANDS: SlashCommand[] = [\n {\n name: \"spend\",\n syntax: \"/spend {duration} [of {job type}]\",\n example: \"/spend 1h 30m of Design\",\n description: \"Logs the time you spent on the task.\",\n },\n {\n name: \"estimate\",\n syntax: \"/estimate {duration}\",\n example: \"/estimate 4h\",\n description: \"Sets the task's time estimate.\",\n },\n {\n name: \"comment\",\n syntax: \"/comment {text}\",\n example: \"/comment Deployed to staging\",\n description: \"Posts a comment on the task.\",\n },\n {\n name: \"done\",\n syntax: \"/done\",\n example: \"/done\",\n description: \"Marks the task complete.\",\n aliases: [\"/complete\"],\n },\n {\n name: \"reopen\",\n syntax: \"/reopen\",\n example: \"/reopen\",\n description: \"Reopens a completed task.\",\n },\n {\n name: \"assign\",\n syntax: \"/assign @{member}\",\n example: \"/assign @ilija\",\n description: \"Assigns the task to a team member.\",\n },\n {\n name: \"label\",\n syntax: \"/label {name}\",\n example: \"/label In Progress\",\n description: \"Adds a label to the task.\",\n },\n];\n\ninterface TableRow {\n key: string;\n example: string;\n format?: string;\n description: string;\n aliases?: string[];\n}\n\n/** Action words first, then the slash commands — the shipped row order. */\nconst TABLE_ROWS: TableRow[] = [\n ...Object.values(ACTION_WORDS).map((word) => ({\n key: `action-${word.primary}`,\n example: word.example,\n description: word.description,\n aliases: word.aliases,\n })),\n ...COMMANDS.map((command) => ({\n key: `command-${command.name}`,\n example: command.example,\n format: command.syntax,\n description: command.description,\n aliases: command.aliases,\n })),\n];\n\n/**\n * Illustrative commit message: closes the task on the subject line, logs time,\n * leaves a note. Fixed sample text — only the task id is interpolated, and\n * durations are printed verbatim (never reformatted).\n */\nconst EXAMPLE_COMMIT = `Fix ranks reset when a contract is archived, closes #${TASK_ID}\n\n/spend 1h 30m\n/comment Verified on staging, ranks hold after archive`;\n\n/* ------------------------------------------------------------------ */\n/* Trigger button — plain DS secondary button, rounded to the compact */\n/* \"Suggest Subtasks\" shape (6px), no icon, no gradient. */\n/* ------------------------------------------------------------------ */\n\nconst TriggerButton = styled(Button)`\n && {\n border-radius: 6px;\n }\n`;\n\n/** Wider than the default 540px dialog, matching the shipped 640px width. */\nconst StyledDialog = styled(Dialog)`\n && {\n width: 640px;\n max-width: calc(100vw - 64px);\n }\n`;\n\nconst StyledTitleRow = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n`;\n\nconst StyledBody = styled.div`\n font-family: ${SANS};\n display: flex;\n flex-direction: column;\n gap: 16px;\n max-height: 60vh;\n overflow-y: auto;\n\n /* Inline code chip — mirrors the app InlineCode (mono, theme-200 fill). */\n .code {\n font-family: ${MONO};\n background: var(--color-theme-200);\n color: var(--color-theme-900);\n border-radius: 4px;\n padding: 2px 6px;\n font-size: 12px;\n }\n\n /* Bold, primary-coloured lead-in term inside a secondary body line. */\n .lc-term {\n font-weight: 600;\n color: var(--color-theme-900);\n }\n\n /* Lead rows under the pitch. */\n .lc-leads {\n display: flex;\n flex-direction: column;\n gap: 8px;\n }\n .lc-lead {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n }\n .lc-lead svg {\n flex-shrink: 0;\n width: 16px;\n height: 16px;\n margin-top: 2px;\n color: var(--color-theme-600);\n }\n\n /* ChooseV2 root is passed .lc-choosectl; its inner flex row is centered. */\n .lc-choosectl > div {\n justify-content: center;\n }\n\n .lc-tabbody {\n display: flex;\n flex-direction: column;\n gap: 20px;\n }\n .lc-commands {\n gap: 16px;\n }\n .lc-block {\n display: flex;\n flex-direction: column;\n gap: 8px;\n }\n .lc-list {\n display: flex;\n flex-direction: column;\n gap: 6px;\n margin: 0;\n padding-left: 20px;\n list-style: disc;\n }\n\n /* Commands table — two-column grid, action words then slash commands. */\n .lc-table {\n display: grid;\n grid-template-columns: max-content 1fr;\n column-gap: 24px;\n }\n .lc-th {\n padding-bottom: 8px;\n border-bottom: 1px solid var(--border-primary);\n }\n .lc-td {\n padding: 12px 0;\n border-bottom: 1px solid var(--border-primary);\n }\n .lc-format {\n display: block;\n margin-top: 4px;\n font-family: ${MONO};\n }\n .lc-aliases {\n margin-top: 12px;\n }\n\n /* Loading skeletons for the reference guide and the suggested branch. */\n .lc-skeleton {\n display: flex;\n flex-direction: column;\n gap: 12px;\n }\n .lc-skel {\n border-radius: 6px;\n }\n .lc-skel-line {\n height: 20px;\n }\n .lc-skel-block {\n height: 36px;\n width: 100%;\n }\n .lc-skel-2-3 {\n width: 66%;\n }\n .lc-skel-1-2 {\n width: 50%;\n }\n .lc-branch-skel {\n width: 100%;\n height: 36px;\n border-radius: 6px;\n }\n`;\n\n/* Copyable code snippet — mirrors the shared CopySnippet: a theme-200 <pre>\n with a copy control that reveals on hover (hidden when hideCopyButton). */\nconst StyledSnippet = styled.div`\n position: relative;\n\n pre {\n margin: 0;\n background: var(--color-theme-200);\n color: var(--color-theme-900);\n border-radius: 6px;\n padding: 12px 16px;\n overflow-x: auto;\n font-family: ${MONO};\n font-size: 13px;\n line-height: 1.5;\n }\n .lc-copy-btn {\n position: absolute;\n top: 6px;\n right: 6px;\n opacity: 0;\n transition: opacity 0.15s ease;\n }\n &:hover .lc-copy-btn {\n opacity: 1;\n }\n .lc-copy-btn svg {\n width: 16px;\n height: 16px;\n }\n`;\n\ntype LcTab = \"linking\" | \"commands\";\n\nconst TAB_OPTIONS: ChooseV2Option[] = [\n { id: \"linking\", name: \"Linking\" },\n { id: \"commands\", name: \"Commands\" },\n];\n\ninterface CopySnippetProps {\n code: string;\n hideCopyButton?: boolean;\n}\n\nconst CopySnippet = ({\n code,\n hideCopyButton = false,\n}: CopySnippetProps): ReactElement => {\n const [copied, setCopied] = useState(false);\n\n const copy = (): void => {\n // eslint-disable-next-line compat/compat\n void navigator.clipboard?.writeText(code);\n setCopied(true);\n window.setTimeout(() => setCopied(false), 1500);\n };\n\n return (\n <StyledSnippet>\n <pre>\n <code>{code}</code>\n </pre>\n {!hideCopyButton && (\n <Tooltip title={copied ? \"Copied!\" : \"Copy\"}>\n <button\n type=\"button\"\n className=\"lc-copy-btn\"\n onClick={copy}\n aria-label=\"Copy command\"\n style={{\n border: \"none\",\n background: \"transparent\",\n cursor: \"pointer\",\n padding: 4,\n display: \"inline-flex\",\n color: \"var(--color-theme-600)\",\n }}\n >\n <CopyIcon />\n </button>\n </Tooltip>\n )}\n </StyledSnippet>\n );\n};\n\ninterface LinkingTabProps {\n branchLoading: boolean;\n branch: string | null;\n}\n\nconst LinkingTab = ({\n branchLoading,\n branch,\n}: LinkingTabProps): ReactElement => {\n const command = branch ? `git checkout -b ${shellQuote(branch)}` : \"\";\n\n return (\n <div className=\"lc-tabbody\">\n <div className=\"lc-block\">\n <Body2 color=\"secondary\">\n Mention the task in your git activity and it links to this task on its\n own:\n </Body2>\n <ul className=\"lc-list\">\n <li>\n <Body2 color=\"secondary\">\n <span className=\"lc-term\">In a branch name:</span> the raw task ID{\" \"}\n <span className=\"code\">{TASK_ID}</span>\n </Body2>\n </li>\n <li>\n <Body2 color=\"secondary\">\n <span className=\"lc-term\">\n In a title, commit message, or description:\n </span>{\" \"}\n <span className=\"code\">#{TASK_ID}</span> or{\" \"}\n <span className=\"code\">AC-{TASK_ID}</span>\n </Body2>\n </li>\n <li>\n <Body2 color=\"secondary\">\n <span className=\"lc-term\">Anywhere:</span> the task URL{\" \"}\n <span className=\"code\">{TASK_URL}</span>\n </Body2>\n </li>\n </ul>\n </div>\n\n {branchLoading || command ? (\n <div className=\"lc-block\">\n <Body2 color=\"secondary\">\n Give the branch a name with the task number in it and it links the\n moment you push. Create one from the suggested name:\n </Body2>\n {branchLoading ? (\n <SkeletonLoader className=\"lc-branch-skel\" />\n ) : (\n <CopySnippet code={command} />\n )}\n </div>\n ) : null}\n </div>\n );\n};\n\nconst CommandsTab = (): ReactElement => (\n <div className=\"lc-tabbody lc-commands\">\n <Body2 color=\"secondary\">\n The table below lists action words and slash commands that you can use in\n a commit message or a pull request description to act on the linked task.\n Example:\n </Body2>\n <CopySnippet code={EXAMPLE_COMMIT} hideCopyButton />\n <div className=\"lc-table\">\n <Caption1 color=\"tertiary\" className=\"lc-th\">\n Command\n </Caption1>\n <Caption1 color=\"tertiary\" className=\"lc-th\">\n What it does\n </Caption1>\n {TABLE_ROWS.map((row) => (\n <React.Fragment key={row.key}>\n <div className=\"lc-td\">\n <span className=\"code\">{row.example}</span>\n {row.format ? (\n <Caption1 color=\"tertiary\" className=\"lc-format\">\n {row.format}\n </Caption1>\n ) : null}\n </div>\n <div className=\"lc-td\">\n <Body2 color=\"secondary\">{row.description}</Body2>\n {row.aliases?.length ? (\n <Body2 color=\"secondary\" className=\"lc-aliases\">\n Aliases: {row.aliases.join(\", \")}\n </Body2>\n ) : null}\n </div>\n </React.Fragment>\n ))}\n </div>\n </div>\n);\n\nexport const LinkingCommandsButton = (): ReactElement => {\n const [open, setOpen] = useState(false);\n const [tab, setTab] = useState<LcTab>(\"linking\");\n const [guideLoading, setGuideLoading] = useState(true);\n const [branchLoading, setBranchLoading] = useState(true);\n const [suggestedBranch, setSuggestedBranch] = useState<string | null>(null);\n\n // Mock the two endpoint loads the real dialog fires once it opens: the\n // reference guide resolves first (~0.6s), then the suggested branch name\n // (~1.1s), each showing its own skeleton until it lands.\n useEffect(() => {\n if (!open) return undefined;\n setGuideLoading(true);\n setBranchLoading(true);\n setSuggestedBranch(null);\n const guideTimer = window.setTimeout(() => setGuideLoading(false), 600);\n const branchTimer = window.setTimeout(() => {\n setSuggestedBranch(SUGGESTED_BRANCH);\n setBranchLoading(false);\n }, 1100);\n return () => {\n window.clearTimeout(guideTimer);\n window.clearTimeout(branchTimer);\n };\n }, [open]);\n\n const openDialog = (): void => {\n setTab(\"linking\");\n setOpen(true);\n };\n\n return (\n <>\n <TriggerButton\n type=\"button\"\n variant=\"secondary\"\n size=\"small\"\n onClick={openDialog}\n >\n Linking and Commands\n </TriggerButton>\n\n <StyledDialog\n open={open}\n onClose={() => setOpen(false)}\n enableBackgroundClick\n >\n <Dialog.Title disableDefaultHeading>\n <StyledTitleRow>\n <Header3>Linking and Commands</Header3>\n <IconButton\n type=\"button\"\n variant=\"text gray\"\n aria-label=\"Close\"\n onClick={() => setOpen(false)}\n >\n <CancelCrossIcon />\n </IconButton>\n </StyledTitleRow>\n </Dialog.Title>\n <Dialog.ContentDivider />\n <Dialog.Content>\n <StyledBody>\n {guideLoading ? (\n <div className=\"lc-skeleton\">\n <SkeletonLoader className=\"lc-skel lc-skel-line lc-skel-2-3\" />\n <SkeletonLoader className=\"lc-skel lc-skel-block\" />\n <SkeletonLoader className=\"lc-skel lc-skel-block\" />\n <SkeletonLoader className=\"lc-skel lc-skel-line lc-skel-1-2\" />\n </div>\n ) : (\n <>\n <Body2>\n Keep a task in sync with your code without leaving your\n editor.\n </Body2>\n <div className=\"lc-leads\">\n <div className=\"lc-lead\">\n <HashIcon />\n <Body2 color=\"secondary\">\n <span className=\"lc-term\">Linking:</span> Mention a task\n in a branch, pull request, or commit and they will be\n connected automatically.\n </Body2>\n </div>\n <div className=\"lc-lead\">\n <CommandLineIcon />\n <Body2 color=\"secondary\">\n <span className=\"lc-term\">Commands:</span> Add short\n instructions in a commit or pull request description to\n act on the task: log time, close it, or leave a comment.\n </Body2>\n </div>\n </div>\n\n <ChooseV2\n className=\"lc-choosectl\"\n options={TAB_OPTIONS}\n selected={[tab]}\n onChange={(ids) => setTab(ids[0] as LcTab)}\n />\n\n {tab === \"linking\" ? (\n <LinkingTab\n branchLoading={branchLoading}\n branch={suggestedBranch}\n />\n ) : (\n <CommandsTab />\n )}\n </>\n )}\n </StyledBody>\n </Dialog.Content>\n </StyledDialog>\n </>\n );\n};\n\nLinkingCommandsButton.displayName = \"LinkingCommandsButton\";\n"],"mappings":"AAAA,OAAOA,KAAK,IAAkBC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAEhE,OAAOC,MAAM,MAAM,mBAAmB;AAEtC,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,QAAQ,QAAwB,2BAA2B;AACpE,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,UAAU,QAAQ,6BAA6B;AACxD,SACEC,eAAe,EACfC,eAAe,EACfC,QAAQ,EACRC,QAAQ,QACH,wBAAwB;AAC/B,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,OAAO,QAAQ,0BAA0B;AAClD,SAASC,KAAK,EAAEC,QAAQ,EAAEC,OAAO,QAAQ,6BAA6B;;AAEtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,IAAI,GACR,kFAAkF;AACpF,MAAMC,IAAI,GAAG,0DAA0D;;AAEvE;AACA,MAAMC,OAAO,GAAG,IAAI;AACpB;AACA,MAAMC,QAAQ,2DAAyDD,OAAS;AAChF;AACA;AACA;AACA;AACA,MAAME,gBAAgB,cAAYF,OAAO,8BAA2B;;AAEpE;AACA,MAAMG,UAAU,GAAIC,KAAa,UAC3BA,KAAK,CAACC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,MAAG;;AAErC;AACA;AACA;AACA;AACA;AACA;;AAiBA;AACA,MAAMC,YAAwC,GAAG;EAC/CC,KAAK,EAAE;IACLC,OA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AAA,CAAAqE,aAAA,CAAC1D,QAAQ,MAAE,CAAC,eACZX,KAAA,CAAAqE,aAAA,CAACvD,KAAK;IAACkE,KAAK,EAAC;EAAW,gBACtBhF,KAAA,CAAAqE,aAAA;IAAMG,SAAS,EAAC;EAAS,GAAC,UAAc,CAAC,kGAGpC,CACJ,CAAC,eACNxE,KAAA,CAAAqE,aAAA;IAAKG,SAAS,EAAC;EAAS,gBACtBxE,KAAA,CAAAqE,aAAA,CAAC5D,eAAe,MAAE,CAAC,eACnBT,KAAA,CAAAqE,aAAA,CAACvD,KAAK;IAACkE,KAAK,EAAC;EAAW,gBACtBhF,KAAA,CAAAqE,aAAA;IAAMG,SAAS,EAAC;EAAS,GAAC,WAAe,CAAC,+HAGrC,CACJ,CACF,CAAC,eAENxE,KAAA,CAAAqE,aAAA,CAAChE,QAAQ;IACPmE,SAAS,EAAC,cAAc;IACxB+C,OAAO,EAAEnE,WAAY;IACrBoE,QAAQ,EAAE,CAACxB,GAAG,CAAE;IAChByB,QAAQ,EAAGC,GAAG,IAAKzB,MAAM,CAACyB,GAAG,CAAC,CAAC,CAAU;EAAE,CAC5C,CAAC,EAED1B,GAAG,KAAK,SAAS,gBAChBhG,KAAA,CAAAqE,aAAA,CAACY,UAAU;IACTE,aAAa,EAAEA,aAAc;IAC7BC,MAAM,EAAEoB;EAAgB,CACzB,CAAC,gBAEFxG,KAAA,CAAAqE,aAAA,CAACgB,WAAW,MAAE,CAEhB,CAEM,CACE,CACJ,CACd,CAAC;AAEP,CAAC;AAEDM,qBAAqB,CAAC9C,WAAW,GAAG,uBAAuB","ignoreList":[]}
@@ -89,8 +89,19 @@ declare const CompletedHeader: ({ expanded, count, onToggle, }: {
89
89
  onToggle: () => void;
90
90
  }) => ReactElement;
91
91
  type SectionVariant = "mix" | "open" | "completed";
92
- declare const SourceCodeSection: ({ variant, }: {
92
+ declare const SourceCodeSection: ({ variant, issues, code, showHeader, showLink, flush, }: {
93
93
  variant?: SectionVariant;
94
+ /** Optional per-task data. Defaults to the built-in demo mix so the existing
95
+ Task Source stories are unchanged. The Tasks List column passes a task's
96
+ own linked elements so the dialog matches the row. */
97
+ issues?: IssueEntry[];
98
+ code?: CodeEntry[];
99
+ /** The dialog gives its own "Source Code" title, so it hides this header. */
100
+ showHeader?: boolean;
101
+ /** The read-only Source Code dialog hides the "Link" action. */
102
+ showLink?: boolean;
103
+ /** Remove the section's outer spacing and bottom rule (used in the dialog). */
104
+ flush?: boolean;
94
105
  }) => ReactElement;
95
106
  export type { StageState, Stage, HistoryEvent, IssueEntry, CodeStatus, CodeEntry, SectionVariant, };
96
107
  export { Spine, HistoryDialog, IssueRow, CodeRow, CompletedHeader, SourceCodeSection, };
@@ -1 +1 @@
1
- {"version":3,"file":"SourceCodeSection.d.ts","sourceRoot":"","sources":["../../../../src/presentation/shared/SourceCodeSection.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,WAAW,EAAE,YAAY,EAAuB,MAAM,OAAO,CAAC;AA6G9E,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,MAAM,CAAC;IAChB;+CAC2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;CACtD;AAiDD,sEAAsE;AACtE,UAAU,UAAU;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,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AY,EAAE,CAAC;CACzB;AAipBD,QAAA,MAAM,KAAK,GAAI,qBAGZ;IACD,KAAK,EAAE,KAAK,EAAE,CAAC;IACf,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,KAAG,YAUH,CAAC;AA6JF,QAAA,MAAM,aAAa,GAAI,qBAGpB;IACD,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,KAAG,YAsHH,CAAC;AAgRF,QAAA,MAAM,QAAQ,GAAI,WAAW;IAAE,KAAK,EAAE,UAAU,CAAA;CAAE,KAAG,YA4CpD,CAAC;AAwCF,QAAA,MAAM,OAAO,GAAI,2BAGd;IACD,KAAK,EAAE,SAAS,CAAC;IACjB,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,KAAG,YAwGH,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;AAEF,KAAK,cAAc,GAAG,KAAK,GAAG,MAAM,GAAG,WAAW,CAAC;AAEnD,QAAA,MAAM,iBAAiB,GAAI,cAExB;IACD,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B,KAAG,YAqFH,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,EAAE,WAAW,EAAE,YAAY,EAAuB,MAAM,OAAO,CAAC;AA6G9E,KAAK,UAAU,GAAG,MAAM,GAAG,U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