forked from ArianaKhit/text-snippets-obsidian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
386 lines (378 loc) · 67.8 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
/*
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());
});
}
class TextSnippets extends obsidian.Plugin {
onInit() { }
onload() {
return __awaiter(this, void 0, void 0, function* () {
console.log("Loading snippets plugin");
yield this.loadSettings();
this.addCommand({
id: "text-snippets",
name: "Run snippet replacement",
callback: () => this.SnippetOnTrigger(),
hotkeys: [{
modifiers: ["Mod"],
key: "tab"
}],
});
this.cmEditors = [];
this.registerCodeMirror((cm) => {
this.cmEditors.push(cm);
// the callback has to be called through another function in order for 'this' to work
cm.on('keydown', (cm, event) => this.handleKeyDown(cm, event));
});
this.addSettingTab(new TextSnippetsSettingsTab(this.app, this));
});
}
onunload() {
console.log("Unloading text snippet plugin");
this.cmEditors = [];
this.registerCodeMirror((cm) => {
this.cmEditors.push(cm);
// the callback has to be called through another function in order for 'this' to work
cm.off('keydown', (cm, event) => this.handleKeyDown(cm, event));
});
}
loadSettings() {
return __awaiter(this, void 0, void 0, function* () {
this.settings = Object.assign({}, DEFAULT_SETTINGS, yield this.loadData());
});
}
saveSettings() {
return __awaiter(this, void 0, void 0, function* () {
yield this.saveData(this.settings);
});
}
UpdateSplit(newlineSymbol) {
var nlSymb = newlineSymbol;
var nlSymb = nlSymb.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
var rg = '(?<!' + nlSymb + ')\\n';
const regex = new RegExp(rg);
var splited = this.settings.snippets_file.split(regex);
splited = splited.filter(item => item);
this.settings.snippets = splited;
}
getSelectedText(editor) {
if (editor.somethingSelected()) {
return editor.getSelection();
}
else {
var wordBoundaries = this.getWordBoundaries(editor);
editor.getDoc().setSelection(wordBoundaries.start, wordBoundaries.end);
return editor.getSelection();
}
}
getWordBoundaries(editor) {
var cursor = editor.getCursor();
var line = cursor.line;
var word = editor.findWordAt({
line: line,
ch: cursor.ch
});
var wordStart = word.anchor.ch;
var wordEnd = word.head.ch;
return {
start: {
line: line,
ch: wordStart
},
end: {
line: line,
ch: wordEnd
},
};
}
findSnippet(editor, cursorOrig, cursor) {
var selectedText = this.getSelectedText(editor);
var wordDelimiters = Array.from(this.settings.wordDelimiters);
var selectedWoSpaces = selectedText.split(' ').join('');
var newStr = "";
if (selectedWoSpaces == '' || wordDelimiters.indexOf(selectedWoSpaces[0]) >= 0 && cursorOrig.ch == cursor.ch) {
editor.execCommand('goWordLeft');
editor.execCommand('goWordLeft');
selectedText = this.getSelectedText(editor);
var cursor = editor.getCursor('from');
}
var i;
var snippets = this.settings.snippets;
for (i in snippets) {
var snippet = snippets[i].split(' : ');
if (selectedText == snippet[0]) {
newStr = snippet[1];
}
}
return newStr;
}
calculateCursorEndPos(nStr, cursor, endPosition) {
var nlSymb = this.settings.newlineSymbol;
var endSymbol = this.settings.endSymbol;
var stopSymbol = this.settings.stopSymbol;
var newStr = nStr.split('\n').join('');
if (newStr.indexOf(stopSymbol) == -1) {
var rawEnd = newStr.indexOf(endSymbol);
if (rawEnd == -1)
rawEnd = newStr.length;
var lastNl = newStr.substring(0, rawEnd).lastIndexOf(nlSymb);
if (lastNl != -1)
var endPosIndex = rawEnd - lastNl - nlSymb.length - cursor.ch;
else
var endPosIndex = rawEnd;
}
else {
var endPosIndex = 0;
}
nlSymb = nlSymb.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); //no special symbols in nlSymb
var rg = nlSymb + '\\n' + '|' + nlSymb;
const regex = new RegExp(rg);
const regexF = new RegExp(rg, 'g');
var nlinesCount = (newStr.substring(0, rawEnd).match(regexF) || []).length;
endPosition.nlinesCount = nlinesCount;
endPosition.position = endPosIndex;
newStr = newStr.split(regex).join('\n');
newStr = newStr.replace(endSymbol, '');
return newStr;
}
insertSnippet(key = '', snippetStartpos = { ch: -1, line: -1 }) {
let activeLeaf = this.app.workspace.activeLeaf;
let editor = activeLeaf.view.sourceMode.cmEditor;
var cursorOrig = editor.getCursor();
var wasSelection = editor.somethingSelected();
var cursor = editor.getCursor('from');
this.getWordBoundaries(editor);
var stopSymbol = this.settings.stopSymbol;
var pasteSymbol = this.settings.pasteSymbol;
var stopFound = false;
var newStr = "";
newStr = this.findSnippet(editor, cursorOrig, cursor);
cursor = editor.getCursor('from');
//proceed Tab and Spacebar
var endCursor = editor.getCursor('to');
if (newStr == "" ||
(key == 'Space' && (cursorOrig.ch != endCursor.ch || cursorOrig.line != endCursor.line))) {
if (wasSelection == false) {
editor.getDoc().setSelection(cursorOrig, cursorOrig);
}
if (key == 'Space')
return false;
if (newStr == "") {
editor.setCursor(cursorOrig);
return this.nextStop();
}
}
//find end position
var endPosition = { nlinesCount: 0, position: 0 };
newStr = this.calculateCursorEndPos(newStr, cursor, endPosition);
if (newStr.indexOf(stopSymbol) != -1)
stopFound = true;
if (newStr.indexOf(pasteSymbol) != -1)
snippetStartpos = cursor;
editor.replaceSelection(newStr);
if (stopFound) {
editor.setCursor({
line: cursor.line,
ch: cursor.ch
});
return this.nextStop();
}
else {
editor.setCursor({
line: cursor.line + endPosition.nlinesCount,
ch: cursor.ch + endPosition.position
});
}
editor.focus();
return true;
}
adjustCursor(editor, cursor, newStr, oldStr) {
var cursorOffset = newStr.length - oldStr.length;
this.adjustCursorOffset(editor, cursor, cursorOffset);
}
adjustCursorOffset(editor, cursor, cursorOffset) {
editor.setCursor({
line: cursor.line,
ch: cursor.ch + cursorOffset
});
}
handleKeyDown(cm, event) {
if ((event.key == 'Tab' && this.settings.useTab) || (event.code == 'Space' && this.settings.useSpace)) {
this.SnippetOnTrigger(event.code, true);
}
}
SnippetOnTrigger(key = '', preventDef = false) {
let activeLeaf = this.app.workspace.activeLeaf;
let cm = activeLeaf.view.sourceMode.cmEditor;
var cursorSt = cm.getCursor();
if (this.insertSnippet(key, cursorSt)) {
if (preventDef)
event.preventDefault();
if (cursorSt.ch >= 0 && cursorSt.line >= 0) { //paste text from clipboard
cm.getCursor();
navigator.clipboard.readText().then((clipText) => {
var search = cm.getSearchCursor(this.settings.pasteSymbol, cursorSt);
if (search.findNext()) {
search.replace(clipText);
}
});
}
}
}
nextStop() {
let activeLeaf = this.app.workspace.activeLeaf;
let cm = activeLeaf.view.sourceMode.cmEditor;
var search = cm.getSearchCursor(this.settings.stopSymbol, cm.getCursor());
if (search.findNext()) {
search.replace("");
cm.setCursor(search.from());
return true;
}
else if (this.settings.useTab) {
return false;
}
return false;
}
}
const DEFAULT_SETTINGS = {
snippets_file: "snippets : It is an obsidian plugin, that replaces your selected text.",
snippets: ["snippets : It is an obsidian plugin, that replaces your selected text."],
endSymbol: '$end$',
newlineSymbol: '$nl$',
stopSymbol: "$tb$",
pasteSymbol: "$pst$",
useTab: true,
useSpace: false,
wordDelimiters: "$()[]{}<>,.!?;:\'\"\\/",
};
class TextSnippetsSettingsTab extends obsidian.PluginSettingTab {
constructor(app, plugin) {
super(app, plugin);
this.plugin = plugin;
}
display() {
let { containerEl } = this;
containerEl.empty();
containerEl.createEl('h2', { text: 'Text Snippets - Settings' });
new obsidian.Setting(containerEl)
.setName("Snippets")
.setDesc("Type here your snippets in format 'snippet : result', one per line. Empty lines will be ignored. Ctrl+Tab to replace (hotkey can be changed).")
.setClass("text-snippets-class")
.addTextArea((text) => text
.setPlaceholder("before : after")
.setValue(this.plugin.settings.snippets_file)
.onChange((value) => __awaiter(this, void 0, void 0, function* () {
this.plugin.settings.snippets_file = value;
this.plugin.UpdateSplit(this.plugin.settings.newlineSymbol);
yield this.plugin.saveSettings();
})));
new obsidian.Setting(containerEl)
.setName("Cursor end position mark")
.setDesc("Places the cursor to the mark position after inserting a snippet (default: $end$).\nMark does not appear anywhere within the snippet. Do not use together with Stop Symbol.")
.setClass("text-snippets-cursor")
.addTextArea((text) => text
.setPlaceholder("$end$")
.setValue(this.plugin.settings.endSymbol)
.onChange((value) => __awaiter(this, void 0, void 0, function* () {
if (value == '') {
value = '$end$';
}
this.plugin.settings.endSymbol = value;
yield this.plugin.saveSettings();
})));
new obsidian.Setting(containerEl)
.setName("Newline mark")
.setDesc("Ignores newline after mark, replace it with a newline character after expanding (default: $nl$).\nNecessary to write before every line break in multiline snippets.")
.setClass("text-snippets-newline")
.addTextArea((text) => text
.setPlaceholder("$nl$")
.setValue(this.plugin.settings.newlineSymbol)
.onChange((value) => __awaiter(this, void 0, void 0, function* () {
if (value == '') {
value = '$nl$';
}
this.plugin.settings.newlineSymbol = value;
this.plugin.UpdateSplit(value);
yield this.plugin.saveSettings();
})));
new obsidian.Setting(containerEl)
.setName('Stop Symbol')
.setDesc('Symbol to jump to when command is called.')
.setClass("text-snippets-tabstops")
.addTextArea((text) => text
.setPlaceholder('')
.setValue(this.plugin.settings.stopSymbol)
.onChange((value) => __awaiter(this, void 0, void 0, function* () {
if (value == '') {
value = '$tb$';
}
this.plugin.settings.stopSymbol = value;
yield this.plugin.saveSettings();
})));
new obsidian.Setting(containerEl)
.setName('Clipboard paste Symbol')
.setDesc('Symbol to be replaced with clipboard content.')
.setClass("text-snippets-tabstops")
.addTextArea((text) => text
.setPlaceholder('')
.setValue(this.plugin.settings.pasteSymbol)
.onChange((value) => __awaiter(this, void 0, void 0, function* () {
if (value == '') {
value = '$pst$';
}
this.plugin.settings.pasteSymbol = value;
yield this.plugin.saveSettings();
})));
new obsidian.Setting(containerEl)
.setName("Expand on Tab")
.setDesc("Use the Tab key as the trigger.")
.addToggle(toggle => toggle.setValue(this.plugin.settings.useTab)
.onChange((value) => __awaiter(this, void 0, void 0, function* () {
this.plugin.settings.useTab = !this.plugin.settings.useTab;
yield this.plugin.saveSettings();
})));
new obsidian.Setting(containerEl)
.setName("Expand on Space")
.setDesc("Use the Space bar button as the trigger.")
.addToggle(toggle => toggle.setValue(this.plugin.settings.useSpace)
.onChange((value) => __awaiter(this, void 0, void 0, function* () {
this.plugin.settings.useSpace = !this.plugin.settings.useSpace;
yield this.plugin.saveSettings();
})));
new obsidian.Setting(containerEl)
.setName('Word delimiters')
.setDesc('Сharacters for specifying the boundary between separate words.')
.setClass("text-snippets-delimiter")
.addTextArea((text) => text
.setPlaceholder('')
.setValue(this.plugin.settings.wordDelimiters)
.onChange((value) => __awaiter(this, void 0, void 0, function* () {
this.plugin.settings.wordDelimiters = value;
yield this.plugin.saveSettings();
})));
}
}
module.exports = TextSnippets;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvdXJjZXMiOlsibm9kZV9tb2R1bGVzL3RzbGliL3RzbGliLmVzNi5qcyIsIm1haW4udHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyohICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqXHJcbkNvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLlxyXG5cclxuUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55XHJcbnB1cnBvc2Ugd2l0aCBvciB3aXRob3V0IGZlZSBpcyBoZXJlYnkgZ3J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