mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-29 09:35:38 -05:00
Notebooks: Add Support for Cell Attachment Images (#14449)
* Add to interfaces * Works E2E * Consolidate interface * Add comments, cleanup * Add some tests * Cleanup * interface cleanup * Add more tests * Add comments * Add type for cell attachment * wip
This commit is contained in:
@@ -6,7 +6,10 @@
|
||||
import { OnDestroy } from '@angular/core';
|
||||
import { AngularDisposable } from 'sql/base/browser/lifecycle';
|
||||
import { ICellEditorProvider, NotebookRange } from 'sql/workbench/services/notebook/browser/notebookService';
|
||||
import { MarkdownRenderOptions } from 'vs/base/browser/markdownRenderer';
|
||||
import { IMarkdownString } from 'vs/base/common/htmlContent';
|
||||
import { BaseTextEditor } from 'vs/workbench/browser/parts/editor/textEditor';
|
||||
import { nb } from 'azdata';
|
||||
|
||||
export abstract class CellView extends AngularDisposable implements OnDestroy, ICellEditorProvider {
|
||||
constructor() {
|
||||
@@ -29,3 +32,11 @@ export abstract class CellView extends AngularDisposable implements OnDestroy, I
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export interface IMarkdownStringWithCellAttachments extends IMarkdownString {
|
||||
readonly cellAttachments?: nb.ICellAttachment
|
||||
}
|
||||
|
||||
export interface MarkdownRenderOptionsWithCellAttachments extends MarkdownRenderOptions {
|
||||
readonly cellAttachments?: nb.ICellAttachment
|
||||
}
|
||||
|
||||
@@ -227,7 +227,8 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
|
||||
this.markdownRenderer.setNotebookURI(this.cellModel.notebookModel.notebookUri);
|
||||
this.markdownResult = this.markdownRenderer.render({
|
||||
isTrusted: true,
|
||||
value: Array.isArray(this._content) ? this._content.join('') : this._content
|
||||
value: Array.isArray(this._content) ? this._content.join('') : this._content,
|
||||
cellAttachments: this.cellModel.attachments
|
||||
});
|
||||
this.markdownResult.element.innerHTML = this.sanitizeContent(this.markdownResult.element.innerHTML);
|
||||
this.setLoading(false);
|
||||
|
||||
Reference in New Issue
Block a user