@vscode/markdown-editor 0.0.2-7 → 0.0.2-70
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/README.md +26 -0
- package/dist/commands.d.ts +65 -0
- package/dist/commands.js +159 -0
- package/dist/commands.js.map +1 -0
- package/dist/config-BGeaJqWk.js +286 -0
- package/dist/config-BGeaJqWk.js.map +1 -0
- package/dist/config.d.ts +10 -0
- package/dist/config.js +6 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +1490 -116
- package/dist/index.js +6170 -2006
- package/dist/index.js.map +1 -1
- package/dist/markdown-editor.css +1 -0
- package/dist/stringEdit-CVDbCUBY.js +215 -0
- package/dist/stringEdit-CVDbCUBY.js.map +1 -0
- package/dist/web-editors.d.ts +282 -0
- package/dist/web-editors.js +7240 -0
- package/dist/web-editors.js.map +1 -0
- package/package.json +60 -17
- package/src/contrib/comments/commentInput.css +150 -0
- package/src/contrib/comments/comments.css +129 -0
- package/src/contrib/commentsVscode/vscodeCommentWidgetV2.css +171 -0
- package/src/contrib/find/find.css +347 -0
- package/src/view/editor.css +555 -25
- package/src/view/themes/default.css +13 -4
- package/src/view/themes/github.css +16 -13
- package/src/view/themes/vscode-default.css +397 -0
- package/src/view/themes/vscode-github.css +393 -0
- package/dist/_observables/assert.d.ts +0 -2
- package/dist/_observables/deps.d.ts +0 -28
- package/dist/_observables/disposables.d.ts +0 -19
- package/dist/_observables/equals.d.ts +0 -32
- package/dist/_observables/index.d.ts +0 -2
- package/dist/_observables/observableInternal/base.d.ts +0 -172
- package/dist/_observables/observableInternal/changeTracker.d.ts +0 -44
- package/dist/_observables/observableInternal/commonFacade/cancellation.d.ts +0 -24
- package/dist/_observables/observableInternal/commonFacade/deps.d.ts +0 -24
- package/dist/_observables/observableInternal/debugLocation.d.ts +0 -21
- package/dist/_observables/observableInternal/debugName.d.ts +0 -33
- package/dist/_observables/observableInternal/experimental/deferUnobserve.d.ts +0 -16
- package/dist/_observables/observableInternal/experimental/reducer.d.ts +0 -37
- package/dist/_observables/observableInternal/experimental/utils.d.ts +0 -15
- package/dist/_observables/observableInternal/index.d.ts +0 -25
- package/dist/_observables/observableInternal/logging/consoleObservableLogger.d.ts +0 -40
- package/dist/_observables/observableInternal/logging/debugGetDependencyGraph.d.ts +0 -4
- package/dist/_observables/observableInternal/logging/debugger/debuggerRpc.d.ts +0 -4
- package/dist/_observables/observableInternal/logging/debugger/devToolsLogger.d.ts +0 -43
- package/dist/_observables/observableInternal/logging/debugger/rpc.d.ts +0 -41
- package/dist/_observables/observableInternal/logging/debugger/utils.d.ts +0 -13
- package/dist/_observables/observableInternal/logging/logging.d.ts +0 -30
- package/dist/_observables/observableInternal/map.d.ts +0 -18
- package/dist/_observables/observableInternal/observables/baseObservable.d.ts +0 -58
- package/dist/_observables/observableInternal/observables/constObservable.d.ts +0 -5
- package/dist/_observables/observableInternal/observables/derived.d.ts +0 -46
- package/dist/_observables/observableInternal/observables/derivedImpl.d.ts +0 -83
- package/dist/_observables/observableInternal/observables/lazyObservableValue.d.ts +0 -27
- package/dist/_observables/observableInternal/observables/observableFromEvent.d.ts +0 -37
- package/dist/_observables/observableInternal/observables/observableSignal.d.ts +0 -11
- package/dist/_observables/observableInternal/observables/observableSignalFromEvent.d.ts +0 -5
- package/dist/_observables/observableInternal/observables/observableValue.d.ts +0 -37
- package/dist/_observables/observableInternal/observables/observableValueOpts.d.ts +0 -8
- package/dist/_observables/observableInternal/reactions/autorun.d.ts +0 -56
- package/dist/_observables/observableInternal/reactions/autorunImpl.d.ts +0 -53
- package/dist/_observables/observableInternal/set.d.ts +0 -17
- package/dist/_observables/observableInternal/transaction.d.ts +0 -27
- package/dist/_observables/observableInternal/utils/promise.d.ts +0 -75
- package/dist/_observables/observableInternal/utils/runOnChange.d.ts +0 -7
- package/dist/_observables/observableInternal/utils/utils.d.ts +0 -43
- package/dist/_observables/observableInternal/utils/utilsCancellation.d.ts +0 -10
- package/dist/_observables/observableInternal/utils/valueWithChangeEvent.d.ts +0 -10
- package/dist/_observables/utils.d.ts +0 -15
- package/dist/observables.d.ts +0 -4
- package/dist/observables.js +0 -439
- package/dist/observables.js.map +0 -1
- package/dist/runOnChange-C00UIwqQ.js +0 -1538
- package/dist/runOnChange-C00UIwqQ.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.vscode-comments-light,.vscode-comments-dark{--vscode-cornerRadius-small: 4px;--vscode-cornerRadius-medium: 6px;--vscode-cornerRadius-large: 8px;--vscode-strokeThickness: 1px;--vscode-shadow-lg: 0 0 12px rgba(0, 0, 0, .14);--monaco-monospace-font: "SF Mono", Monaco, Menlo, Courier, monospace;font-family:var(--vscode-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif);font-size:13px;color:var(--vscode-foreground);background:var(--vscode-editor-background)}.vscode-comments-light{--vscode-agentFeedbackEditorWidget-background: #eeeeee;--vscode-agentFeedbackEditorWidget-border: rgba(59, 59, 59, .35);--vscode-editorWidget-background: #f8f8f8;--vscode-editorWidget-border: rgba(59, 59, 59, .2);--vscode-widget-border: #e5e5e5;--vscode-foreground: #3b3b3b;--vscode-descriptionForeground: #3b3b3b;--vscode-list-hoverBackground: #f2f2f2;--vscode-list-activeSelectionBackground: #e8e8e8;--vscode-list-activeSelectionForeground: #000000;--vscode-toolbar-hoverBackground: rgba(184, 184, 184, .31);--vscode-charts-purple: #652d90;--vscode-input-background: #ffffff;--vscode-input-foreground: #3b3b3b;--vscode-input-placeholderForeground: #767676;--vscode-focusBorder: #005fb8;--vscode-editorGutter-modifiedBackground: #1b81a8;--vscode-button-background: #005fb8;--vscode-button-foreground: #ffffff;--vscode-button-hoverBackground: #0258a8;--vscode-button-border: rgba(0, 0, 0, .1);--vscode-button-secondaryBackground: #e5e5e5;--vscode-button-secondaryForeground: #3b3b3b;--vscode-button-secondaryHoverBackground: #cccccc;--vscode-editor-background: #ffffff;--vscode-editor-foreground: #3b3b3b}.vscode-comments-dark{--vscode-agentFeedbackEditorWidget-background: #222222;--vscode-agentFeedbackEditorWidget-border: rgba(204, 204, 204, .35);--vscode-editorWidget-background: #202020;--vscode-editorWidget-border: rgba(204, 204, 204, .2);--vscode-widget-border: #313131;--vscode-foreground: #cccccc;--vscode-descriptionForeground: #9d9d9d;--vscode-list-hoverBackground: #2a2d2e;--vscode-list-activeSelectionBackground: #04395e;--vscode-list-activeSelectionForeground: #ffffff;--vscode-toolbar-hoverBackground: rgba(90, 93, 94, .31);--vscode-charts-purple: #b180d7;--vscode-input-background: #313131;--vscode-input-foreground: #cccccc;--vscode-input-placeholderForeground: #989898;--vscode-focusBorder: #0078d4;--vscode-editorGutter-modifiedBackground: #1b81a8;--vscode-button-background: #0078d4;--vscode-button-foreground: #ffffff;--vscode-button-hoverBackground: #026ec1;--vscode-button-border: rgba(255, 255, 255, .1);--vscode-button-secondaryBackground: transparent;--vscode-button-secondaryForeground: #cccccc;--vscode-button-secondaryHoverBackground: #2b2b2b;--vscode-editor-background: #1f1f1f;--vscode-editor-foreground: #cccccc}.agent-feedback-widget .codicon{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;flex:0 0 auto}.agent-feedback-widget .codicon svg{display:block;width:16px;height:16px}.agent-feedback-widget .monaco-action-bar .actions-container{display:flex;align-items:center;gap:2px;margin:0;padding:0;list-style:none}.agent-feedback-widget .monaco-action-bar .action-item{display:flex}.agent-feedback-widget .monaco-action-bar .action-label{display:flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:var(--vscode-cornerRadius-small);color:var(--vscode-foreground);cursor:pointer;text-decoration:none}.agent-feedback-widget .monaco-action-bar .action-label:hover{background-color:var(--vscode-toolbar-hoverBackground)}.agent-feedback-widget{position:absolute;max-width:280px;min-width:180px;background-color:var(--vscode-agentFeedbackEditorWidget-background, var(--vscode-editorWidget-background));border:var(--vscode-strokeThickness) solid var(--vscode-agentFeedbackEditorWidget-border, var(--vscode-editorWidget-border, var(--vscode-contrastBorder)));border-radius:var(--vscode-cornerRadius-large);box-shadow:var(--vscode-shadow-lg);font-size:var(--vscode-agents-fontSize-label1);line-height:1.4;opacity:0;transition:opacity .2s ease-in-out;z-index:10}.hc-black .agent-feedback-widget,.hc-light .agent-feedback-widget{box-shadow:none}.agent-feedback-widget.visible{opacity:1}.agent-feedback-widget:focus{outline:none}.agent-feedback-widget.fadeOut{animation:agentFeedbackFadeOut .15s ease-out forwards}@keyframes agentFeedbackFadeOut{0%{opacity:1}to{opacity:0}}.agent-feedback-widget-arrow{position:absolute;left:-6px;top:11px;width:0;height:0;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:6px solid var(--vscode-agentFeedbackEditorWidget-border, var(--vscode-editorWidget-border, var(--vscode-contrastBorder)));display:none}.agent-feedback-widget.collapsed .agent-feedback-widget-arrow{display:none}.agent-feedback-widget-arrow:after{content:"";position:absolute;left:2px;top:-5px;width:0;height:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid var(--vscode-agentFeedbackEditorWidget-background, var(--vscode-editorWidget-background))}.agent-feedback-widget-header{display:flex;align-items:center;padding:4px 4px 4px 8px;border-bottom:1px solid var(--vscode-editorWidget-border, var(--vscode-widget-border));border-radius:var(--vscode-cornerRadius-large) var(--vscode-cornerRadius-large) 0 0;overflow:hidden;cursor:pointer;gap:6px}.agent-feedback-widget.collapsed .agent-feedback-widget-header{border-bottom:none;border-radius:var(--vscode-cornerRadius-large)}.agent-feedback-widget-header:hover{background-color:var(--vscode-list-hoverBackground)}.agent-feedback-widget-title{font-weight:var(--vscode-agents-fontWeight-semiBold);line-height:16px;color:var(--vscode-foreground);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.agent-feedback-widget-spacer{flex:1}.agent-feedback-widget-toggle{display:flex;align-items:center;justify-content:center;width:22px;height:22px;min-width:22px;border-radius:var(--vscode-cornerRadius-medium);cursor:pointer;color:var(--vscode-foreground);opacity:.7;transition:opacity .1s}.agent-feedback-widget-toggle:hover{opacity:1;background-color:var(--vscode-toolbar-hoverBackground)}.agent-feedback-widget-body{transition:max-height .2s ease-in-out,padding .2s ease-in-out;border-radius:0 0 var(--vscode-cornerRadius-large) var(--vscode-cornerRadius-large);overflow:hidden}.agent-feedback-widget-body.collapsed{max-height:0;overflow:hidden;padding:0}.agent-feedback-widget-item{display:flex;flex-direction:column;padding:4px 4px 8px 8px;border-bottom:1px solid var(--vscode-editorWidget-border, var(--vscode-widget-border));cursor:pointer;position:relative;gap:6px}.agent-feedback-widget-item:last-child{border-bottom:none}.agent-feedback-widget-item:hover{background-color:var(--vscode-list-hoverBackground)}.agent-feedback-widget-item.focused{background-color:var(--vscode-list-activeSelectionBackground);color:var(--vscode-list-activeSelectionForeground)}.agent-feedback-widget-item-header{display:flex;align-items:center;justify-content:space-between;gap:8px}.agent-feedback-widget-item-meta{display:flex;align-items:center;gap:6px;min-width:0;flex-wrap:wrap}.agent-feedback-widget-item-actions{margin-left:auto;flex:0 0 auto;opacity:0;visibility:hidden;pointer-events:none}.agent-feedback-widget-item:hover .agent-feedback-widget-item-actions{opacity:1;visibility:visible;pointer-events:auto}.agent-feedback-widget-item-type{display:inline-flex;align-items:center;padding:2px 6px;border-radius:var(--vscode-cornerRadius-small);font-size:var(--vscode-agents-fontSize-label3);font-weight:var(--vscode-agents-fontWeight-semiBold);letter-spacing:.2px;background:color-mix(in srgb,var(--vscode-editorWidget-border, var(--vscode-widget-border)) 25%,transparent);color:var(--vscode-descriptionForeground)}.agent-feedback-widget-item-prReview .agent-feedback-widget-item-type,.agent-feedback-widget-item-agentFeedback .agent-feedback-widget-item-type{background:color-mix(in srgb,var(--vscode-charts-purple) 22%,var(--vscode-editorWidget-background));color:var(--vscode-charts-purple)}.agent-feedback-widget-line-info{font-size:var(--vscode-agents-fontSize-label3);font-weight:var(--vscode-agents-fontWeight-semiBold);color:var(--vscode-descriptionForeground);text-transform:uppercase;letter-spacing:.5px}.agent-feedback-widget-text{color:var(--vscode-foreground);word-wrap:break-word;user-select:text;-webkit-user-select:text;cursor:text}.agent-feedback-widget-text .rendered-markdown p{margin:0}.agent-feedback-widget-text .rendered-markdown code{font-family:var(--monaco-monospace-font);font-size:var(--vscode-agents-fontSize-label3);padding:1px 4px;border-radius:var(--vscode-cornerRadius-small);background:color-mix(in srgb,var(--vscode-editorWidget-border, var(--vscode-widget-border)) 25%,transparent)}.agent-feedback-widget-suggestion{display:flex;flex-direction:column;gap:6px;margin-top:8px;padding:0 8px 4px 12px}.agent-feedback-widget-item-prReview .agent-feedback-widget-suggestion{border-left:1px solid color-mix(in srgb,var(--vscode-charts-purple) 50%,transparent)}.agent-feedback-widget-suggestion-header{font-size:var(--vscode-agents-fontSize-label3);font-weight:var(--vscode-agents-fontWeight-semiBold);text-transform:uppercase;letter-spacing:.4px;color:var(--vscode-descriptionForeground)}.agent-feedback-widget-suggestion-edit{display:flex;flex-direction:column;gap:4px}.agent-feedback-widget-suggestion-text{margin:0;padding:6px 8px;border-radius:var(--vscode-cornerRadius-small);overflow-x:auto;white-space:pre-wrap;font-family:var(--monaco-monospace-font);font-size:var(--vscode-agents-fontSize-label3);line-height:1.45;background:var(--vscode-editorWidget-background);user-select:text;-webkit-user-select:text;cursor:text}.agent-feedback-widget-range-glyph{margin-left:8px;z-index:5;border-left:2px solid var(--vscode-editorGutter-modifiedBackground)}.agent-feedback-widget-text.editing{padding:0 4px 0 0}.agent-feedback-widget-edit-textarea{width:100%;min-height:22px;padding:4px 6px;border:1px solid var(--vscode-focusBorder);border-radius:var(--vscode-cornerRadius-small);background:var(--vscode-input-background);color:var(--vscode-input-foreground);font:inherit;font-size:12px;line-height:1.4;resize:none;overflow:hidden;box-sizing:border-box}.agent-feedback-widget-edit-textarea:focus{outline:none;border-color:var(--vscode-focusBorder)}.agent-feedback-widget-replies{display:flex;flex-direction:column;gap:4px}.agent-feedback-widget-reply{padding-top:4px;border-top:1px dashed color-mix(in srgb,var(--vscode-editorWidget-border, var(--vscode-widget-border)) 60%,transparent)}.agent-feedback-widget-reply-text{color:var(--vscode-foreground);word-wrap:break-word;user-select:text;-webkit-user-select:text;cursor:text}.agent-feedback-widget-reply-text .rendered-markdown p{margin:0}.agent-feedback-widget-reply-text .rendered-markdown code{font-family:var(--monaco-monospace-font);font-size:var(--vscode-agents-fontSize-label3);padding:2px 4px;border-radius:var(--vscode-cornerRadius-small);background:color-mix(in srgb,var(--vscode-editorWidget-border, var(--vscode-widget-border)) 25%,transparent)}.agent-feedback-widget-add-reply{padding-top:4px;border-top:1px dashed color-mix(in srgb,var(--vscode-editorWidget-border, var(--vscode-widget-border)) 60%,transparent)}.agent-feedback-widget-add-reply .agent-feedback-widget-edit-textarea::placeholder{color:var(--vscode-input-placeholderForeground);opacity:1}.agent-feedback-widget-actions-bar{display:flex;gap:6px;margin-top:4px}.agent-feedback-widget-actions-bar .monaco-button{flex:1;padding:2px 10px;width:auto;font-size:var(--vscode-agents-fontSize-label2);line-height:18px}.vscode-comments-light{--vscode-icon-foreground: #616161;--vscode-textLink-foreground: #005fb8}.vscode-comments-dark{--vscode-editorWidget-background: #202122;--vscode-editorHoverWidget-border: #2a2b2c;--vscode-foreground: #bfbfbf;--vscode-icon-foreground: #8c8c8c;--vscode-textLink-foreground: #4daafc}.vscode-comment-widget-v2{box-sizing:border-box;width:320px;display:flex;flex-direction:column;gap:12px;padding:8px;background:var(--vscode-editorWidget-background, #202122);border:none;border-radius:var(--vscode-cornerRadius-large, 8px);box-shadow:inset 0 0 0 1px var(--vscode-editorHoverWidget-border, var(--vscode-editorWidget-border, #2a2b2c)),0 8px 8px #00000040;font-family:var(--vscode-font-family, "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif)}.vscode-comment-widget-v2 *,.vscode-comment-widget-v2 *:before,.vscode-comment-widget-v2 *:after{box-sizing:border-box}.vscode-comment-widget-v2-header{display:flex;align-items:center;justify-content:space-between;width:100%}.vscode-comment-widget-v2-title-group{display:flex;align-items:center;gap:6px;flex:1 0 0;min-width:0}.vscode-comment-widget-v2-username{flex:1 0 0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:600;line-height:16px;color:var(--vscode-foreground, #bfbfbf)}.vscode-comment-widget-v2-actions{display:flex;align-items:center;gap:4px;flex-shrink:0}.vscode-comment-widget-v2-action{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;margin:0;border:none;background:transparent;color:var(--vscode-icon-foreground, #8c8c8c);cursor:pointer}.vscode-comment-widget-v2-action:hover{color:var(--vscode-foreground, #bfbfbf)}.vscode-comment-widget-v2-action svg{display:block;width:16px;height:16px}.vscode-comment-widget-v2-body{display:flex;flex-direction:column;gap:6px;width:100%}.vscode-comment-widget-v2-text{margin:0;width:100%;font-size:13px;font-weight:400;line-height:16px;color:var(--vscode-foreground, #bfbfbf);opacity:.9;white-space:pre-wrap;word-break:break-word}.vscode-comment-widget-v2--collapsed .vscode-comment-widget-v2-text{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3;overflow:hidden}.vscode-comment-widget-v2-toggle{align-self:flex-start;padding:0;margin:0;border:none;background:none;cursor:pointer;text-align:left;font-family:inherit;font-size:12px;font-weight:400;line-height:normal;color:var(--vscode-textLink-foreground, #48a0c7)}.vscode-comment-widget-v2-toggle:hover{text-decoration:underline}.md-comment-shapes{position:absolute;top:0;left:0;width:100%;height:100%;overflow:visible;pointer-events:none}.md-comment-group{opacity:var(--md-comment-opacity, .16);transition:opacity .1s ease}.md-comment-group-hovered{opacity:var(--md-comment-opacity-hover, .3)}.md-comment-shape-path{fill:var(--md-comment-color, rgb(64, 120, 240));stroke:none}.md-comment-leader-path{fill:none;stroke:var(--md-comment-color, rgb(64, 120, 240));stroke-width:2;stroke-linecap:butt;stroke-linejoin:round}.md-comment-card{position:absolute;box-sizing:border-box;display:flex;flex-direction:column;gap:8px;padding:12px 14px;background:var(--vscode-editorWidget-background, #fff);color:var(--vscode-editorWidget-foreground, #1f1f1f);border:1px solid var(--vscode-editorWidget-border, #e0e0e0);border-radius:8px;box-shadow:0 2px 8px #0000001a;font-family:var(--vscode-font-family, system-ui, sans-serif);font-size:13px;transition:box-shadow .1s ease,border-color .1s ease,top .12s ease}.md-comment-card-hovered{border-color:var(--md-comment-leader-hover, rgba(64, 120, 240, 1));box-shadow:0 3px 12px #00000029}.md-comment-card-header{display:flex;align-items:center;gap:8px}.md-comment-avatar{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;background:var(--md-comment-avatar-bg, #d6e2fb);color:var(--md-comment-avatar-fg, #25408f);font-size:10px;font-weight:600;letter-spacing:.3px}.md-comment-author{font-weight:600}.md-comment-time{color:var(--vscode-descriptionForeground, #767676);font-size:12px}.md-comment-menu{margin-left:auto;color:var(--vscode-descriptionForeground, #767676);cursor:default;user-select:none}.md-comment-body{line-height:1.45;white-space:pre-wrap;word-break:break-word}.md-comment-reply{align-self:flex-start;margin:0;padding:0;border:none;background:transparent;color:var(--vscode-textLink-foreground, #2563c9);font:inherit;font-weight:600;cursor:pointer}.md-comment-reply:hover{text-decoration:underline}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
class s {
|
|
2
|
+
constructor(e, t) {
|
|
3
|
+
if (this.start = e, this.endExclusive = t, e > t)
|
|
4
|
+
throw new Error(`Invalid range: [${e}, ${t})`);
|
|
5
|
+
}
|
|
6
|
+
static fromTo(e, t) {
|
|
7
|
+
return new s(e, t);
|
|
8
|
+
}
|
|
9
|
+
static ofLength(e) {
|
|
10
|
+
return new s(0, e);
|
|
11
|
+
}
|
|
12
|
+
static ofStartAndLength(e, t) {
|
|
13
|
+
return new s(e, e + t);
|
|
14
|
+
}
|
|
15
|
+
static emptyAt(e) {
|
|
16
|
+
return new s(e, e);
|
|
17
|
+
}
|
|
18
|
+
get isEmpty() {
|
|
19
|
+
return this.start === this.endExclusive;
|
|
20
|
+
}
|
|
21
|
+
get length() {
|
|
22
|
+
return this.endExclusive - this.start;
|
|
23
|
+
}
|
|
24
|
+
delta(e) {
|
|
25
|
+
return new s(this.start + e, this.endExclusive + e);
|
|
26
|
+
}
|
|
27
|
+
deltaStart(e) {
|
|
28
|
+
return new s(this.start + e, this.endExclusive);
|
|
29
|
+
}
|
|
30
|
+
deltaEnd(e) {
|
|
31
|
+
return new s(this.start, this.endExclusive + e);
|
|
32
|
+
}
|
|
33
|
+
contains(e) {
|
|
34
|
+
return this.start <= e && e < this.endExclusive;
|
|
35
|
+
}
|
|
36
|
+
containsRange(e) {
|
|
37
|
+
return this.start <= e.start && e.endExclusive <= this.endExclusive;
|
|
38
|
+
}
|
|
39
|
+
intersects(e) {
|
|
40
|
+
return Math.max(this.start, e.start) < Math.min(this.endExclusive, e.endExclusive);
|
|
41
|
+
}
|
|
42
|
+
intersectsOrTouches(e) {
|
|
43
|
+
return Math.max(this.start, e.start) <= Math.min(this.endExclusive, e.endExclusive);
|
|
44
|
+
}
|
|
45
|
+
intersect(e) {
|
|
46
|
+
const t = Math.max(this.start, e.start), n = Math.min(this.endExclusive, e.endExclusive);
|
|
47
|
+
if (t <= n)
|
|
48
|
+
return new s(t, n);
|
|
49
|
+
}
|
|
50
|
+
join(e) {
|
|
51
|
+
return new s(
|
|
52
|
+
Math.min(this.start, e.start),
|
|
53
|
+
Math.max(this.endExclusive, e.endExclusive)
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
isBefore(e) {
|
|
57
|
+
return this.endExclusive <= e.start;
|
|
58
|
+
}
|
|
59
|
+
isAfter(e) {
|
|
60
|
+
return this.start >= e.endExclusive;
|
|
61
|
+
}
|
|
62
|
+
substring(e) {
|
|
63
|
+
return e.substring(this.start, this.endExclusive);
|
|
64
|
+
}
|
|
65
|
+
slice(e) {
|
|
66
|
+
return e.slice(this.start, this.endExclusive);
|
|
67
|
+
}
|
|
68
|
+
equals(e) {
|
|
69
|
+
return this.start === e.start && this.endExclusive === e.endExclusive;
|
|
70
|
+
}
|
|
71
|
+
toString() {
|
|
72
|
+
return `[${this.start}, ${this.endExclusive})`;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
class a {
|
|
76
|
+
constructor(e, t) {
|
|
77
|
+
this.replaceRange = e, this.newText = t;
|
|
78
|
+
}
|
|
79
|
+
static insert(e, t) {
|
|
80
|
+
return new a(s.emptyAt(e), t);
|
|
81
|
+
}
|
|
82
|
+
static replace(e, t) {
|
|
83
|
+
return new a(e, t);
|
|
84
|
+
}
|
|
85
|
+
static delete(e) {
|
|
86
|
+
return new a(e, "");
|
|
87
|
+
}
|
|
88
|
+
get isEmpty() {
|
|
89
|
+
return this.replaceRange.isEmpty && this.newText.length === 0;
|
|
90
|
+
}
|
|
91
|
+
equals(e) {
|
|
92
|
+
return this.replaceRange.equals(e.replaceRange) && this.newText === e.newText;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Narrows this replacement to the span that actually changes, by trimming
|
|
96
|
+
* the prefix and suffix it shares with the text it replaces in `source`.
|
|
97
|
+
*/
|
|
98
|
+
removeCommonSuffixPrefix(e) {
|
|
99
|
+
const t = this.replaceRange.substring(e), n = h(t, this.newText), r = Math.min(
|
|
100
|
+
t.length - n,
|
|
101
|
+
this.newText.length - n,
|
|
102
|
+
u(t, this.newText)
|
|
103
|
+
);
|
|
104
|
+
return new a(
|
|
105
|
+
new s(
|
|
106
|
+
this.replaceRange.start + n,
|
|
107
|
+
this.replaceRange.endExclusive - r
|
|
108
|
+
),
|
|
109
|
+
this.newText.substring(n, this.newText.length - r)
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
toString() {
|
|
113
|
+
return `${this.replaceRange} -> ${JSON.stringify(this.newText)}`;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function h(i, e) {
|
|
117
|
+
const t = Math.min(i.length, e.length);
|
|
118
|
+
let n = 0;
|
|
119
|
+
for (; n < t && i.charCodeAt(n) === e.charCodeAt(n); )
|
|
120
|
+
n++;
|
|
121
|
+
return n;
|
|
122
|
+
}
|
|
123
|
+
function u(i, e) {
|
|
124
|
+
const t = Math.min(i.length, e.length);
|
|
125
|
+
let n = 0;
|
|
126
|
+
for (; n < t && i.charCodeAt(i.length - n - 1) === e.charCodeAt(e.length - n - 1); )
|
|
127
|
+
n++;
|
|
128
|
+
return n;
|
|
129
|
+
}
|
|
130
|
+
class l {
|
|
131
|
+
static empty = new l([]);
|
|
132
|
+
static single(e) {
|
|
133
|
+
return new l([e]);
|
|
134
|
+
}
|
|
135
|
+
static replace(e, t) {
|
|
136
|
+
return new l([a.replace(e, t)]);
|
|
137
|
+
}
|
|
138
|
+
static insert(e, t) {
|
|
139
|
+
return new l([a.insert(e, t)]);
|
|
140
|
+
}
|
|
141
|
+
static delete(e) {
|
|
142
|
+
return new l([a.delete(e)]);
|
|
143
|
+
}
|
|
144
|
+
replacements;
|
|
145
|
+
constructor(e) {
|
|
146
|
+
let t = -1;
|
|
147
|
+
for (const n of e) {
|
|
148
|
+
if (n.replaceRange.start < t)
|
|
149
|
+
throw new Error(
|
|
150
|
+
`Edits must be disjoint and sorted. Found ${n} after ${t}`
|
|
151
|
+
);
|
|
152
|
+
t = n.replaceRange.endExclusive;
|
|
153
|
+
}
|
|
154
|
+
this.replacements = e;
|
|
155
|
+
}
|
|
156
|
+
get isEmpty() {
|
|
157
|
+
return this.replacements.length === 0;
|
|
158
|
+
}
|
|
159
|
+
apply(e) {
|
|
160
|
+
const t = [];
|
|
161
|
+
let n = 0;
|
|
162
|
+
for (const r of this.replacements)
|
|
163
|
+
t.push(e.substring(n, r.replaceRange.start)), t.push(r.newText), n = r.replaceRange.endExclusive;
|
|
164
|
+
return t.push(e.substring(n)), t.join("");
|
|
165
|
+
}
|
|
166
|
+
inverse(e) {
|
|
167
|
+
const t = [];
|
|
168
|
+
let n = 0;
|
|
169
|
+
for (const r of this.replacements) {
|
|
170
|
+
const c = e.substring(r.replaceRange.start, r.replaceRange.endExclusive);
|
|
171
|
+
t.push(
|
|
172
|
+
a.replace(
|
|
173
|
+
s.ofStartAndLength(r.replaceRange.start + n, r.newText.length),
|
|
174
|
+
c
|
|
175
|
+
)
|
|
176
|
+
), n += r.newText.length - r.replaceRange.length;
|
|
177
|
+
}
|
|
178
|
+
return new l(t);
|
|
179
|
+
}
|
|
180
|
+
equals(e) {
|
|
181
|
+
if (this.replacements.length !== e.replacements.length)
|
|
182
|
+
return !1;
|
|
183
|
+
for (let t = 0; t < this.replacements.length; t++)
|
|
184
|
+
if (!this.replacements[t].equals(e.replacements[t]))
|
|
185
|
+
return !1;
|
|
186
|
+
return !0;
|
|
187
|
+
}
|
|
188
|
+
mapOffset(e) {
|
|
189
|
+
let t = 0;
|
|
190
|
+
for (const n of this.replacements) {
|
|
191
|
+
if (n.replaceRange.start > e)
|
|
192
|
+
break;
|
|
193
|
+
if (n.replaceRange.endExclusive <= e)
|
|
194
|
+
t += n.newText.length - n.replaceRange.length;
|
|
195
|
+
else
|
|
196
|
+
return n.replaceRange.start + t + n.newText.length;
|
|
197
|
+
}
|
|
198
|
+
return e + t;
|
|
199
|
+
}
|
|
200
|
+
toString() {
|
|
201
|
+
return `[${this.replacements.map((e) => e.toString()).join(", ")}]`;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
function o(i, e) {
|
|
205
|
+
return i === e ? l.empty : l.single(
|
|
206
|
+
a.replace(new s(0, i.length), e).removeCommonSuffixPrefix(i)
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
export {
|
|
210
|
+
s as O,
|
|
211
|
+
l as S,
|
|
212
|
+
a,
|
|
213
|
+
o as c
|
|
214
|
+
};
|
|
215
|
+
//# sourceMappingURL=stringEdit-CVDbCUBY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stringEdit-CVDbCUBY.js","sources":["../src/core/offsetRange.ts","../src/core/stringEdit.ts"],"sourcesContent":["export class OffsetRange {\n\tpublic static fromTo(start: number, endExclusive: number): OffsetRange {\n\t\treturn new OffsetRange(start, endExclusive);\n\t}\n\n\tpublic static ofLength(length: number): OffsetRange {\n\t\treturn new OffsetRange(0, length);\n\t}\n\n\tpublic static ofStartAndLength(start: number, length: number): OffsetRange {\n\t\treturn new OffsetRange(start, start + length);\n\t}\n\n\tpublic static emptyAt(offset: number): OffsetRange {\n\t\treturn new OffsetRange(offset, offset);\n\t}\n\n\tconstructor(\n\t\tpublic readonly start: number,\n\t\tpublic readonly endExclusive: number,\n\t) {\n\t\tif (start > endExclusive) {\n\t\t\tthrow new Error(`Invalid range: [${start}, ${endExclusive})`);\n\t\t}\n\t}\n\n\tget isEmpty(): boolean {\n\t\treturn this.start === this.endExclusive;\n\t}\n\n\tget length(): number {\n\t\treturn this.endExclusive - this.start;\n\t}\n\n\tpublic delta(offset: number): OffsetRange {\n\t\treturn new OffsetRange(this.start + offset, this.endExclusive + offset);\n\t}\n\n\tpublic deltaStart(offset: number): OffsetRange {\n\t\treturn new OffsetRange(this.start + offset, this.endExclusive);\n\t}\n\n\tpublic deltaEnd(offset: number): OffsetRange {\n\t\treturn new OffsetRange(this.start, this.endExclusive + offset);\n\t}\n\n\tpublic contains(offset: number): boolean {\n\t\treturn this.start <= offset && offset < this.endExclusive;\n\t}\n\n\tpublic containsRange(other: OffsetRange): boolean {\n\t\treturn this.start <= other.start && other.endExclusive <= this.endExclusive;\n\t}\n\n\tpublic intersects(other: OffsetRange): boolean {\n\t\treturn Math.max(this.start, other.start) < Math.min(this.endExclusive, other.endExclusive);\n\t}\n\n\tpublic intersectsOrTouches(other: OffsetRange): boolean {\n\t\treturn Math.max(this.start, other.start) <= Math.min(this.endExclusive, other.endExclusive);\n\t}\n\n\tpublic intersect(other: OffsetRange): OffsetRange | undefined {\n\t\tconst start = Math.max(this.start, other.start);\n\t\tconst end = Math.min(this.endExclusive, other.endExclusive);\n\t\tif (start <= end) {\n\t\t\treturn new OffsetRange(start, end);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tpublic join(other: OffsetRange): OffsetRange {\n\t\treturn new OffsetRange(\n\t\t\tMath.min(this.start, other.start),\n\t\t\tMath.max(this.endExclusive, other.endExclusive),\n\t\t);\n\t}\n\n\tpublic isBefore(other: OffsetRange): boolean {\n\t\treturn this.endExclusive <= other.start;\n\t}\n\n\tpublic isAfter(other: OffsetRange): boolean {\n\t\treturn this.start >= other.endExclusive;\n\t}\n\n\tpublic substring(str: string): string {\n\t\treturn str.substring(this.start, this.endExclusive);\n\t}\n\n\tpublic slice<T>(arr: readonly T[]): T[] {\n\t\treturn arr.slice(this.start, this.endExclusive);\n\t}\n\n\tpublic equals(other: OffsetRange): boolean {\n\t\treturn this.start === other.start && this.endExclusive === other.endExclusive;\n\t}\n\n\tpublic toString(): string {\n\t\treturn `[${this.start}, ${this.endExclusive})`;\n\t}\n}\n","import { OffsetRange } from './offsetRange.js';\n\nexport class StringReplacement {\n\tpublic static insert(offset: number, text: string): StringReplacement {\n\t\treturn new StringReplacement(OffsetRange.emptyAt(offset), text);\n\t}\n\n\tpublic static replace(range: OffsetRange, text: string): StringReplacement {\n\t\treturn new StringReplacement(range, text);\n\t}\n\n\tpublic static delete(range: OffsetRange): StringReplacement {\n\t\treturn new StringReplacement(range, '');\n\t}\n\n\tconstructor(\n\t\tpublic readonly replaceRange: OffsetRange,\n\t\tpublic readonly newText: string,\n\t) {}\n\n\tget isEmpty(): boolean {\n\t\treturn this.replaceRange.isEmpty && this.newText.length === 0;\n\t}\n\n\tpublic equals(other: StringReplacement): boolean {\n\t\treturn this.replaceRange.equals(other.replaceRange) && this.newText === other.newText;\n\t}\n\n\t/**\n\t * Narrows this replacement to the span that actually changes, by trimming\n\t * the prefix and suffix it shares with the text it replaces in `source`.\n\t */\n\tpublic removeCommonSuffixPrefix(source: string): StringReplacement {\n\t\tconst oldText = this.replaceRange.substring(source);\n\n\t\tconst prefixLength = commonPrefixLength(oldText, this.newText);\n\t\tconst suffixLength = Math.min(\n\t\t\toldText.length - prefixLength,\n\t\t\tthis.newText.length - prefixLength,\n\t\t\tcommonSuffixLength(oldText, this.newText),\n\t\t);\n\n\t\treturn new StringReplacement(\n\t\t\tnew OffsetRange(\n\t\t\t\tthis.replaceRange.start + prefixLength,\n\t\t\t\tthis.replaceRange.endExclusive - suffixLength,\n\t\t\t),\n\t\t\tthis.newText.substring(prefixLength, this.newText.length - suffixLength),\n\t\t);\n\t}\n\n\tpublic toString(): string {\n\t\treturn `${this.replaceRange} -> ${JSON.stringify(this.newText)}`;\n\t}\n}\n\n/** The length of the common prefix of `a` and `b`. */\nfunction commonPrefixLength(a: string, b: string): number {\n\tconst maxLength = Math.min(a.length, b.length);\n\tlet length = 0;\n\twhile (length < maxLength && a.charCodeAt(length) === b.charCodeAt(length)) {\n\t\tlength++;\n\t}\n\treturn length;\n}\n\n/** The length of the common suffix of `a` and `b`. */\nfunction commonSuffixLength(a: string, b: string): number {\n\tconst maxLength = Math.min(a.length, b.length);\n\tlet length = 0;\n\twhile (\n\t\tlength < maxLength\n\t\t&& a.charCodeAt(a.length - length - 1) === b.charCodeAt(b.length - length - 1)\n\t) {\n\t\tlength++;\n\t}\n\treturn length;\n}\n\nexport class StringEdit {\n\tpublic static readonly empty = new StringEdit([]);\n\n\tpublic static single(replacement: StringReplacement): StringEdit {\n\t\treturn new StringEdit([replacement]);\n\t}\n\n\tpublic static replace(range: OffsetRange, text: string): StringEdit {\n\t\treturn new StringEdit([StringReplacement.replace(range, text)]);\n\t}\n\n\tpublic static insert(offset: number, text: string): StringEdit {\n\t\treturn new StringEdit([StringReplacement.insert(offset, text)]);\n\t}\n\n\tpublic static delete(range: OffsetRange): StringEdit {\n\t\treturn new StringEdit([StringReplacement.delete(range)]);\n\t}\n\n\tpublic readonly replacements: readonly StringReplacement[];\n\n\tconstructor(replacements: readonly StringReplacement[]) {\n\t\tlet lastEndEx = -1;\n\t\tfor (const replacement of replacements) {\n\t\t\tif (replacement.replaceRange.start < lastEndEx) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Edits must be disjoint and sorted. Found ${replacement} after ${lastEndEx}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tlastEndEx = replacement.replaceRange.endExclusive;\n\t\t}\n\t\tthis.replacements = replacements;\n\t}\n\n\tget isEmpty(): boolean {\n\t\treturn this.replacements.length === 0;\n\t}\n\n\tpublic apply(base: string): string {\n\t\tconst parts: string[] = [];\n\t\tlet pos = 0;\n\t\tfor (const r of this.replacements) {\n\t\t\tparts.push(base.substring(pos, r.replaceRange.start));\n\t\t\tparts.push(r.newText);\n\t\t\tpos = r.replaceRange.endExclusive;\n\t\t}\n\t\tparts.push(base.substring(pos));\n\t\treturn parts.join('');\n\t}\n\n\tpublic inverse(original: string): StringEdit {\n\t\tconst edits: StringReplacement[] = [];\n\t\tlet offset = 0;\n\t\tfor (const r of this.replacements) {\n\t\t\tconst oldText = original.substring(r.replaceRange.start, r.replaceRange.endExclusive);\n\t\t\tedits.push(\n\t\t\t\tStringReplacement.replace(\n\t\t\t\t\tOffsetRange.ofStartAndLength(r.replaceRange.start + offset, r.newText.length),\n\t\t\t\t\toldText,\n\t\t\t\t),\n\t\t\t);\n\t\t\toffset += r.newText.length - r.replaceRange.length;\n\t\t}\n\t\treturn new StringEdit(edits);\n\t}\n\n\tpublic equals(other: StringEdit): boolean {\n\t\tif (this.replacements.length !== other.replacements.length) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (let i = 0; i < this.replacements.length; i++) {\n\t\t\tif (!this.replacements[i].equals(other.replacements[i])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic mapOffset(offset: number): number {\n\t\tlet delta = 0;\n\t\tfor (const r of this.replacements) {\n\t\t\tif (r.replaceRange.start > offset) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (r.replaceRange.endExclusive <= offset) {\n\t\t\t\tdelta += r.newText.length - r.replaceRange.length;\n\t\t\t} else {\n\t\t\t\t// offset is inside a replaced range — map to end of replacement\n\t\t\t\treturn r.replaceRange.start + delta + r.newText.length;\n\t\t\t}\n\t\t}\n\t\treturn offset + delta;\n\t}\n\n\tpublic toString(): string {\n\t\treturn `[${this.replacements.map(r => r.toString()).join(', ')}]`;\n\t}\n}\n\n/**\n * Computes the smallest single replacement that transforms `original` into\n * `modified`.\n *\n * Distinct from {@link computeStringEdit}, which produces a word-level\n * multi-hunk diff but requires the asynchronously loaded `@vscode/diff`\n * computer and throws before it is ready. This one is synchronous and\n * dependency-free, so it is safe on the edit-application and history paths.\n */\nexport function computeMinimalEdit(original: string, modified: string): StringEdit {\n\tif (original === modified) {\n\t\treturn StringEdit.empty;\n\t}\n\n\treturn StringEdit.single(\n\t\tStringReplacement\n\t\t\t.replace(new OffsetRange(0, original.length), modified)\n\t\t\t.removeCommonSuffixPrefix(original),\n\t);\n}\n"],"names":["OffsetRange","start","endExclusive","length","offset","other","end","str","arr","StringReplacement","replaceRange","newText","text","range","source","oldText","prefixLength","commonPrefixLength","suffixLength","commonSuffixLength","a","b","maxLength","StringEdit","replacement","replacements","lastEndEx","base","parts","pos","original","edits","i","delta","r","computeMinimalEdit","modified"],"mappings":"AAAO,MAAMA,EAAY;AAAA,EAiBxB,YACiBC,GACAC,GACf;AACD,QAHgB,KAAA,QAAAD,GACA,KAAA,eAAAC,GAEZD,IAAQC;AACX,YAAM,IAAI,MAAM,mBAAmBD,CAAK,KAAKC,CAAY,GAAG;AAAA,EAE9D;AAAA,EAvBA,OAAc,OAAOD,GAAeC,GAAmC;AACtE,WAAO,IAAIF,EAAYC,GAAOC,CAAY;AAAA,EAC3C;AAAA,EAEA,OAAc,SAASC,GAA6B;AACnD,WAAO,IAAIH,EAAY,GAAGG,CAAM;AAAA,EACjC;AAAA,EAEA,OAAc,iBAAiBF,GAAeE,GAA6B;AAC1E,WAAO,IAAIH,EAAYC,GAAOA,IAAQE,CAAM;AAAA,EAC7C;AAAA,EAEA,OAAc,QAAQC,GAA6B;AAClD,WAAO,IAAIJ,EAAYI,GAAQA,CAAM;AAAA,EACtC;AAAA,EAWA,IAAI,UAAmB;AACtB,WAAO,KAAK,UAAU,KAAK;AAAA,EAC5B;AAA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AAA,EAEO,OAAO1B,GAA4B;AACzC,QAAI,KAAK,aAAa,WAAWA,EAAM,aAAa;AACnD,aAAO;AAER,aAAS2B,IAAI,GAAGA,IAAI,KAAK,aAAa,QAAQA;AAC7C,UAAI,CAAC,KAAK,aAAaA,CAAC,EAAE,OAAO3B,EAAM,aAAa2B,CAAC,CAAC;AACrD,eAAO;AAGT,WAAO;AAAA,EACR;AAAA,EAEO,UAAU5B,GAAwB;AACxC,QAAI6B,IAAQ;AACZ,eAAWC,KAAK,KAAK,cAAc;AAClC,UAAIA,EAAE,aAAa,QAAQ9B;AAC1B;AAED,UAAI8B,EAAE,aAAa,gBAAgB9B;AAClC,QAAA6B,KAASC,EAAE,QAAQ,SAASA,EAAE,aAAa;AAAA;AAG3C,eAAOA,EAAE,aAAa,QAAQD,IAAQC,EAAE,QAAQ;AAAA,IAElD;AACA,WAAO9B,IAAS6B;AAAA,EACjB;AAAA,EAEO,WAAmB;AACzB,WAAO,IAAI,KAAK,aAAa,IAAI,CAAAC,MAAKA,EAAE,SAAA,CAAU,EAAE,KAAK,IAAI,CAAC;AAAA,EAC/D;AACD;AAWO,SAASC,EAAmBL,GAAkBM,GAA8B;AAClF,SAAIN,MAAaM,IACTb,EAAW,QAGZA,EAAW;AAAA,IACjBd,EACE,QAAQ,IAAIT,EAAY,GAAG8B,EAAS,MAAM,GAAGM,CAAQ,EACrD,yBAAyBN,CAAQ;AAAA,EAAA;AAErC;"}
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { ContentType } from '@vscode/web-editors';
|
|
2
|
+
import { IDisposable } from '@vscode/observables';
|
|
3
|
+
|
|
4
|
+
export declare interface CodeBlockEditorProviderDefinition {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly selector: CodeBlockEditorSelector;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export declare type CodeBlockEditorProviderSelection<T> = {
|
|
10
|
+
readonly kind: 'match';
|
|
11
|
+
readonly provider: T;
|
|
12
|
+
} | {
|
|
13
|
+
readonly kind: 'ambiguous';
|
|
14
|
+
readonly providers: readonly T[];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export declare type CodeBlockEditorSelector = {
|
|
18
|
+
readonly language: string;
|
|
19
|
+
} | {
|
|
20
|
+
readonly languagePrefix: string;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A live editor embedded in place of a fenced code block's *rendered* form.
|
|
25
|
+
*
|
|
26
|
+
* This is the internal seam between the block view and a concrete embedded
|
|
27
|
+
* editor (e.g. an `<iframe>` speaking the web-editor protocol). The block view
|
|
28
|
+
* only speaks string edits: it pushes the block's content down via
|
|
29
|
+
* {@link setContent} and receives the editor's own changes back through
|
|
30
|
+
* {@link onEdit} (set by the block view on each (re)construction, so it always
|
|
31
|
+
* routes to the current AST node). The concrete implementation owns its DOM,
|
|
32
|
+
* transport, and lifecycle.
|
|
33
|
+
*
|
|
34
|
+
* A single instance is adopted across re-renders (like the highlighter session)
|
|
35
|
+
* so the underlying editor keeps its state across edits — see
|
|
36
|
+
* {@link CodeBlockViewNode}.
|
|
37
|
+
*/
|
|
38
|
+
declare interface IEmbeddedCodeEditor {
|
|
39
|
+
/** The element mounted as the block's rendered form. */
|
|
40
|
+
readonly element: HTMLElement;
|
|
41
|
+
/**
|
|
42
|
+
* Document → editor. The block's content changed (from any source). Must be
|
|
43
|
+
* idempotent: pushing the content the editor already holds is a no-op, which
|
|
44
|
+
* is how edits the editor itself originated are prevented from echoing back.
|
|
45
|
+
*/
|
|
46
|
+
setContent(content: string): void;
|
|
47
|
+
/** Update whether the embedded editor may change its content. */
|
|
48
|
+
setReadOnly?(readOnly: boolean): void;
|
|
49
|
+
/**
|
|
50
|
+
* Optional synchronous height (px) to reserve for `content` *before* the
|
|
51
|
+
* editor has laid out. Return `undefined` to let the editor size itself
|
|
52
|
+
* (the implementation may report its real height later). Lets a registration
|
|
53
|
+
* avoid a layout jump when it can cheaply estimate the size from content.
|
|
54
|
+
*/
|
|
55
|
+
estimateHeight?(content: string): number | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Editor → document. Set by the block view on every (re)construction to
|
|
58
|
+
* route the editor's own edits, expressed in the block's *content*
|
|
59
|
+
* coordinates, to the current AST node.
|
|
60
|
+
*/
|
|
61
|
+
onEdit?: (edit: StringEdit) => void;
|
|
62
|
+
dispose(): void;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Creates an {@link IEmbeddedCodeEditor} for a fenced block, or opts out. */
|
|
66
|
+
declare interface IEmbeddedCodeEditorFactory {
|
|
67
|
+
/**
|
|
68
|
+
* Return an editor for a fenced block, or `undefined` to fall
|
|
69
|
+
* back to the default (highlighting / {@link BlockViewOptions.renderCustomCodeBlock}).
|
|
70
|
+
*/
|
|
71
|
+
create(language: string, infoString: string, initialContent: string): IEmbeddedCodeEditor | undefined;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export declare interface IframeEmbeddedEditorProvider extends CodeBlockEditorProviderDefinition {
|
|
75
|
+
readonly resolve: (infoString: string) => Promise<ResolvedIframeEmbeddedEditor | undefined>;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export declare type IframeEmbeddedEditorProviderSelector = CodeBlockEditorSelector;
|
|
79
|
+
|
|
80
|
+
declare interface IframeSandboxOptions {
|
|
81
|
+
readonly forms?: boolean;
|
|
82
|
+
readonly downloads?: boolean;
|
|
83
|
+
readonly pointerLock?: boolean;
|
|
84
|
+
readonly clipboardWrite?: boolean;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
declare class OffsetRange {
|
|
88
|
+
readonly start: number;
|
|
89
|
+
readonly endExclusive: number;
|
|
90
|
+
static fromTo(start: number, endExclusive: number): OffsetRange;
|
|
91
|
+
static ofLength(length: number): OffsetRange;
|
|
92
|
+
static ofStartAndLength(start: number, length: number): OffsetRange;
|
|
93
|
+
static emptyAt(offset: number): OffsetRange;
|
|
94
|
+
constructor(start: number, endExclusive: number);
|
|
95
|
+
get isEmpty(): boolean;
|
|
96
|
+
get length(): number;
|
|
97
|
+
delta(offset: number): OffsetRange;
|
|
98
|
+
deltaStart(offset: number): OffsetRange;
|
|
99
|
+
deltaEnd(offset: number): OffsetRange;
|
|
100
|
+
contains(offset: number): boolean;
|
|
101
|
+
containsRange(other: OffsetRange): boolean;
|
|
102
|
+
intersects(other: OffsetRange): boolean;
|
|
103
|
+
intersectsOrTouches(other: OffsetRange): boolean;
|
|
104
|
+
intersect(other: OffsetRange): OffsetRange | undefined;
|
|
105
|
+
join(other: OffsetRange): OffsetRange;
|
|
106
|
+
isBefore(other: OffsetRange): boolean;
|
|
107
|
+
isAfter(other: OffsetRange): boolean;
|
|
108
|
+
substring(str: string): string;
|
|
109
|
+
slice<T>(arr: readonly T[]): T[];
|
|
110
|
+
equals(other: OffsetRange): boolean;
|
|
111
|
+
toString(): string;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
declare class PhysicalIframe implements IDisposable {
|
|
115
|
+
private readonly _descriptor;
|
|
116
|
+
private readonly _frameRoot;
|
|
117
|
+
private readonly _scriptNonce;
|
|
118
|
+
private readonly _themeCss;
|
|
119
|
+
readonly iframe: HTMLIFrameElement;
|
|
120
|
+
editor: VirtualizedIframeEmbeddedEditor | undefined;
|
|
121
|
+
readonly pool: PhysicalIframePool;
|
|
122
|
+
private _host;
|
|
123
|
+
private _transport;
|
|
124
|
+
private _pendingEditor;
|
|
125
|
+
private _disposed;
|
|
126
|
+
private readonly _onWindowMessage;
|
|
127
|
+
constructor(pool: PhysicalIframePool, _descriptor: ResolvedIframeEmbeddedEditor, frameLayer: HTMLElement, _frameRoot: HTMLElement, _scriptNonce: string | undefined, _themeCss: string | (() => string) | undefined);
|
|
128
|
+
bind(editor: VirtualizedIframeEmbeddedEditor): void;
|
|
129
|
+
unbind(): void;
|
|
130
|
+
layout(editor: VirtualizedIframeEmbeddedEditor): void;
|
|
131
|
+
dispose(): void;
|
|
132
|
+
private _setup;
|
|
133
|
+
private _getThemeCss;
|
|
134
|
+
private _postTheme;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
declare class PhysicalIframePool implements IDisposable {
|
|
138
|
+
private readonly _frameLayer;
|
|
139
|
+
private readonly _frameRoot;
|
|
140
|
+
private readonly _scriptNonce;
|
|
141
|
+
private readonly _themeCss;
|
|
142
|
+
readonly descriptor: ResolvedIframeEmbeddedEditor;
|
|
143
|
+
private readonly _frames;
|
|
144
|
+
constructor(descriptor: ResolvedIframeEmbeddedEditor, _frameLayer: HTMLElement, _frameRoot: HTMLElement, _scriptNonce: string | undefined, _themeCss: string | (() => string) | undefined);
|
|
145
|
+
get leasedFrames(): number;
|
|
146
|
+
get idleFrames(): number;
|
|
147
|
+
acquire(editor: VirtualizedIframeEmbeddedEditor): void;
|
|
148
|
+
release(editor: VirtualizedIframeEmbeddedEditor): void;
|
|
149
|
+
park(iframe: HTMLIFrameElement): void;
|
|
150
|
+
dispose(): void;
|
|
151
|
+
layout(): void;
|
|
152
|
+
private _createFrame;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export declare interface ResolvedIframeEmbeddedEditor {
|
|
156
|
+
readonly html: string;
|
|
157
|
+
readonly contentType?: ContentType;
|
|
158
|
+
readonly initialHeight?: number;
|
|
159
|
+
readonly sandbox?: IframeSandboxOptions;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export declare type ResolvedIframeEmbeddedEditorSandbox = IframeSandboxOptions;
|
|
163
|
+
|
|
164
|
+
export declare function selectCodeBlockEditorProvider<T extends CodeBlockEditorProviderDefinition>(providers: readonly T[], language: string): CodeBlockEditorProviderSelection<T> | undefined;
|
|
165
|
+
|
|
166
|
+
declare class StringEdit {
|
|
167
|
+
static readonly empty: StringEdit;
|
|
168
|
+
static single(replacement: StringReplacement): StringEdit;
|
|
169
|
+
static replace(range: OffsetRange, text: string): StringEdit;
|
|
170
|
+
static insert(offset: number, text: string): StringEdit;
|
|
171
|
+
static delete(range: OffsetRange): StringEdit;
|
|
172
|
+
readonly replacements: readonly StringReplacement[];
|
|
173
|
+
constructor(replacements: readonly StringReplacement[]);
|
|
174
|
+
get isEmpty(): boolean;
|
|
175
|
+
apply(base: string): string;
|
|
176
|
+
inverse(original: string): StringEdit;
|
|
177
|
+
equals(other: StringEdit): boolean;
|
|
178
|
+
mapOffset(offset: number): number;
|
|
179
|
+
toString(): string;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
declare class StringReplacement {
|
|
183
|
+
readonly replaceRange: OffsetRange;
|
|
184
|
+
readonly newText: string;
|
|
185
|
+
static insert(offset: number, text: string): StringReplacement;
|
|
186
|
+
static replace(range: OffsetRange, text: string): StringReplacement;
|
|
187
|
+
static delete(range: OffsetRange): StringReplacement;
|
|
188
|
+
constructor(replaceRange: OffsetRange, newText: string);
|
|
189
|
+
get isEmpty(): boolean;
|
|
190
|
+
equals(other: StringReplacement): boolean;
|
|
191
|
+
/**
|
|
192
|
+
* Narrows this replacement to the span that actually changes, by trimming
|
|
193
|
+
* the prefix and suffix it shares with the text it replaces in `source`.
|
|
194
|
+
*/
|
|
195
|
+
removeCommonSuffixPrefix(source: string): StringReplacement;
|
|
196
|
+
toString(): string;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
declare class VirtualizedIframeEmbeddedEditor implements IEmbeddedCodeEditor {
|
|
200
|
+
private readonly _factory;
|
|
201
|
+
readonly provider: IframeEmbeddedEditorProvider;
|
|
202
|
+
readonly element: HTMLElement;
|
|
203
|
+
onEdit?: (edit: StringEdit) => void;
|
|
204
|
+
readonly estimateHeight: () => number;
|
|
205
|
+
frame: PhysicalIframe | undefined;
|
|
206
|
+
disposed: boolean;
|
|
207
|
+
visible: boolean;
|
|
208
|
+
readonly infoString: string;
|
|
209
|
+
private readonly _frameHost;
|
|
210
|
+
private _content;
|
|
211
|
+
private _readOnly;
|
|
212
|
+
private _pool;
|
|
213
|
+
private _resolved;
|
|
214
|
+
constructor(_factory: VirtualizedIframeEmbeddedEditorFactory, provider: IframeEmbeddedEditorProvider, infoString: string, initialContent: string, initialHeight: number, generation: number);
|
|
215
|
+
setContent(content: string): void;
|
|
216
|
+
setReadOnly(readOnly: boolean): void;
|
|
217
|
+
setVisible(visible: boolean): void;
|
|
218
|
+
resolve(pool: PhysicalIframePool | undefined): void;
|
|
219
|
+
invalidate(): void;
|
|
220
|
+
bindFrame(frame: PhysicalIframe): void;
|
|
221
|
+
unbindFrame(height: number): void;
|
|
222
|
+
applyGuestText(text: string): void;
|
|
223
|
+
applyHeight(height: number): void;
|
|
224
|
+
observeLayout(observer: ResizeObserver): void;
|
|
225
|
+
hasFocus(): boolean;
|
|
226
|
+
get content(): string;
|
|
227
|
+
get readOnly(): boolean;
|
|
228
|
+
get frameHost(): HTMLElement;
|
|
229
|
+
dispose(): void;
|
|
230
|
+
private _renderFallback;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export declare interface VirtualizedIframeEmbeddedEditorDiagnostics {
|
|
234
|
+
readonly logicalEditors: number;
|
|
235
|
+
readonly leasedFrames: number;
|
|
236
|
+
readonly idleFrames: number;
|
|
237
|
+
readonly descriptorCacheEntries: number;
|
|
238
|
+
readonly descriptorCacheHits: number;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export declare class VirtualizedIframeEmbeddedEditorFactory implements IEmbeddedCodeEditorFactory, IDisposable {
|
|
242
|
+
private readonly _options;
|
|
243
|
+
private readonly _frameLayer;
|
|
244
|
+
private _frameRoot;
|
|
245
|
+
private _restoreFrameRootPosition;
|
|
246
|
+
private _layoutObserver;
|
|
247
|
+
private _layoutFrame;
|
|
248
|
+
private readonly _observer;
|
|
249
|
+
private readonly _logicalEditors;
|
|
250
|
+
private readonly _pools;
|
|
251
|
+
private readonly _descriptorCache;
|
|
252
|
+
private readonly _rejectedProviders;
|
|
253
|
+
private _providers;
|
|
254
|
+
private _generation;
|
|
255
|
+
private _descriptorCacheHits;
|
|
256
|
+
private _disposed;
|
|
257
|
+
constructor(_options: VirtualizedIframeEmbeddedEditorOptions);
|
|
258
|
+
updateProviders(providers: readonly IframeEmbeddedEditorProvider[]): void;
|
|
259
|
+
get diagnostics(): VirtualizedIframeEmbeddedEditorDiagnostics;
|
|
260
|
+
create(language: string, infoString: string, initialContent: string): IEmbeddedCodeEditor | undefined;
|
|
261
|
+
dispose(): void;
|
|
262
|
+
remove(editor: VirtualizedIframeEmbeddedEditor): void;
|
|
263
|
+
resolve(editor: VirtualizedIframeEmbeddedEditor, generation: number): Promise<void>;
|
|
264
|
+
private _rejectEditor;
|
|
265
|
+
private _ensureFrameRoot;
|
|
266
|
+
private _setFrameRoot;
|
|
267
|
+
private readonly _scheduleLayout;
|
|
268
|
+
private _disposePools;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export declare interface VirtualizedIframeEmbeddedEditorOptions {
|
|
272
|
+
readonly providers: readonly IframeEmbeddedEditorProvider[];
|
|
273
|
+
readonly root?: Element | Document | null;
|
|
274
|
+
readonly frameRoot?: HTMLElement;
|
|
275
|
+
readonly scriptNonce?: string;
|
|
276
|
+
readonly themeCss?: string | (() => string);
|
|
277
|
+
readonly defaultHeight?: number;
|
|
278
|
+
readonly onAmbiguous?: (language: string, providers: readonly CodeBlockEditorProviderDefinition[]) => void;
|
|
279
|
+
readonly onDidChange?: () => void;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export { }
|