Reapplied all the things
This commit is contained in:
@@ -1,16 +1,11 @@
|
||||
import {
|
||||
flashNotification,
|
||||
getCurrentPage,
|
||||
reloadPage,
|
||||
save,
|
||||
} from "plugos-silverbullet-syscall/editor";
|
||||
import {flashNotification, getCurrentPage, reloadPage, save,} from "plugos-silverbullet-syscall/editor";
|
||||
|
||||
import { readPage, writePage } from "plugos-silverbullet-syscall/space";
|
||||
import { invokeFunctionOnServer } from "plugos-silverbullet-syscall/system";
|
||||
import { scanPrefixGlobal } from "plugos-silverbullet-syscall";
|
||||
import {readPage, writePage} from "plugos-silverbullet-syscall/space";
|
||||
import {invokeFunctionOnServer} from "plugos-silverbullet-syscall/system";
|
||||
import {scanPrefixGlobal} from "plugos-silverbullet-syscall";
|
||||
|
||||
export const queryRegex =
|
||||
/(<!--\s*#query\s+(?<table>\w+)\s*(filter\s+["'“”‘’](?<filter>[^"'“”‘’]+)["'“”‘’])?\s*-->)(.+?)(<!--\s*#end\s*-->)/gs;
|
||||
/(<!--\s*#query\s+(?<table>\w+)\s*(filter\s+["'“”‘’](?<filter>[^"'“”‘’]+)["'“”‘’])?\s*(group by\s+(?<groupBy>\w+))?\s*-->)(.+?)(<!--\s*#end\s*-->)/gs;
|
||||
|
||||
export function whiteOutQueries(text: string): string {
|
||||
return text.replaceAll(queryRegex, (match) =>
|
||||
|
||||
+12
-7
@@ -1,12 +1,14 @@
|
||||
import { ClickEvent } from "../../webapp/app_event";
|
||||
import { updateMaterializedQueriesCommand } from "./materialized_queries";
|
||||
import {ClickEvent} from "../../webapp/app_event";
|
||||
import {updateMaterializedQueriesCommand} from "./materialized_queries";
|
||||
import {
|
||||
getSyntaxNodeAtPos,
|
||||
getSyntaxNodeUnderCursor,
|
||||
navigate as navigateTo,
|
||||
openUrl,
|
||||
getSyntaxNodeAtPos,
|
||||
getSyntaxNodeUnderCursor,
|
||||
getText,
|
||||
navigate as navigateTo,
|
||||
openUrl,
|
||||
} from "plugos-silverbullet-syscall/editor";
|
||||
import { taskToggleAtPos } from "../tasks/task";
|
||||
import {taskToggleAtPos} from "../tasks/task";
|
||||
import {nodeAtPos, parse} from "plugos-silverbullet-syscall/markdown";
|
||||
|
||||
const materializedQueryPrefix = /<!--\s*#query\s+/;
|
||||
|
||||
@@ -52,6 +54,9 @@ export async function linkNavigate() {
|
||||
export async function clickNavigate(event: ClickEvent) {
|
||||
if (event.ctrlKey || event.metaKey) {
|
||||
let syntaxNode = await getSyntaxNodeAtPos(event.pos);
|
||||
let mdTree = await parse(await getText());
|
||||
let newNode = await nodeAtPos(mdTree, event.pos);
|
||||
console.log("New node", newNode);
|
||||
await actionClickOrActionEnter(syntaxNode);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user