From 01c7b2824a3b4823fb8df01b49f53b9fd1d39eb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20James?= Date: Tue, 6 Feb 2024 00:39:02 +0100 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=90=9B=20Fix=20shift-tab=20in=20csv?= =?UTF-8?q?=20not=20working=20on=20last=20cell?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CodeMirror6/NodeLib/src/CmColumns.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CodeMirror6/NodeLib/src/CmColumns.ts b/CodeMirror6/NodeLib/src/CmColumns.ts index ec5b8571..2b571a05 100644 --- a/CodeMirror6/NodeLib/src/CmColumns.ts +++ b/CodeMirror6/NodeLib/src/CmColumns.ts @@ -58,7 +58,9 @@ function getRelativeColumnOffset(text: string, separator: string, position: numb offset++ } } - return offset + if (previous) + return previousColumnOffset - position + else return offset } export function columnStylingPlugin(separator: string): Extension { From 00b8ff6c3839d2e276740399713674f5e9d20129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20James?= Date: Tue, 6 Feb 2024 00:52:51 +0100 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=A5=85=20Silence=20errors=20when=20DO?= =?UTF-8?q?M=20elements=20are=20no=20longer=20available=20in=20Diagrams=20?= =?UTF-8?q?(SVG)=20and=20file=20upload=20(main=20div)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CodeMirror6/NodeLib/src/CmDiagrams.ts | 2 ++ CodeMirror6/NodeLib/src/CmFileUpload.ts | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CodeMirror6/NodeLib/src/CmDiagrams.ts b/CodeMirror6/NodeLib/src/CmDiagrams.ts index 4560863d..085bd1b1 100644 --- a/CodeMirror6/NodeLib/src/CmDiagrams.ts +++ b/CodeMirror6/NodeLib/src/CmDiagrams.ts @@ -52,6 +52,8 @@ function readSvgDimensions(svgContent: string): { width: number, height: number const parser = new DOMParser() const svg = parser.parseFromString(svgContent, "image/svg+xml") const svgElement = svg.getElementsByTagName("svg")[0] + if (!svgElement) + return { width: 0, height: 0 } const width = svgElement.getAttribute("width") const height = svgElement.getAttribute("height") return { width: parseInt(width), height: parseInt(height) } diff --git a/CodeMirror6/NodeLib/src/CmFileUpload.ts b/CodeMirror6/NodeLib/src/CmFileUpload.ts index 92ab5b07..8236a9be 100644 --- a/CodeMirror6/NodeLib/src/CmFileUpload.ts +++ b/CodeMirror6/NodeLib/src/CmFileUpload.ts @@ -7,7 +7,6 @@ import { CMInstances } from "./CmInstance" export function getFileUploadExtensions(id: string, setup: CmSetup) { const overlayId = `${id}-file-upload` - // check if the document already contains the overlay if (document.getElementById(overlayId)) return [] const overlay = document.createElement("div") @@ -30,8 +29,10 @@ export function getFileUploadExtensions(id: string, setup: CmSetup) ` let depth = 0 - // Append the overlay to your CodeMirror container - const editorContainer = document.getElementById(id) // Replace with your actual container ID + const editorContainer = document.getElementById(id) + if (!editorContainer) { + return [] + } editorContainer.style.position = 'relative' editorContainer.appendChild(overlay) From 354276ae16d587bd41e5b15cc5ff74ab1843d006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20James?= Date: Tue, 6 Feb 2024 00:55:02 +0100 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=93=9D=20Update=20changelog=20for=200?= =?UTF-8?q?.3.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 10 ++++++++++ NEW_CHANGELOG.md | 10 ++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bef4f12..e4ed91fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 0.3.1 - 2024-02-06 + +### 🐛 Fix a bug + +- Fix shift-tab in csv not working on last cell + +### 🥅 Catch errors + +- Silence errors when DOM elements are no longer available in Diagrams (SVG) and file upload (main div) + ## 0.3.0 - 2024-02-06 ### ✨ Introduce new features diff --git a/NEW_CHANGELOG.md b/NEW_CHANGELOG.md index 23619a48..349f9f37 100644 --- a/NEW_CHANGELOG.md +++ b/NEW_CHANGELOG.md @@ -1,9 +1,7 @@ -### ✨ Introduce new features +### 🐛 Fix a bug -- Add commands to insert markdown table and horizontal rule -- Implement csv and tsv with padded column widths (Does not support multiline cells) -- Add Tab and Shift-Tab keymaps to csv mode, to navigate columns +- Fix shift-tab in csv not working on last cell -### 🎨 Improve structure / format of the code +### 🥅 Catch errors -- Improve eq() of emojiWidget +- Silence errors when DOM elements are no longer available in Diagrams (SVG) and file upload (main div) From 131f51c6e423e584ecbba4671e26c37fbbd8e021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20James?= Date: Tue, 6 Feb 2024 00:55:02 +0100 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=94=96=20Bump=20version=20to=200.3.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CodeMirror6/CodeMirror6.csproj | 2 +- Examples.BlazorServer/Examples.BlazorServer.csproj | 2 +- .../Examples.BlazorServerInteractive.csproj | 2 +- Examples.BlazorWasm/Examples.BlazorWasm.csproj | 2 +- Examples.Common/Examples.Common.csproj | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CodeMirror6/CodeMirror6.csproj b/CodeMirror6/CodeMirror6.csproj index 69576873..5c532505 100644 --- a/CodeMirror6/CodeMirror6.csproj +++ b/CodeMirror6/CodeMirror6.csproj @@ -9,7 +9,7 @@ GaelJ.BlazorCodeMirror6 true GaelJ.BlazorCodeMirror6 - 0.3.0 + 0.3.1 true snupkg true diff --git a/Examples.BlazorServer/Examples.BlazorServer.csproj b/Examples.BlazorServer/Examples.BlazorServer.csproj index 4481d26b..d91094cd 100644 --- a/Examples.BlazorServer/Examples.BlazorServer.csproj +++ b/Examples.BlazorServer/Examples.BlazorServer.csproj @@ -4,7 +4,7 @@ enable false enable - 0.3.0 + 0.3.1 diff --git a/Examples.BlazorServerInteractive/Examples.BlazorServerInteractive.csproj b/Examples.BlazorServerInteractive/Examples.BlazorServerInteractive.csproj index a1228e5c..88b0667f 100644 --- a/Examples.BlazorServerInteractive/Examples.BlazorServerInteractive.csproj +++ b/Examples.BlazorServerInteractive/Examples.BlazorServerInteractive.csproj @@ -4,7 +4,7 @@ enable enable false - 0.3.0 + 0.3.1 diff --git a/Examples.BlazorWasm/Examples.BlazorWasm.csproj b/Examples.BlazorWasm/Examples.BlazorWasm.csproj index 30dded37..75357825 100644 --- a/Examples.BlazorWasm/Examples.BlazorWasm.csproj +++ b/Examples.BlazorWasm/Examples.BlazorWasm.csproj @@ -4,7 +4,7 @@ enable enable false - 0.3.0 + 0.3.1 diff --git a/Examples.Common/Examples.Common.csproj b/Examples.Common/Examples.Common.csproj index a8940241..218498f0 100644 --- a/Examples.Common/Examples.Common.csproj +++ b/Examples.Common/Examples.Common.csproj @@ -5,7 +5,7 @@ enable enable false - 0.3.0 + 0.3.1