From f4bbf6900b6f860d27fb47adf34d557d784f35c9 Mon Sep 17 00:00:00 2001 From: mgreminger Date: Wed, 18 Dec 2024 22:25:31 -0600 Subject: [PATCH] refactor: port Cell.svelte to runes mode --- src/App.svelte | 16 +++--- src/Cell.svelte | 129 +++++++++++++++++++++++++------------------- src/CellList.svelte | 31 ++++++++--- 3 files changed, 105 insertions(+), 71 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index 34d3cb735..811bf3f34 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -518,16 +518,16 @@ $prefersReducedMotion = event.matches; } - function handleInsertMathCell(event: ComponentEvents['insertMathCell']) { + function handleInsertMathCell(event: {detail: {index: number}}) { addCell('math', event.detail.index+1); } - function handleInsertInsertCell(event: ComponentEvents['insertInsertCells']) { + function handleInsertInsertCell(event: {detail: {index: number}}) { $inCellInsertMode = true; addCell('insert', event.detail.index+1); } - function handleCellModal(event: ComponentEvents['modal']) { + function handleCellModal(event: {detail: {modalInfo: ModalInfo}}) { modalInfo = event.detail.modalInfo; } @@ -2700,11 +2700,11 @@ Please include a link to this sheet in the email to assist in debugging the prob diff --git a/src/Cell.svelte b/src/Cell.svelte index b134949a3..ef33fb1ab 100644 --- a/src/Cell.svelte +++ b/src/Cell.svelte @@ -1,8 +1,9 @@ @@ -192,7 +213,7 @@
moveUp(index)} title="Move Cell Up" > @@ -202,8 +223,8 @@ moveDown(index)} title="Move Cell Down" > @@ -224,79 +245,77 @@ - - - +
handleClickInCell(index)} - on:focusin={() => handleClickInCell(index)} + onclickcapture={() => handleClickInCell(index)} + onfocusin={() => handleClickInCell(index)} bind:this={contentDiv} > {#if cell instanceof MathCell} {:else if cell instanceof DocumentationCell} {:else if cell instanceof PlotCell} {:else if cell instanceof TableCell} {:else if cell instanceof DataTableCell} {:else if cell instanceof PiecewiseCell} {:else if cell instanceof SystemCell} {:else if cell instanceof FluidCell} {:else if cell instanceof InsertCell} deleteCell(index)} title="Delete Cell" > diff --git a/src/CellList.svelte b/src/CellList.svelte index 4babf11be..df7bc336c 100644 --- a/src/CellList.svelte +++ b/src/CellList.svelte @@ -1,13 +1,28 @@