-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
448 lines (440 loc) · 65.3 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
/*
THIS IS A GENERATED/BUNDLED FILE BY ROLLUP
if you want to view the source visit the plugins github repository
*/
'use strict';
var obsidian = require('obsidian');
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
const plugin_name = 'koncham-nav-note';
class MyPlugin extends obsidian.Plugin {
onunload() {
console.log('unloading plugin :' + plugin_name);
}
onload() {
return __awaiter(this, void 0, void 0, function* () {
console.log('loading plugin: ' + plugin_name);
this.addCommand({
id: 'goto-sibling-prev',
name: 'goto sibling: previous',
callback: () => this.gotoSibling(-1),
});
this.addCommand({
id: 'goto-sibling-next',
name: 'goto sibling: next',
callback: () => this.gotoSibling(1),
});
this.addCommand({
id: 'show-tokens',
name: 'show tokens',
callback: () => this.showTokens(),
});
this.addCommand({
id: 'flash-line',
name: 'flash line',
callback: () => this.flashLine(),
});
this.addCommand({
id: 'goto-block-prev',
name: 'goto block: prev',
callback: () => this.gotoBlockPrev(),
});
this.addCommand({
id: 'goto-block-next',
name: 'goto block: next',
callback: () => this.gotoBlockNext(),
});
this.addCommand({
id: 'goto-section-prev',
name: 'goto section: prev',
callback: () => this.gotoSection(-1),
});
this.addCommand({
id: 'goto-section-next',
name: 'goto section: next',
callback: () => this.gotoSection(1),
});
this.addCommand({
id: 'show-family',
name: 'show family',
callback: () => this.showFamily(),
});
this.addCommand({
id: 'goto-cousin-next',
name: 'goto cousin: next',
callback: () => this.gotoCousin(1),
});
this.addCommand({
id: 'goto-cousin-prev',
name: 'goto cousin: prev',
callback: () => this.gotoCousin(-1),
});
this.addCommand({
id: 'log-headings',
name: 'log headings',
hotkeys: [{ "modifiers": [], "key": "F21" }],
callback: () => this.getHeadingsNote(),
});
this.addCommand({
id: 'switch-heading',
name: 'Open Heading Switcher',
hotkeys: [{ "modifiers": [], "key": "F22" }],
checkCallback: (checking) => {
let leaf = this.app.workspace.activeLeaf;
if (leaf) {
if (!checking) {
new headingSwitchModal(this.app, this.getHeadingsNote()).open();
}
return true;
}
return false;
}
});
});
}
showFamily() {
let family = this.getFamily();
new obsidian.Notice(family);
console.log(family);
}
getFamily() {
const view = this.app.workspace.activeLeaf.view;
if (view instanceof obsidian.MarkdownView) {
const cm = view.sourceMode.cmEditor;
let cursorHead = cm.getCursor();
let var_token_base = cm.getTokenTypeAt(cursorHead);
let family;
if (var_token_base === undefined) {
family = '--blank';
}
else if (var_token_base === null) {
family = '--paragraph';
}
else if (var_token_base.includes('hashtag')) {
family = 'hashtag';
}
else if (var_token_base.includes('header')) {
family = 'header';
}
else if (var_token_base.includes('list')) {
family = 'list';
}
else if (var_token_base.includes('quote')) {
family = 'quote';
}
else {
family = '--tbd';
}
return (family);
}
}
showTokens() {
const view = this.app.workspace.activeLeaf.view;
if (view instanceof obsidian.MarkdownView) {
const cm = view.sourceMode.cmEditor;
let cursorHead = cm.getCursor();
let var_token_base = cm.getTokenTypeAt(cursorHead);
new obsidian.Notice(var_token_base);
console.log(var_token_base);
}
}
// flashes the current line to highlight
flashLine() {
const view = this.app.workspace.activeLeaf.view;
if (view instanceof obsidian.MarkdownView) {
const cm = view.sourceMode.cmEditor;
let cursorLine = cm.getCursor().line;
cm.addLineClass(cursorLine, "wrap", plugin_name + "-flash");
setTimeout(() => {
cm.removeLineClass(cursorLine, "wrap", plugin_name + "-flash");
}, 100);
}
}
// flashes the current line to highlight an error
errorLine() {
const view = this.app.workspace.activeLeaf.view;
if (view instanceof obsidian.MarkdownView) {
const cm = view.sourceMode.cmEditor;
let cursorLine = cm.getCursor().line;
cm.addLineClass(cursorLine, "wrap", plugin_name + "-error");
setTimeout(() => {
cm.removeLineClass(cursorLine, "wrap", plugin_name + "-error");
}, 100);
}
}
gotoBlockNext() {
const view = this.app.workspace.activeLeaf.view;
if (view instanceof obsidian.MarkdownView) {
const cm = view.sourceMode.cmEditor;
cm.execCommand('goLineStartSmart');
let cursorHead = cm.getCursor();
let line_base = cursorHead.line;
let line_limit = cm.lastLine();
let result = false;
let is_blank;
if (cm.getTokenTypeAt(cursorHead) === undefined) {
is_blank = true;
}
else {
is_blank = false;
}
cursorHead.line += 1;
while (!result && cursorHead.line <= line_limit) {
let token = cm.getTokenTypeAt(cursorHead);
if (is_blank == true && token !== undefined) {
result = true;
}
else if (cursorHead.line == line_limit + 1) {
result = true;
}
else if (token === undefined) {
is_blank = true;
cursorHead.line += 1;
}
else {
is_blank = false;
cursorHead.line += 1;
}
}
if (result) {
cm.setCursor(cursorHead);
this.flashLine();
}
else {
cursorHead.line = line_base;
this.errorLine();
}
}
}
gotoBlockPrev() {
const view = this.app.workspace.activeLeaf.view;
if (view instanceof obsidian.MarkdownView) {
const cm = view.sourceMode.cmEditor;
cm.execCommand('goLineStartSmart');
let cursorHead = cm.getCursor();
let line_base = cursorHead.line;
let line_limit = cm.firstLine();
let result = false;
cursorHead.line -= 1;
while (!result && cursorHead.line >= line_limit) {
let token1 = cm.getTokenTypeAt(cursorHead);
cursorHead.line -= 1;
let token2 = cm.getTokenTypeAt(cursorHead);
if (token1 !== undefined && token2 === undefined) {
result = true;
}
else if (cursorHead.line < line_limit) {
result = true;
}
}
if (result) {
cursorHead.line += 1;
cm.setCursor(cursorHead);
this.flashLine();
}
else {
cursorHead.line = line_base;
this.errorLine();
}
}
}
// gotoSibling is configured only for [n_item = +1 or -1]
// it may be extended later
gotoSibling(n_item) {
const view = this.app.workspace.activeLeaf.view;
if (view instanceof obsidian.MarkdownView) {
const cm = view.sourceMode.cmEditor;
let line_limit;
if (n_item > 0) {
line_limit = cm.lastLine();
}
else {
line_limit = cm.firstLine();
}
let cursorHead = cm.getCursor();
let var_token_base = cm.getTokenTypeAt(cursorHead);
let line_base = cursorHead.line;
let var_token;
while (var_token != var_token_base
&& this.gotoCheckLimit(cursorHead.line, n_item, line_limit)) {
cursorHead.line += n_item;
var_token = cm.getTokenTypeAt(cursorHead);
}
if (var_token == var_token_base) {
cm.setCursor(cursorHead);
this.flashLine();
}
else {
cursorHead.line = line_base;
this.errorLine();
}
}
}
// gotoCousin is configured only for [n_item = +1 or -1]
// it may be extended later
gotoCousin(n_item) {
const view = this.app.workspace.activeLeaf.view;
if (view instanceof obsidian.MarkdownView) {
const cm = view.sourceMode.cmEditor;
let line_limit;
if (n_item > 0) {
line_limit = cm.lastLine();
}
else {
line_limit = cm.firstLine();
}
let cursorHead = cm.getCursor();
let family_base = this.getFamily();
let line_base = cursorHead.line;
let family;
while (family != family_base
&& this.gotoCheckLimit(cursorHead.line, n_item, line_limit)) {
cursorHead.line += n_item;
family = this.getFamily();
}
if (family == family_base) {
cm.setCursor(cursorHead);
this.flashLine();
}
else {
cursorHead.line = line_base;
this.errorLine();
}
}
}
// gotoSection is configured only for [n_item = +1 or -1]
// it may be extended later
gotoSection(n_item) {
const view = this.app.workspace.activeLeaf.view;
if (view instanceof obsidian.MarkdownView) {
const cm = view.sourceMode.cmEditor;
let cursorHead = cm.getCursor();
let line_base = cursorHead.line;
let line_limit;
if (n_item > 0) {
line_limit = cm.lastLine();
}
else {
line_limit = cm.firstLine();
}
let result = false;
let var_token;
while (this.gotoCheckLimit(cursorHead.line, n_item, line_limit) && !result) {
cursorHead.line += n_item;
var_token = cm.getTokenTypeAt(cursorHead);
if (var_token !== undefined && var_token !== null) {
if (var_token.includes('header')) {
result = true;
}
}
}
if (result) {
cm.setCursor(cursorHead);
this.flashLine();
}
else {
cursorHead.line = line_base;
this.errorLine();
}
}
}
// gotoCheckLimit is configured only for [n_item = +1 or -1]
// it may be extended later
gotoCheckLimit(current_line, n_item, line_limit) {
if (n_item > 0 && current_line < line_limit) {
return true;
}
else if (n_item < 0 && current_line > line_limit) {
return true;
}
else {
return false;
}
}
// gotoCheckLimit is configured only for [n_item = +1 or -1]
// it may be extended later
getLineLimit(n_item) {
const view = this.app.workspace.activeLeaf.view;
let line_limit;
if (view instanceof obsidian.MarkdownView) {
const cm = view.sourceMode.cmEditor;
if (n_item > 0) {
line_limit = cm.lastLine();
}
else {
line_limit = cm.firstLine();
}
}
return line_limit;
}
getHeadingsNote() {
let file = this.app.workspace.getActiveFile();
let file_cache = this.app.metadataCache.getFileCache(file);
let heading_cache = file_cache.headings;
console.log(heading_cache);
let heading_data_interface = [];
let heading_context;
heading_context = [];
for (const [key, value] of Object.entries(heading_cache)) {
heading_context = process_heading(heading_context, value.level, value.heading);
let name_full = heading_context.slice().reverse().join(' < ');
heading_data_interface.push({
title: value.heading,
level: value.level,
name_full: name_full,
line: value.position.start.line,
start: value.position.start.col
});
function process_heading(heading_context, level, title) {
heading_context[level - 1] = title;
heading_context = heading_context.slice(0, level);
return heading_context;
}
}
// console.log('final: ', heading_data_interface)
return heading_data_interface;
}
}
class headingSwitchModal extends obsidian.FuzzySuggestModal {
constructor(app, items) {
super(app);
this.app = app;
this.items = items;
}
getItems() {
return this.items;
}
getItemText(item) {
let level_indicator = " ";
return item.level + 'HH' + level_indicator.repeat(item.level) + item.name_full;
}
onChooseItem(item, evt) {
this.app.workspace.activeLeaf.view;
// if (view instanceof MarkdownView) {
// let editor = view.editor
// editor.setSelection({ line: item.line, ch: item.start + 1 })
// }
console.log(item.name_full);
}
}
module.exports = MyPlugin;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvdXJjZXMiOlsibm9kZV9tb2R1bGVzL3RzbGliL3RzbGliLmVzNi5qcyIsIm1haW4udHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyohICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqXHJcbkNvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLlxyXG5cclxuUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55XHJcbnB1cnBvc2Ugd2l0aCBvciB3aXRob3V0IGZlZSBpcyBoZXJlYnkgZ3JhbnRlZC5cclxuXHJcblRIRSBTT0ZUV0FSRSBJUyBQUk9WSURFRCBcIkFTIElTXCIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEhcclxuUkVHQVJEIFRPIFRISVMgU09GVFdBUkUgSU5DTFVESU5HIEFMTCBJTVBMSUVEIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZXHJcbkFORCBGSVRORVNTLiBJTiBOTyBFVkVOVCBTSEFMTCBUSEUgQVVUSE9SIEJFIExJQUJMRSBGT1IgQU5ZIFNQRUNJQUwsIERJUkVDVCxcclxuSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NXHJcbkxPU1MgT0YgVVNFLCBEQVRBIE9SIFBST0ZJVFMsIFdIRVRIRVIgSU4gQU4gQUNUSU9OIE9GIENPTlRSQUNUL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G9yID0gZDsgfVxyXG4gICAgZC5wcm90b3R5cGUgPSBiID09PSBudWxsID8gT2JqZWN0LmNyZWF0ZShiKSA6IChfXy5wcm90b3R5cGUgPSBiLnByb3RvdHlwZSwgbmV3IF9fKCkpO1xyXG59XHJcblxyXG5leHBvcnQgdmFyIF9fYXNzaWduID0gZnVuY3Rpb24oKSB7XHJcbiAgICBfX2Fzc2lnbiA9IE9iamVjdC5hc3NpZ24gfHwgZnVuY3Rpb24gX19hc3NpZ24odCkge1xyXG4gICAgICAgIGZvciAodmFyIHMsIGkgPSAxLCBuID0gYXJndW1lbnRzLmxlbmd0aDsgaSA8IG47IGkrKykge1xyXG4gICAgICAgICAgICBzID0gYXJndW1lbnRzW2ldO1xyXG4gICAgICAgICAgICBmb3IgKHZhciBwIGluIHMpIGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwocywgcCkpIHRbcF0gPSBzW3BdO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gdDtcclxuICAgIH1cclxuICAgIHJldHVybiBfX2Fzc2lnbi5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gX19yZXN0KHMsIGUpIHtcclxuICAgIHZhciB0ID0ge307XHJcbiAgICBmb3IgKHZhciBwIGluIHMpIGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwocywgcCkgJiYgZS5pbmRleE9mKHApIDwgMClcclxuICAgICAgICB0W3BdID0gc1twXTtcclxuICAgIGlmIChzICE9IG51bGwgJiYgdHlwZW9mIE9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMgPT09IFwiZnVuY3Rpb25cIilcclxuICAgICAgICBmb3IgKHZhciBpID0gMCwgcCA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMocyk7IGkgPCBwLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgIGlmIChlLm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