@adecore/editor 0.53.3 → 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/controller.js +2 -2
- package/dist/editor.css +0 -2
- package/dist/engine.js +5 -5
- package/dist/fake.d.ts +1 -1
- package/dist/fake.js +2 -7
- package/dist/find.js +1 -1
- package/dist/layout.js +2 -2
- package/dist/paint.js +2 -2
- package/dist/search-client.d.ts +1 -1
- package/dist/search-client.js +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/view.d.ts +1 -1
- package/dist/view.js +10 -10
- package/package.json +3 -2
- package/src/column-selection.ts +1 -1
- package/src/controller.ts +4 -4
- package/src/editor.css +0 -2
- package/src/engine.ts +5 -5
- package/src/fake.ts +5 -12
- package/src/find.ts +1 -1
- package/src/layout.ts +2 -3
- package/src/paint.ts +2 -2
- package/src/search-client.ts +2 -2
- package/src/types.ts +2 -2
- package/src/view.ts +10 -10
package/dist/controller.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { columnSelections, sameCell } from './column-selection.js';
|
|
1
2
|
import { replacementEdits } from './input.js';
|
|
2
|
-
import { emit, subscribe } from './listeners.js';
|
|
3
3
|
import { chordMatches, keyAction } from './keymap.js';
|
|
4
|
+
import { emit, subscribe } from './listeners.js';
|
|
4
5
|
import { DoubleModifierGesture } from './modifier-gesture.js';
|
|
5
6
|
import { NativeInput } from './native-input.js';
|
|
6
|
-
import { columnSelections, sameCell } from './column-selection.js';
|
|
7
7
|
import { PointerSelection } from './pointer.js';
|
|
8
8
|
import { TouchSelection } from './touch.js';
|
|
9
9
|
import { WheelZoom } from './zoom.js';
|
package/dist/editor.css
CHANGED
|
@@ -77,8 +77,6 @@
|
|
|
77
77
|
overflow-anchor: none;
|
|
78
78
|
overscroll-behavior: contain;
|
|
79
79
|
touch-action: pan-x pan-y pinch-zoom;
|
|
80
|
-
scrollbar-width: thin;
|
|
81
|
-
scrollbar-color: color-mix(in srgb, var(--text) 25%, transparent) transparent;
|
|
82
80
|
}
|
|
83
81
|
.se-editor[data-wrap='true'] .se-viewport {
|
|
84
82
|
overflow-x: hidden;
|
package/dist/engine.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { changedSpans, DocumentModel, replacementText } from '@adecore/editor-core';
|
|
2
|
-
import { MAX_REPLACEMENT_CHARACTERS } from './search-protocol.js';
|
|
3
|
-
import { placeAt, postfixOperands, surroundShape, unwrapTargets } from './text-queries.js';
|
|
4
|
-
import { GrammarPreparation } from './grammar-preparation.js';
|
|
5
2
|
import { InputController } from './controller.js';
|
|
6
|
-
import {
|
|
7
|
-
import { emit, subscribe } from './listeners.js';
|
|
3
|
+
import { GrammarPreparation } from './grammar-preparation.js';
|
|
8
4
|
import { fillLens, lensSignature } from './lens.js';
|
|
5
|
+
import { emit, subscribe } from './listeners.js';
|
|
6
|
+
import { MAX_REPLACEMENT_CHARACTERS } from './search-protocol.js';
|
|
7
|
+
import { resolveSmartKeys } from './smart-keys.js';
|
|
8
|
+
import { placeAt, postfixOperands, surroundShape, unwrapTargets } from './text-queries.js';
|
|
9
9
|
import { EditorView } from './view.js';
|
|
10
10
|
import { clampFontSize, fontSizeRange } from './zoom.js';
|
|
11
11
|
const DEFAULT_TAB_SIZE = 4;
|
package/dist/fake.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Editor, EditorAttributionHover, EditorAttributionMark, EditorBlock, EditorCodeBlockOptions, EditorLineAction, EditorReplacement, EditorLineHighlight, LineToken, EditorChangeMark, EditorCodeVision, EditorClick, EditorClickHandler, EditorContextMenu, EditorContentChange, EditorEngine, EditorFindQuery, EditorFindState, EditorReplaceOptions, EditorGutterAction, EditorGutterMarker, EditorHighlight, EditorHover, EditorIndentation, EditorGhostText, EditorInlayClick, EditorInlayClickHandler, EditorInlayHint, EditorInlayTarget, EditorKeyHandler, EditorInputPopup, EditorMarker, EditorMessages, EditorOptions, EditorPosition, EditorPostfixOperand, EditorSurroundShape, EditorTextPlace, EditorUnwrapTarget, EditorRemoteCursor, EditorRange, EditorReveal, EditorRect, EditorRunCommand, EditorSelectionRanges, EditorFoldHints, EditorFoldOutline, EditorFolds, EditorSemanticToken, EditorSmartKeys, EditorApplyEditsOptions, EditorCopy, EditorPasteOptions, EditorTextChange, EditorTrackedRange, EditorTheme, EditorWhitespaceCleanup, EditorWidget } from './types.ts';
|
|
2
1
|
import { type Listener } from './listeners.ts';
|
|
2
|
+
import type { Editor, EditorAttributionHover, EditorAttributionMark, EditorBlock, EditorCodeBlockOptions, EditorLineAction, EditorReplacement, EditorLineHighlight, LineToken, EditorChangeMark, EditorCodeVision, EditorClick, EditorClickHandler, EditorContextMenu, EditorContentChange, EditorEngine, EditorFindQuery, EditorFindState, EditorReplaceOptions, EditorGutterAction, EditorGutterMarker, EditorHighlight, EditorHover, EditorIndentation, EditorGhostText, EditorInlayClick, EditorInlayClickHandler, EditorInlayHint, EditorInlayTarget, EditorKeyHandler, EditorInputPopup, EditorMarker, EditorMessages, EditorOptions, EditorPosition, EditorPostfixOperand, EditorSurroundShape, EditorTextPlace, EditorUnwrapTarget, EditorRemoteCursor, EditorRange, EditorReveal, EditorRect, EditorRunCommand, EditorSelectionRanges, EditorFoldHints, EditorFoldOutline, EditorFolds, EditorSemanticToken, EditorSmartKeys, EditorApplyEditsOptions, EditorCopy, EditorPasteOptions, EditorTextChange, EditorTrackedRange, EditorTheme, EditorWhitespaceCleanup, EditorWidget } from './types.ts';
|
|
3
3
|
export declare class FakeEditor implements Editor {
|
|
4
4
|
readonly element: HTMLElement;
|
|
5
5
|
readonly language: string | undefined;
|
package/dist/fake.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { emit, subscribe } from './listeners.js';
|
|
2
1
|
import { changedSpan, changedSpans, DocumentModel } from '@adecore/editor-core';
|
|
2
|
+
import { isHighSurrogate, isLowSurrogate } from '@adecore/utils/text';
|
|
3
|
+
import { emit, subscribe } from './listeners.js';
|
|
3
4
|
import { placeAt, postfixOperands, surroundShape, unwrapTargets } from './text-queries.js';
|
|
4
5
|
import { mapTrackedRange } from './tracked-range.js';
|
|
5
6
|
const LINE_BREAK = /\r\n|\r|\n/g;
|
|
@@ -14,12 +15,6 @@ function linesOf(text) {
|
|
|
14
15
|
lines.push({ start, end: text.length });
|
|
15
16
|
return lines;
|
|
16
17
|
}
|
|
17
|
-
function isHighSurrogate(code) {
|
|
18
|
-
return code >= 0xd800 && code <= 0xdbff;
|
|
19
|
-
}
|
|
20
|
-
function isLowSurrogate(code) {
|
|
21
|
-
return code >= 0xdc00 && code <= 0xdfff;
|
|
22
|
-
}
|
|
23
18
|
/* Clamps to the text and moves back off the middle of a CRLF or a surrogate pair, as the real document does. */
|
|
24
19
|
function clampOffset(text, value) {
|
|
25
20
|
const offset = Math.max(0, Math.min(text.length, Number.isFinite(value) ? Math.trunc(value) : 0));
|
package/dist/find.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { mapOffset } from './offsets.js';
|
|
2
1
|
import { FindSearchQueue, scheduleFind } from './find-search.js';
|
|
2
|
+
import { mapOffset } from './offsets.js';
|
|
3
3
|
import { EditorSearchError } from './search-client.js';
|
|
4
4
|
import { SEARCH_LIMIT, MAX_REPLACEMENT_PAGE, MAX_REPLACEMENT_CHARACTERS } from './search-protocol.js';
|
|
5
5
|
export const FIND_LIMIT = SEARCH_LIMIT;
|
package/dist/layout.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { offsetOfStop, rowOfStop, stopAtOffset, stopCount, xOfStop } from './geometry-stops.js';
|
|
2
1
|
import { BIDI_COLUMNS, bidiControl, visibleBidi } from './bidi.js';
|
|
3
|
-
import {
|
|
2
|
+
import { offsetOfStop, rowOfStop, stopAtOffset, stopCount, xOfStop } from './geometry-stops.js';
|
|
4
3
|
import { lineChangeMapper } from './layout-changes.js';
|
|
5
4
|
import { offsetMapper } from './offsets.js';
|
|
5
|
+
import { uniformGeometry } from './uniform-geometry.js';
|
|
6
6
|
export function subRowBand(top, subRows, lineHeight, window, block = 1) {
|
|
7
7
|
const first = Math.max(0, Math.min(subRows - 1, Math.floor((window.top - top) / lineHeight)));
|
|
8
8
|
const last = Math.max(first, Math.min(subRows - 1, Math.ceil((window.bottom - top) / lineHeight) - 1));
|
package/dist/paint.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { offsetOfStop, rowOfStop, stopAtOffset, stopCount, xOfStop } from './geometry-stops.js';
|
|
2
1
|
import { colorValue, tintValue } from './attribution.js';
|
|
3
|
-
import { scanLine, subRowBand } from './layout.js';
|
|
4
2
|
import { BIDI_CONTROLS, BIDI_PATTERN, visibleBidi } from './bidi.js';
|
|
3
|
+
import { offsetOfStop, rowOfStop, stopAtOffset, stopCount, xOfStop } from './geometry-stops.js';
|
|
4
|
+
import { scanLine, subRowBand } from './layout.js';
|
|
5
5
|
const ITALIC = 1;
|
|
6
6
|
const BOLD = 2;
|
|
7
7
|
const UNDERLINE = 4;
|
package/dist/search-client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FindMatch } from '@adecore/editor-core';
|
|
2
|
-
import type { EditorFindQuery } from './types.ts';
|
|
3
2
|
import { type EditorSearchRange, type EditorSearchNextOptions, type EditorSearchReplacementOptions, type EditorSearchReplacements, type EditorSearchOptions, type EditorSearchResult, type EditorSearchSnapshot } from './search-protocol.ts';
|
|
3
|
+
import type { EditorFindQuery } from './types.ts';
|
|
4
4
|
export type EditorSearchErrorKind = 'timeout' | 'superseded' | 'unavailable' | 'syntax' | 'range' | 'snapshot' | 'error' | 'disposed';
|
|
5
5
|
export declare class EditorSearchError extends Error {
|
|
6
6
|
readonly kind: EditorSearchErrorKind;
|
package/dist/search-client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createWorkerRequestClient, WorkerRequestError } from './worker-client.js';
|
|
2
1
|
import { SEARCH_LIMIT, MAX_REPLACEMENT_PAGE, MAX_REPLACEMENT_CHARACTERS } from './search-protocol.js';
|
|
2
|
+
import { createWorkerRequestClient, WorkerRequestError } from './worker-client.js';
|
|
3
3
|
export class EditorSearchError extends Error {
|
|
4
4
|
kind;
|
|
5
5
|
constructor(kind, message) {
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { EditorSearchClientOptions } from './search-client.ts';
|
|
2
|
-
import type { Keymap } from './keymap-table.ts';
|
|
3
1
|
import type { EditorCommand, FoldRole, TextPlaceKind, UnwrapKind, WhitespaceCleanupOptions } from '@adecore/editor-core';
|
|
2
|
+
import type { Keymap } from './keymap-table.ts';
|
|
3
|
+
import type { EditorSearchClientOptions } from './search-client.ts';
|
|
4
4
|
export type { EditorCommand, FoldRole };
|
|
5
5
|
export type EditorWhitespaceCleanup = WhitespaceCleanupOptions;
|
|
6
6
|
export type EditorFoldOutline = 'off' | 'hover' | 'always';
|
package/dist/view.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type DocumentModel, type FoldHints, type FoldRole, type FoldingRange, type Selection as EditorSelection } from '@adecore/editor-core';
|
|
2
|
-
import { type EditorSearchClientOptions } from './search-client.ts';
|
|
3
2
|
import { FindController } from './find.ts';
|
|
4
3
|
import { type BlockReplacement, type BlockWidget, EditorLayout, type Inlay } from './layout.ts';
|
|
5
4
|
import { type ScrollKind } from './scroll.ts';
|
|
5
|
+
import { type EditorSearchClientOptions } from './search-client.ts';
|
|
6
6
|
import { TokenCache } from './tokens.ts';
|
|
7
7
|
import type { EditorBlock, EditorChangeMark, EditorCodeBlockOptions, EditorFindQuery, EditorFindState, EditorHighlightKind, EditorInputPopup, EditorLineHighlight, EditorGutterIcon, EditorMarkerSeverity, EditorMessages, EditorRect, EditorSmartKeys, LineToken, LineTokenKind, LineTokenizer, ScopeColors } from './types.ts';
|
|
8
8
|
export interface ViewSettings {
|
package/dist/view.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { offsetOfStop, xOfStop } from './geometry-stops.js';
|
|
2
|
-
import { visibleBidi } from './bidi.js';
|
|
3
1
|
import { indentationColumn, replacementText } from '@adecore/editor-core';
|
|
4
|
-
import { createSearchClient } from './search-client.js';
|
|
5
|
-
import { FindController } from './find.js';
|
|
6
|
-
import { EditorLayout, RIGHT_PADDING, subRowBand } from './layout.js';
|
|
7
|
-
import { createMetrics, readEditorFont } from './metrics.js';
|
|
8
|
-
import { zoomedFont } from './zoom.js';
|
|
9
2
|
import { AttributionRuns, colorValue, tintValue } from './attribution.js';
|
|
3
|
+
import { visibleBidi } from './bidi.js';
|
|
10
4
|
import { renderCodeBlock } from './code-block.js';
|
|
5
|
+
import { FindController } from './find.js';
|
|
6
|
+
import { offsetOfStop, xOfStop } from './geometry-stops.js';
|
|
7
|
+
import { EditorLayout, RIGHT_PADDING, subRowBand } from './layout.js';
|
|
11
8
|
import { emit, subscribe } from './listeners.js';
|
|
9
|
+
import { createMetrics, readEditorFont } from './metrics.js';
|
|
12
10
|
import { mapOffset, offsetMapper } from './offsets.js';
|
|
13
|
-
import { mapTrackedRange } from './tracked-range.js';
|
|
14
|
-
import { scrollPosition } from './scroll.js';
|
|
15
|
-
import { easeOut, scrollDuration } from './scroll-animation.js';
|
|
16
11
|
import { Outline, scopeChain, stickyCover, stickyPlacements, structuralEntries } from './outline.js';
|
|
17
12
|
import { overviewTicks, paintOverview } from './overview.js';
|
|
18
13
|
import { paintCarets, paintGutter, paintOver, paintOverlays, paintRemoteCarets, paintSigns, paintSticky, RowPainter } from './paint.js';
|
|
14
|
+
import { easeOut, scrollDuration } from './scroll-animation.js';
|
|
15
|
+
import { scrollPosition } from './scroll.js';
|
|
16
|
+
import { createSearchClient } from './search-client.js';
|
|
19
17
|
import { overlayTokens } from './semantic.js';
|
|
20
18
|
import { TodoMarks } from './todos.js';
|
|
21
19
|
import { TokenCache } from './tokens.js';
|
|
20
|
+
import { mapTrackedRange } from './tracked-range.js';
|
|
21
|
+
import { zoomedFont } from './zoom.js';
|
|
22
22
|
function sameRect(left, right) {
|
|
23
23
|
return left.left === right.left && left.top === right.top && left.right === right.right && left.bottom === right.bottom;
|
|
24
24
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adecore/editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -54,7 +54,8 @@
|
|
|
54
54
|
"test": "bun test --conditions=source"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@adecore/editor-core": "0.
|
|
57
|
+
"@adecore/editor-core": "0.54.0",
|
|
58
|
+
"@adecore/utils": "0.54.0",
|
|
58
59
|
"linkedom": "^0.18.14",
|
|
59
60
|
"shiki": "^4.5.0"
|
|
60
61
|
},
|
package/src/column-selection.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { stopCount, xOfStop } from './geometry-stops.ts';
|
|
2
1
|
import type { Selection } from '@adecore/editor-core';
|
|
2
|
+
import { stopCount, xOfStop } from './geometry-stops.ts';
|
|
3
3
|
import { type EditorLayout, TEXT_PADDING } from './layout.ts';
|
|
4
4
|
|
|
5
5
|
export interface ContentPoint {
|
package/src/controller.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import type { Keymap } from './keymap-table.ts';
|
|
2
1
|
import type { CommandOptions, EditorCommand, Selection, TextEdit } from '@adecore/editor-core';
|
|
2
|
+
import { columnSelections, sameCell } from './column-selection.ts';
|
|
3
3
|
import { replacementEdits } from './input.ts';
|
|
4
|
-
import {
|
|
4
|
+
import type { Keymap } from './keymap-table.ts';
|
|
5
5
|
import { chordMatches, type KeyAction, keyAction, type MoveKey } from './keymap.ts';
|
|
6
|
+
import { emit, subscribe } from './listeners.ts';
|
|
6
7
|
import { DoubleModifierGesture } from './modifier-gesture.ts';
|
|
7
8
|
import { NativeInput } from './native-input.ts';
|
|
8
|
-
import { columnSelections, sameCell } from './column-selection.ts';
|
|
9
9
|
import { PointerSelection } from './pointer.ts';
|
|
10
10
|
import { TouchSelection } from './touch.ts';
|
|
11
|
-
import { WheelZoom } from './zoom.ts';
|
|
12
11
|
import type {
|
|
13
12
|
EditorClick,
|
|
14
13
|
EditorClickHandler,
|
|
@@ -25,6 +24,7 @@ import type {
|
|
|
25
24
|
KeyChord
|
|
26
25
|
} from './types.ts';
|
|
27
26
|
import type { EditorView } from './view.ts';
|
|
27
|
+
import { WheelZoom } from './zoom.ts';
|
|
28
28
|
|
|
29
29
|
export interface ControllerOptions {
|
|
30
30
|
keymap?: Keymap;
|
package/src/editor.css
CHANGED
|
@@ -77,8 +77,6 @@
|
|
|
77
77
|
overflow-anchor: none;
|
|
78
78
|
overscroll-behavior: contain;
|
|
79
79
|
touch-action: pan-x pan-y pinch-zoom;
|
|
80
|
-
scrollbar-width: thin;
|
|
81
|
-
scrollbar-color: color-mix(in srgb, var(--text) 25%, transparent) transparent;
|
|
82
80
|
}
|
|
83
81
|
.se-editor[data-wrap='true'] .se-viewport {
|
|
84
82
|
overflow-x: hidden;
|
package/src/engine.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { changedSpans, DocumentModel, type EditorSnapshot, type FoldHints, replacementText } from '@adecore/editor-core';
|
|
2
|
-
import { MAX_REPLACEMENT_CHARACTERS } from './search-protocol.ts';
|
|
3
|
-
import { placeAt, postfixOperands, surroundShape, unwrapTargets } from './text-queries.ts';
|
|
4
|
-
import { GrammarPreparation } from './grammar-preparation.ts';
|
|
5
2
|
import { InputController } from './controller.ts';
|
|
6
|
-
import {
|
|
3
|
+
import { GrammarPreparation } from './grammar-preparation.ts';
|
|
4
|
+
import { fillLens, lensSignature } from './lens.ts';
|
|
7
5
|
import { emit, type Listener, subscribe } from './listeners.ts';
|
|
6
|
+
import { MAX_REPLACEMENT_CHARACTERS } from './search-protocol.ts';
|
|
7
|
+
import { resolveSmartKeys } from './smart-keys.ts';
|
|
8
|
+
import { placeAt, postfixOperands, surroundShape, unwrapTargets } from './text-queries.ts';
|
|
8
9
|
import type {
|
|
9
10
|
Editor,
|
|
10
11
|
EditorAttributionHover,
|
|
@@ -64,7 +65,6 @@ import type {
|
|
|
64
65
|
EditorWidget,
|
|
65
66
|
SmartEditorEngineOptions
|
|
66
67
|
} from './types.ts';
|
|
67
|
-
import { fillLens, lensSignature } from './lens.ts';
|
|
68
68
|
import { EditorView, type ViewSettings } from './view.ts';
|
|
69
69
|
import { clampFontSize, type FontSizeRange, fontSizeRange } from './zoom.ts';
|
|
70
70
|
|
package/src/fake.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { changedSpan, changedSpans, DocumentModel } from '@adecore/editor-core';
|
|
2
|
+
import { isHighSurrogate, isLowSurrogate } from '@adecore/utils/text';
|
|
3
|
+
import { emit, type Listener, subscribe } from './listeners.ts';
|
|
4
|
+
import { placeAt, postfixOperands, surroundShape, unwrapTargets } from './text-queries.ts';
|
|
5
|
+
import { mapTrackedRange } from './tracked-range.ts';
|
|
1
6
|
import type {
|
|
2
7
|
Editor,
|
|
3
8
|
EditorAttributionHover,
|
|
@@ -58,10 +63,6 @@ import type {
|
|
|
58
63
|
EditorWhitespaceCleanup,
|
|
59
64
|
EditorWidget
|
|
60
65
|
} from './types.ts';
|
|
61
|
-
import { emit, type Listener, subscribe } from './listeners.ts';
|
|
62
|
-
import { changedSpan, changedSpans, DocumentModel } from '@adecore/editor-core';
|
|
63
|
-
import { placeAt, postfixOperands, surroundShape, unwrapTargets } from './text-queries.ts';
|
|
64
|
-
import { mapTrackedRange } from './tracked-range.ts';
|
|
65
66
|
|
|
66
67
|
interface OffsetSelection {
|
|
67
68
|
anchor: number;
|
|
@@ -96,14 +97,6 @@ function linesOf(text: string): { start: number; end: number }[] {
|
|
|
96
97
|
return lines;
|
|
97
98
|
}
|
|
98
99
|
|
|
99
|
-
function isHighSurrogate(code: number): boolean {
|
|
100
|
-
return code >= 0xd800 && code <= 0xdbff;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function isLowSurrogate(code: number): boolean {
|
|
104
|
-
return code >= 0xdc00 && code <= 0xdfff;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
100
|
/* Clamps to the text and moves back off the middle of a CRLF or a surrogate pair, as the real document does. */
|
|
108
101
|
function clampOffset(text: string, value: number): number {
|
|
109
102
|
const offset = Math.max(0, Math.min(text.length, Number.isFinite(value) ? Math.trunc(value) : 0));
|
package/src/find.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DocumentChange, DocumentModel, FindMatch, TextEdit } from '@adecore/editor-core';
|
|
2
|
-
import { mapOffset } from './offsets.ts';
|
|
3
2
|
import { FindSearchQueue, scheduleFind, type FindSearchOptions } from './find-search.ts';
|
|
3
|
+
import { mapOffset } from './offsets.ts';
|
|
4
4
|
import { EditorSearchError } from './search-client.ts';
|
|
5
5
|
import type { EditorSearchSnapshot } from './search-protocol.ts';
|
|
6
6
|
import { SEARCH_LIMIT, MAX_REPLACEMENT_PAGE, MAX_REPLACEMENT_CHARACTERS } from './search-protocol.ts';
|
package/src/layout.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { DocumentChange, Position } from '@adecore/editor-core';
|
|
2
|
-
|
|
3
|
-
import { offsetOfStop, rowOfStop, stopAtOffset, stopCount, xOfStop } from './geometry-stops.ts';
|
|
4
2
|
import { BIDI_COLUMNS, bidiControl, visibleBidi } from './bidi.ts';
|
|
5
|
-
import {
|
|
3
|
+
import { offsetOfStop, rowOfStop, stopAtOffset, stopCount, xOfStop } from './geometry-stops.ts';
|
|
6
4
|
import { lineChangeMapper } from './layout-changes.ts';
|
|
7
5
|
import { offsetMapper } from './offsets.ts';
|
|
6
|
+
import { uniformGeometry } from './uniform-geometry.ts';
|
|
8
7
|
|
|
9
8
|
export type Affinity = 'before' | 'after';
|
|
10
9
|
|
package/src/paint.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { offsetOfStop, rowOfStop, stopAtOffset, stopCount, xOfStop } from './geometry-stops.ts';
|
|
2
1
|
import { type AttributedLines, colorValue, tintValue } from './attribution.ts';
|
|
2
|
+
import { BIDI_CONTROLS, BIDI_PATTERN, visibleBidi } from './bidi.ts';
|
|
3
|
+
import { offsetOfStop, rowOfStop, stopAtOffset, stopCount, xOfStop } from './geometry-stops.ts';
|
|
3
4
|
import {
|
|
4
5
|
type BlockReplacement,
|
|
5
6
|
type BlockWidget,
|
|
@@ -14,7 +15,6 @@ import {
|
|
|
14
15
|
type TextRow
|
|
15
16
|
} from './layout.ts';
|
|
16
17
|
import type { EditorChangeKind, EditorGutterIcon, LineToken } from './types.ts';
|
|
17
|
-
import { BIDI_CONTROLS, BIDI_PATTERN, visibleBidi } from './bidi.ts';
|
|
18
18
|
|
|
19
19
|
const ITALIC = 1;
|
|
20
20
|
const BOLD = 2;
|
package/src/search-client.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { createWorkerRequestClient, WorkerRequestError } from './worker-client.ts';
|
|
2
1
|
import type { FindMatch } from '@adecore/editor-core';
|
|
3
|
-
import type { EditorFindQuery } from './types.ts';
|
|
4
2
|
import {
|
|
5
3
|
SEARCH_LIMIT,
|
|
6
4
|
MAX_REPLACEMENT_PAGE,
|
|
@@ -15,6 +13,8 @@ import {
|
|
|
15
13
|
type EditorSearchResult,
|
|
16
14
|
type EditorSearchSnapshot
|
|
17
15
|
} from './search-protocol.ts';
|
|
16
|
+
import type { EditorFindQuery } from './types.ts';
|
|
17
|
+
import { createWorkerRequestClient, WorkerRequestError } from './worker-client.ts';
|
|
18
18
|
|
|
19
19
|
export type EditorSearchErrorKind = 'timeout' | 'superseded' | 'unavailable' | 'syntax' | 'range' | 'snapshot' | 'error' | 'disposed';
|
|
20
20
|
|
package/src/types.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { EditorSearchClientOptions } from './search-client.ts';
|
|
2
|
-
import type { Keymap } from './keymap-table.ts';
|
|
3
1
|
import type { EditorCommand, FoldRole, TextPlaceKind, UnwrapKind, WhitespaceCleanupOptions } from '@adecore/editor-core';
|
|
2
|
+
import type { Keymap } from './keymap-table.ts';
|
|
3
|
+
import type { EditorSearchClientOptions } from './search-client.ts';
|
|
4
4
|
|
|
5
5
|
export type { EditorCommand, FoldRole };
|
|
6
6
|
|
package/src/view.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { offsetOfStop, xOfStop } from './geometry-stops.ts';
|
|
2
|
-
import { visibleBidi } from './bidi.ts';
|
|
3
1
|
import {
|
|
4
2
|
type DocumentChange,
|
|
5
3
|
type DocumentModel,
|
|
@@ -11,8 +9,11 @@ import {
|
|
|
11
9
|
replacementText,
|
|
12
10
|
type Selection as EditorSelection
|
|
13
11
|
} from '@adecore/editor-core';
|
|
14
|
-
import {
|
|
12
|
+
import { type AttributedLines, AttributionRuns, colorValue, tintValue } from './attribution.ts';
|
|
13
|
+
import { visibleBidi } from './bidi.ts';
|
|
14
|
+
import { renderCodeBlock } from './code-block.ts';
|
|
15
15
|
import { FindController } from './find.ts';
|
|
16
|
+
import { offsetOfStop, xOfStop } from './geometry-stops.ts';
|
|
16
17
|
import {
|
|
17
18
|
type BlockReplacement,
|
|
18
19
|
type BlockWidget,
|
|
@@ -26,15 +27,9 @@ import {
|
|
|
26
27
|
subRowBand,
|
|
27
28
|
type VerticalWindow
|
|
28
29
|
} from './layout.ts';
|
|
29
|
-
import { createMetrics, type EditorFont, readEditorFont } from './metrics.ts';
|
|
30
|
-
import { zoomedFont } from './zoom.ts';
|
|
31
|
-
import { type AttributedLines, AttributionRuns, colorValue, tintValue } from './attribution.ts';
|
|
32
|
-
import { renderCodeBlock } from './code-block.ts';
|
|
33
30
|
import { emit, subscribe } from './listeners.ts';
|
|
31
|
+
import { createMetrics, type EditorFont, readEditorFont } from './metrics.ts';
|
|
34
32
|
import { mapOffset, offsetMapper } from './offsets.ts';
|
|
35
|
-
import { mapTrackedRange } from './tracked-range.ts';
|
|
36
|
-
import { type ScrollKind, scrollPosition } from './scroll.ts';
|
|
37
|
-
import { easeOut, scrollDuration } from './scroll-animation.ts';
|
|
38
33
|
import { Outline, scopeChain, type StickyPlacement, stickyCover, stickyPlacements, structuralEntries } from './outline.ts';
|
|
39
34
|
import { type OverviewSpan, overviewTicks, paintOverview } from './overview.ts';
|
|
40
35
|
import {
|
|
@@ -50,9 +45,13 @@ import {
|
|
|
50
45
|
type StickyEntry,
|
|
51
46
|
type WrapSign
|
|
52
47
|
} from './paint.ts';
|
|
48
|
+
import { easeOut, scrollDuration } from './scroll-animation.ts';
|
|
49
|
+
import { type ScrollKind, scrollPosition } from './scroll.ts';
|
|
50
|
+
import { createSearchClient, type EditorSearchClientOptions } from './search-client.ts';
|
|
53
51
|
import { overlayTokens, type SemanticSpan } from './semantic.ts';
|
|
54
52
|
import { TodoMarks } from './todos.ts';
|
|
55
53
|
import { TokenCache } from './tokens.ts';
|
|
54
|
+
import { mapTrackedRange } from './tracked-range.ts';
|
|
56
55
|
import type {
|
|
57
56
|
EditorBlock,
|
|
58
57
|
EditorChangeKind,
|
|
@@ -73,6 +72,7 @@ import type {
|
|
|
73
72
|
LineTokenizer,
|
|
74
73
|
ScopeColors
|
|
75
74
|
} from './types.ts';
|
|
75
|
+
import { zoomedFont } from './zoom.ts';
|
|
76
76
|
|
|
77
77
|
function sameRect(left: EditorRect, right: EditorRect): boolean {
|
|
78
78
|
return left.left === right.left && left.top === right.top && left.right === right.right && left.bottom === right.bottom;
|