vertex-notes 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-JGE6NM2D.js → chunk-23CKP3YP.js} +1 -2
- package/dist/{chunk-PBF5EE4Y.js → chunk-DRIWYEQE.js} +0 -1
- package/dist/{chunk-QEOOUDO3.js → chunk-K5SQERJ7.js} +81 -13
- package/dist/{chunk-HJR4UBO3.js → chunk-LXT34CD7.js} +2 -3
- package/dist/commands/capture.js +3 -4
- package/dist/commands/daily.js +3 -4
- package/dist/commands/delete.js +3 -4
- package/dist/commands/edit.js +3 -8
- package/dist/commands/export.js +3 -4
- package/dist/commands/hello.js +1 -2
- package/dist/commands/help.js +1 -2
- package/dist/commands/howto.js +0 -1
- package/dist/commands/import.js +3 -4
- package/dist/commands/interactive.js +45 -4
- package/dist/commands/login.js +2 -3
- package/dist/commands/logout.js +1 -2
- package/dist/commands/new.js +3 -4
- package/dist/commands/notes.js +3 -4
- package/dist/commands/restore.js +3 -4
- package/dist/commands/search.js +3 -4
- package/dist/commands/status.js +3 -4
- package/dist/commands/syntax.js +0 -1
- package/dist/commands/tags.js +3 -4
- package/dist/commands/today.js +3 -4
- package/dist/commands/trash/empty.js +4 -5
- package/dist/commands/trash/index.js +3 -4
- package/dist/commands/view.js +3 -4
- package/dist/commands/whoami.js +1 -2
- package/dist/index.js +0 -1
- package/dist/lib/client.js +3 -4
- package/dist/lib/config.js +1 -2
- package/dist/lib/file-cleanup.js +2 -3
- package/package.json +1 -1
- package/dist/chunk-HJR4UBO3.js.map +0 -1
- package/dist/chunk-JGE6NM2D.js.map +0 -1
- package/dist/chunk-PBF5EE4Y.js.map +0 -1
- package/dist/chunk-QEOOUDO3.js.map +0 -1
- package/dist/commands/capture.js.map +0 -1
- package/dist/commands/daily.js.map +0 -1
- package/dist/commands/delete.js.map +0 -1
- package/dist/commands/edit.js.map +0 -1
- package/dist/commands/export.js.map +0 -1
- package/dist/commands/hello.js.map +0 -1
- package/dist/commands/help.js.map +0 -1
- package/dist/commands/howto.js.map +0 -1
- package/dist/commands/import.js.map +0 -1
- package/dist/commands/interactive.js.map +0 -1
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/logout.js.map +0 -1
- package/dist/commands/new.js.map +0 -1
- package/dist/commands/notes.js.map +0 -1
- package/dist/commands/restore.js.map +0 -1
- package/dist/commands/search.js.map +0 -1
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/syntax.js.map +0 -1
- package/dist/commands/tags.js.map +0 -1
- package/dist/commands/today.js.map +0 -1
- package/dist/commands/trash/empty.js.map +0 -1
- package/dist/commands/trash/index.js.map +0 -1
- package/dist/commands/view.js.map +0 -1
- package/dist/commands/whoami.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/client.js.map +0 -1
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/file-cleanup.js.map +0 -1
- package/dist/lib/md-to-tiptap.js +0 -250
- package/dist/lib/md-to-tiptap.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DRIWYEQE.js";
|
|
4
4
|
|
|
5
5
|
// src/lib/file-cleanup.ts
|
|
6
6
|
var R2_WORKER_URL = "https://vertex-r2.codessahil.workers.dev";
|
|
@@ -25,4 +25,3 @@ async function cleanupRemovedFiles(removedFiles) {
|
|
|
25
25
|
export {
|
|
26
26
|
cleanupRemovedFiles
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=chunk-JGE6NM2D.js.map
|
|
@@ -78,6 +78,17 @@ async function hardDeleteNote(client, noteId, onFilesRemoved) {
|
|
|
78
78
|
if (src && (b.type === "file" || b.type === "image") && !src.startsWith("data:")) {
|
|
79
79
|
fileUrls.push({ src, filesize: attrs.filesize ?? 0 });
|
|
80
80
|
}
|
|
81
|
+
if (tiptap?.type === "excalidrawBlock" && attrs.data) {
|
|
82
|
+
try {
|
|
83
|
+
const excalidrawData = JSON.parse(attrs.data);
|
|
84
|
+
for (const file of Object.values(excalidrawData.files ?? {})) {
|
|
85
|
+
if (file.dataURL?.startsWith("https://")) {
|
|
86
|
+
fileUrls.push({ src: file.dataURL, filesize: 0 });
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
} catch {
|
|
90
|
+
}
|
|
91
|
+
}
|
|
81
92
|
}
|
|
82
93
|
for (const file of fileUrls) {
|
|
83
94
|
try {
|
|
@@ -322,7 +333,11 @@ function mapTiptapTypeToBlockType(tiptapType) {
|
|
|
322
333
|
horizontalRule: "divider",
|
|
323
334
|
fileBlock: "file",
|
|
324
335
|
linkPreview: "text",
|
|
325
|
-
inlineMath: "text"
|
|
336
|
+
inlineMath: "text",
|
|
337
|
+
table: "text",
|
|
338
|
+
tableRow: "text",
|
|
339
|
+
tableCell: "text",
|
|
340
|
+
tableHeader: "text"
|
|
326
341
|
};
|
|
327
342
|
return MAP[tiptapType] ?? "text";
|
|
328
343
|
}
|
|
@@ -365,7 +380,7 @@ function extractWikiLinks(text) {
|
|
|
365
380
|
return [...new Set(matches.map((m) => m.slice(2, -2)))];
|
|
366
381
|
}
|
|
367
382
|
async function fullTextSearch(client, userId, query, limit = 30) {
|
|
368
|
-
const { data, error } = await client.from("blocks").select("*, notes!inner(id, title)").eq("user_id", userId).is("deleted_at", null).
|
|
383
|
+
const { data, error } = await client.from("blocks").select("*, notes!inner(id, title)").eq("user_id", userId).is("deleted_at", null).ilike("content", `%${query}%`).limit(limit);
|
|
369
384
|
if (error) throw error;
|
|
370
385
|
return (data ?? []).map((row) => {
|
|
371
386
|
const notes = row.notes;
|
|
@@ -378,15 +393,23 @@ async function fullTextSearch(client, userId, query, limit = 30) {
|
|
|
378
393
|
});
|
|
379
394
|
}
|
|
380
395
|
async function searchByTag(client, userId, tagName, includeDescendants = true) {
|
|
381
|
-
|
|
382
|
-
if (
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
396
|
+
let tagQuery = client.from("tags").select("id").eq("user_id", userId);
|
|
397
|
+
if (tagName) {
|
|
398
|
+
tagQuery = tagQuery.ilike("name", `${tagName}%`);
|
|
399
|
+
}
|
|
400
|
+
const { data: matchedTags } = await tagQuery;
|
|
401
|
+
if (!matchedTags || matchedTags.length === 0) return [];
|
|
402
|
+
const allTagIds = /* @__PURE__ */ new Set();
|
|
403
|
+
for (const tag of matchedTags) {
|
|
404
|
+
if (includeDescendants) {
|
|
405
|
+
const descendants = await getTagDescendants(client, tag.id);
|
|
406
|
+
for (const id of descendants) allTagIds.add(id);
|
|
407
|
+
} else {
|
|
408
|
+
allTagIds.add(tag.id);
|
|
409
|
+
}
|
|
389
410
|
}
|
|
411
|
+
const tagIds = [...allTagIds];
|
|
412
|
+
if (tagIds.length === 0) return [];
|
|
390
413
|
const { data, error } = await client.from("block_tags").select("block_id, blocks!inner(*, notes!inner(id, title))").in("tag_id", tagIds);
|
|
391
414
|
if (error) throw error;
|
|
392
415
|
return (data ?? []).map((row) => {
|
|
@@ -439,7 +462,7 @@ function parseQuery(input) {
|
|
|
439
462
|
async function executeQuery(client, userId, input, limit = 30) {
|
|
440
463
|
const filter = parseQuery(input);
|
|
441
464
|
let results = [];
|
|
442
|
-
if (filter.tag) {
|
|
465
|
+
if (filter.tag !== void 0) {
|
|
443
466
|
results = await searchByTag(client, userId, filter.tag);
|
|
444
467
|
} else if (filter.type) {
|
|
445
468
|
results = await searchByType(client, userId, filter.type, limit);
|
|
@@ -571,6 +594,25 @@ function tiptapNodeToMarkdown(node) {
|
|
|
571
594
|
lines.push(``);
|
|
572
595
|
break;
|
|
573
596
|
}
|
|
597
|
+
case "table": {
|
|
598
|
+
const rows = content.map((row) => row.content ?? []);
|
|
599
|
+
const colCount = Math.max(...rows.map((r) => r.length));
|
|
600
|
+
const colWidths = Array.from(
|
|
601
|
+
{ length: colCount },
|
|
602
|
+
(_, ci) => Math.max(3, ...rows.map((r) => (r[ci] ? extractTextFromNode(r[ci]) : "").length))
|
|
603
|
+
);
|
|
604
|
+
rows.forEach((cells, ri) => {
|
|
605
|
+
const line = "| " + colWidths.map((w, ci) => {
|
|
606
|
+
const text = cells[ci] ? extractTextFromNode(cells[ci]) : "";
|
|
607
|
+
return text.padEnd(w);
|
|
608
|
+
}).join(" | ") + " |";
|
|
609
|
+
lines.push(line);
|
|
610
|
+
if (ri === 0) {
|
|
611
|
+
lines.push("| " + colWidths.map((w) => "-".repeat(w)).join(" | ") + " |");
|
|
612
|
+
}
|
|
613
|
+
});
|
|
614
|
+
break;
|
|
615
|
+
}
|
|
574
616
|
case "linkPreview": {
|
|
575
617
|
const url = attrs.url ?? "";
|
|
576
618
|
lines.push(`> [!embed]`, `> ${url}`);
|
|
@@ -751,6 +793,33 @@ function markdownToTiptap(md) {
|
|
|
751
793
|
i++;
|
|
752
794
|
continue;
|
|
753
795
|
}
|
|
796
|
+
const trimmedLine = line.trimStart();
|
|
797
|
+
if (trimmedLine.startsWith("|") && lines[i + 1]?.trimStart().match(/^\|[\s\-|:]+\|/)) {
|
|
798
|
+
const parseRow = (raw) => raw.trimStart().split("|").slice(1, -1).map((c) => c.trim());
|
|
799
|
+
const headers = parseRow(lines[i]);
|
|
800
|
+
i += 2;
|
|
801
|
+
const rows = [];
|
|
802
|
+
while (i < lines.length && lines[i].trimStart().startsWith("|")) {
|
|
803
|
+
rows.push(parseRow(lines[i]));
|
|
804
|
+
i++;
|
|
805
|
+
}
|
|
806
|
+
const makeCell = (text, isHeader) => ({
|
|
807
|
+
type: isHeader ? "tableHeader" : "tableCell",
|
|
808
|
+
attrs: { colspan: 1, rowspan: 1, colwidth: null },
|
|
809
|
+
content: [{ type: "paragraph", content: parseInline(text) }]
|
|
810
|
+
});
|
|
811
|
+
nodes.push({
|
|
812
|
+
type: "table",
|
|
813
|
+
content: [
|
|
814
|
+
{ type: "tableRow", content: headers.map((h) => makeCell(h, true)) },
|
|
815
|
+
...rows.map((row) => ({
|
|
816
|
+
type: "tableRow",
|
|
817
|
+
content: headers.map((_, ci) => makeCell(row[ci] ?? "", false))
|
|
818
|
+
}))
|
|
819
|
+
]
|
|
820
|
+
});
|
|
821
|
+
continue;
|
|
822
|
+
}
|
|
754
823
|
if (line.match(/^!\[.*?\]\(.*?\)$/)) {
|
|
755
824
|
const imgMatch = line.match(/^!\[(.*?)\]\((.*?)\)$/);
|
|
756
825
|
if (imgMatch) {
|
|
@@ -809,7 +878,7 @@ function markdownToTiptap(md) {
|
|
|
809
878
|
continue;
|
|
810
879
|
}
|
|
811
880
|
const paraLines = [];
|
|
812
|
-
while (i < lines.length && lines[i].trim() !== "" && !lines[i].match(/^#{1,4}\s/) && !lines[i].match(/^```/) && !lines[i].match(/^\$\$/) && !lines[i].match(/^---\s*$/) && !lines[i].match(/^[-*]\s/) && !lines[i].match(/^\d+\.\s/) && !lines[i].match(/^>\s/) && !lines[i].match(/^!\[/)) {
|
|
881
|
+
while (i < lines.length && lines[i].trim() !== "" && !lines[i].match(/^#{1,4}\s/) && !lines[i].match(/^```/) && !lines[i].match(/^\$\$/) && !lines[i].match(/^---\s*$/) && !lines[i].match(/^[-*]\s/) && !lines[i].match(/^\d+\.\s/) && !lines[i].match(/^>\s/) && !lines[i].match(/^!\[/) && !lines[i].startsWith("|")) {
|
|
813
882
|
paraLines.push(lines[i]);
|
|
814
883
|
i++;
|
|
815
884
|
}
|
|
@@ -879,4 +948,3 @@ export {
|
|
|
879
948
|
markdownToTiptap,
|
|
880
949
|
VERTEX_VERSION
|
|
881
950
|
};
|
|
882
|
-
//# sourceMappingURL=chunk-QEOOUDO3.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadConfig,
|
|
3
3
|
saveConfig
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DRIWYEQE.js";
|
|
5
5
|
import {
|
|
6
6
|
createSupabaseClient
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-K5SQERJ7.js";
|
|
8
8
|
|
|
9
9
|
// src/lib/client.ts
|
|
10
10
|
var cachedClient = null;
|
|
@@ -47,4 +47,3 @@ export {
|
|
|
47
47
|
getClient,
|
|
48
48
|
getUserId
|
|
49
49
|
};
|
|
50
|
-
//# sourceMappingURL=chunk-HJR4UBO3.js.map
|
package/dist/commands/capture.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getClient,
|
|
3
3
|
getUserId
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-LXT34CD7.js";
|
|
5
|
+
import "../chunk-DRIWYEQE.js";
|
|
6
6
|
import {
|
|
7
7
|
getBlocksForNote,
|
|
8
8
|
listNotes,
|
|
9
9
|
saveNoteContent
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-K5SQERJ7.js";
|
|
11
11
|
|
|
12
12
|
// src/commands/capture.ts
|
|
13
13
|
import { Command, Args } from "@oclif/core";
|
|
@@ -41,4 +41,3 @@ var Capture = class _Capture extends Command {
|
|
|
41
41
|
export {
|
|
42
42
|
Capture as default
|
|
43
43
|
};
|
|
44
|
-
//# sourceMappingURL=capture.js.map
|
package/dist/commands/daily.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getClient,
|
|
3
3
|
getUserId
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-LXT34CD7.js";
|
|
5
|
+
import "../chunk-DRIWYEQE.js";
|
|
6
6
|
import {
|
|
7
7
|
exportNoteAsMarkdown,
|
|
8
8
|
getOrCreateDailyNote,
|
|
9
9
|
listNotes
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-K5SQERJ7.js";
|
|
11
11
|
|
|
12
12
|
// src/commands/daily.ts
|
|
13
13
|
import { Command, Flags } from "@oclif/core";
|
|
@@ -50,4 +50,3 @@ var Daily = class _Daily extends Command {
|
|
|
50
50
|
export {
|
|
51
51
|
Daily as default
|
|
52
52
|
};
|
|
53
|
-
//# sourceMappingURL=daily.js.map
|
package/dist/commands/delete.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getClient,
|
|
3
3
|
getUserId
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-LXT34CD7.js";
|
|
5
|
+
import "../chunk-DRIWYEQE.js";
|
|
6
6
|
import {
|
|
7
7
|
listNotes,
|
|
8
8
|
softDeleteNote
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-K5SQERJ7.js";
|
|
10
10
|
|
|
11
11
|
// src/commands/delete.ts
|
|
12
12
|
import { Command, Args } from "@oclif/core";
|
|
@@ -35,4 +35,3 @@ var Delete = class _Delete extends Command {
|
|
|
35
35
|
export {
|
|
36
36
|
Delete as default
|
|
37
37
|
};
|
|
38
|
-
//# sourceMappingURL=delete.js.map
|
package/dist/commands/edit.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getClient,
|
|
3
3
|
getUserId
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-LXT34CD7.js";
|
|
5
|
+
import "../chunk-DRIWYEQE.js";
|
|
6
6
|
import {
|
|
7
7
|
exportNoteAsMarkdown,
|
|
8
8
|
listNotes,
|
|
9
9
|
markdownToTiptap,
|
|
10
10
|
saveNoteContent
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-K5SQERJ7.js";
|
|
12
12
|
|
|
13
13
|
// src/commands/edit.ts
|
|
14
14
|
import { Command, Args } from "@oclif/core";
|
|
@@ -71,10 +71,6 @@ var Edit = class _Edit extends Command {
|
|
|
71
71
|
this.error("Editor exited with error");
|
|
72
72
|
}
|
|
73
73
|
const edited = readFileSync(tmpFile, "utf-8");
|
|
74
|
-
if (edited === md) {
|
|
75
|
-
this.log("No changes.");
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
74
|
const tiptapJson = markdownToTiptap(edited);
|
|
79
75
|
await saveNoteContent(client, match.id, userId, tiptapJson);
|
|
80
76
|
this.log(`Saved: ${match.title}`);
|
|
@@ -83,4 +79,3 @@ var Edit = class _Edit extends Command {
|
|
|
83
79
|
export {
|
|
84
80
|
Edit as default
|
|
85
81
|
};
|
|
86
|
-
//# sourceMappingURL=edit.js.map
|
package/dist/commands/export.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getClient,
|
|
3
3
|
getUserId
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-LXT34CD7.js";
|
|
5
|
+
import "../chunk-DRIWYEQE.js";
|
|
6
6
|
import {
|
|
7
7
|
exportNoteAsJson,
|
|
8
8
|
exportNoteAsMarkdown,
|
|
9
9
|
listNotes
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-K5SQERJ7.js";
|
|
11
11
|
|
|
12
12
|
// src/commands/export.ts
|
|
13
13
|
import { Command, Args, Flags } from "@oclif/core";
|
|
@@ -43,4 +43,3 @@ var Export = class _Export extends Command {
|
|
|
43
43
|
export {
|
|
44
44
|
Export as default
|
|
45
45
|
};
|
|
46
|
-
//# sourceMappingURL=export.js.map
|
package/dist/commands/hello.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
VERTEX_VERSION
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-K5SQERJ7.js";
|
|
4
4
|
|
|
5
5
|
// src/commands/hello.ts
|
|
6
6
|
import { Command } from "@oclif/core";
|
|
@@ -13,4 +13,3 @@ var Hello = class extends Command {
|
|
|
13
13
|
export {
|
|
14
14
|
Hello as default
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=hello.js.map
|
package/dist/commands/help.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
VERTEX_VERSION
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-K5SQERJ7.js";
|
|
4
4
|
|
|
5
5
|
// src/commands/help.ts
|
|
6
6
|
import { Command } from "@oclif/core";
|
|
@@ -114,4 +114,3 @@ ${heading("EXAMPLES")}
|
|
|
114
114
|
export {
|
|
115
115
|
Help as default
|
|
116
116
|
};
|
|
117
|
-
//# sourceMappingURL=help.js.map
|
package/dist/commands/howto.js
CHANGED
package/dist/commands/import.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getClient,
|
|
3
3
|
getUserId
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-LXT34CD7.js";
|
|
5
|
+
import "../chunk-DRIWYEQE.js";
|
|
6
6
|
import {
|
|
7
7
|
createNote,
|
|
8
8
|
markdownToTiptap,
|
|
9
9
|
saveNoteContent
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-K5SQERJ7.js";
|
|
11
11
|
|
|
12
12
|
// src/commands/import.ts
|
|
13
13
|
import { Command, Args, Flags } from "@oclif/core";
|
|
@@ -36,4 +36,3 @@ var Import = class _Import extends Command {
|
|
|
36
36
|
export {
|
|
37
37
|
Import as default
|
|
38
38
|
};
|
|
39
|
-
//# sourceMappingURL=import.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getClient,
|
|
3
3
|
getUserId
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-LXT34CD7.js";
|
|
5
|
+
import "../chunk-DRIWYEQE.js";
|
|
6
6
|
import {
|
|
7
7
|
exportNoteAsMarkdown,
|
|
8
8
|
getBlocksForNote,
|
|
9
9
|
listNotes,
|
|
10
10
|
markdownToTiptap,
|
|
11
11
|
saveNoteContent
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-K5SQERJ7.js";
|
|
13
13
|
|
|
14
14
|
// src/commands/interactive.ts
|
|
15
15
|
import { Command, Args } from "@oclif/core";
|
|
@@ -82,6 +82,13 @@ function blocksToItems(blocks) {
|
|
|
82
82
|
case "fileBlock":
|
|
83
83
|
items.push({ kind: "file", text: attrs.filename || "file", checked: false });
|
|
84
84
|
break;
|
|
85
|
+
case "table": {
|
|
86
|
+
const tableRows = (tiptap.content ?? []).map(
|
|
87
|
+
(row) => (row.content ?? []).map((cell) => extractText(cell))
|
|
88
|
+
);
|
|
89
|
+
items.push({ kind: "table", text: "", checked: false, tableRows });
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
85
92
|
default: {
|
|
86
93
|
const text = extractText(tiptap);
|
|
87
94
|
if (text.trim()) items.push({ kind: "text", text, checked: false });
|
|
@@ -126,6 +133,27 @@ ${item.text.split("\n").map((l) => ` ${YELLOW}\u2502${R} ${l}`).join("\n")}
|
|
|
126
133
|
return `${ptr}${DIM}[image: ${item.text}]${R}`;
|
|
127
134
|
case "file":
|
|
128
135
|
return `${ptr}${DIM}[file: ${item.text}]${R}`;
|
|
136
|
+
case "table": {
|
|
137
|
+
const rows = item.tableRows ?? [];
|
|
138
|
+
if (rows.length === 0) return `${ptr}${DIM}[empty table]${R}`;
|
|
139
|
+
const colCount = Math.max(...rows.map((r) => r.length));
|
|
140
|
+
const colWidths = Array.from(
|
|
141
|
+
{ length: colCount },
|
|
142
|
+
(_, ci) => Math.max(3, ...rows.map((r) => (r[ci] ?? "").length))
|
|
143
|
+
);
|
|
144
|
+
const hr = (l, m, r, s) => " " + l + colWidths.map((w) => s.repeat(w + 2)).join(m) + r;
|
|
145
|
+
const rowLine = (cells, bold) => " \u2502 " + colWidths.map((w, ci) => {
|
|
146
|
+
const text = (cells[ci] ?? "").padEnd(w);
|
|
147
|
+
return bold ? `${BOLD}${text}${R}` : text;
|
|
148
|
+
}).join(" \u2502 ") + " \u2502";
|
|
149
|
+
const lines = [hr("\u250C", "\u252C", "\u2510", "\u2500")];
|
|
150
|
+
rows.forEach((cells, ri) => {
|
|
151
|
+
lines.push(rowLine(cells, ri === 0));
|
|
152
|
+
if (ri === 0 && rows.length > 1) lines.push(hr("\u251C", "\u253C", "\u2524", "\u2500"));
|
|
153
|
+
});
|
|
154
|
+
lines.push(hr("\u2514", "\u2534", "\u2518", "\u2500"));
|
|
155
|
+
return ptr + lines.join("\n");
|
|
156
|
+
}
|
|
129
157
|
default:
|
|
130
158
|
return `${ptr}${item.text}`;
|
|
131
159
|
}
|
|
@@ -220,6 +248,20 @@ $$`;
|
|
|
220
248
|
case "file":
|
|
221
249
|
return `> [!file]
|
|
222
250
|
> ${item.text}`;
|
|
251
|
+
case "table": {
|
|
252
|
+
const rows = item.tableRows ?? [];
|
|
253
|
+
if (rows.length === 0) return "";
|
|
254
|
+
const colCount = Math.max(...rows.map((r) => r.length));
|
|
255
|
+
const colWidths = Array.from(
|
|
256
|
+
{ length: colCount },
|
|
257
|
+
(_, ci) => Math.max(3, ...rows.map((r) => (r[ci] ?? "").length))
|
|
258
|
+
);
|
|
259
|
+
return rows.map((cells, ri) => {
|
|
260
|
+
const line = "| " + colWidths.map((w, ci) => (cells[ci] ?? "").padEnd(w)).join(" | ") + " |";
|
|
261
|
+
if (ri === 0) return line + "\n| " + colWidths.map((w) => "-".repeat(w)).join(" | ") + " |";
|
|
262
|
+
return line;
|
|
263
|
+
}).join("\n");
|
|
264
|
+
}
|
|
223
265
|
default:
|
|
224
266
|
return item.text;
|
|
225
267
|
}
|
|
@@ -321,4 +363,3 @@ $$`;
|
|
|
321
363
|
export {
|
|
322
364
|
Interactive as default
|
|
323
365
|
};
|
|
324
|
-
//# sourceMappingURL=interactive.js.map
|
package/dist/commands/login.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadConfig,
|
|
3
3
|
saveConfig
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-DRIWYEQE.js";
|
|
5
5
|
import {
|
|
6
6
|
createSupabaseClient
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-K5SQERJ7.js";
|
|
8
8
|
|
|
9
9
|
// src/commands/login.ts
|
|
10
10
|
import { Command } from "@oclif/core";
|
|
@@ -163,4 +163,3 @@ var Login = class extends Command {
|
|
|
163
163
|
export {
|
|
164
164
|
Login as default
|
|
165
165
|
};
|
|
166
|
-
//# sourceMappingURL=login.js.map
|
package/dist/commands/logout.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
clearConfig
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-DRIWYEQE.js";
|
|
4
4
|
|
|
5
5
|
// src/commands/logout.ts
|
|
6
6
|
import { Command } from "@oclif/core";
|
|
@@ -14,4 +14,3 @@ var Logout = class extends Command {
|
|
|
14
14
|
export {
|
|
15
15
|
Logout as default
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=logout.js.map
|
package/dist/commands/new.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getClient,
|
|
3
3
|
getUserId
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-LXT34CD7.js";
|
|
5
|
+
import "../chunk-DRIWYEQE.js";
|
|
6
6
|
import {
|
|
7
7
|
createNote
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-K5SQERJ7.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/new.ts
|
|
11
11
|
import { Command, Args } from "@oclif/core";
|
|
@@ -25,4 +25,3 @@ var New = class _New extends Command {
|
|
|
25
25
|
export {
|
|
26
26
|
New as default
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=new.js.map
|
package/dist/commands/notes.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getClient,
|
|
3
3
|
getUserId
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-LXT34CD7.js";
|
|
5
|
+
import "../chunk-DRIWYEQE.js";
|
|
6
6
|
import {
|
|
7
7
|
listNotes
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-K5SQERJ7.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/notes.ts
|
|
11
11
|
import { Command } from "@oclif/core";
|
|
@@ -42,4 +42,3 @@ var Notes = class extends Command {
|
|
|
42
42
|
export {
|
|
43
43
|
Notes as default
|
|
44
44
|
};
|
|
45
|
-
//# sourceMappingURL=notes.js.map
|
package/dist/commands/restore.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getClient,
|
|
3
3
|
getUserId
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-LXT34CD7.js";
|
|
5
|
+
import "../chunk-DRIWYEQE.js";
|
|
6
6
|
import {
|
|
7
7
|
listNotes,
|
|
8
8
|
restoreNote
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-K5SQERJ7.js";
|
|
10
10
|
|
|
11
11
|
// src/commands/restore.ts
|
|
12
12
|
import { Command, Args } from "@oclif/core";
|
|
@@ -32,4 +32,3 @@ var Restore = class _Restore extends Command {
|
|
|
32
32
|
export {
|
|
33
33
|
Restore as default
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=restore.js.map
|
package/dist/commands/search.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getClient,
|
|
3
3
|
getUserId
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-LXT34CD7.js";
|
|
5
|
+
import "../chunk-DRIWYEQE.js";
|
|
6
6
|
import {
|
|
7
7
|
executeQuery
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-K5SQERJ7.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/search.ts
|
|
11
11
|
import { Command, Args } from "@oclif/core";
|
|
@@ -35,4 +35,3 @@ var Search = class _Search extends Command {
|
|
|
35
35
|
export {
|
|
36
36
|
Search as default
|
|
37
37
|
};
|
|
38
|
-
//# sourceMappingURL=search.js.map
|
package/dist/commands/status.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getClient,
|
|
3
3
|
getUserId
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-LXT34CD7.js";
|
|
5
5
|
import {
|
|
6
6
|
loadConfig
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-DRIWYEQE.js";
|
|
8
8
|
import {
|
|
9
9
|
VERTEX_VERSION,
|
|
10
10
|
formatFileSize,
|
|
11
11
|
getStorageInfo,
|
|
12
12
|
listNotes
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-K5SQERJ7.js";
|
|
14
14
|
|
|
15
15
|
// src/commands/status.ts
|
|
16
16
|
import { Command } from "@oclif/core";
|
|
@@ -36,4 +36,3 @@ var Status = class extends Command {
|
|
|
36
36
|
export {
|
|
37
37
|
Status as default
|
|
38
38
|
};
|
|
39
|
-
//# sourceMappingURL=status.js.map
|
package/dist/commands/syntax.js
CHANGED
package/dist/commands/tags.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getClient,
|
|
3
3
|
getUserId
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-LXT34CD7.js";
|
|
5
|
+
import "../chunk-DRIWYEQE.js";
|
|
6
6
|
import {
|
|
7
7
|
getUserTags
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-K5SQERJ7.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/tags.ts
|
|
11
11
|
import { Command } from "@oclif/core";
|
|
@@ -29,4 +29,3 @@ var Tags = class extends Command {
|
|
|
29
29
|
export {
|
|
30
30
|
Tags as default
|
|
31
31
|
};
|
|
32
|
-
//# sourceMappingURL=tags.js.map
|
package/dist/commands/today.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getClient,
|
|
3
3
|
getUserId
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-LXT34CD7.js";
|
|
5
|
+
import "../chunk-DRIWYEQE.js";
|
|
6
6
|
import {
|
|
7
7
|
listNotes
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-K5SQERJ7.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/today.ts
|
|
11
11
|
import { Command } from "@oclif/core";
|
|
@@ -30,4 +30,3 @@ var Today = class extends Command {
|
|
|
30
30
|
export {
|
|
31
31
|
Today as default
|
|
32
32
|
};
|
|
33
|
-
//# sourceMappingURL=today.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cleanupRemovedFiles
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-23CKP3YP.js";
|
|
4
4
|
import {
|
|
5
5
|
getClient,
|
|
6
6
|
getUserId
|
|
7
|
-
} from "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
7
|
+
} from "../../chunk-LXT34CD7.js";
|
|
8
|
+
import "../../chunk-DRIWYEQE.js";
|
|
9
9
|
import {
|
|
10
10
|
emptyTrash
|
|
11
|
-
} from "../../chunk-
|
|
11
|
+
} from "../../chunk-K5SQERJ7.js";
|
|
12
12
|
|
|
13
13
|
// src/commands/trash/empty.ts
|
|
14
14
|
import { Command } from "@oclif/core";
|
|
@@ -24,4 +24,3 @@ var TrashEmpty = class extends Command {
|
|
|
24
24
|
export {
|
|
25
25
|
TrashEmpty as default
|
|
26
26
|
};
|
|
27
|
-
//# sourceMappingURL=empty.js.map
|