Skip to content

Commit

Permalink
feat(notebooks): render html output in cells
Browse files Browse the repository at this point in the history
  • Loading branch information
bsahitya committed Jul 9, 2024
1 parent 10e2fa9 commit 23c128e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions libs/components/src/cell/cell.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ cv-code-snippet::part(code) {
border-radius: 2px;
margin-top: 2px;
visibility: hidden;
width: 8px;
min-width: 8px;
}

.timesExecuted {
Expand Down Expand Up @@ -66,7 +66,7 @@ cv-code-snippet::part(code) {
}

.cellOutputWrapper {
width: 100%;
width: calc(100% - 96px);
}

.output {
Expand Down
2 changes: 1 addition & 1 deletion libs/components/src/notebook/notebook.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
box-sizing: border-box;
display: flex;
gap: 0.15rem;
padding: 0.5rem 0.25rem;
padding: 7px 0.25rem;

cv-select {
margin-left: 0.5rem;
Expand Down
10 changes: 8 additions & 2 deletions libs/components/src/notebook/notebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,13 @@ export class CovalentNotebook extends LitElement {
this.cells = this.cells.map((cell, idx) => ({ ...cell, index: idx }));

this._draggedCellIndex = null;
this.requestUpdate();
this.dispatchEvent(
new CustomEvent('drag-finished', {
bubbles: true,
cancelable: true,
detail: { cells: this.cells },
})
);
}
}

Expand Down Expand Up @@ -325,7 +331,7 @@ export class CovalentNotebook extends LitElement {
content.innerHTML = md.render(output.data[key]);
break;
case 'text/html':
// content.innerHTML = output.data[key];
content.innerHTML = output.data[key];
break;
case 'image/png': {
const image = document.createElement('img');
Expand Down

0 comments on commit 23c128e

Please sign in to comment.