@adecore/editor-react 0.31.12 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AnchoredPopup.js +73 -19
- package/dist/AttributionCard.js +162 -4
- package/dist/BaselineStatus.js +62 -8
- package/dist/CallHierarchyPanel.js +977 -60
- package/dist/ChangeReview.js +76 -25
- package/dist/CodeAuthorsCard.js +314 -14
- package/dist/CompletionPopup.js +490 -83
- package/dist/DiffView.js +548 -181
- package/dist/EditorContextMenu.js +352 -34
- package/dist/EditorView.js +276 -99
- package/dist/FindReplace.js +525 -67
- package/dist/HoverCard.js +378 -38
- package/dist/HoverSections.js +367 -56
- package/dist/LanguagePopups.js +95 -34
- package/dist/Markdown.js +41 -6
- package/dist/PanelResizeHandle.js +199 -66
- package/dist/PathText.js +49 -7
- package/dist/PeekPanel.js +675 -72
- package/dist/PickPopup.js +304 -34
- package/dist/RenameCard.js +679 -85
- package/dist/RenderedDocs.js +329 -58
- package/dist/SignatureCard.js +91 -7
- package/dist/SplitDiffView.js +344 -254
- package/dist/SymbolPicker.js +440 -85
- package/dist/call-hierarchy-model.js +102 -68
- package/dist/call-hierarchy.js +458 -359
- package/dist/code-actions-model.js +88 -76
- package/dist/code-actions.js +372 -283
- package/dist/code-authors.js +64 -55
- package/dist/code-vision-model.js +134 -127
- package/dist/code-vision.js +224 -206
- package/dist/completion-call.js +94 -67
- package/dist/completion-model.js +334 -244
- package/dist/completion.js +840 -649
- package/dist/conflict-model.js +35 -29
- package/dist/context-menu-rows.js +42 -17
- package/dist/context-menu.js +64 -46
- package/dist/definition-link.js +88 -85
- package/dist/diagnostics-model.js +74 -55
- package/dist/diagnostics.js +121 -100
- package/dist/diff-expansion.js +38 -35
- package/dist/diff-overlays.js +144 -22
- package/dist/diff-syntax.js +65 -42
- package/dist/diff-wordmarks.js +26 -23
- package/dist/doc-comment-model.js +265 -216
- package/dist/editor-language.js +177 -152
- package/dist/error-message.js +2 -2
- package/dist/find-query.js +49 -36
- package/dist/folding.js +81 -62
- package/dist/format-on-type.js +86 -67
- package/dist/highlight-layers.js +19 -20
- package/dist/highlights.js +105 -83
- package/dist/history.js +44 -38
- package/dist/holder.js +18 -18
- package/dist/host-types.js +1 -1
- package/dist/hover-content.js +167 -129
- package/dist/hover.js +285 -245
- package/dist/index.js +10 -10
- package/dist/inlay-hints.js +369 -324
- package/dist/key-priority.js +34 -31
- package/dist/language-ids.js +45 -42
- package/dist/line-edits.js +74 -28
- package/dist/line-text.js +18 -3
- package/dist/locales/en.json +38 -38
- package/dist/locales/nl.json +41 -41
- package/dist/models.js +1 -1
- package/dist/navigation-history.js +40 -41
- package/dist/navigation.js +141 -123
- package/dist/panel-size.js +8 -8
- package/dist/patch-decorations.js +236 -160
- package/dist/patch-layout.js +331 -262
- package/dist/paths.js +3 -3
- package/dist/peek-model.js +86 -69
- package/dist/peek.js +254 -192
- package/dist/pick.js +164 -157
- package/dist/popup-focus.js +5 -5
- package/dist/popup-placement.js +36 -21
- package/dist/popups.js +13 -13
- package/dist/project-language.js +228 -211
- package/dist/project-problems.js +81 -69
- package/dist/proposal-model.js +163 -126
- package/dist/recent-choices.js +25 -25
- package/dist/refresher.js +44 -49
- package/dist/rename-model.js +113 -113
- package/dist/rename.js +321 -233
- package/dist/rendered-docs.d.ts +4 -2
- package/dist/rendered-docs.js +384 -318
- package/dist/rendering-context.js +5 -3
- package/dist/rendering.js +22 -4
- package/dist/review-group.js +42 -39
- package/dist/row-host.d.ts +4 -2
- package/dist/row-host.js +90 -78
- package/dist/selection-ranges.js +21 -17
- package/dist/semantic-delta.js +22 -19
- package/dist/semantic-model.js +86 -73
- package/dist/semantic-tokens.js +201 -162
- package/dist/shortcut-keys.js +16 -10
- package/dist/signature-model.js +34 -28
- package/dist/signature.js +177 -129
- package/dist/snippet-field-transforms.js +118 -106
- package/dist/snippet-indent.js +48 -43
- package/dist/snippet-range-order.js +11 -11
- package/dist/snippet-session.js +703 -667
- package/dist/snippet-transform-client.js +59 -59
- package/dist/snippet-transform-format.js +285 -263
- package/dist/snippet-transform-protocol.js +1 -1
- package/dist/snippet-transform-queue.js +163 -153
- package/dist/snippet-transform-worker.js +42 -35
- package/dist/snippet-variable-names.js +1 -36
- package/dist/snippet-variables.js +53 -63
- package/dist/snippet.js +477 -405
- package/dist/split-alignment.js +47 -35
- package/dist/split-scroll.js +42 -40
- package/dist/symbol-links.js +33 -25
- package/dist/symbol-picker-model.js +126 -116
- package/dist/symbol-picker.js +98 -59
- package/dist/symbols.js +117 -88
- package/dist/testing.js +248 -165
- package/dist/timers.js +35 -30
- package/dist/use-panel-body.js +49 -8
- package/dist/use-problem-counts.js +29 -15
- package/dist/view-state.js +54 -33
- package/dist/word-diff.js +18 -18
- package/dist/workspace-edit.js +300 -249
- package/package.json +6 -6
- package/src/CallHierarchyPanel.tsx +2 -2
- package/src/DiffView.tsx +3 -3
- package/src/FindReplace.tsx +2 -2
- package/src/LanguagePopups.tsx +2 -0
- package/src/PeekPanel.tsx +3 -3
- package/src/RenderedDocs.tsx +9 -10
- package/src/SymbolPicker.tsx +2 -2
- package/src/diff-overlays.tsx +6 -4
- package/src/locales/en.json +38 -38
- package/src/locales/nl.json +41 -41
- package/src/rendered-docs.ts +14 -3
- package/src/row-host.ts +14 -3
package/dist/RenderedDocs.js
CHANGED
|
@@ -1,88 +1,359 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
import { memo, useSyncExternalStore } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { DOC_LINK_PREFIX, sectionsOf } from './doc-comment-model.js';
|
|
6
6
|
import { markdownParts } from './hover-content.js';
|
|
7
|
-
import { Signature } from
|
|
7
|
+
import { Signature } from "./HoverSections.js";
|
|
8
8
|
import { shikiLanguageOf } from './language-ids.js';
|
|
9
|
-
import { Markdown } from
|
|
9
|
+
import { Markdown } from "./Markdown.js";
|
|
10
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
11
|
const LINK = /\[([^\]]*)\]\(#doc-link:[^)]*\)/g;
|
|
11
|
-
const KNOWN = new Set([
|
|
12
|
-
'deprecated',
|
|
13
|
-
'template',
|
|
14
|
-
'param',
|
|
15
|
-
'property',
|
|
16
|
-
'type',
|
|
17
|
-
'var',
|
|
18
|
-
'return',
|
|
19
|
-
'yield',
|
|
20
|
-
'throws',
|
|
21
|
-
'see',
|
|
22
|
-
'example',
|
|
23
|
-
'since',
|
|
24
|
-
'version',
|
|
25
|
-
'author'
|
|
26
|
-
]);
|
|
12
|
+
const KNOWN = new Set(['deprecated', 'template', 'param', 'property', 'type', 'var', 'return', 'yield', 'throws', 'see', 'example', 'since', 'version', 'author']);
|
|
27
13
|
/* Code in the editor's face, with a type fainter than a name. */
|
|
28
|
-
function Code(
|
|
29
|
-
|
|
14
|
+
function Code(t0) {
|
|
15
|
+
const $ = _c(3);
|
|
16
|
+
const {
|
|
17
|
+
children,
|
|
18
|
+
faint: t1
|
|
19
|
+
} = t0;
|
|
20
|
+
const faint = t1 === undefined ? false : t1;
|
|
21
|
+
const t2 = `font-mono text-code break-words ${faint ? "text-text-faint" : "text-text"}`;
|
|
22
|
+
let t3;
|
|
23
|
+
if ($[0] !== children || $[1] !== t2) {
|
|
24
|
+
t3 = /*#__PURE__*/_jsx("code", {
|
|
25
|
+
className: t2,
|
|
26
|
+
children: children
|
|
27
|
+
});
|
|
28
|
+
$[0] = children;
|
|
29
|
+
$[1] = t2;
|
|
30
|
+
$[2] = t3;
|
|
31
|
+
} else {
|
|
32
|
+
t3 = $[2];
|
|
33
|
+
}
|
|
34
|
+
return t3;
|
|
30
35
|
}
|
|
31
36
|
/* Markdown prose and fenced code as the hover draws them: the blocks in the code face, the rest muted. */
|
|
32
|
-
function Prose(
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
function Prose(t0) {
|
|
38
|
+
const $ = _c(10);
|
|
39
|
+
const {
|
|
40
|
+
text,
|
|
41
|
+
language,
|
|
42
|
+
linkable,
|
|
43
|
+
compact: t1
|
|
44
|
+
} = t0;
|
|
45
|
+
const compact = t1 === undefined ? false : t1;
|
|
46
|
+
let t2;
|
|
47
|
+
if ($[0] !== compact || $[1] !== language || $[2] !== linkable || $[3] !== text) {
|
|
48
|
+
const plain = linkable ? text : text.replace(LINK, "$1");
|
|
49
|
+
let t3;
|
|
50
|
+
if ($[5] !== compact || $[6] !== language) {
|
|
51
|
+
t3 = (part, index) => part.kind === "code" ? /*#__PURE__*/_jsx("div", {
|
|
52
|
+
className: "rounded-md bg-surface-sunken px-2 py-1.5",
|
|
53
|
+
children: /*#__PURE__*/_jsx(Signature, {
|
|
54
|
+
code: part.block.code,
|
|
55
|
+
language: part.block.language === "text" ? language : part.block.language
|
|
56
|
+
})
|
|
57
|
+
}, index) : /*#__PURE__*/_jsx("div", {
|
|
58
|
+
className: `[&_.adecore-editor-markdown]:text-xs ${compact ? "[&_p]:my-0" : "[&_p]:my-1"}`,
|
|
59
|
+
children: /*#__PURE__*/_jsx(Markdown, {
|
|
60
|
+
text: part.text,
|
|
61
|
+
images: false
|
|
62
|
+
})
|
|
63
|
+
}, index);
|
|
64
|
+
$[5] = compact;
|
|
65
|
+
$[6] = language;
|
|
66
|
+
$[7] = t3;
|
|
67
|
+
} else {
|
|
68
|
+
t3 = $[7];
|
|
69
|
+
}
|
|
70
|
+
t2 = markdownParts(plain).map(t3);
|
|
71
|
+
$[0] = compact;
|
|
72
|
+
$[1] = language;
|
|
73
|
+
$[2] = linkable;
|
|
74
|
+
$[3] = text;
|
|
75
|
+
$[4] = t2;
|
|
76
|
+
} else {
|
|
77
|
+
t2 = $[4];
|
|
78
|
+
}
|
|
79
|
+
let t3;
|
|
80
|
+
if ($[8] !== t2) {
|
|
81
|
+
t3 = /*#__PURE__*/_jsx(_Fragment, {
|
|
82
|
+
children: t2
|
|
83
|
+
});
|
|
84
|
+
$[8] = t2;
|
|
85
|
+
$[9] = t3;
|
|
86
|
+
} else {
|
|
87
|
+
t3 = $[9];
|
|
88
|
+
}
|
|
89
|
+
return t3;
|
|
35
90
|
}
|
|
36
91
|
/* A value of a tag, in the second column of the table; `spaced` opens a new section with more room above. */
|
|
37
|
-
function TagRow(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
92
|
+
function TagRow(t0) {
|
|
93
|
+
const $ = _c(14);
|
|
94
|
+
const {
|
|
95
|
+
tag,
|
|
96
|
+
language,
|
|
97
|
+
linkable,
|
|
98
|
+
spaced
|
|
99
|
+
} = t0;
|
|
100
|
+
const target = tag.name === "see" && tag.subject !== null ? tag.subject : null;
|
|
101
|
+
let t1;
|
|
102
|
+
if ($[0] !== target) {
|
|
103
|
+
t1 = target === null ? null : /^https?:\/\//i.test(target) ? `[${target}](${target})` : `[\`${target}\`](${DOC_LINK_PREFIX}${encodeURIComponent(target)})`;
|
|
104
|
+
$[0] = target;
|
|
105
|
+
$[1] = t1;
|
|
106
|
+
} else {
|
|
107
|
+
t1 = $[1];
|
|
108
|
+
}
|
|
109
|
+
const link = t1;
|
|
110
|
+
const t2 = `col-start-2 m-0 flex min-w-0 flex-wrap items-baseline gap-x-2 ${spaced ? "mt-1" : ""}`;
|
|
111
|
+
let t3;
|
|
112
|
+
if ($[2] !== language || $[3] !== link || $[4] !== linkable || $[5] !== tag.name || $[6] !== tag.subject || $[7] !== tag.text || $[8] !== tag.type || $[9] !== target) {
|
|
113
|
+
t3 = tag.name === "example" ? /*#__PURE__*/_jsx("div", {
|
|
114
|
+
className: "w-full rounded-md bg-surface-sunken px-2 py-1.5",
|
|
115
|
+
children: /*#__PURE__*/_jsx(Signature, {
|
|
116
|
+
code: tag.text,
|
|
117
|
+
language: language
|
|
118
|
+
})
|
|
119
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
120
|
+
children: [tag.subject !== null && target === null && /*#__PURE__*/_jsx(Code, {
|
|
121
|
+
children: tag.subject
|
|
122
|
+
}), tag.type !== null && /*#__PURE__*/_jsx(Code, {
|
|
123
|
+
faint: true,
|
|
124
|
+
children: tag.type
|
|
125
|
+
}), (link !== null || tag.text !== "") && /*#__PURE__*/_jsx("div", {
|
|
126
|
+
className: "min-w-0 grow basis-48 text-text",
|
|
127
|
+
children: /*#__PURE__*/_jsx(Prose, {
|
|
128
|
+
text: [link, tag.text].filter(_temp).join(" "),
|
|
129
|
+
language: language,
|
|
130
|
+
linkable: linkable,
|
|
131
|
+
compact: true
|
|
132
|
+
})
|
|
133
|
+
})]
|
|
134
|
+
});
|
|
135
|
+
$[2] = language;
|
|
136
|
+
$[3] = link;
|
|
137
|
+
$[4] = linkable;
|
|
138
|
+
$[5] = tag.name;
|
|
139
|
+
$[6] = tag.subject;
|
|
140
|
+
$[7] = tag.text;
|
|
141
|
+
$[8] = tag.type;
|
|
142
|
+
$[9] = target;
|
|
143
|
+
$[10] = t3;
|
|
144
|
+
} else {
|
|
145
|
+
t3 = $[10];
|
|
146
|
+
}
|
|
147
|
+
let t4;
|
|
148
|
+
if ($[11] !== t2 || $[12] !== t3) {
|
|
149
|
+
t4 = /*#__PURE__*/_jsx("dd", {
|
|
150
|
+
className: t2,
|
|
151
|
+
children: t3
|
|
152
|
+
});
|
|
153
|
+
$[11] = t2;
|
|
154
|
+
$[12] = t3;
|
|
155
|
+
$[13] = t4;
|
|
156
|
+
} else {
|
|
157
|
+
t4 = $[13];
|
|
158
|
+
}
|
|
159
|
+
return t4;
|
|
41
160
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
161
|
+
function _temp(part) {
|
|
162
|
+
return part !== null && part !== "";
|
|
163
|
+
}
|
|
164
|
+
function DocBlock(t0) {
|
|
165
|
+
const $ = _c(19);
|
|
166
|
+
const {
|
|
167
|
+
language,
|
|
168
|
+
comment,
|
|
169
|
+
parsed,
|
|
170
|
+
linkable
|
|
171
|
+
} = t0;
|
|
172
|
+
const {
|
|
173
|
+
t
|
|
174
|
+
} = useTranslation("editor");
|
|
175
|
+
const feature = language.renderedDocs;
|
|
176
|
+
const {
|
|
177
|
+
description,
|
|
178
|
+
tags
|
|
179
|
+
} = parsed;
|
|
180
|
+
let t1;
|
|
181
|
+
if ($[0] !== language.languageId) {
|
|
182
|
+
t1 = shikiLanguageOf(language.languageId);
|
|
183
|
+
$[0] = language.languageId;
|
|
184
|
+
$[1] = t1;
|
|
185
|
+
} else {
|
|
186
|
+
t1 = $[1];
|
|
187
|
+
}
|
|
188
|
+
const highlighter = t1;
|
|
189
|
+
let t2;
|
|
190
|
+
if ($[2] !== comment || $[3] !== description || $[4] !== feature || $[5] !== highlighter || $[6] !== language.apple || $[7] !== linkable || $[8] !== t || $[9] !== tags) {
|
|
47
191
|
const sections = sectionsOf(tags);
|
|
48
|
-
const deprecated = sections.find(
|
|
49
|
-
const shown = sections.filter(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
192
|
+
const deprecated = sections.find(_temp2);
|
|
193
|
+
const shown = sections.filter(_temp3);
|
|
194
|
+
let t3;
|
|
195
|
+
if ($[11] !== comment || $[12] !== feature || $[13] !== language.apple) {
|
|
196
|
+
t3 = event => {
|
|
197
|
+
const anchor = event.target.closest("a");
|
|
53
198
|
if (anchor === null) {
|
|
54
|
-
|
|
199
|
+
return;
|
|
55
200
|
}
|
|
56
201
|
event.preventDefault();
|
|
57
202
|
const mod = language.apple ? event.metaKey : event.ctrlKey;
|
|
58
|
-
const href = anchor.getAttribute(
|
|
203
|
+
const href = anchor.getAttribute("href") ?? "";
|
|
59
204
|
if (!mod) {
|
|
60
|
-
|
|
205
|
+
return;
|
|
61
206
|
}
|
|
62
207
|
if (href.startsWith(DOC_LINK_PREFIX)) {
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
window.open(href,
|
|
208
|
+
feature.follow(decodeURIComponent(href.slice(DOC_LINK_PREFIX.length)), comment);
|
|
209
|
+
} else {
|
|
210
|
+
if (/^(https?:|mailto:)/i.test(href)) {
|
|
211
|
+
window.open(href, "_blank", "noopener,noreferrer");
|
|
212
|
+
}
|
|
67
213
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
214
|
+
};
|
|
215
|
+
$[11] = comment;
|
|
216
|
+
$[12] = feature;
|
|
217
|
+
$[13] = language.apple;
|
|
218
|
+
$[14] = t3;
|
|
219
|
+
} else {
|
|
220
|
+
t3 = $[14];
|
|
221
|
+
}
|
|
222
|
+
const follow = t3;
|
|
223
|
+
let t4;
|
|
224
|
+
if ($[15] !== description || $[16] !== highlighter || $[17] !== linkable) {
|
|
225
|
+
t4 = description !== "" && /*#__PURE__*/_jsx("div", {
|
|
226
|
+
className: "text-text",
|
|
227
|
+
children: /*#__PURE__*/_jsx(Prose, {
|
|
228
|
+
text: description,
|
|
229
|
+
language: highlighter,
|
|
230
|
+
linkable: linkable
|
|
231
|
+
})
|
|
232
|
+
});
|
|
233
|
+
$[15] = description;
|
|
234
|
+
$[16] = highlighter;
|
|
235
|
+
$[17] = linkable;
|
|
236
|
+
$[18] = t4;
|
|
237
|
+
} else {
|
|
238
|
+
t4 = $[18];
|
|
239
|
+
}
|
|
240
|
+
t2 = /*#__PURE__*/_jsxs("div", {
|
|
241
|
+
className: "adecore-rendered-doc flex max-w-[520px] flex-col gap-1.5 py-1 font-sans text-xs/[18px] text-text select-text",
|
|
242
|
+
onClick: follow,
|
|
243
|
+
children: [deprecated !== undefined && /*#__PURE__*/_jsxs("div", {
|
|
244
|
+
className: "border-l-2 border-status-error pl-2 text-text-muted",
|
|
245
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
246
|
+
className: "font-medium text-status-error",
|
|
247
|
+
children: t("language.docs.deprecated")
|
|
248
|
+
}), deprecated.tags.some(_temp4) && /*#__PURE__*/_jsx(Prose, {
|
|
249
|
+
text: deprecated.tags.map(_temp5).join(" "),
|
|
250
|
+
language: highlighter,
|
|
251
|
+
linkable: linkable
|
|
252
|
+
})]
|
|
253
|
+
}), t4, shown.length > 0 && /*#__PURE__*/_jsx("dl", {
|
|
254
|
+
className: "m-0 grid grid-cols-[max-content_minmax(0,1fr)] items-baseline gap-x-3 gap-y-0.5",
|
|
255
|
+
children: shown.map((section_1, row) => [/*#__PURE__*/_jsx("dt", {
|
|
256
|
+
className: `col-start-1 font-medium text-text-muted ${row > 0 ? "mt-1" : ""}`,
|
|
257
|
+
children: KNOWN.has(section_1.name) ? t(`language.docs.tags.${section_1.name}`) : `${section_1.name}:`
|
|
258
|
+
}, `${section_1.name}:label`), ...section_1.tags.map((tag_1, index) => /*#__PURE__*/_jsx(TagRow, {
|
|
259
|
+
tag: tag_1,
|
|
260
|
+
language: highlighter,
|
|
261
|
+
linkable: linkable,
|
|
262
|
+
spaced: row > 0 && index === 0
|
|
263
|
+
}, `${section_1.name}:${index}`))])
|
|
264
|
+
})]
|
|
265
|
+
});
|
|
266
|
+
$[2] = comment;
|
|
267
|
+
$[3] = description;
|
|
268
|
+
$[4] = feature;
|
|
269
|
+
$[5] = highlighter;
|
|
270
|
+
$[6] = language.apple;
|
|
271
|
+
$[7] = linkable;
|
|
272
|
+
$[8] = t;
|
|
273
|
+
$[9] = tags;
|
|
274
|
+
$[10] = t2;
|
|
275
|
+
} else {
|
|
276
|
+
t2 = $[10];
|
|
277
|
+
}
|
|
278
|
+
return t2;
|
|
73
279
|
}
|
|
74
280
|
/* Drawn again only when its comment or its links change, since every scroll of the editor draws the popups again. */
|
|
281
|
+
function _temp5(tag) {
|
|
282
|
+
return tag.text;
|
|
283
|
+
}
|
|
284
|
+
function _temp4(tag_0) {
|
|
285
|
+
return tag_0.text !== "";
|
|
286
|
+
}
|
|
287
|
+
function _temp3(section_0) {
|
|
288
|
+
return section_0.name !== "deprecated";
|
|
289
|
+
}
|
|
290
|
+
function _temp2(section) {
|
|
291
|
+
return section.name === "deprecated";
|
|
292
|
+
}
|
|
75
293
|
export const RenderedDocBlock = memo(DocBlock);
|
|
76
294
|
/*
|
|
77
295
|
* The documentation comments the editor drew as rows, filled with their formatted text. It portals into
|
|
78
296
|
* the element the editor made for each row, so the editor decides what is in view; a comment is parsed
|
|
79
297
|
* only once its row is. Links in the text are followed with Cmd (Ctrl elsewhere) held, as definitions are.
|
|
80
298
|
*/
|
|
81
|
-
export function RenderedDocs(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
299
|
+
export function RenderedDocs(t0) {
|
|
300
|
+
const $ = _c(13);
|
|
301
|
+
const {
|
|
302
|
+
language
|
|
303
|
+
} = t0;
|
|
304
|
+
const feature = language.renderedDocs;
|
|
305
|
+
let t1;
|
|
306
|
+
if ($[0] !== feature) {
|
|
307
|
+
t1 = () => feature.getEntries();
|
|
308
|
+
$[0] = feature;
|
|
309
|
+
$[1] = t1;
|
|
310
|
+
} else {
|
|
311
|
+
t1 = $[1];
|
|
312
|
+
}
|
|
313
|
+
const getEntries = t1;
|
|
314
|
+
let t2;
|
|
315
|
+
if ($[2] !== feature) {
|
|
316
|
+
t2 = listener => feature.subscribe(listener);
|
|
317
|
+
$[2] = feature;
|
|
318
|
+
$[3] = t2;
|
|
319
|
+
} else {
|
|
320
|
+
t2 = $[3];
|
|
321
|
+
}
|
|
322
|
+
const entries = useSyncExternalStore(t2, getEntries, getEntries);
|
|
323
|
+
const linkable = feature.canFollow;
|
|
324
|
+
let t3;
|
|
325
|
+
if ($[4] !== entries || $[5] !== language || $[6] !== linkable) {
|
|
326
|
+
let t4;
|
|
327
|
+
if ($[8] !== language || $[9] !== linkable) {
|
|
328
|
+
t4 = entry => createPortal(/*#__PURE__*/_jsx(RenderedDocBlock, {
|
|
329
|
+
language: language,
|
|
330
|
+
comment: entry.comment,
|
|
331
|
+
parsed: entry.parsed,
|
|
332
|
+
linkable: linkable
|
|
333
|
+
}), entry.container, entry.id);
|
|
334
|
+
$[8] = language;
|
|
335
|
+
$[9] = linkable;
|
|
336
|
+
$[10] = t4;
|
|
337
|
+
} else {
|
|
338
|
+
t4 = $[10];
|
|
339
|
+
}
|
|
340
|
+
t3 = entries.map(t4);
|
|
341
|
+
$[4] = entries;
|
|
342
|
+
$[5] = language;
|
|
343
|
+
$[6] = linkable;
|
|
344
|
+
$[7] = t3;
|
|
345
|
+
} else {
|
|
346
|
+
t3 = $[7];
|
|
347
|
+
}
|
|
348
|
+
let t4;
|
|
349
|
+
if ($[11] !== t3) {
|
|
350
|
+
t4 = /*#__PURE__*/_jsx(_Fragment, {
|
|
351
|
+
children: t3
|
|
352
|
+
});
|
|
353
|
+
$[11] = t3;
|
|
354
|
+
$[12] = t4;
|
|
355
|
+
} else {
|
|
356
|
+
t4 = $[12];
|
|
357
|
+
}
|
|
358
|
+
return t4;
|
|
359
|
+
}
|
package/dist/SignatureCard.js
CHANGED
|
@@ -1,8 +1,92 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Markdown } from
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { Markdown } from "./Markdown.js";
|
|
3
3
|
/* The signature with the parameter being typed underlined, and what is said about that parameter below it. */
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
export function SignatureCard(t0) {
|
|
6
|
+
const $ = _c(16);
|
|
7
|
+
const {
|
|
8
|
+
model
|
|
9
|
+
} = t0;
|
|
10
|
+
const {
|
|
11
|
+
label,
|
|
12
|
+
active
|
|
13
|
+
} = model;
|
|
14
|
+
const documentation = model.parameterDocumentation !== "" ? model.parameterDocumentation : model.documentation;
|
|
15
|
+
let t1;
|
|
16
|
+
if ($[0] !== active || $[1] !== label) {
|
|
17
|
+
t1 = active === null ? label : /*#__PURE__*/_jsxs(_Fragment, {
|
|
18
|
+
children: [label.slice(0, active.start), /*#__PURE__*/_jsx("span", {
|
|
19
|
+
className: "font-semibold text-text underline decoration-2 underline-offset-2",
|
|
20
|
+
children: label.slice(active.start, active.end)
|
|
21
|
+
}), label.slice(active.end)]
|
|
22
|
+
});
|
|
23
|
+
$[0] = active;
|
|
24
|
+
$[1] = label;
|
|
25
|
+
$[2] = t1;
|
|
26
|
+
} else {
|
|
27
|
+
t1 = $[2];
|
|
28
|
+
}
|
|
29
|
+
let t2;
|
|
30
|
+
if ($[3] !== model.count || $[4] !== model.index) {
|
|
31
|
+
t2 = model.count > 1 && /*#__PURE__*/_jsxs("span", {
|
|
32
|
+
className: "ml-2 font-sans text-xs text-text-faint",
|
|
33
|
+
children: [model.index + 1, "/", model.count]
|
|
34
|
+
});
|
|
35
|
+
$[3] = model.count;
|
|
36
|
+
$[4] = model.index;
|
|
37
|
+
$[5] = t2;
|
|
38
|
+
} else {
|
|
39
|
+
t2 = $[5];
|
|
40
|
+
}
|
|
41
|
+
let t3;
|
|
42
|
+
if ($[6] !== t1 || $[7] !== t2) {
|
|
43
|
+
t3 = /*#__PURE__*/_jsxs("div", {
|
|
44
|
+
className: "px-3 py-2 font-mono text-code break-words whitespace-pre-wrap text-text-muted",
|
|
45
|
+
children: [t1, t2]
|
|
46
|
+
});
|
|
47
|
+
$[6] = t1;
|
|
48
|
+
$[7] = t2;
|
|
49
|
+
$[8] = t3;
|
|
50
|
+
} else {
|
|
51
|
+
t3 = $[8];
|
|
52
|
+
}
|
|
53
|
+
let t4;
|
|
54
|
+
if ($[9] !== documentation || $[10] !== model.parameterDocumentation || $[11] !== model.parameterName) {
|
|
55
|
+
t4 = documentation !== "" && /*#__PURE__*/_jsxs("div", {
|
|
56
|
+
className: "flex items-baseline gap-1.5 px-3 py-2 text-xs text-text-muted select-text [&_.adecore-editor-markdown]:text-xs [&_.adecore-editor-markdown_p]:m-0",
|
|
57
|
+
children: [model.parameterName !== "" && model.parameterDocumentation !== "" && /*#__PURE__*/_jsxs(_Fragment, {
|
|
58
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
59
|
+
className: "shrink-0 font-semibold text-text",
|
|
60
|
+
children: model.parameterName
|
|
61
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
62
|
+
"aria-hidden": true,
|
|
63
|
+
children: "\xB7"
|
|
64
|
+
})]
|
|
65
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
66
|
+
className: "min-w-0",
|
|
67
|
+
children: /*#__PURE__*/_jsx(Markdown, {
|
|
68
|
+
text: documentation
|
|
69
|
+
})
|
|
70
|
+
})]
|
|
71
|
+
});
|
|
72
|
+
$[9] = documentation;
|
|
73
|
+
$[10] = model.parameterDocumentation;
|
|
74
|
+
$[11] = model.parameterName;
|
|
75
|
+
$[12] = t4;
|
|
76
|
+
} else {
|
|
77
|
+
t4 = $[12];
|
|
78
|
+
}
|
|
79
|
+
let t5;
|
|
80
|
+
if ($[13] !== t3 || $[14] !== t4) {
|
|
81
|
+
t5 = /*#__PURE__*/_jsxs("div", {
|
|
82
|
+
className: "flex w-max max-w-[min(560px,calc(100vw-16px))] min-w-[240px] flex-col divide-y divide-border",
|
|
83
|
+
children: [t3, t4]
|
|
84
|
+
});
|
|
85
|
+
$[13] = t3;
|
|
86
|
+
$[14] = t4;
|
|
87
|
+
$[15] = t5;
|
|
88
|
+
} else {
|
|
89
|
+
t5 = $[15];
|
|
90
|
+
}
|
|
91
|
+
return t5;
|
|
92
|
+
}
|