Merge pull request #153 from h-sphere/fix/modifying-columns

fix: fixing column editing + updating dependencies
This commit is contained in:
Kacper Kula 2025-05-06 16:25:02 +01:00 committed by GitHub
commit cd79bcd4c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 1301 additions and 1179 deletions

View file

@ -1,3 +1,7 @@
# 0.36.0 (2025-05-06)
- fix: deleting columns and renaming columns works again
- chore: updated dependencies to the latest versions
# 0.35.0 (2025-05-02)
- fix: fixed issue with CSV files edits not being saved

View file

@ -1,7 +1,7 @@
{
"id": "sqlseal",
"name": "SQLSeal",
"version": "0.35.0",
"version": "0.36.0",
"minAppVersion": "0.15.0",
"description": "Use SQL in your notes to query your vault files and CSV content.",
"author": "hypersphere",

View file

@ -1,6 +1,6 @@
{
"name": "sqlseal",
"version": "0.35.0",
"version": "0.36.0",
"description": "A plugin for Obsidian that allows you to run SQL queries on your notes.",
"main": "main.js",
"scripts": {
@ -26,36 +26,36 @@
"@types/esprima": "^4.0.6",
"@types/estraverse": "^5.1.7",
"@types/jest": "^29.5.14",
"@types/lodash": "^4.17.13",
"@types/node": "^22.9.3",
"@types/lodash": "^4.17.16",
"@types/node": "^22.15.12",
"@types/papaparse": "^5.3.15",
"@types/sql.js": "^1.4.9",
"@typescript-eslint/eslint-plugin": "8.15.0",
"@typescript-eslint/parser": "8.15.0",
"builtin-modules": "4.0.0",
"@typescript-eslint/eslint-plugin": "8.32.0",
"@typescript-eslint/parser": "8.32.0",
"builtin-modules": "5.0.0",
"electron-rebuild": "^3.2.9",
"esbuild": "0.24.0",
"esbuild": "0.25.4",
"esbuild-plugin-replace": "^1.4.0",
"jest": "^29.7.0",
"obsidian": "^1.7.2",
"prettier": "3.3.3",
"ts-jest": "^29.2.5",
"obsidian": "^1.8.7",
"prettier": "3.5.3",
"ts-jest": "^29.3.2",
"tslib": "2.8.1",
"typescript": "5.7.2",
"vitepress": "^1.5.0",
"typescript": "5.8.3",
"vitepress": "^1.6.3",
"vue": "^3.5.13"
},
"dependencies": {
"@ag-grid-community/theming": "^32.3.3",
"@codemirror/language": "^6.10.8",
"@codemirror/state": "^6.5.1",
"@codemirror/view": "^6.36.2",
"@ag-grid-community/theming": "^32.3.5",
"@codemirror/language": "^6.11.0",
"@codemirror/state": "^6.5.2",
"@codemirror/view": "^6.36.7",
"@hypersphere/omnibus": "^0.1.6",
"@jlongster/sql.js": "^1.6.7",
"@types/jsonpath": "^0.2.4",
"@vanakat/plugin-api": "^0.2.1",
"absurd-sql": "^0.0.54",
"ag-grid-community": "^32.3.3",
"ag-grid-community": "^33.2.4",
"comlink": "^4.4.2",
"esbuild-plugin-polyfill-node": "^0.3.0",
"esprima": "^4.0.1",
@ -66,10 +66,10 @@
"lodash": "^4.17.21",
"markdown-table-ts": "^1.0.3",
"ohm-js": "^17.1.0",
"papaparse": "^5.4.1",
"sql-parser-cst": "^0.32.0",
"papaparse": "^5.5.2",
"sql-parser-cst": "^0.33.1",
"unidecode": "^1.1.0",
"util": "^0.12.5",
"uuid": "^11.0.4"
"uuid": "^11.1.0"
}
}

File diff suppressed because it is too large Load diff

View file

@ -113,7 +113,7 @@ export class CodeblockProcessor extends MarkdownRenderChild {
if (file) {
const fileCache = this.app.metadataCache.getFileCache(file)
variables = {
...fileCache?.frontmatter ?? {},
...(fileCache?.frontmatter ?? {}),
path: file.path,
fileName: file.name,
basename: file.basename,

View file

@ -58,7 +58,7 @@ export class InlineProcessor extends MarkdownRenderChild {
// TODO: unify this between codeblock and inline handlers
const variables = {
...fileCache?.frontmatter ?? {},
...(fileCache?.frontmatter ?? {}),
path: file.path,
fileName: file.name,
basename: file.basename,

View file

@ -21,6 +21,14 @@ import { ModernCellParser } from './cellParser/ModernCellParser';
import { getCellParser } from './cellParser/factory';
import { CellFunction } from './cellParser/CellFunction';
import { AllCommunityModule, ModuleRegistry, provideGlobalGridOptions } from 'ag-grid-community';
// Register all community features
ModuleRegistry.registerModules([AllCommunityModule]);
// Mark all grids as using legacy themes
provideGlobalGridOptions({ theme: "legacy"});
export default class SqlSealPlugin extends Plugin {
settings: SQLSealSettings;
fileSync: SealFileSync;

View file

@ -135,8 +135,7 @@ export class CSVView extends TextFileView {
api: any = null;
loadDataIntoGrid() {
setTimeout(() => {
requestAnimationFrame(() => {
const result = parse(this.content, {
header: true,
skipEmptyLines: true,
@ -156,7 +155,7 @@ export class CSVView extends TextFileView {
columns: result.meta.fields
})
}, 100)
})
}
private async renderCSV() {
@ -219,7 +218,8 @@ export class CSVView extends TextFileView {
item.setTitle('Rename Column')
item.onClick(() => {
const modal = new RenameColumnModal(csvView.app, (res) => {
csvView.renameColumn(this.column.colId, res)
csvView.renameColumn(
this.column.userProvidedColDef.headerName, res)
})
modal.open()
})
@ -228,9 +228,9 @@ export class CSVView extends TextFileView {
menu.addItem(item => {
item.setTitle('Delete Column')
item.onClick(() => {
this.column.colId
const modal = new DeleteConfirmationModal(csvView.app, `column ${this.column.colId}`, () => {
csvView.deleteColumn(this.column.colId)
const colName = this.column.userProvidedColDef.headerName
const modal = new DeleteConfirmationModal(csvView.app, `column ${colName}`, () => {
csvView.deleteColumn(colName)
})
modal.open()
})
@ -254,7 +254,7 @@ export class CSVView extends TextFileView {
if (!columnName) {
return
}
csvView.moveColumn(columnName?.field!, e.toIndex!)
csvView.moveColumn(columnName?.headerName!, e.toIndex!)
},
domLayout: 'normal',
getRowId: (p) => p.data.__index,

View file

@ -61,5 +61,6 @@
"0.32.0": "0.15.0",
"0.33.0": "0.15.0",
"0.34.0": "0.15.0",
"0.35.0": "0.15.0"
"0.35.0": "0.15.0",
"0.36.0": "0.15.0"
}