XeNote/posts/.obsidian/plugins/mrj-backlinks-in-document/main.js
web-meister a97a7b4f33 ...
2021-03-04 00:33:38 +03:00

220 lines
43 KiB
JavaScript

'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.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
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());
});
}
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
var defaultData = {
prBacklinkLeaf: null,
mdBacklinkLeaf: null
};
var BacklinksInDocument = /** @class */ (function (_super) {
__extends(BacklinksInDocument, _super);
function BacklinksInDocument() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.data = defaultData;
return _this;
}
Object.defineProperty(BacklinksInDocument.prototype, "hasOpenedMdFiles", {
get: function () {
return this.app.workspace.getLeavesOfType('markdown').length !== 0;
},
enumerable: false,
configurable: true
});
Object.defineProperty(BacklinksInDocument.prototype, "isPluginLeafExists", {
get: function () {
var _a, _b;
var openedBacklinksLeaves = this.app.workspace.getLeavesOfType('backlink').map(function (e) { return e === null || e === void 0 ? void 0 : e.id; });
return openedBacklinksLeaves.includes((_a = this.data.prBacklinkLeaf) === null || _a === void 0 ? void 0 : _a.id)
&& openedBacklinksLeaves.includes((_b = this.data.mdBacklinkLeaf) === null || _b === void 0 ? void 0 : _b.id);
},
enumerable: false,
configurable: true
});
BacklinksInDocument.prototype.createPluginLeaf = function () {
var workspace = this.app.workspace;
var root = workspace.rootSplit;
this.data.mdBacklinkLeaf = workspace.createLeafInParent(root);
this.data.prBacklinkLeaf = workspace.createLeafInParent(root);
};
BacklinksInDocument.prototype.removeLeaf = function (id) {
var leaf = this.app.workspace.getLeafById(id);
leaf === null || leaf === void 0 ? void 0 : leaf.detach();
};
BacklinksInDocument.prototype.clear = function () {
var _a, _b;
(_a = this.data.prBacklinkLeaf) === null || _a === void 0 ? void 0 : _a.detach();
(_b = this.data.mdBacklinkLeaf) === null || _b === void 0 ? void 0 : _b.detach();
};
BacklinksInDocument.prototype.updateBacklinks = function (file) {
return __awaiter(this, void 0, void 0, function () {
var _a, prBacklinkLeaf, mdBacklinkLeaf;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
if (!file) {
return [2 /*return*/];
}
_a = this.data, prBacklinkLeaf = _a.prBacklinkLeaf, mdBacklinkLeaf = _a.mdBacklinkLeaf;
console.log(file);
return [4 /*yield*/, (prBacklinkLeaf === null || prBacklinkLeaf === void 0 ? void 0 : prBacklinkLeaf.setViewState({
type: 'backlink',
state: {
file: file.path,
}
}))];
case 1:
_b.sent();
return [4 /*yield*/, (mdBacklinkLeaf === null || mdBacklinkLeaf === void 0 ? void 0 : mdBacklinkLeaf.setViewState({
type: 'backlink',
state: {
file: file.path,
}
}))];
case 2:
_b.sent();
return [2 /*return*/];
}
});
});
};
BacklinksInDocument.prototype.onload = function () {
return __awaiter(this, void 0, void 0, function () {
var saved;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.loadData()];
case 1:
saved = _a.sent();
this.app.workspace.on('layout-ready', function () {
saved.ids.forEach(function (id) { return _this.removeLeaf(id); });
});
this.app.workspace.on('file-open', function (file) { return __awaiter(_this, void 0, void 0, function () {
var activeLeaf, activeView, isAllowedView, isBacklinkView, _a, prBacklinkLeaf, mdBacklinkLeaf, mdLeafEl, prLeafEl, mdEl, prEl;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
activeLeaf = this.app.workspace.activeLeaf;
if (!activeLeaf) {
return [2 /*return*/];
}
activeView = activeLeaf.view;
isAllowedView = activeView instanceof obsidian.MarkdownView || activeView instanceof obsidian.MarkdownPreviewView;
isBacklinkView = activeView.getState().hasOwnProperty('backlinkCollapsed');
if (!this.hasOpenedMdFiles) {
this.clear();
return [2 /*return*/];
}
if (isBacklinkView) {
return [2 /*return*/];
}
if (!isAllowedView) {
this.clear();
return [2 /*return*/];
}
if (!this.isPluginLeafExists) {
this.clear();
this.createPluginLeaf();
}
_a = this.data, prBacklinkLeaf = _a.prBacklinkLeaf, mdBacklinkLeaf = _a.mdBacklinkLeaf;
mdLeafEl = mdBacklinkLeaf.view.containerEl.parentNode;
prLeafEl = prBacklinkLeaf.view.containerEl.parentNode;
mdEl = activeView.containerEl.querySelector('.mod-active .markdown-source-view .CodeMirror-lines');
prEl = activeView.containerEl.querySelector('.mod-active .markdown-preview-view');
mdEl.appendChild(mdLeafEl);
prEl.appendChild(prLeafEl);
return [4 /*yield*/, this.updateBacklinks(file)
// @ts-ignore
];
case 1:
_b.sent();
// @ts-ignore
return [4 /*yield*/, this.saveData({ ids: [mdBacklinkLeaf.id, prBacklinkLeaf.id] })];
case 2:
// @ts-ignore
_b.sent();
return [2 /*return*/];
}
});
}); });
return [2 /*return*/];
}
});
});
};
BacklinksInDocument.prototype.onunload = function () {
console.log('unloading plugin');
};
return BacklinksInDocument;
}(obsidian.Plugin));
module.exports = BacklinksInDocument;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvdXJjZXMiOlsibm9kZV9tb2R1b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5cclxuKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi9cclxuLyogZ2xvYmFsIFJlZmxlY3QsIFByb21pc2UgKi9cclxuXHJcbnZhciBleHRlbmRTdGF0aWNzID0gZnVuY3Rpb24oZCwgYikge1xyXG4gICAgZXh0ZW5kU3RhdGljcyA9IE9iamVjdC5zZXRQcm90b3R5cGVPZiB8fFxyXG4gICAgICAgICh7IF9fcHJvdG9fXzogW10gfSBpbnN0YW5jZW9mIEFycmF5ICYmIGZ1bmN0aW9uIChkLCBiKSB7IGQuX19wcm90b19fID0gYjsgfSkgfHxcclxuICAgICAgICBmdW5jdGlvbiAoZCwgYikgeyBmb3IgKHZhciBwIGluIGIpIGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoYiwgcCkpIGRbcF0gPSBiW3BdOyB9O1xyXG4gICAgcmV0dXJuIGV4dGVuZFN0YXRpY3MoZCwgYik7XHJcbn07XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gX19leHRlbmRzKGQsIGIpIHtcclxuICAgIGV4dGVuZFN0YXRpY3MoZCwgYik7XHJcbiAgICBmdW5jdGlvbiBfXygpIHsgdGhpcy5jb25zdHJ1Y3RvciA9IGQ7IH1cclxuICAgIGQucHJvdG90eXBlID0gYiA9PT0gbnVsbCA/IE9iamVjdC5jcmVhdGUoYikgOiAoX18ucHJvdG90eXBlID0gYi5wcm90b3R5cGUsIG5ldyBfXygpKTtcclxufVxyXG5cclxuZXhwb3J0IHZhciBfX2Fzc2lnbiA9IGZ1bmN0aW9uKCkge1xyXG4gICAgX19hc3NpZ24gPSBPYmplY3QuYXNzaWduIHx8IGZ1bmN0aW9uIF9fYXNzaWduKHQpIHtcclxuICAgICAgICBmb3IgKHZhciBzLCBpID0gMSwgbiA9IGFyZ3VtZW50cy5sZW5ndGg7IGkgPCBuOyBpKyspIHtcclxuICAgICAgICAgICAg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rOyB5ID0gb3BbMV07IG9wID0gWzBdOyBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIGNhc2UgNzogb3AgPSBfLm9wcy5wb3AoKTsgXy50cnlzLnBvcCgpOyBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEodCA9IF8udHJ5cywgdCA9IHQubGVuZ3RoID4gMCAmJiB0W3QubGVuZ3RoIC0gMV0pICYmIChvcFswXSA9PT0gNiB8fCBvcFswXSA9PT0gMikpIHsgXyA9IDA7IGNvbnRpbnVlOyB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wWzBdID09PSAzICYmICghdCB8fCAob3BbMV0gPiB0WzBdICYmIG9wWzFdIDwgdFszXSkpKSB7IF8ubGFiZWwgPSBvcFsxXTsgYnJlYWs7IH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAob3BbMF0gPT09IDYgJiYgXy5sYWJlbCA8IHRbMV0pIHsgXy5sYWJlbCA9IHRbMV07IHQgPSBvcDsgYnJlYWs7IH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAodCAmJiBfLmxhYmVsIDwgdFsyXSkgeyBfLmxhYmVsID0gdFsyXTsgXy5vcHMucHVzaChvcCk7IGJyZWFrOyB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRbMl0pIF8ub3BzLnBvcCgpO1xyXG4gICAgICAgICAgICAgICAgICAgIF8udHJ5cy5wb3AoKTsgY29udGludWU7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgb3AgPSBib2R5LmNhbGwodGhpc0FyZywgXyk7XHJcbiAgICAgICAgfSBjYXRjaCAoZSkgeyBvcCA9IFs2LCBlXTsgeSA9IDA7IH0gZmluYWxseSB7IGYgPSB0ID0gMDsgfVxyXG4gICAgICAgIGlmIChvcFswXSAmIDUpIHRocm93IG9wWzFdOyByZXR1cm4geyB2YWx1ZTogb3BbMF0gPyBvcFsxXSA6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aXMuZGF0YVxyXG5cclxuICAgICAgICBjb25zb2xlLmxvZyhmaWxlKVxyXG4gICAgICAgIGF3YWl0IHByQmFja2xpbmtMZWFmPy5zZXRWaWV3U3RhdGUoe1xyXG4gICAgICAgICAgICB0eXBlOiAnYmFja2xpbmsnLFxyXG4gICAgICAgICAgICBzdGF0ZToge1xyXG4gICAgICAgICAgICAgICAgZmlsZTogZmlsZS5wYXRoLFxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSlcclxuXHJcbiAgICAgICAgYXdhaXQgbWRCYWNrbGlua0xlYWY/LnNldFZpZXdTdGF0ZSh7XHJcbiAgICAgICAgICAgIHR5cGU6ICdiYWNrbGluaycsXHJcbiAgICAgICAgICAgIHN0YXRlOiB7XHJcbiAgICAgICAgICAgICAgICBmaWxlOiBmaWxlLnBhdGgsXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KVxyXG5cclxuICAgIH1cclxuXHJcbiAgICBhc3luYyBvbmxvYWQoKSB7XHJcbiAgICAgICAgY29uc3Qgc2F2ZWQgPSBhd2FpdCB0aGlzLmxvYWREYXRhKClcclxuXHJcbiAgICAgICAgdGhpcy5hcHAud29ya3NwYWNlLm9uKCdsYXlvdXQtcmVhZHknLCAoKSA9PiB7XHJcbiAgICAgICAgICAgIHNhdmVkLmlkcy5mb3JFYWNoKChpZDogc3RyaW5nKSA9PiB0aGlzLnJlbW92ZUxlYWYoaWQpKVxyXG4gICAgICAgIH0pXHJcblxyXG4gICAgICAgIHRoaXMuYXBwLndvcmtzcGFjZS5vbignZmlsZS1vcGVuJywgYXN5bmMgKGZpbGUpID0+IHtcclxuICAgICAgICAgICAgY29uc3QgYWN0aXZlTGVhZiA9IHRoaXMuYXBwLndvcmtzcGFjZS5hY3RpdmVMZWFmXHJcbiAgICAgICAgICAgIGlmICghYWN0aXZlTGVhZikgeyByZXR1cm4gfVxyXG5cclxuICAgICAgICAgICAgY29uc3QgYWN0aXZlVmlldyA9IGFjdGl2ZUxlYWYudmlld1xyXG5cclxuICAgICAgICAgICAgY29uc3QgaXNBbGxvd2VkVmlldyA9IGFjdGl2ZVZpZXcgaW5zdGFuY2VvZiBNYXJrZG93blZpZXcgfHwgYWN0aXZlVmlldyBpbnN0YW5jZW9mIE1hcmtkb3duUHJldmlld1ZpZXdcclxuXHJcbiAgICAgICAgICAgIGNvbnN0IGlzQmFja2xpbmtWaWV3ID0gYWN0aXZlVmlldy5nZXRTdGF0ZSgpLmhhc093blByb3BlcnR5KCdiYWNrbGlua0NvbGxhcHNlZCcpXHJcblxyXG4gICAgICAgICAgICBpZiAoIXRoaXMuaGFzT3BlbmVkTWRGaWxlcykge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5jbGVhcigpXHJcbiAgICAgICAgICAgICAgICByZXR1cm5cclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgaWYgKGlzQmFja2xpbmtWaWV3KSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm5cclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgaWYgKCFpc0FsbG93ZWRWaWV3KSB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmNsZWFyKClcclxuICAgICAgICAgICAgICAgIHJldHVyblxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICBpZiAoIXRoaXMuaXNQbHVnaW5MZWFmRXhpc3RzKSB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmNsZWFyKClcclxuICAgICAgICAgICAgICAgIHRoaXMuY3JlYXRlUGx1Z2luTGVhZigpXHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIGNvbnN0IHsgcHJCYWNrbGlua0xlYWYsIG1kQmFja2xpbmtMZWFmIH0gPSB0aGlzLmRhdGFcclxuXHJcbiAgICAgICAgICAgIGNvbnN0IG1kTGVhZkVsID0gbWRCYWNrbGlua0xlYWYudmlldy5jb250YWluZXJFbC5wYXJlbnROb2RlIGFzIEhUTUxFbGVtZW50XHJcbiA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