@adecore/editor-react 0.53.2 → 0.54.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.d.ts +1 -1
- package/dist/AnchoredPopup.js +27 -12
- package/dist/AttributionCard.d.ts +1 -1
- package/dist/BaselineStatus.js +1 -1
- package/dist/CallHierarchyPanel.js +11 -10
- package/dist/ChangeReview.d.ts +1 -1
- package/dist/CodeAuthorsCard.js +2 -2
- package/dist/CompletionPopup.js +18 -14
- package/dist/DiffView.d.ts +2 -2
- package/dist/DiffView.js +159 -143
- package/dist/EditorContextMenu.js +1 -1
- package/dist/EditorView.d.ts +2 -2
- package/dist/EditorView.js +97 -81
- package/dist/FindReplace.js +3 -3
- package/dist/HoverCard.d.ts +3 -3
- package/dist/HoverCard.js +3 -3
- package/dist/HoverSections.js +1 -1
- package/dist/LanguagePopups.js +1 -1
- package/dist/Markdown.js +15 -3
- package/dist/PeekPanel.js +124 -103
- package/dist/PickPopup.js +8 -4
- package/dist/RenameCard.js +7 -7
- package/dist/RenderedDocs.d.ts +1 -1
- package/dist/RenderedDocs.js +1 -1
- package/dist/SplitDiffView.js +21 -4
- package/dist/SymbolPicker.js +93 -89
- package/dist/WrapCard.js +1 -1
- package/dist/call-hierarchy.d.ts +1 -1
- package/dist/call-hierarchy.js +3 -3
- package/dist/code-actions.js +2 -2
- package/dist/code-vision.d.ts +1 -1
- package/dist/completion-model.d.ts +1 -1
- package/dist/completion-model.js +2 -2
- package/dist/completion.d.ts +1 -1
- package/dist/completion.js +12 -12
- package/dist/diagnostics.d.ts +1 -1
- package/dist/diagnostics.js +1 -1
- package/dist/diff-overlays.js +2 -2
- package/dist/editor-language.d.ts +12 -12
- package/dist/editor-language.js +10 -10
- package/dist/editor-react.css +4 -4
- package/dist/highlights.d.ts +1 -1
- package/dist/highlights.js +2 -2
- package/dist/host-types.d.ts +4 -4
- package/dist/hover.js +1 -1
- package/dist/inlay-hints.js +1 -1
- package/dist/live-templates.js +1 -1
- package/dist/markup.js +1 -1
- package/dist/navigation.d.ts +1 -1
- package/dist/navigation.js +3 -3
- package/dist/peek.js +1 -1
- package/dist/popups.d.ts +5 -5
- package/dist/project-language.d.ts +4 -4
- package/dist/project-language.js +5 -5
- package/dist/rename.js +1 -1
- package/dist/rendered-docs.d.ts +1 -1
- package/dist/rendered-docs.js +1 -1
- package/dist/shortcut-keys.d.ts +1 -1
- package/dist/signature.js +1 -1
- package/dist/snippet-field-transforms.d.ts +2 -2
- package/dist/snippet-insert.js +3 -3
- package/dist/snippet-session.d.ts +2 -2
- package/dist/snippet-session.js +5 -5
- package/dist/snippet-transform-queue.d.ts +1 -1
- package/dist/surround.js +1 -1
- package/dist/symbol-picker.js +2 -2
- package/dist/templates.js +1 -1
- package/dist/use-problem-counts.d.ts +1 -1
- package/package.json +6 -6
- package/src/AnchoredPopup.tsx +7 -3
- package/src/AttributionCard.tsx +1 -1
- package/src/BaselineStatus.tsx +1 -1
- package/src/CallHierarchyPanel.tsx +13 -12
- package/src/ChangeReview.tsx +1 -1
- package/src/CodeAuthorsCard.tsx +2 -2
- package/src/CompletionPopup.tsx +16 -13
- package/src/DiffView.tsx +12 -6
- package/src/EditorContextMenu.tsx +2 -2
- package/src/EditorView.tsx +14 -6
- package/src/FindReplace.tsx +3 -3
- package/src/HoverCard.tsx +7 -7
- package/src/HoverSections.tsx +1 -1
- package/src/LanguagePopups.tsx +3 -3
- package/src/Markdown.tsx +13 -2
- package/src/PeekPanel.tsx +13 -13
- package/src/PickPopup.tsx +6 -5
- package/src/RenameCard.tsx +8 -8
- package/src/RenderedDocs.tsx +3 -3
- package/src/SplitDiffView.tsx +14 -5
- package/src/SymbolPicker.tsx +6 -6
- package/src/WrapCard.tsx +2 -2
- package/src/call-hierarchy.ts +5 -5
- package/src/code-actions.ts +3 -3
- package/src/code-authors.ts +1 -1
- package/src/code-vision.ts +3 -3
- package/src/completion-model.ts +3 -3
- package/src/completion.ts +15 -15
- package/src/diagnostics.ts +4 -4
- package/src/diff-overlays.tsx +4 -4
- package/src/editor-language.ts +13 -13
- package/src/editor-react.css +4 -4
- package/src/format-on-type.ts +1 -1
- package/src/highlights.ts +3 -3
- package/src/host-types.ts +4 -4
- package/src/hover.ts +3 -3
- package/src/inlay-hints.ts +1 -1
- package/src/line-edits.ts +1 -1
- package/src/live-templates.ts +2 -2
- package/src/markup.ts +2 -2
- package/src/navigation.ts +5 -5
- package/src/patch-decorations.ts +1 -1
- package/src/peek.ts +3 -3
- package/src/pick.ts +1 -1
- package/src/popups.ts +5 -5
- package/src/postfix.ts +1 -1
- package/src/project-language.ts +7 -7
- package/src/proposal-model.ts +1 -1
- package/src/rename.ts +3 -3
- package/src/rendered-docs.ts +2 -2
- package/src/shortcut-keys.ts +1 -1
- package/src/signature.ts +3 -3
- package/src/snippet-field-transforms.ts +2 -2
- package/src/snippet-insert.ts +3 -3
- package/src/snippet-session.ts +7 -7
- package/src/snippet-transform-queue.ts +1 -1
- package/src/surround.ts +1 -1
- package/src/symbol-picker-model.ts +1 -1
- package/src/symbol-picker.ts +3 -3
- package/src/templates.ts +1 -1
- package/src/use-problem-counts.ts +1 -1
- package/src/workspace-edit.ts +1 -1
package/dist/live-templates.js
CHANGED
|
@@ -2,8 +2,8 @@ import { identifierPrefix, isIdentifierCharacter } from './completion-model.js';
|
|
|
2
2
|
import { comparePositions } from './diagnostics-model.js';
|
|
3
3
|
import { KEY_PRIORITY } from './key-priority.js';
|
|
4
4
|
import { textBeforeOf } from './line-text.js';
|
|
5
|
-
import { isShortcut } from './shortcut-keys.js';
|
|
6
5
|
import { PostfixFeature } from './postfix.js';
|
|
6
|
+
import { isShortcut } from './shortcut-keys.js';
|
|
7
7
|
import { bodyWithIndentUnit, dedentLines, indentUnitOf, insertSnippet } from './snippet-insert.js';
|
|
8
8
|
import { escapeSnippetText } from './snippet.js';
|
|
9
9
|
import { SNIPPET_KIND, sortAfterServer, templateApplies, templateContextAt } from './template-context.js';
|
package/dist/markup.js
CHANGED
|
@@ -3,9 +3,9 @@ import { KEY_PRIORITY } from './key-priority.js';
|
|
|
3
3
|
import { lineTextOf } from './line-text.js';
|
|
4
4
|
import { isVoidElement, markupPlaceAt, markupSyntaxOf, tagPairAt } from './markup-context.js';
|
|
5
5
|
import { isShortcut } from './shortcut-keys.js';
|
|
6
|
-
import { parseSnippet } from './snippet.js';
|
|
7
6
|
import { indentSnippet } from './snippet-indent.js';
|
|
8
7
|
import { positionInInsertion } from './snippet-session.js';
|
|
8
|
+
import { parseSnippet } from './snippet.js';
|
|
9
9
|
const NAME = /^[\w:.-]*$/;
|
|
10
10
|
const NAME_BEFORE = /<\/?[\w:.-]*$/;
|
|
11
11
|
/*
|
package/dist/navigation.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Location, type NavigationResult, type Range } from '@adecore/lsp';
|
|
2
1
|
import type { EditorPosition } from '@adecore/editor';
|
|
2
|
+
import { type Location, type NavigationResult, type Range } from '@adecore/lsp';
|
|
3
3
|
import type { EditorLanguage } from './editor-language.ts';
|
|
4
4
|
export type NavigationKind = 'definition' | 'declaration' | 'typeDefinition' | 'implementation';
|
|
5
5
|
export declare function uniquePlaces(result: NavigationResult): {
|
package/dist/navigation.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { StaleResultError, fileUriToPath } from '@adecore/lsp';
|
|
2
|
+
import { rangeHolds } from './diagnostics-model.js';
|
|
3
|
+
import { messageOf } from './error-message.js';
|
|
2
4
|
import { KEY_PRIORITY } from './key-priority.js';
|
|
3
5
|
import { basenameOf } from './paths.js';
|
|
4
|
-
import { rangeHolds } from './diagnostics-model.js';
|
|
5
|
-
import { placesOfName } from './symbol-links.js';
|
|
6
6
|
import { isShortcut } from './shortcut-keys.js';
|
|
7
|
-
import {
|
|
7
|
+
import { placesOfName } from './symbol-links.js';
|
|
8
8
|
import { placeKey, uniqueBy } from './unique.js';
|
|
9
9
|
const METHODS = {
|
|
10
10
|
definition: 'textDocument/definition',
|
package/dist/peek.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { StaleResultError } from '@adecore/lsp';
|
|
2
|
+
import { messageOf } from './error-message.js';
|
|
2
3
|
import { KEY_PRIORITY } from './key-priority.js';
|
|
3
4
|
import { uniquePlaces } from './navigation.js';
|
|
4
5
|
import { PEEK_READ_FILES, definitionSnippetOf, peekFilesOf, snippetOf } from './peek-model.js';
|
|
5
6
|
import { isShortcut } from './shortcut-keys.js';
|
|
6
|
-
import { messageOf } from './error-message.js';
|
|
7
7
|
import { realTimers, revealRow } from './timers.js';
|
|
8
8
|
import { placeKey, uniqueBy } from './unique.js';
|
|
9
9
|
const TOAST_ID = 'language-peek';
|
package/dist/popups.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { type StoreApi } from 'zustand';
|
|
2
1
|
import type { EditorPosition, EditorRange, EditorRect } from '@adecore/editor';
|
|
3
2
|
import type { Location } from '@adecore/lsp';
|
|
4
|
-
import type
|
|
5
|
-
import type { Problem } from './diagnostics-model.ts';
|
|
6
|
-
import type { PeekFile, PeekSnippet } from './peek-model.ts';
|
|
3
|
+
import { type StoreApi } from 'zustand';
|
|
7
4
|
import type { CallDirection, CallRow } from './call-hierarchy-model.ts';
|
|
8
5
|
import type { ActionEntry } from './code-actions-model.ts';
|
|
9
|
-
import type {
|
|
6
|
+
import type { CodeAuthorship } from './code-authors.ts';
|
|
7
|
+
import type { Problem } from './diagnostics-model.ts';
|
|
10
8
|
import type { HoverText } from './hover-content.ts';
|
|
9
|
+
import type { PeekFile, PeekSnippet } from './peek-model.ts';
|
|
11
10
|
import type { SignatureViewModel } from './signature-model.ts';
|
|
11
|
+
import type { SymbolEntry } from './symbol-picker-model.ts';
|
|
12
12
|
import type { ResourceOperationView } from './workspace-edit.ts';
|
|
13
13
|
export interface HoverView {
|
|
14
14
|
readonly anchor: EditorPosition;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { type i18n } from 'i18next';
|
|
2
|
-
import { type ApplyWorkspaceEditResult, type LanguageService, type WorkspaceEdit } from '@adecore/lsp';
|
|
3
1
|
import type { Editor, EditorPosition } from '@adecore/editor';
|
|
2
|
+
import { type ApplyWorkspaceEditResult, type LanguageService, type WorkspaceEdit } from '@adecore/lsp';
|
|
3
|
+
import { type i18n } from 'i18next';
|
|
4
4
|
import { ClipboardHistory } from './clipboard-history.ts';
|
|
5
|
-
import { TemplateRegistry } from './templates.ts';
|
|
6
5
|
import { EditLocations } from './edit-locations.ts';
|
|
6
|
+
import type { LanguageHost } from './host-types.ts';
|
|
7
7
|
import { NavigationHistory, type Place } from './navigation-history.ts';
|
|
8
8
|
import { ProjectProblems } from './project-problems.ts';
|
|
9
|
-
import
|
|
9
|
+
import { TemplateRegistry } from './templates.ts';
|
|
10
10
|
export interface LanguageDocumentHandle {
|
|
11
11
|
readonly uri: string;
|
|
12
12
|
readonly service: LanguageService;
|
package/dist/project-language.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { disposeSnippetTransforms } from './snippet-transform-queue.js';
|
|
2
|
-
import i18next from 'i18next';
|
|
3
1
|
import { fileUriToPath, pathToFileUri, unservedLanguageService } from '@adecore/lsp';
|
|
2
|
+
import i18next from 'i18next';
|
|
4
3
|
import { ClipboardHistory } from './clipboard-history.js';
|
|
5
|
-
import { TemplateRegistry } from './templates.js';
|
|
6
4
|
import { EditLocations } from './edit-locations.js';
|
|
7
5
|
import { NavigationHistory } from './navigation-history.js';
|
|
6
|
+
import { PANEL_BODY_HEIGHT } from './panel-size.js';
|
|
7
|
+
import { relativeTo } from './paths.js';
|
|
8
8
|
import { ProjectProblems, serviceProblems } from './project-problems.js';
|
|
9
|
+
import { disposeSnippetTransforms } from './snippet-transform-queue.js';
|
|
10
|
+
import { TemplateRegistry } from './templates.js';
|
|
9
11
|
import { applyWorkspaceEdit } from './workspace-edit.js';
|
|
10
|
-
import { relativeTo } from './paths.js';
|
|
11
|
-
import { PANEL_BODY_HEIGHT } from './panel-size.js';
|
|
12
12
|
const UNSERVED = unservedLanguageService();
|
|
13
13
|
/* Sends one editor's edits to the document, holding them until the document is open. */
|
|
14
14
|
class DocumentSync {
|
package/dist/rename.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { StaleResultError } from '@adecore/lsp';
|
|
2
|
+
import { messageOf } from './error-message.js';
|
|
2
3
|
import { KEY_PRIORITY } from './key-priority.js';
|
|
3
4
|
import { lineTextOf } from './line-text.js';
|
|
4
5
|
import { occurrencesOf, renameKindOf, renamePreviewOf, renameTargetOf, wordRangeAt } from './rename-model.js';
|
|
5
6
|
import { isShortcut } from './shortcut-keys.js';
|
|
6
7
|
import { resourceOperationsOf } from './workspace-edit.js';
|
|
7
|
-
import { messageOf } from './error-message.js';
|
|
8
8
|
const METHOD = 'textDocument/rename';
|
|
9
9
|
const TOAST_ID = 'language-rename';
|
|
10
10
|
/* How much is read to tell a name suggester how the symbol is used: its first places, other files and lines around it. */
|
package/dist/rendered-docs.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type DocComment } from '@adecore/editor';
|
|
2
|
-
import type { EditorLanguage } from './editor-language.ts';
|
|
3
2
|
import { type ParsedDocComment } from './doc-comment-model.ts';
|
|
3
|
+
import type { EditorLanguage } from './editor-language.ts';
|
|
4
4
|
import { type Timers } from './timers.ts';
|
|
5
5
|
export interface RenderedDocsSettings {
|
|
6
6
|
readonly renderDocComments: boolean;
|
package/dist/rendered-docs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { findDocComments } from '@adecore/editor';
|
|
2
2
|
import { comparePositions } from './diagnostics-model.js';
|
|
3
|
-
import { KEY_PRIORITY } from './key-priority.js';
|
|
4
3
|
import { parseDocComment } from './doc-comment-model.js';
|
|
4
|
+
import { KEY_PRIORITY } from './key-priority.js';
|
|
5
5
|
import { lineTextOf } from './line-text.js';
|
|
6
6
|
import { isShortcut } from './shortcut-keys.js';
|
|
7
7
|
import { realTimers } from './timers.js';
|
package/dist/shortcut-keys.d.ts
CHANGED
package/dist/signature.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KEY_PRIORITY } from './key-priority.js';
|
|
2
|
-
import { signatureViewOf } from './signature-model.js';
|
|
3
2
|
import { isShortcut } from './shortcut-keys.js';
|
|
3
|
+
import { signatureViewOf } from './signature-model.js';
|
|
4
4
|
import { realTimers } from './timers.js';
|
|
5
5
|
const METHOD = 'textDocument/signatureHelp';
|
|
6
6
|
const PAUSE_MS = 60;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Editor, EditorContentChange, EditorRange } from '@adecore/editor';
|
|
2
|
-
import type { SnippetTransform } from './snippet.ts';
|
|
3
|
-
import type { SnippetTransformLease } from './snippet-transform-queue.ts';
|
|
4
2
|
import type { SnippetTransformJob } from './snippet-transform-protocol.ts';
|
|
3
|
+
import type { SnippetTransformLease } from './snippet-transform-queue.ts';
|
|
4
|
+
import type { SnippetTransform } from './snippet.ts';
|
|
5
5
|
export interface FieldTransformTarget {
|
|
6
6
|
readonly id: symbol;
|
|
7
7
|
range: EditorRange;
|
package/dist/snippet-insert.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fileUriToPath } from '@adecore/lsp';
|
|
2
2
|
import { comparePositions, shiftPosition } from './diagnostics-model.js';
|
|
3
3
|
import { lineTextOf, textBeforeOf } from './line-text.js';
|
|
4
4
|
import { wordRangeAt } from './rename-model.js';
|
|
@@ -7,9 +7,9 @@ import { indentSnippet } from './snippet-indent.js';
|
|
|
7
7
|
import { positionInInsertion } from './snippet-session.js';
|
|
8
8
|
import { SnippetTransformError } from './snippet-transform-client.js';
|
|
9
9
|
import { MAX_TRANSFORM_JOBS, MAX_TRANSFORM_WORK } from './snippet-transform-protocol.js';
|
|
10
|
-
import {
|
|
10
|
+
import { SnippetTransformQueueError } from './snippet-transform-queue.js';
|
|
11
11
|
import { createSnippetResolver } from './snippet-variables.js';
|
|
12
|
-
import {
|
|
12
|
+
import { compileSnippet, tabOrder } from './snippet.js';
|
|
13
13
|
/* The same limits as an inserted completion item. */
|
|
14
14
|
const MAX_CHARACTERS = 2_000_000;
|
|
15
15
|
const MAX_RANGES = 1_000;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type Timers } from './timers.ts';
|
|
2
|
-
import { type SnippetTransformJob } from './snippet-transform-protocol.ts';
|
|
3
1
|
import type { EditorApplyEditsOptions, EditorContentChange, EditorPosition, EditorRange } from '@adecore/editor';
|
|
4
2
|
import type { EditorLanguage } from './editor-language.ts';
|
|
3
|
+
import { type SnippetTransformJob } from './snippet-transform-protocol.ts';
|
|
5
4
|
import type { SnippetField, SnippetStop } from './snippet.ts';
|
|
5
|
+
import { type Timers } from './timers.ts';
|
|
6
6
|
export declare function positionInInsertion(start: EditorPosition, text: string, offset: number): EditorPosition;
|
|
7
7
|
export interface SnippetInsertion {
|
|
8
8
|
readonly start: EditorPosition;
|
package/dist/snippet-session.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { comparePositions, endOfInsertion, rangeHolds, sameRange, shiftPosition } from './diagnostics-model.js';
|
|
2
|
+
import { KEY_PRIORITY } from './key-priority.js';
|
|
3
|
+
import { textBeforeOf } from './line-text.js';
|
|
2
4
|
import { SnippetFieldTransforms } from './snippet-field-transforms.js';
|
|
5
|
+
import { compareSnippetOrder, snippetOrderOf } from './snippet-range-order.js';
|
|
3
6
|
import { SnippetTransformError } from './snippet-transform-client.js';
|
|
7
|
+
import { MAX_TRANSFORM_CHARACTERS } from './snippet-transform-protocol.js';
|
|
4
8
|
import { acquireSnippetTransforms } from './snippet-transform-queue.js';
|
|
5
9
|
import { realTimers } from './timers.js';
|
|
6
|
-
import { KEY_PRIORITY } from './key-priority.js';
|
|
7
|
-
import { MAX_TRANSFORM_CHARACTERS } from './snippet-transform-protocol.js';
|
|
8
|
-
import { comparePositions, endOfInsertion, rangeHolds, sameRange, shiftPosition } from './diagnostics-model.js';
|
|
9
|
-
import { textBeforeOf } from './line-text.js';
|
|
10
10
|
export function positionInInsertion(start, text, offset) {
|
|
11
11
|
return endOfInsertion(start, text.slice(0, offset));
|
|
12
12
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WorkerRequestPort } from '@adecore/editor/worker-client';
|
|
2
|
-
import { type SnippetTransformJob } from './snippet-transform-protocol.ts';
|
|
3
2
|
import type { ProjectLanguage } from './project-language.ts';
|
|
3
|
+
import { type SnippetTransformJob } from './snippet-transform-protocol.ts';
|
|
4
4
|
import { type Timers } from './timers.ts';
|
|
5
5
|
interface RequestOptions {
|
|
6
6
|
readonly kind?: 'accept' | 'exit';
|
package/dist/surround.js
CHANGED
|
@@ -4,8 +4,8 @@ import { KEY_PRIORITY } from './key-priority.js';
|
|
|
4
4
|
import { lineTextOf, textBeforeOf } from './line-text.js';
|
|
5
5
|
import { enclosingElements, lineEndOf, lineStartOf, markupSyntaxOf, removeTagEdits } from './markup-context.js';
|
|
6
6
|
import { isShortcut } from './shortcut-keys.js';
|
|
7
|
-
import { bodyWithIndentUnit, dedentLines, insertSnippet } from './snippet-insert.js';
|
|
8
7
|
import { indentSnippet } from './snippet-indent.js';
|
|
8
|
+
import { bodyWithIndentUnit, dedentLines, insertSnippet } from './snippet-insert.js';
|
|
9
9
|
import { compileSnippet, snippetVariables } from './snippet.js';
|
|
10
10
|
import { expressionConstructs, regionConstructs, statementConstructs } from './surround-constructs.js';
|
|
11
11
|
import { templateApplies, templateContextAt } from './template-context.js';
|
package/dist/symbol-picker.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { StaleResultError } from '@adecore/lsp';
|
|
2
|
+
import { messageOf } from './error-message.js';
|
|
2
3
|
import { KEY_PRIORITY } from './key-priority.js';
|
|
3
4
|
import { basenameOf } from './paths.js';
|
|
4
|
-
import { entriesOf, workspaceEntriesOf } from './symbol-picker-model.js';
|
|
5
5
|
import { isShortcut } from './shortcut-keys.js';
|
|
6
|
-
import {
|
|
6
|
+
import { entriesOf, workspaceEntriesOf } from './symbol-picker-model.js';
|
|
7
7
|
const TOAST_ID = 'language-symbols';
|
|
8
8
|
/*
|
|
9
9
|
* Go to symbol: a picker over the symbols the language servers know in the file, filtered as it is typed.
|
package/dist/templates.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BUILT_IN_LIVE_TEMPLATES, BUILT_IN_POSTFIX_TEMPLATES } from './template-builtins.js';
|
|
2
1
|
import { checkSnippet } from './snippet.js';
|
|
2
|
+
import { BUILT_IN_LIVE_TEMPLATES, BUILT_IN_POSTFIX_TEMPLATES } from './template-builtins.js';
|
|
3
3
|
export { BUILT_IN_LIVE_TEMPLATES, BUILT_IN_POSTFIX_TEMPLATES };
|
|
4
4
|
export {} from './live-templates.js';
|
|
5
5
|
const MAX_KEY_LENGTH = 40;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adecore/editor-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Language-enabled editors, feature coordination and React popups over injected language services.",
|
|
6
6
|
"license": "FSL-1.1-MIT",
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"test": "bun test --conditions=source"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@adecore/editor": "0.
|
|
66
|
-
"@adecore/lsp": "0.
|
|
67
|
-
"@adecore/merge": "0.
|
|
65
|
+
"@adecore/editor": "0.54.0",
|
|
66
|
+
"@adecore/lsp": "0.54.0",
|
|
67
|
+
"@adecore/merge": "0.54.0",
|
|
68
68
|
"emmet": "^2.4.11",
|
|
69
69
|
"lucide-react": "^1.65.0",
|
|
70
70
|
"react-markdown": "^10.1.0",
|
|
@@ -73,14 +73,14 @@
|
|
|
73
73
|
"zustand": "^5.0.16"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"@adecore/ui": "^0.
|
|
76
|
+
"@adecore/ui": "^0.54.0",
|
|
77
77
|
"i18next": "^26.5.12",
|
|
78
78
|
"react": "^19.3.1",
|
|
79
79
|
"react-dom": "^19.3.1",
|
|
80
80
|
"react-i18next": "^17.1.9"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@adecore/ui": "0.
|
|
83
|
+
"@adecore/ui": "0.54.0",
|
|
84
84
|
"@types/bun": "^1.4.4",
|
|
85
85
|
"@types/react": "^19.3.0",
|
|
86
86
|
"@types/react-dom": "^19.3.0",
|
package/src/AnchoredPopup.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { EditorRect } from '@adecore/editor';
|
|
2
|
+
import { ScrollArea } from '@adecore/ui';
|
|
1
3
|
import { useLayoutEffect, useRef, type ReactNode } from 'react';
|
|
2
4
|
import { createPortal } from 'react-dom';
|
|
3
|
-
import type { EditorRect } from '@adecore/editor';
|
|
4
5
|
import { placePopup, type PlaceOptions } from './popup-placement.ts';
|
|
5
6
|
|
|
6
7
|
export interface AnchoredPopupProps {
|
|
@@ -39,15 +40,18 @@ export function AnchoredPopup({ rect, className, overflow = 'scroll', children,
|
|
|
39
40
|
popup.style.visibility = 'visible';
|
|
40
41
|
});
|
|
41
42
|
|
|
43
|
+
const scrolls = overflow === 'scroll';
|
|
44
|
+
|
|
45
|
+
// A card that scrolls is a frame around a `ScrollArea`, which takes the content's classes.
|
|
42
46
|
return createPortal(
|
|
43
47
|
<div
|
|
44
48
|
ref={element}
|
|
45
|
-
className={`fixed top-0 left-0 z-(--z-popup)
|
|
49
|
+
className={`fixed top-0 left-0 z-(--z-popup) overflow-hidden rounded-lg border border-border bg-surface-raised text-text shadow-(--float-shadow) ${scrolls ? 'flex flex-col' : (className ?? '')}`}
|
|
46
50
|
style={{ visibility: 'hidden' }}
|
|
47
51
|
onPointerEnter={onPointerEnter}
|
|
48
52
|
onPointerLeave={onPointerLeave}
|
|
49
53
|
>
|
|
50
|
-
{children}
|
|
54
|
+
{scrolls ? <ScrollArea viewportClassName={className}>{children}</ScrollArea> : children}
|
|
51
55
|
</div>,
|
|
52
56
|
document.body
|
|
53
57
|
);
|
package/src/AttributionCard.tsx
CHANGED
package/src/BaselineStatus.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CircleCheck, Sparkles, TriangleAlert } from 'lucide-react';
|
|
2
1
|
import { Icon } from '@adecore/ui';
|
|
2
|
+
import { CircleCheck, Sparkles, TriangleAlert } from 'lucide-react';
|
|
3
3
|
import type { Baseline, BaselineLevel } from './hover-content.ts';
|
|
4
4
|
|
|
5
5
|
const BASELINE_MARKS: Record<BaselineLevel, { icon: typeof CircleCheck; color: string }> = {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
+
import { fileUriToPath } from '@adecore/lsp';
|
|
2
|
+
import { Icon, IconButton, ScrollArea, Segmented, Spinner, Tooltip } from '@adecore/ui';
|
|
3
|
+
import { formatNumber } from '@adecore/ui/format';
|
|
4
|
+
import { ChevronDown, ChevronLeft, ChevronRight, X } from 'lucide-react';
|
|
1
5
|
import { useEffect, useId, useRef, type ReactNode, type Ref } from 'react';
|
|
2
6
|
import { createPortal } from 'react-dom';
|
|
3
7
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { ChevronDown, ChevronLeft, ChevronRight, X } from 'lucide-react';
|
|
5
|
-
import { fileUriToPath } from '@adecore/lsp';
|
|
6
|
-
import { Icon, IconButton, Segmented, Spinner, Tooltip } from '@adecore/ui';
|
|
7
|
-
import { formatNumber } from '@adecore/ui/format';
|
|
8
|
-
import { CALL_HIERARCHY_HEIGHT } from './call-hierarchy.ts';
|
|
9
|
-
import { PanelResizeHandle } from './PanelResizeHandle.tsx';
|
|
10
|
-
import { usePanelBody } from './use-panel-body.ts';
|
|
11
|
-
import { PANEL_BODY_HEIGHT } from './panel-size.ts';
|
|
12
8
|
import { CALL_LEVEL_LIMIT, isTypeDirection, type CallDirection, type CallRow } from './call-hierarchy-model.ts';
|
|
9
|
+
import { CALL_HIERARCHY_HEIGHT } from './call-hierarchy.ts';
|
|
13
10
|
import type { EditorLanguage } from './editor-language.ts';
|
|
11
|
+
import { PANEL_BODY_HEIGHT } from './panel-size.ts';
|
|
12
|
+
import { PanelResizeHandle } from './PanelResizeHandle.tsx';
|
|
14
13
|
import { basenameOf, relativeTo } from './paths.ts';
|
|
15
14
|
import { PathText } from './PathText.tsx';
|
|
16
15
|
import { Preview } from './PeekPanel.tsx';
|
|
16
|
+
import { useInputPopup } from './popup-focus.ts';
|
|
17
17
|
import type { CallHierarchyView } from './popups.ts';
|
|
18
18
|
import { SymbolBadge } from './SymbolPicker.tsx';
|
|
19
|
-
import {
|
|
19
|
+
import { usePanelBody } from './use-panel-body.ts';
|
|
20
20
|
|
|
21
21
|
const INDENT = 14;
|
|
22
22
|
const BASE_INDENT = 8;
|
|
@@ -125,11 +125,12 @@ function Tree({ language, view }: { language: EditorLanguage; view: CallHierarch
|
|
|
125
125
|
useInputPopup(language, treeId, activeId);
|
|
126
126
|
|
|
127
127
|
return (
|
|
128
|
-
<
|
|
128
|
+
<ScrollArea
|
|
129
129
|
id={treeId}
|
|
130
130
|
role="tree"
|
|
131
131
|
aria-label={t(isTypeDirection(view.direction) ? 'language.callHierarchy.typesLabel' : 'language.callHierarchy.label')}
|
|
132
|
-
className="w-1/2 shrink-0
|
|
132
|
+
className="w-1/2 shrink-0 border-r border-border"
|
|
133
|
+
viewportClassName="py-1"
|
|
133
134
|
>
|
|
134
135
|
{view.rows.map((row) => {
|
|
135
136
|
const active = row.id === view.active;
|
|
@@ -157,7 +158,7 @@ function Tree({ language, view }: { language: EditorLanguage; view: CallHierarch
|
|
|
157
158
|
</Line>
|
|
158
159
|
);
|
|
159
160
|
})}
|
|
160
|
-
</
|
|
161
|
+
</ScrollArea>
|
|
161
162
|
);
|
|
162
163
|
}
|
|
163
164
|
|
package/src/ChangeReview.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useLayoutEffect, useRef, type ReactNode } from 'react';
|
|
2
1
|
import type { Editor } from '@adecore/editor';
|
|
2
|
+
import { useLayoutEffect, useRef, type ReactNode } from 'react';
|
|
3
3
|
import { diffSegments, emphasisOf } from './proposal-model.ts';
|
|
4
4
|
|
|
5
5
|
export interface ChangeReviewProps {
|
package/src/CodeAuthorsCard.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useTranslation } from 'react-i18next';
|
|
2
|
-
import { GitCommitHorizontal, User, Users } from 'lucide-react';
|
|
3
1
|
import { Button, Icon, Popover, Separator, Tooltip, useNow } from '@adecore/ui';
|
|
4
2
|
import { formatAge, formatNumber } from '@adecore/ui/format';
|
|
3
|
+
import { GitCommitHorizontal, User, Users } from 'lucide-react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import type { EditorLanguage } from './editor-language.ts';
|
|
6
6
|
import type { GitBlameCommit } from './host-types.ts';
|
|
7
7
|
import type { AuthorsView } from './popups.ts';
|
package/src/CompletionPopup.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import type { EditorRect } from '@adecore/editor';
|
|
2
|
+
import { formatShortcut, ScrollArea } from '@adecore/ui';
|
|
1
3
|
import { useId, useLayoutEffect, useRef, useState } from 'react';
|
|
2
4
|
import { createPortal } from 'react-dom';
|
|
3
5
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { formatShortcut } from '@adecore/ui';
|
|
5
|
-
import type { EditorRect } from '@adecore/editor';
|
|
6
|
-
import type { EditorLanguage } from './editor-language.ts';
|
|
7
6
|
import { kindLetterOf, kindToneOf, rowWindow } from './completion-model.ts';
|
|
7
|
+
import type { EditorLanguage } from './editor-language.ts';
|
|
8
8
|
import { SourceLine, SymbolSections } from './HoverSections.tsx';
|
|
9
9
|
import { PathText } from './PathText.tsx';
|
|
10
10
|
import { keepFocusOutOfList, useInputPopup } from './popup-focus.ts';
|
|
@@ -150,10 +150,11 @@ export function CompletionPopup({ language, view, rect }: { language: EditorLang
|
|
|
150
150
|
width: `calc(${Math.max(widest, need)}ch + ${ROW_CHROME}px)`
|
|
151
151
|
}}
|
|
152
152
|
/>
|
|
153
|
-
<
|
|
153
|
+
<ScrollArea
|
|
154
154
|
id={listId}
|
|
155
155
|
role="listbox"
|
|
156
|
-
className="w-0 min-w-full
|
|
156
|
+
className="w-0 min-w-full"
|
|
157
|
+
viewportClassName="p-1"
|
|
157
158
|
style={{ maxHeight: ROW_HEIGHT * VISIBLE_ROWS + 8 }}
|
|
158
159
|
onScroll={(event) => setListTop(event.currentTarget.scrollTop)}
|
|
159
160
|
>
|
|
@@ -190,7 +191,7 @@ export function CompletionPopup({ language, view, rect }: { language: EditorLang
|
|
|
190
191
|
);
|
|
191
192
|
})}
|
|
192
193
|
<div aria-hidden style={{ height: (total - last) * ROW_HEIGHT }} />
|
|
193
|
-
</
|
|
194
|
+
</ScrollArea>
|
|
194
195
|
<div className="flex items-center gap-3 border-t border-border px-2 py-1 text-xs whitespace-nowrap text-text-faint">
|
|
195
196
|
<span>↵ {t('language.completion.insert')}</span>
|
|
196
197
|
<span>⇥ {t('language.completion.replace')}</span>
|
|
@@ -205,16 +206,18 @@ export function CompletionPopup({ language, view, rect }: { language: EditorLang
|
|
|
205
206
|
{view.detailsOpen && view.docs !== null && (
|
|
206
207
|
<div
|
|
207
208
|
ref={docs}
|
|
208
|
-
className={`${CARD} flex w-[360px] flex-col
|
|
209
|
+
className={`${CARD} flex w-[360px] flex-col`}
|
|
209
210
|
style={{ visibility: 'hidden' }}
|
|
210
211
|
onPointerDown={(event) => event.preventDefault()}
|
|
211
212
|
>
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
<
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
213
|
+
<ScrollArea viewportClassName="flex flex-col divide-y divide-border select-text">
|
|
214
|
+
{view.docs.source !== '' && (
|
|
215
|
+
<div className="px-3 py-2">
|
|
216
|
+
<SourceLine text={view.docs.source} language={view.highlightLanguage} />
|
|
217
|
+
</div>
|
|
218
|
+
)}
|
|
219
|
+
<SymbolSections text={view.docs.text} />
|
|
220
|
+
</ScrollArea>
|
|
218
221
|
</div>
|
|
219
222
|
)}
|
|
220
223
|
</>,
|
package/src/DiffView.tsx
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { useLayoutEffect, useRef, useState, type Ref } from 'react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
1
|
import type { Editor, EditorEngine, EditorLineHighlight, EditorTheme } from '@adecore/editor';
|
|
4
2
|
import { parseChord } from '@adecore/editor/keymap';
|
|
5
3
|
import { diffDisplay, diffSplit, sourceLineOf, type DiffDocument, type DiffDisplay, type DiffSourceLine } from '@adecore/merge';
|
|
6
|
-
import {
|
|
4
|
+
import { useOverlayScrollbars } from '@adecore/ui';
|
|
5
|
+
import { useLayoutEffect, useRef, useState, type Ref } from 'react';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
|
+
import { DEFAULT_UNFOLD_LIMITS, expandDiff, type DiffLimits } from './diff-expansion.ts';
|
|
7
8
|
import { DiffOverlays, type MountedDiff } from './diff-overlays.tsx';
|
|
8
|
-
import { SplitDiffView } from './SplitDiffView.tsx';
|
|
9
9
|
import { repaintOnTokens, type DiffSourceTokens } from './diff-syntax.ts';
|
|
10
|
+
import { wordMarks } from './diff-wordmarks.ts';
|
|
10
11
|
import { LineActionHost, RowHost } from './row-host.ts';
|
|
11
|
-
import {
|
|
12
|
+
import { SplitDiffView } from './SplitDiffView.tsx';
|
|
12
13
|
|
|
13
14
|
export interface DiffViewProps {
|
|
14
15
|
engine: EditorEngine;
|
|
@@ -74,6 +75,8 @@ function UnifiedDiffView({
|
|
|
74
75
|
const applied = useRef({ theme, wrap, label });
|
|
75
76
|
const [mounted, setMounted] = useState<MountedDiff | null>(null);
|
|
76
77
|
const [height, setHeight] = useState(0);
|
|
78
|
+
const [scroller, setScroller] = useState<HTMLElement | null>(null);
|
|
79
|
+
const scrollbars = useOverlayScrollbars(scroller, { axis: 'both' });
|
|
77
80
|
|
|
78
81
|
useLayoutEffect(() => {
|
|
79
82
|
current.current = { document, display, tokens, theme, wrap, label };
|
|
@@ -112,6 +115,7 @@ function UnifiedDiffView({
|
|
|
112
115
|
});
|
|
113
116
|
|
|
114
117
|
setMounted({ engine, editor, rows: new RowHost(editor, 'diff-gaps'), actions: new LineActionHost(editor, 'diff-status') });
|
|
118
|
+
setScroller(host.querySelector<HTMLElement>('.se-viewport'));
|
|
115
119
|
|
|
116
120
|
const measure = (): void => setHeight(editor.getContentHeight());
|
|
117
121
|
|
|
@@ -120,6 +124,7 @@ function UnifiedDiffView({
|
|
|
120
124
|
|
|
121
125
|
return () => {
|
|
122
126
|
stop();
|
|
127
|
+
setScroller(null);
|
|
123
128
|
editor.dispose();
|
|
124
129
|
};
|
|
125
130
|
}, [engine]);
|
|
@@ -271,8 +276,9 @@ function UnifiedDiffView({
|
|
|
271
276
|
data-scroll={fill || height > limit}
|
|
272
277
|
style={{ position: 'relative', minHeight: 0, height: fill ? '100%' : Math.min(height, limit) }}
|
|
273
278
|
>
|
|
274
|
-
<div ref={element} style={{ position: 'absolute', inset: 0 }} />
|
|
279
|
+
<div ref={element} style={{ position: 'absolute', inset: 0, isolation: 'isolate' }} />
|
|
275
280
|
{mounted !== null && mounted.engine === engine && <DiffOverlays mounted={mounted} display={display} unfold={unfold} blocked={blocked} />}
|
|
281
|
+
{scrollbars}
|
|
276
282
|
</div>
|
|
277
283
|
);
|
|
278
284
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { ContextMenu, EDIT_SHORTCUTS, Kbd } from '@adecore/ui';
|
|
1
2
|
import { Fragment, useEffect, useRef, type ReactNode } from 'react';
|
|
2
3
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { ContextMenu, EDIT_SHORTCUTS, Kbd } from '@adecore/ui';
|
|
4
|
-
import type { EditorLanguage } from './editor-language.ts';
|
|
5
4
|
import { menuGroupsOf, type MenuRowId, type MenuRowSpec } from './context-menu-rows.ts';
|
|
5
|
+
import type { EditorLanguage } from './editor-language.ts';
|
|
6
6
|
import type { MenuView } from './popups.ts';
|
|
7
7
|
|
|
8
8
|
/*
|
package/src/EditorView.tsx
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import { createHolder } from './holder.ts';
|
|
2
|
-
import { useLayoutEffect, useMemo, useRef, useSyncExternalStore, type ReactNode, type Ref } from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import type { TFunction } from 'i18next';
|
|
5
1
|
import {
|
|
6
2
|
DEFAULT_SMART_KEYS,
|
|
7
3
|
DEFAULT_TODO_WORDS,
|
|
@@ -12,10 +8,15 @@ import {
|
|
|
12
8
|
type EditorOptions,
|
|
13
9
|
type EditorSmartKeys
|
|
14
10
|
} from '@adecore/editor';
|
|
11
|
+
import { useOverlayScrollbars } from '@adecore/ui';
|
|
12
|
+
import type { TFunction } from 'i18next';
|
|
13
|
+
import { useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore, type ReactNode, type Ref } from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { EditorLanguage, type EditorLanguageOptions } from './editor-language.ts';
|
|
16
|
+
import { createHolder } from './holder.ts';
|
|
16
17
|
import { LanguagePopups } from './LanguagePopups.tsx';
|
|
17
|
-
import type { ProjectLanguage } from './project-language.ts';
|
|
18
18
|
import type { HoverView } from './popups.ts';
|
|
19
|
+
import type { ProjectLanguage } from './project-language.ts';
|
|
19
20
|
import type { Timers } from './timers.ts';
|
|
20
21
|
|
|
21
22
|
export interface EditorViewProps {
|
|
@@ -147,6 +148,8 @@ export function EditorView({
|
|
|
147
148
|
const applied = useRef(options);
|
|
148
149
|
const holder = useMemo(() => createHolder<EditorLanguage>(), []);
|
|
149
150
|
const language = useSyncExternalStore(holder.subscribe, holder.get, holder.get);
|
|
151
|
+
const [scroller, setScroller] = useState<HTMLElement | null>(null);
|
|
152
|
+
const scrollbars = useOverlayScrollbars(scroller, { axis: 'both' });
|
|
150
153
|
|
|
151
154
|
useLayoutEffect(() => {
|
|
152
155
|
latest.current = { options, timers, languageOptions, onMount };
|
|
@@ -163,6 +166,8 @@ export function EditorView({
|
|
|
163
166
|
const editor = engine.mount(host, { ...inputs.options, messages: { ...foldMessages(words.current), ...inputs.options.messages } });
|
|
164
167
|
mounted.current = editor;
|
|
165
168
|
applied.current = inputs.options;
|
|
169
|
+
// The engine's scroller stays native; it gets the overlay bars here, over the host it fills.
|
|
170
|
+
setScroller(host.querySelector<HTMLElement>('.se-viewport'));
|
|
166
171
|
|
|
167
172
|
const attached =
|
|
168
173
|
project === undefined || uri === undefined || languageId === undefined
|
|
@@ -174,6 +179,7 @@ export function EditorView({
|
|
|
174
179
|
|
|
175
180
|
return () => {
|
|
176
181
|
mounted.current = null;
|
|
182
|
+
setScroller(null);
|
|
177
183
|
holder.set(null);
|
|
178
184
|
stop?.();
|
|
179
185
|
attached?.dispose();
|
|
@@ -207,7 +213,9 @@ export function EditorView({
|
|
|
207
213
|
|
|
208
214
|
return (
|
|
209
215
|
<div className={className} ref={ref} style={{ position: 'relative', minHeight: 0 }}>
|
|
210
|
-
|
|
216
|
+
{/* Its own stacking layer, so no layer of the editor rises over the bars beside it. */}
|
|
217
|
+
<div ref={element} style={{ position: 'absolute', inset: 0, isolation: 'isolate' }} />
|
|
218
|
+
{scrollbars}
|
|
211
219
|
{language !== null && <LanguagePopups language={language} contextMenuItems={contextMenuItems} hoverFooter={hoverFooter} />}
|
|
212
220
|
</div>
|
|
213
221
|
);
|