5323 lines
207 KiB
JavaScript
5323 lines
207 KiB
JavaScript
/*
|
||
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||
if you want to view the source, please visit the github repository of this plugin
|
||
*/
|
||
|
||
"use strict";
|
||
var __create = Object.create;
|
||
var __defProp = Object.defineProperty;
|
||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||
var __getProtoOf = Object.getPrototypeOf;
|
||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||
var __commonJS = (cb, mod) => function __require() {
|
||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||
};
|
||
var __export = (target, all) => {
|
||
for (var name in all)
|
||
__defProp(target, name, { get: all[name], enumerable: true });
|
||
};
|
||
var __copyProps = (to, from, except, desc) => {
|
||
if (from && typeof from === "object" || typeof from === "function") {
|
||
for (let key of __getOwnPropNames(from))
|
||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||
}
|
||
return to;
|
||
};
|
||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||
// If the importer is in node compatibility mode or this is not an ESM
|
||
// file that has been converted to a CommonJS file using a Babel-
|
||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||
mod
|
||
));
|
||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||
var __publicField = (obj, key, value) => {
|
||
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
||
return value;
|
||
};
|
||
|
||
// node_modules/obsidian-daily-notes-interface/dist/main.js
|
||
var require_main = __commonJS({
|
||
"node_modules/obsidian-daily-notes-interface/dist/main.js"(exports) {
|
||
"use strict";
|
||
Object.defineProperty(exports, "__esModule", { value: true });
|
||
var obsidian = require("obsidian");
|
||
var DEFAULT_DAILY_NOTE_FORMAT = "YYYY-MM-DD";
|
||
var DEFAULT_WEEKLY_NOTE_FORMAT = "gggg-[W]ww";
|
||
var DEFAULT_MONTHLY_NOTE_FORMAT = "YYYY-MM";
|
||
var DEFAULT_QUARTERLY_NOTE_FORMAT = "YYYY-[Q]Q";
|
||
var DEFAULT_YEARLY_NOTE_FORMAT = "YYYY";
|
||
function shouldUsePeriodicNotesSettings(periodicity) {
|
||
var _a, _b;
|
||
const periodicNotes = window.app.plugins.getPlugin("periodic-notes");
|
||
return periodicNotes && ((_b = (_a = periodicNotes.settings) == null ? void 0 : _a[periodicity]) == null ? void 0 : _b.enabled);
|
||
}
|
||
function getDailyNoteSettings() {
|
||
var _a, _b, _c, _d;
|
||
try {
|
||
const { internalPlugins, plugins } = window.app;
|
||
if (shouldUsePeriodicNotesSettings("daily")) {
|
||
const { format: format2, folder: folder2, template: template2 } = ((_b = (_a = plugins.getPlugin("periodic-notes")) == null ? void 0 : _a.settings) == null ? void 0 : _b.daily) || {};
|
||
return {
|
||
format: format2 || DEFAULT_DAILY_NOTE_FORMAT,
|
||
folder: (folder2 == null ? void 0 : folder2.trim()) || "",
|
||
template: (template2 == null ? void 0 : template2.trim()) || ""
|
||
};
|
||
}
|
||
const { folder, format, template } = ((_d = (_c = internalPlugins.getPluginById("daily-notes")) == null ? void 0 : _c.instance) == null ? void 0 : _d.options) || {};
|
||
return {
|
||
format: format || DEFAULT_DAILY_NOTE_FORMAT,
|
||
folder: (folder == null ? void 0 : folder.trim()) || "",
|
||
template: (template == null ? void 0 : template.trim()) || ""
|
||
};
|
||
} catch (err) {
|
||
console.info("No custom daily note settings found!", err);
|
||
}
|
||
}
|
||
function getWeeklyNoteSettings() {
|
||
var _a, _b, _c, _d, _e, _f, _g;
|
||
try {
|
||
const pluginManager = window.app.plugins;
|
||
const calendarSettings = (_a = pluginManager.getPlugin("calendar")) == null ? void 0 : _a.options;
|
||
const periodicNotesSettings = (_c = (_b = pluginManager.getPlugin("periodic-notes")) == null ? void 0 : _b.settings) == null ? void 0 : _c.weekly;
|
||
if (shouldUsePeriodicNotesSettings("weekly")) {
|
||
return {
|
||
format: periodicNotesSettings.format || DEFAULT_WEEKLY_NOTE_FORMAT,
|
||
folder: ((_d = periodicNotesSettings.folder) == null ? void 0 : _d.trim()) || "",
|
||
template: ((_e = periodicNotesSettings.template) == null ? void 0 : _e.trim()) || ""
|
||
};
|
||
}
|
||
const settings2 = calendarSettings || {};
|
||
return {
|
||
format: settings2.weeklyNoteFormat || DEFAULT_WEEKLY_NOTE_FORMAT,
|
||
folder: ((_f = settings2.weeklyNoteFolder) == null ? void 0 : _f.trim()) || "",
|
||
template: ((_g = settings2.weeklyNoteTemplate) == null ? void 0 : _g.trim()) || ""
|
||
};
|
||
} catch (err) {
|
||
console.info("No custom weekly note settings found!", err);
|
||
}
|
||
}
|
||
function getMonthlyNoteSettings() {
|
||
var _a, _b, _c, _d;
|
||
const pluginManager = window.app.plugins;
|
||
try {
|
||
const settings2 = shouldUsePeriodicNotesSettings("monthly") && ((_b = (_a = pluginManager.getPlugin("periodic-notes")) == null ? void 0 : _a.settings) == null ? void 0 : _b.monthly) || {};
|
||
return {
|
||
format: settings2.format || DEFAULT_MONTHLY_NOTE_FORMAT,
|
||
folder: ((_c = settings2.folder) == null ? void 0 : _c.trim()) || "",
|
||
template: ((_d = settings2.template) == null ? void 0 : _d.trim()) || ""
|
||
};
|
||
} catch (err) {
|
||
console.info("No custom monthly note settings found!", err);
|
||
}
|
||
}
|
||
function getQuarterlyNoteSettings() {
|
||
var _a, _b, _c, _d;
|
||
const pluginManager = window.app.plugins;
|
||
try {
|
||
const settings2 = shouldUsePeriodicNotesSettings("quarterly") && ((_b = (_a = pluginManager.getPlugin("periodic-notes")) == null ? void 0 : _a.settings) == null ? void 0 : _b.quarterly) || {};
|
||
return {
|
||
format: settings2.format || DEFAULT_QUARTERLY_NOTE_FORMAT,
|
||
folder: ((_c = settings2.folder) == null ? void 0 : _c.trim()) || "",
|
||
template: ((_d = settings2.template) == null ? void 0 : _d.trim()) || ""
|
||
};
|
||
} catch (err) {
|
||
console.info("No custom quarterly note settings found!", err);
|
||
}
|
||
}
|
||
function getYearlyNoteSettings() {
|
||
var _a, _b, _c, _d;
|
||
const pluginManager = window.app.plugins;
|
||
try {
|
||
const settings2 = shouldUsePeriodicNotesSettings("yearly") && ((_b = (_a = pluginManager.getPlugin("periodic-notes")) == null ? void 0 : _a.settings) == null ? void 0 : _b.yearly) || {};
|
||
return {
|
||
format: settings2.format || DEFAULT_YEARLY_NOTE_FORMAT,
|
||
folder: ((_c = settings2.folder) == null ? void 0 : _c.trim()) || "",
|
||
template: ((_d = settings2.template) == null ? void 0 : _d.trim()) || ""
|
||
};
|
||
} catch (err) {
|
||
console.info("No custom yearly note settings found!", err);
|
||
}
|
||
}
|
||
function join2(...partSegments) {
|
||
let parts = [];
|
||
for (let i = 0, l = partSegments.length; i < l; i++) {
|
||
parts = parts.concat(partSegments[i].split("/"));
|
||
}
|
||
const newParts = [];
|
||
for (let i = 0, l = parts.length; i < l; i++) {
|
||
const part = parts[i];
|
||
if (!part || part === ".")
|
||
continue;
|
||
else
|
||
newParts.push(part);
|
||
}
|
||
if (parts[0] === "")
|
||
newParts.unshift("");
|
||
return newParts.join("/");
|
||
}
|
||
function basename(fullPath) {
|
||
let base = fullPath.substring(fullPath.lastIndexOf("/") + 1);
|
||
if (base.lastIndexOf(".") != -1)
|
||
base = base.substring(0, base.lastIndexOf("."));
|
||
return base;
|
||
}
|
||
async function ensureFolderExists(path) {
|
||
const dirs = path.replace(/\\/g, "/").split("/");
|
||
dirs.pop();
|
||
if (dirs.length) {
|
||
const dir = join2(...dirs);
|
||
if (!window.app.vault.getAbstractFileByPath(dir)) {
|
||
await window.app.vault.createFolder(dir);
|
||
}
|
||
}
|
||
}
|
||
async function getNotePath(directory, filename) {
|
||
if (!filename.endsWith(".md")) {
|
||
filename += ".md";
|
||
}
|
||
const path = obsidian.normalizePath(join2(directory, filename));
|
||
await ensureFolderExists(path);
|
||
return path;
|
||
}
|
||
async function getTemplateInfo(template) {
|
||
const { metadataCache, vault } = window.app;
|
||
const templatePath = obsidian.normalizePath(template);
|
||
if (templatePath === "/") {
|
||
return Promise.resolve(["", null]);
|
||
}
|
||
try {
|
||
const templateFile = metadataCache.getFirstLinkpathDest(templatePath, "");
|
||
const contents = await vault.cachedRead(templateFile);
|
||
const IFoldInfo = window.app.foldManager.load(templateFile);
|
||
return [contents, IFoldInfo];
|
||
} catch (err) {
|
||
console.error(`Failed to read the daily note template '${templatePath}'`, err);
|
||
new obsidian.Notice("Failed to read the daily note template");
|
||
return ["", null];
|
||
}
|
||
}
|
||
function getDateUID(date, granularity = "day") {
|
||
const ts = date.clone().startOf(granularity).format();
|
||
return `${granularity}-${ts}`;
|
||
}
|
||
function removeEscapedCharacters(format) {
|
||
return format.replace(/\[[^\]]*\]/g, "");
|
||
}
|
||
function isFormatAmbiguous(format, granularity) {
|
||
if (granularity === "week") {
|
||
const cleanFormat = removeEscapedCharacters(format);
|
||
return /w{1,2}/i.test(cleanFormat) && (/M{1,4}/.test(cleanFormat) || /D{1,4}/.test(cleanFormat));
|
||
}
|
||
return false;
|
||
}
|
||
function getDateFromFile(file, granularity) {
|
||
return getDateFromFilename(file.basename, granularity);
|
||
}
|
||
function getDateFromPath(path, granularity) {
|
||
return getDateFromFilename(basename(path), granularity);
|
||
}
|
||
function getDateFromFilename(filename, granularity) {
|
||
const getSettings = {
|
||
day: getDailyNoteSettings,
|
||
week: getWeeklyNoteSettings,
|
||
month: getMonthlyNoteSettings,
|
||
quarter: getQuarterlyNoteSettings,
|
||
year: getYearlyNoteSettings
|
||
};
|
||
const format = getSettings[granularity]().format.split("/").pop();
|
||
const noteDate = window.moment(filename, format, true);
|
||
if (!noteDate.isValid()) {
|
||
return null;
|
||
}
|
||
if (isFormatAmbiguous(format, granularity)) {
|
||
if (granularity === "week") {
|
||
const cleanFormat = removeEscapedCharacters(format);
|
||
if (/w{1,2}/i.test(cleanFormat)) {
|
||
return window.moment(
|
||
filename,
|
||
// If format contains week, remove day & month formatting
|
||
format.replace(/M{1,4}/g, "").replace(/D{1,4}/g, ""),
|
||
false
|
||
);
|
||
}
|
||
}
|
||
}
|
||
return noteDate;
|
||
}
|
||
var DailyNotesFolderMissingError = class extends Error {
|
||
};
|
||
async function createDailyNote2(date) {
|
||
const app = window.app;
|
||
const { vault } = app;
|
||
const moment4 = window.moment;
|
||
const { template, format, folder } = getDailyNoteSettings();
|
||
const [templateContents, IFoldInfo] = await getTemplateInfo(template);
|
||
const filename = date.format(format);
|
||
const normalizedPath = await getNotePath(folder, filename);
|
||
try {
|
||
const createdFile = await vault.create(normalizedPath, templateContents.replace(/{{\s*date\s*}}/gi, filename).replace(/{{\s*time\s*}}/gi, moment4().format("HH:mm")).replace(/{{\s*title\s*}}/gi, filename).replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi, (_, _timeOrDate, calc, timeDelta, unit, momentFormat) => {
|
||
const now2 = moment4();
|
||
const currentDate = date.clone().set({
|
||
hour: now2.get("hour"),
|
||
minute: now2.get("minute"),
|
||
second: now2.get("second")
|
||
});
|
||
if (calc) {
|
||
currentDate.add(parseInt(timeDelta, 10), unit);
|
||
}
|
||
if (momentFormat) {
|
||
return currentDate.format(momentFormat.substring(1).trim());
|
||
}
|
||
return currentDate.format(format);
|
||
}).replace(/{{\s*yesterday\s*}}/gi, date.clone().subtract(1, "day").format(format)).replace(/{{\s*tomorrow\s*}}/gi, date.clone().add(1, "d").format(format)));
|
||
app.foldManager.save(createdFile, IFoldInfo);
|
||
return createdFile;
|
||
} catch (err) {
|
||
console.error(`Failed to create file: '${normalizedPath}'`, err);
|
||
new obsidian.Notice("Unable to create new file.");
|
||
}
|
||
}
|
||
function getDailyNote2(date, dailyNotes) {
|
||
var _a;
|
||
return (_a = dailyNotes[getDateUID(date, "day")]) != null ? _a : null;
|
||
}
|
||
function getAllDailyNotes2() {
|
||
const { vault } = window.app;
|
||
const { folder } = getDailyNoteSettings();
|
||
const dailyNotesFolder = vault.getAbstractFileByPath(obsidian.normalizePath(folder));
|
||
if (!dailyNotesFolder) {
|
||
throw new DailyNotesFolderMissingError("Failed to find daily notes folder");
|
||
}
|
||
const dailyNotes = {};
|
||
obsidian.Vault.recurseChildren(dailyNotesFolder, (note) => {
|
||
if (note instanceof obsidian.TFile) {
|
||
const date = getDateFromFile(note, "day");
|
||
if (date) {
|
||
const dateString = getDateUID(date, "day");
|
||
dailyNotes[dateString] = note;
|
||
}
|
||
}
|
||
});
|
||
return dailyNotes;
|
||
}
|
||
var WeeklyNotesFolderMissingError = class extends Error {
|
||
};
|
||
function getDaysOfWeek() {
|
||
const { moment: moment4 } = window;
|
||
let weekStart = moment4.localeData()._week.dow;
|
||
const daysOfWeek = [
|
||
"sunday",
|
||
"monday",
|
||
"tuesday",
|
||
"wednesday",
|
||
"thursday",
|
||
"friday",
|
||
"saturday"
|
||
];
|
||
while (weekStart) {
|
||
daysOfWeek.push(daysOfWeek.shift());
|
||
weekStart--;
|
||
}
|
||
return daysOfWeek;
|
||
}
|
||
function getDayOfWeekNumericalValue(dayOfWeekName) {
|
||
return getDaysOfWeek().indexOf(dayOfWeekName.toLowerCase());
|
||
}
|
||
async function createWeeklyNote(date) {
|
||
const { vault } = window.app;
|
||
const { template, format, folder } = getWeeklyNoteSettings();
|
||
const [templateContents, IFoldInfo] = await getTemplateInfo(template);
|
||
const filename = date.format(format);
|
||
const normalizedPath = await getNotePath(folder, filename);
|
||
try {
|
||
const createdFile = await vault.create(normalizedPath, templateContents.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi, (_, _timeOrDate, calc, timeDelta, unit, momentFormat) => {
|
||
const now2 = window.moment();
|
||
const currentDate = date.clone().set({
|
||
hour: now2.get("hour"),
|
||
minute: now2.get("minute"),
|
||
second: now2.get("second")
|
||
});
|
||
if (calc) {
|
||
currentDate.add(parseInt(timeDelta, 10), unit);
|
||
}
|
||
if (momentFormat) {
|
||
return currentDate.format(momentFormat.substring(1).trim());
|
||
}
|
||
return currentDate.format(format);
|
||
}).replace(/{{\s*title\s*}}/gi, filename).replace(/{{\s*time\s*}}/gi, window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi, (_, dayOfWeek, momentFormat) => {
|
||
const day = getDayOfWeekNumericalValue(dayOfWeek);
|
||
return date.weekday(day).format(momentFormat.trim());
|
||
}));
|
||
window.app.foldManager.save(createdFile, IFoldInfo);
|
||
return createdFile;
|
||
} catch (err) {
|
||
console.error(`Failed to create file: '${normalizedPath}'`, err);
|
||
new obsidian.Notice("Unable to create new file.");
|
||
}
|
||
}
|
||
function getWeeklyNote(date, weeklyNotes) {
|
||
var _a;
|
||
return (_a = weeklyNotes[getDateUID(date, "week")]) != null ? _a : null;
|
||
}
|
||
function getAllWeeklyNotes() {
|
||
const weeklyNotes = {};
|
||
if (!appHasWeeklyNotesPluginLoaded()) {
|
||
return weeklyNotes;
|
||
}
|
||
const { vault } = window.app;
|
||
const { folder } = getWeeklyNoteSettings();
|
||
const weeklyNotesFolder = vault.getAbstractFileByPath(obsidian.normalizePath(folder));
|
||
if (!weeklyNotesFolder) {
|
||
throw new WeeklyNotesFolderMissingError("Failed to find weekly notes folder");
|
||
}
|
||
obsidian.Vault.recurseChildren(weeklyNotesFolder, (note) => {
|
||
if (note instanceof obsidian.TFile) {
|
||
const date = getDateFromFile(note, "week");
|
||
if (date) {
|
||
const dateString = getDateUID(date, "week");
|
||
weeklyNotes[dateString] = note;
|
||
}
|
||
}
|
||
});
|
||
return weeklyNotes;
|
||
}
|
||
var MonthlyNotesFolderMissingError = class extends Error {
|
||
};
|
||
async function createMonthlyNote(date) {
|
||
const { vault } = window.app;
|
||
const { template, format, folder } = getMonthlyNoteSettings();
|
||
const [templateContents, IFoldInfo] = await getTemplateInfo(template);
|
||
const filename = date.format(format);
|
||
const normalizedPath = await getNotePath(folder, filename);
|
||
try {
|
||
const createdFile = await vault.create(normalizedPath, templateContents.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi, (_, _timeOrDate, calc, timeDelta, unit, momentFormat) => {
|
||
const now2 = window.moment();
|
||
const currentDate = date.clone().set({
|
||
hour: now2.get("hour"),
|
||
minute: now2.get("minute"),
|
||
second: now2.get("second")
|
||
});
|
||
if (calc) {
|
||
currentDate.add(parseInt(timeDelta, 10), unit);
|
||
}
|
||
if (momentFormat) {
|
||
return currentDate.format(momentFormat.substring(1).trim());
|
||
}
|
||
return currentDate.format(format);
|
||
}).replace(/{{\s*date\s*}}/gi, filename).replace(/{{\s*time\s*}}/gi, window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi, filename));
|
||
window.app.foldManager.save(createdFile, IFoldInfo);
|
||
return createdFile;
|
||
} catch (err) {
|
||
console.error(`Failed to create file: '${normalizedPath}'`, err);
|
||
new obsidian.Notice("Unable to create new file.");
|
||
}
|
||
}
|
||
function getMonthlyNote(date, monthlyNotes) {
|
||
var _a;
|
||
return (_a = monthlyNotes[getDateUID(date, "month")]) != null ? _a : null;
|
||
}
|
||
function getAllMonthlyNotes() {
|
||
const monthlyNotes = {};
|
||
if (!appHasMonthlyNotesPluginLoaded()) {
|
||
return monthlyNotes;
|
||
}
|
||
const { vault } = window.app;
|
||
const { folder } = getMonthlyNoteSettings();
|
||
const monthlyNotesFolder = vault.getAbstractFileByPath(obsidian.normalizePath(folder));
|
||
if (!monthlyNotesFolder) {
|
||
throw new MonthlyNotesFolderMissingError("Failed to find monthly notes folder");
|
||
}
|
||
obsidian.Vault.recurseChildren(monthlyNotesFolder, (note) => {
|
||
if (note instanceof obsidian.TFile) {
|
||
const date = getDateFromFile(note, "month");
|
||
if (date) {
|
||
const dateString = getDateUID(date, "month");
|
||
monthlyNotes[dateString] = note;
|
||
}
|
||
}
|
||
});
|
||
return monthlyNotes;
|
||
}
|
||
var QuarterlyNotesFolderMissingError = class extends Error {
|
||
};
|
||
async function createQuarterlyNote(date) {
|
||
const { vault } = window.app;
|
||
const { template, format, folder } = getQuarterlyNoteSettings();
|
||
const [templateContents, IFoldInfo] = await getTemplateInfo(template);
|
||
const filename = date.format(format);
|
||
const normalizedPath = await getNotePath(folder, filename);
|
||
try {
|
||
const createdFile = await vault.create(normalizedPath, templateContents.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi, (_, _timeOrDate, calc, timeDelta, unit, momentFormat) => {
|
||
const now2 = window.moment();
|
||
const currentDate = date.clone().set({
|
||
hour: now2.get("hour"),
|
||
minute: now2.get("minute"),
|
||
second: now2.get("second")
|
||
});
|
||
if (calc) {
|
||
currentDate.add(parseInt(timeDelta, 10), unit);
|
||
}
|
||
if (momentFormat) {
|
||
return currentDate.format(momentFormat.substring(1).trim());
|
||
}
|
||
return currentDate.format(format);
|
||
}).replace(/{{\s*date\s*}}/gi, filename).replace(/{{\s*time\s*}}/gi, window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi, filename));
|
||
window.app.foldManager.save(createdFile, IFoldInfo);
|
||
return createdFile;
|
||
} catch (err) {
|
||
console.error(`Failed to create file: '${normalizedPath}'`, err);
|
||
new obsidian.Notice("Unable to create new file.");
|
||
}
|
||
}
|
||
function getQuarterlyNote(date, quarterly) {
|
||
var _a;
|
||
return (_a = quarterly[getDateUID(date, "quarter")]) != null ? _a : null;
|
||
}
|
||
function getAllQuarterlyNotes() {
|
||
const quarterly = {};
|
||
if (!appHasQuarterlyNotesPluginLoaded()) {
|
||
return quarterly;
|
||
}
|
||
const { vault } = window.app;
|
||
const { folder } = getQuarterlyNoteSettings();
|
||
const quarterlyFolder = vault.getAbstractFileByPath(obsidian.normalizePath(folder));
|
||
if (!quarterlyFolder) {
|
||
throw new QuarterlyNotesFolderMissingError("Failed to find quarterly notes folder");
|
||
}
|
||
obsidian.Vault.recurseChildren(quarterlyFolder, (note) => {
|
||
if (note instanceof obsidian.TFile) {
|
||
const date = getDateFromFile(note, "quarter");
|
||
if (date) {
|
||
const dateString = getDateUID(date, "quarter");
|
||
quarterly[dateString] = note;
|
||
}
|
||
}
|
||
});
|
||
return quarterly;
|
||
}
|
||
var YearlyNotesFolderMissingError = class extends Error {
|
||
};
|
||
async function createYearlyNote(date) {
|
||
const { vault } = window.app;
|
||
const { template, format, folder } = getYearlyNoteSettings();
|
||
const [templateContents, IFoldInfo] = await getTemplateInfo(template);
|
||
const filename = date.format(format);
|
||
const normalizedPath = await getNotePath(folder, filename);
|
||
try {
|
||
const createdFile = await vault.create(normalizedPath, templateContents.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi, (_, _timeOrDate, calc, timeDelta, unit, momentFormat) => {
|
||
const now2 = window.moment();
|
||
const currentDate = date.clone().set({
|
||
hour: now2.get("hour"),
|
||
minute: now2.get("minute"),
|
||
second: now2.get("second")
|
||
});
|
||
if (calc) {
|
||
currentDate.add(parseInt(timeDelta, 10), unit);
|
||
}
|
||
if (momentFormat) {
|
||
return currentDate.format(momentFormat.substring(1).trim());
|
||
}
|
||
return currentDate.format(format);
|
||
}).replace(/{{\s*date\s*}}/gi, filename).replace(/{{\s*time\s*}}/gi, window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi, filename));
|
||
window.app.foldManager.save(createdFile, IFoldInfo);
|
||
return createdFile;
|
||
} catch (err) {
|
||
console.error(`Failed to create file: '${normalizedPath}'`, err);
|
||
new obsidian.Notice("Unable to create new file.");
|
||
}
|
||
}
|
||
function getYearlyNote(date, yearlyNotes) {
|
||
var _a;
|
||
return (_a = yearlyNotes[getDateUID(date, "year")]) != null ? _a : null;
|
||
}
|
||
function getAllYearlyNotes() {
|
||
const yearlyNotes = {};
|
||
if (!appHasYearlyNotesPluginLoaded()) {
|
||
return yearlyNotes;
|
||
}
|
||
const { vault } = window.app;
|
||
const { folder } = getYearlyNoteSettings();
|
||
const yearlyNotesFolder = vault.getAbstractFileByPath(obsidian.normalizePath(folder));
|
||
if (!yearlyNotesFolder) {
|
||
throw new YearlyNotesFolderMissingError("Failed to find yearly notes folder");
|
||
}
|
||
obsidian.Vault.recurseChildren(yearlyNotesFolder, (note) => {
|
||
if (note instanceof obsidian.TFile) {
|
||
const date = getDateFromFile(note, "year");
|
||
if (date) {
|
||
const dateString = getDateUID(date, "year");
|
||
yearlyNotes[dateString] = note;
|
||
}
|
||
}
|
||
});
|
||
return yearlyNotes;
|
||
}
|
||
function appHasDailyNotesPluginLoaded() {
|
||
var _a, _b;
|
||
const { app } = window;
|
||
const dailyNotesPlugin = app.internalPlugins.plugins["daily-notes"];
|
||
if (dailyNotesPlugin && dailyNotesPlugin.enabled) {
|
||
return true;
|
||
}
|
||
const periodicNotes = app.plugins.getPlugin("periodic-notes");
|
||
return periodicNotes && ((_b = (_a = periodicNotes.settings) == null ? void 0 : _a.daily) == null ? void 0 : _b.enabled);
|
||
}
|
||
function appHasWeeklyNotesPluginLoaded() {
|
||
var _a, _b;
|
||
const { app } = window;
|
||
if (app.plugins.getPlugin("calendar")) {
|
||
return true;
|
||
}
|
||
const periodicNotes = app.plugins.getPlugin("periodic-notes");
|
||
return periodicNotes && ((_b = (_a = periodicNotes.settings) == null ? void 0 : _a.weekly) == null ? void 0 : _b.enabled);
|
||
}
|
||
function appHasMonthlyNotesPluginLoaded() {
|
||
var _a, _b;
|
||
const { app } = window;
|
||
const periodicNotes = app.plugins.getPlugin("periodic-notes");
|
||
return periodicNotes && ((_b = (_a = periodicNotes.settings) == null ? void 0 : _a.monthly) == null ? void 0 : _b.enabled);
|
||
}
|
||
function appHasQuarterlyNotesPluginLoaded() {
|
||
var _a, _b;
|
||
const { app } = window;
|
||
const periodicNotes = app.plugins.getPlugin("periodic-notes");
|
||
return periodicNotes && ((_b = (_a = periodicNotes.settings) == null ? void 0 : _a.quarterly) == null ? void 0 : _b.enabled);
|
||
}
|
||
function appHasYearlyNotesPluginLoaded() {
|
||
var _a, _b;
|
||
const { app } = window;
|
||
const periodicNotes = app.plugins.getPlugin("periodic-notes");
|
||
return periodicNotes && ((_b = (_a = periodicNotes.settings) == null ? void 0 : _a.yearly) == null ? void 0 : _b.enabled);
|
||
}
|
||
function getPeriodicNoteSettings(granularity) {
|
||
const getSettings = {
|
||
day: getDailyNoteSettings,
|
||
week: getWeeklyNoteSettings,
|
||
month: getMonthlyNoteSettings,
|
||
quarter: getQuarterlyNoteSettings,
|
||
year: getYearlyNoteSettings
|
||
}[granularity];
|
||
return getSettings();
|
||
}
|
||
function createPeriodicNote(granularity, date) {
|
||
const createFn = {
|
||
day: createDailyNote2,
|
||
month: createMonthlyNote,
|
||
week: createWeeklyNote
|
||
};
|
||
return createFn[granularity](date);
|
||
}
|
||
exports.DEFAULT_DAILY_NOTE_FORMAT = DEFAULT_DAILY_NOTE_FORMAT;
|
||
exports.DEFAULT_MONTHLY_NOTE_FORMAT = DEFAULT_MONTHLY_NOTE_FORMAT;
|
||
exports.DEFAULT_QUARTERLY_NOTE_FORMAT = DEFAULT_QUARTERLY_NOTE_FORMAT;
|
||
exports.DEFAULT_WEEKLY_NOTE_FORMAT = DEFAULT_WEEKLY_NOTE_FORMAT;
|
||
exports.DEFAULT_YEARLY_NOTE_FORMAT = DEFAULT_YEARLY_NOTE_FORMAT;
|
||
exports.appHasDailyNotesPluginLoaded = appHasDailyNotesPluginLoaded;
|
||
exports.appHasMonthlyNotesPluginLoaded = appHasMonthlyNotesPluginLoaded;
|
||
exports.appHasQuarterlyNotesPluginLoaded = appHasQuarterlyNotesPluginLoaded;
|
||
exports.appHasWeeklyNotesPluginLoaded = appHasWeeklyNotesPluginLoaded;
|
||
exports.appHasYearlyNotesPluginLoaded = appHasYearlyNotesPluginLoaded;
|
||
exports.createDailyNote = createDailyNote2;
|
||
exports.createMonthlyNote = createMonthlyNote;
|
||
exports.createPeriodicNote = createPeriodicNote;
|
||
exports.createQuarterlyNote = createQuarterlyNote;
|
||
exports.createWeeklyNote = createWeeklyNote;
|
||
exports.createYearlyNote = createYearlyNote;
|
||
exports.getAllDailyNotes = getAllDailyNotes2;
|
||
exports.getAllMonthlyNotes = getAllMonthlyNotes;
|
||
exports.getAllQuarterlyNotes = getAllQuarterlyNotes;
|
||
exports.getAllWeeklyNotes = getAllWeeklyNotes;
|
||
exports.getAllYearlyNotes = getAllYearlyNotes;
|
||
exports.getDailyNote = getDailyNote2;
|
||
exports.getDailyNoteSettings = getDailyNoteSettings;
|
||
exports.getDateFromFile = getDateFromFile;
|
||
exports.getDateFromPath = getDateFromPath;
|
||
exports.getDateUID = getDateUID;
|
||
exports.getMonthlyNote = getMonthlyNote;
|
||
exports.getMonthlyNoteSettings = getMonthlyNoteSettings;
|
||
exports.getPeriodicNoteSettings = getPeriodicNoteSettings;
|
||
exports.getQuarterlyNote = getQuarterlyNote;
|
||
exports.getQuarterlyNoteSettings = getQuarterlyNoteSettings;
|
||
exports.getTemplateInfo = getTemplateInfo;
|
||
exports.getWeeklyNote = getWeeklyNote;
|
||
exports.getWeeklyNoteSettings = getWeeklyNoteSettings;
|
||
exports.getYearlyNote = getYearlyNote;
|
||
exports.getYearlyNoteSettings = getYearlyNoteSettings;
|
||
}
|
||
});
|
||
|
||
// src/main.ts
|
||
var main_exports = {};
|
||
__export(main_exports, {
|
||
default: () => PomodoroTimerPlugin
|
||
});
|
||
module.exports = __toCommonJS(main_exports);
|
||
|
||
// src/TimerView.ts
|
||
var import_obsidian4 = require("obsidian");
|
||
|
||
// node_modules/svelte/src/runtime/internal/utils.js
|
||
function noop() {
|
||
}
|
||
function run(fn) {
|
||
return fn();
|
||
}
|
||
function blank_object() {
|
||
return /* @__PURE__ */ Object.create(null);
|
||
}
|
||
function run_all(fns) {
|
||
fns.forEach(run);
|
||
}
|
||
function is_function(thing) {
|
||
return typeof thing === "function";
|
||
}
|
||
function safe_not_equal(a, b) {
|
||
return a != a ? b == b : a !== b || a && typeof a === "object" || typeof a === "function";
|
||
}
|
||
function is_empty(obj) {
|
||
return Object.keys(obj).length === 0;
|
||
}
|
||
function subscribe(store, ...callbacks) {
|
||
if (store == null) {
|
||
for (const callback of callbacks) {
|
||
callback(void 0);
|
||
}
|
||
return noop;
|
||
}
|
||
const unsub = store.subscribe(...callbacks);
|
||
return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
|
||
}
|
||
function component_subscribe(component, store, callback) {
|
||
component.$$.on_destroy.push(subscribe(store, callback));
|
||
}
|
||
|
||
// node_modules/svelte/src/runtime/internal/globals.js
|
||
var globals = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : (
|
||
// @ts-ignore Node typings have this
|
||
global
|
||
);
|
||
|
||
// node_modules/svelte/src/runtime/internal/ResizeObserverSingleton.js
|
||
var ResizeObserverSingleton = class {
|
||
/** @param {ResizeObserverOptions} options */
|
||
constructor(options) {
|
||
/**
|
||
* @private
|
||
* @readonly
|
||
* @type {WeakMap<Element, import('./private.js').Listener>}
|
||
*/
|
||
__publicField(this, "_listeners", "WeakMap" in globals ? /* @__PURE__ */ new WeakMap() : void 0);
|
||
/**
|
||
* @private
|
||
* @type {ResizeObserver}
|
||
*/
|
||
__publicField(this, "_observer");
|
||
/** @type {ResizeObserverOptions} */
|
||
__publicField(this, "options");
|
||
this.options = options;
|
||
}
|
||
/**
|
||
* @param {Element} element
|
||
* @param {import('./private.js').Listener} listener
|
||
* @returns {() => void}
|
||
*/
|
||
observe(element2, listener) {
|
||
this._listeners.set(element2, listener);
|
||
this._getObserver().observe(element2, this.options);
|
||
return () => {
|
||
this._listeners.delete(element2);
|
||
this._observer.unobserve(element2);
|
||
};
|
||
}
|
||
/**
|
||
* @private
|
||
*/
|
||
_getObserver() {
|
||
var _a;
|
||
return (_a = this._observer) != null ? _a : this._observer = new ResizeObserver((entries) => {
|
||
var _a2;
|
||
for (const entry of entries) {
|
||
ResizeObserverSingleton.entries.set(entry.target, entry);
|
||
(_a2 = this._listeners.get(entry.target)) == null ? void 0 : _a2(entry);
|
||
}
|
||
});
|
||
}
|
||
};
|
||
ResizeObserverSingleton.entries = "WeakMap" in globals ? /* @__PURE__ */ new WeakMap() : void 0;
|
||
|
||
// node_modules/svelte/src/runtime/internal/dom.js
|
||
var is_hydrating = false;
|
||
function start_hydrating() {
|
||
is_hydrating = true;
|
||
}
|
||
function end_hydrating() {
|
||
is_hydrating = false;
|
||
}
|
||
function append(target, node) {
|
||
target.appendChild(node);
|
||
}
|
||
function append_styles(target, style_sheet_id, styles) {
|
||
const append_styles_to = get_root_for_style(target);
|
||
if (!append_styles_to.getElementById(style_sheet_id)) {
|
||
const style = element("style");
|
||
style.id = style_sheet_id;
|
||
style.textContent = styles;
|
||
append_stylesheet(append_styles_to, style);
|
||
}
|
||
}
|
||
function get_root_for_style(node) {
|
||
if (!node)
|
||
return document;
|
||
const root = node.getRootNode ? node.getRootNode() : node.ownerDocument;
|
||
if (root && /** @type {ShadowRoot} */
|
||
root.host) {
|
||
return (
|
||
/** @type {ShadowRoot} */
|
||
root
|
||
);
|
||
}
|
||
return node.ownerDocument;
|
||
}
|
||
function append_stylesheet(node, style) {
|
||
append(
|
||
/** @type {Document} */
|
||
node.head || node,
|
||
style
|
||
);
|
||
return style.sheet;
|
||
}
|
||
function insert(target, node, anchor) {
|
||
target.insertBefore(node, anchor || null);
|
||
}
|
||
function detach(node) {
|
||
if (node.parentNode) {
|
||
node.parentNode.removeChild(node);
|
||
}
|
||
}
|
||
function destroy_each(iterations, detaching) {
|
||
for (let i = 0; i < iterations.length; i += 1) {
|
||
if (iterations[i])
|
||
iterations[i].d(detaching);
|
||
}
|
||
}
|
||
function element(name) {
|
||
return document.createElement(name);
|
||
}
|
||
function svg_element(name) {
|
||
return document.createElementNS("http://www.w3.org/2000/svg", name);
|
||
}
|
||
function text(data) {
|
||
return document.createTextNode(data);
|
||
}
|
||
function space() {
|
||
return text(" ");
|
||
}
|
||
function empty() {
|
||
return text("");
|
||
}
|
||
function listen(node, event, handler, options) {
|
||
node.addEventListener(event, handler, options);
|
||
return () => node.removeEventListener(event, handler, options);
|
||
}
|
||
function attr(node, attribute, value) {
|
||
if (value == null)
|
||
node.removeAttribute(attribute);
|
||
else if (node.getAttribute(attribute) !== value)
|
||
node.setAttribute(attribute, value);
|
||
}
|
||
function children(element2) {
|
||
return Array.from(element2.childNodes);
|
||
}
|
||
function set_data(text2, data) {
|
||
data = "" + data;
|
||
if (text2.data === data)
|
||
return;
|
||
text2.data = /** @type {string} */
|
||
data;
|
||
}
|
||
function set_input_value(input, value) {
|
||
input.value = value == null ? "" : value;
|
||
}
|
||
function set_style(node, key, value, important) {
|
||
if (value == null) {
|
||
node.style.removeProperty(key);
|
||
} else {
|
||
node.style.setProperty(key, value, important ? "important" : "");
|
||
}
|
||
}
|
||
function get_custom_elements_slots(element2) {
|
||
const result = {};
|
||
element2.childNodes.forEach(
|
||
/** @param {Element} node */
|
||
(node) => {
|
||
result[node.slot || "default"] = true;
|
||
}
|
||
);
|
||
return result;
|
||
}
|
||
|
||
// node_modules/svelte/src/runtime/internal/lifecycle.js
|
||
var current_component;
|
||
function set_current_component(component) {
|
||
current_component = component;
|
||
}
|
||
function get_current_component() {
|
||
if (!current_component)
|
||
throw new Error("Function called outside component initialization");
|
||
return current_component;
|
||
}
|
||
function afterUpdate(fn) {
|
||
get_current_component().$$.after_update.push(fn);
|
||
}
|
||
|
||
// node_modules/svelte/src/runtime/internal/scheduler.js
|
||
var dirty_components = [];
|
||
var binding_callbacks = [];
|
||
var render_callbacks = [];
|
||
var flush_callbacks = [];
|
||
var resolved_promise = /* @__PURE__ */ Promise.resolve();
|
||
var update_scheduled = false;
|
||
function schedule_update() {
|
||
if (!update_scheduled) {
|
||
update_scheduled = true;
|
||
resolved_promise.then(flush);
|
||
}
|
||
}
|
||
function add_render_callback(fn) {
|
||
render_callbacks.push(fn);
|
||
}
|
||
var seen_callbacks = /* @__PURE__ */ new Set();
|
||
var flushidx = 0;
|
||
function flush() {
|
||
if (flushidx !== 0) {
|
||
return;
|
||
}
|
||
const saved_component = current_component;
|
||
do {
|
||
try {
|
||
while (flushidx < dirty_components.length) {
|
||
const component = dirty_components[flushidx];
|
||
flushidx++;
|
||
set_current_component(component);
|
||
update(component.$$);
|
||
}
|
||
} catch (e) {
|
||
dirty_components.length = 0;
|
||
flushidx = 0;
|
||
throw e;
|
||
}
|
||
set_current_component(null);
|
||
dirty_components.length = 0;
|
||
flushidx = 0;
|
||
while (binding_callbacks.length)
|
||
binding_callbacks.pop()();
|
||
for (let i = 0; i < render_callbacks.length; i += 1) {
|
||
const callback = render_callbacks[i];
|
||
if (!seen_callbacks.has(callback)) {
|
||
seen_callbacks.add(callback);
|
||
callback();
|
||
}
|
||
}
|
||
render_callbacks.length = 0;
|
||
} while (dirty_components.length);
|
||
while (flush_callbacks.length) {
|
||
flush_callbacks.pop()();
|
||
}
|
||
update_scheduled = false;
|
||
seen_callbacks.clear();
|
||
set_current_component(saved_component);
|
||
}
|
||
function update($$) {
|
||
if ($$.fragment !== null) {
|
||
$$.update();
|
||
run_all($$.before_update);
|
||
const dirty = $$.dirty;
|
||
$$.dirty = [-1];
|
||
$$.fragment && $$.fragment.p($$.ctx, dirty);
|
||
$$.after_update.forEach(add_render_callback);
|
||
}
|
||
}
|
||
function flush_render_callbacks(fns) {
|
||
const filtered = [];
|
||
const targets = [];
|
||
render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c));
|
||
targets.forEach((c) => c());
|
||
render_callbacks = filtered;
|
||
}
|
||
|
||
// node_modules/svelte/src/runtime/internal/transitions.js
|
||
var outroing = /* @__PURE__ */ new Set();
|
||
var outros;
|
||
function group_outros() {
|
||
outros = {
|
||
r: 0,
|
||
c: [],
|
||
p: outros
|
||
// parent group
|
||
};
|
||
}
|
||
function check_outros() {
|
||
if (!outros.r) {
|
||
run_all(outros.c);
|
||
}
|
||
outros = outros.p;
|
||
}
|
||
function transition_in(block, local) {
|
||
if (block && block.i) {
|
||
outroing.delete(block);
|
||
block.i(local);
|
||
}
|
||
}
|
||
function transition_out(block, local, detach2, callback) {
|
||
if (block && block.o) {
|
||
if (outroing.has(block))
|
||
return;
|
||
outroing.add(block);
|
||
outros.c.push(() => {
|
||
outroing.delete(block);
|
||
if (callback) {
|
||
if (detach2)
|
||
block.d(1);
|
||
callback();
|
||
}
|
||
});
|
||
block.o(local);
|
||
} else if (callback) {
|
||
callback();
|
||
}
|
||
}
|
||
|
||
// node_modules/svelte/src/runtime/internal/each.js
|
||
function ensure_array_like(array_like_or_iterator) {
|
||
return (array_like_or_iterator == null ? void 0 : array_like_or_iterator.length) !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator);
|
||
}
|
||
|
||
// node_modules/svelte/src/shared/boolean_attributes.js
|
||
var _boolean_attributes = (
|
||
/** @type {const} */
|
||
[
|
||
"allowfullscreen",
|
||
"allowpaymentrequest",
|
||
"async",
|
||
"autofocus",
|
||
"autoplay",
|
||
"checked",
|
||
"controls",
|
||
"default",
|
||
"defer",
|
||
"disabled",
|
||
"formnovalidate",
|
||
"hidden",
|
||
"inert",
|
||
"ismap",
|
||
"loop",
|
||
"multiple",
|
||
"muted",
|
||
"nomodule",
|
||
"novalidate",
|
||
"open",
|
||
"playsinline",
|
||
"readonly",
|
||
"required",
|
||
"reversed",
|
||
"selected"
|
||
]
|
||
);
|
||
var boolean_attributes = /* @__PURE__ */ new Set([..._boolean_attributes]);
|
||
|
||
// node_modules/svelte/src/runtime/internal/Component.js
|
||
function create_component(block) {
|
||
block && block.c();
|
||
}
|
||
function mount_component(component, target, anchor) {
|
||
const { fragment, after_update } = component.$$;
|
||
fragment && fragment.m(target, anchor);
|
||
add_render_callback(() => {
|
||
const new_on_destroy = component.$$.on_mount.map(run).filter(is_function);
|
||
if (component.$$.on_destroy) {
|
||
component.$$.on_destroy.push(...new_on_destroy);
|
||
} else {
|
||
run_all(new_on_destroy);
|
||
}
|
||
component.$$.on_mount = [];
|
||
});
|
||
after_update.forEach(add_render_callback);
|
||
}
|
||
function destroy_component(component, detaching) {
|
||
const $$ = component.$$;
|
||
if ($$.fragment !== null) {
|
||
flush_render_callbacks($$.after_update);
|
||
run_all($$.on_destroy);
|
||
$$.fragment && $$.fragment.d(detaching);
|
||
$$.on_destroy = $$.fragment = null;
|
||
$$.ctx = [];
|
||
}
|
||
}
|
||
function make_dirty(component, i) {
|
||
if (component.$$.dirty[0] === -1) {
|
||
dirty_components.push(component);
|
||
schedule_update();
|
||
component.$$.dirty.fill(0);
|
||
}
|
||
component.$$.dirty[i / 31 | 0] |= 1 << i % 31;
|
||
}
|
||
function init(component, options, instance6, create_fragment6, not_equal, props, append_styles2 = null, dirty = [-1]) {
|
||
const parent_component = current_component;
|
||
set_current_component(component);
|
||
const $$ = component.$$ = {
|
||
fragment: null,
|
||
ctx: [],
|
||
// state
|
||
props,
|
||
update: noop,
|
||
not_equal,
|
||
bound: blank_object(),
|
||
// lifecycle
|
||
on_mount: [],
|
||
on_destroy: [],
|
||
on_disconnect: [],
|
||
before_update: [],
|
||
after_update: [],
|
||
context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
|
||
// everything else
|
||
callbacks: blank_object(),
|
||
dirty,
|
||
skip_bound: false,
|
||
root: options.target || parent_component.$$.root
|
||
};
|
||
append_styles2 && append_styles2($$.root);
|
||
let ready = false;
|
||
$$.ctx = instance6 ? instance6(component, options.props || {}, (i, ret, ...rest) => {
|
||
const value = rest.length ? rest[0] : ret;
|
||
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
|
||
if (!$$.skip_bound && $$.bound[i])
|
||
$$.bound[i](value);
|
||
if (ready)
|
||
make_dirty(component, i);
|
||
}
|
||
return ret;
|
||
}) : [];
|
||
$$.update();
|
||
ready = true;
|
||
run_all($$.before_update);
|
||
$$.fragment = create_fragment6 ? create_fragment6($$.ctx) : false;
|
||
if (options.target) {
|
||
if (options.hydrate) {
|
||
start_hydrating();
|
||
const nodes = children(options.target);
|
||
$$.fragment && $$.fragment.l(nodes);
|
||
nodes.forEach(detach);
|
||
} else {
|
||
$$.fragment && $$.fragment.c();
|
||
}
|
||
if (options.intro)
|
||
transition_in(component.$$.fragment);
|
||
mount_component(component, options.target, options.anchor);
|
||
end_hydrating();
|
||
flush();
|
||
}
|
||
set_current_component(parent_component);
|
||
}
|
||
var SvelteElement;
|
||
if (typeof HTMLElement === "function") {
|
||
SvelteElement = class extends HTMLElement {
|
||
constructor($$componentCtor, $$slots, use_shadow_dom) {
|
||
super();
|
||
/** The Svelte component constructor */
|
||
__publicField(this, "$$ctor");
|
||
/** Slots */
|
||
__publicField(this, "$$s");
|
||
/** The Svelte component instance */
|
||
__publicField(this, "$$c");
|
||
/** Whether or not the custom element is connected */
|
||
__publicField(this, "$$cn", false);
|
||
/** Component props data */
|
||
__publicField(this, "$$d", {});
|
||
/** `true` if currently in the process of reflecting component props back to attributes */
|
||
__publicField(this, "$$r", false);
|
||
/** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
|
||
__publicField(this, "$$p_d", {});
|
||
/** @type {Record<string, Function[]>} Event listeners */
|
||
__publicField(this, "$$l", {});
|
||
/** @type {Map<Function, Function>} Event listener unsubscribe functions */
|
||
__publicField(this, "$$l_u", /* @__PURE__ */ new Map());
|
||
this.$$ctor = $$componentCtor;
|
||
this.$$s = $$slots;
|
||
if (use_shadow_dom) {
|
||
this.attachShadow({ mode: "open" });
|
||
}
|
||
}
|
||
addEventListener(type, listener, options) {
|
||
this.$$l[type] = this.$$l[type] || [];
|
||
this.$$l[type].push(listener);
|
||
if (this.$$c) {
|
||
const unsub = this.$$c.$on(type, listener);
|
||
this.$$l_u.set(listener, unsub);
|
||
}
|
||
super.addEventListener(type, listener, options);
|
||
}
|
||
removeEventListener(type, listener, options) {
|
||
super.removeEventListener(type, listener, options);
|
||
if (this.$$c) {
|
||
const unsub = this.$$l_u.get(listener);
|
||
if (unsub) {
|
||
unsub();
|
||
this.$$l_u.delete(listener);
|
||
}
|
||
}
|
||
}
|
||
async connectedCallback() {
|
||
this.$$cn = true;
|
||
if (!this.$$c) {
|
||
let create_slot = function(name) {
|
||
return () => {
|
||
let node;
|
||
const obj = {
|
||
c: function create() {
|
||
node = element("slot");
|
||
if (name !== "default") {
|
||
attr(node, "name", name);
|
||
}
|
||
},
|
||
/**
|
||
* @param {HTMLElement} target
|
||
* @param {HTMLElement} [anchor]
|
||
*/
|
||
m: function mount(target, anchor) {
|
||
insert(target, node, anchor);
|
||
},
|
||
d: function destroy(detaching) {
|
||
if (detaching) {
|
||
detach(node);
|
||
}
|
||
}
|
||
};
|
||
return obj;
|
||
};
|
||
};
|
||
await Promise.resolve();
|
||
if (!this.$$cn) {
|
||
return;
|
||
}
|
||
const $$slots = {};
|
||
const existing_slots = get_custom_elements_slots(this);
|
||
for (const name of this.$$s) {
|
||
if (name in existing_slots) {
|
||
$$slots[name] = [create_slot(name)];
|
||
}
|
||
}
|
||
for (const attribute of this.attributes) {
|
||
const name = this.$$g_p(attribute.name);
|
||
if (!(name in this.$$d)) {
|
||
this.$$d[name] = get_custom_element_value(name, attribute.value, this.$$p_d, "toProp");
|
||
}
|
||
}
|
||
this.$$c = new this.$$ctor({
|
||
target: this.shadowRoot || this,
|
||
props: {
|
||
...this.$$d,
|
||
$$slots,
|
||
$$scope: {
|
||
ctx: []
|
||
}
|
||
}
|
||
});
|
||
const reflect_attributes = () => {
|
||
this.$$r = true;
|
||
for (const key in this.$$p_d) {
|
||
this.$$d[key] = this.$$c.$$.ctx[this.$$c.$$.props[key]];
|
||
if (this.$$p_d[key].reflect) {
|
||
const attribute_value = get_custom_element_value(
|
||
key,
|
||
this.$$d[key],
|
||
this.$$p_d,
|
||
"toAttribute"
|
||
);
|
||
if (attribute_value == null) {
|
||
this.removeAttribute(this.$$p_d[key].attribute || key);
|
||
} else {
|
||
this.setAttribute(this.$$p_d[key].attribute || key, attribute_value);
|
||
}
|
||
}
|
||
}
|
||
this.$$r = false;
|
||
};
|
||
this.$$c.$$.after_update.push(reflect_attributes);
|
||
reflect_attributes();
|
||
for (const type in this.$$l) {
|
||
for (const listener of this.$$l[type]) {
|
||
const unsub = this.$$c.$on(type, listener);
|
||
this.$$l_u.set(listener, unsub);
|
||
}
|
||
}
|
||
this.$$l = {};
|
||
}
|
||
}
|
||
// We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte
|
||
// and setting attributes through setAttribute etc, this is helpful
|
||
attributeChangedCallback(attr2, _oldValue, newValue) {
|
||
var _a;
|
||
if (this.$$r)
|
||
return;
|
||
attr2 = this.$$g_p(attr2);
|
||
this.$$d[attr2] = get_custom_element_value(attr2, newValue, this.$$p_d, "toProp");
|
||
(_a = this.$$c) == null ? void 0 : _a.$set({ [attr2]: this.$$d[attr2] });
|
||
}
|
||
disconnectedCallback() {
|
||
this.$$cn = false;
|
||
Promise.resolve().then(() => {
|
||
if (!this.$$cn) {
|
||
this.$$c.$destroy();
|
||
this.$$c = void 0;
|
||
}
|
||
});
|
||
}
|
||
$$g_p(attribute_name) {
|
||
return Object.keys(this.$$p_d).find(
|
||
(key) => this.$$p_d[key].attribute === attribute_name || !this.$$p_d[key].attribute && key.toLowerCase() === attribute_name
|
||
) || attribute_name;
|
||
}
|
||
};
|
||
}
|
||
function get_custom_element_value(prop, value, props_definition, transform) {
|
||
var _a;
|
||
const type = (_a = props_definition[prop]) == null ? void 0 : _a.type;
|
||
value = type === "Boolean" && typeof value !== "boolean" ? value != null : value;
|
||
if (!transform || !props_definition[prop]) {
|
||
return value;
|
||
} else if (transform === "toAttribute") {
|
||
switch (type) {
|
||
case "Object":
|
||
case "Array":
|
||
return value == null ? null : JSON.stringify(value);
|
||
case "Boolean":
|
||
return value ? "" : null;
|
||
case "Number":
|
||
return value == null ? null : value;
|
||
default:
|
||
return value;
|
||
}
|
||
} else {
|
||
switch (type) {
|
||
case "Object":
|
||
case "Array":
|
||
return value && JSON.parse(value);
|
||
case "Boolean":
|
||
return value;
|
||
case "Number":
|
||
return value != null ? +value : value;
|
||
default:
|
||
return value;
|
||
}
|
||
}
|
||
}
|
||
var SvelteComponent = class {
|
||
constructor() {
|
||
/**
|
||
* ### PRIVATE API
|
||
*
|
||
* Do not use, may change at any time
|
||
*
|
||
* @type {any}
|
||
*/
|
||
__publicField(this, "$$");
|
||
/**
|
||
* ### PRIVATE API
|
||
*
|
||
* Do not use, may change at any time
|
||
*
|
||
* @type {any}
|
||
*/
|
||
__publicField(this, "$$set");
|
||
}
|
||
/** @returns {void} */
|
||
$destroy() {
|
||
destroy_component(this, 1);
|
||
this.$destroy = noop;
|
||
}
|
||
/**
|
||
* @template {Extract<keyof Events, string>} K
|
||
* @param {K} type
|
||
* @param {((e: Events[K]) => void) | null | undefined} callback
|
||
* @returns {() => void}
|
||
*/
|
||
$on(type, callback) {
|
||
if (!is_function(callback)) {
|
||
return noop;
|
||
}
|
||
const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
|
||
callbacks.push(callback);
|
||
return () => {
|
||
const index = callbacks.indexOf(callback);
|
||
if (index !== -1)
|
||
callbacks.splice(index, 1);
|
||
};
|
||
}
|
||
/**
|
||
* @param {Partial<Props>} props
|
||
* @returns {void}
|
||
*/
|
||
$set(props) {
|
||
if (this.$$set && !is_empty(props)) {
|
||
this.$$.skip_bound = true;
|
||
this.$$set(props);
|
||
this.$$.skip_bound = false;
|
||
}
|
||
}
|
||
};
|
||
|
||
// node_modules/svelte/src/shared/version.js
|
||
var PUBLIC_VERSION = "4";
|
||
|
||
// node_modules/svelte/src/runtime/internal/disclose-version/index.js
|
||
if (typeof window !== "undefined")
|
||
(window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(PUBLIC_VERSION);
|
||
|
||
// src/TaskItemComponent.svelte
|
||
function add_css(target) {
|
||
append_styles(target, "svelte-u70618", ".pomodoro-tasks-item-desc.svelte-u70618{flex:1;overflow:hidden;width:100%;pointer-events:none;cursor:pointer}");
|
||
}
|
||
function create_fragment(ctx) {
|
||
let div;
|
||
return {
|
||
c() {
|
||
div = element("div");
|
||
attr(div, "class", "pomodoro-tasks-item-desc svelte-u70618");
|
||
},
|
||
m(target, anchor) {
|
||
insert(target, div, anchor);
|
||
ctx[3](div);
|
||
},
|
||
p: noop,
|
||
i: noop,
|
||
o: noop,
|
||
d(detaching) {
|
||
if (detaching) {
|
||
detach(div);
|
||
}
|
||
ctx[3](null);
|
||
}
|
||
};
|
||
}
|
||
function instance($$self, $$props, $$invalidate) {
|
||
let { render } = $$props;
|
||
let { content } = $$props;
|
||
let el;
|
||
afterUpdate(() => {
|
||
el.empty();
|
||
render(content, el);
|
||
});
|
||
function div_binding($$value) {
|
||
binding_callbacks[$$value ? "unshift" : "push"](() => {
|
||
el = $$value;
|
||
$$invalidate(0, el);
|
||
});
|
||
}
|
||
$$self.$$set = ($$props2) => {
|
||
if ("render" in $$props2)
|
||
$$invalidate(1, render = $$props2.render);
|
||
if ("content" in $$props2)
|
||
$$invalidate(2, content = $$props2.content);
|
||
};
|
||
return [el, render, content, div_binding];
|
||
}
|
||
var TaskItemComponent = class extends SvelteComponent {
|
||
constructor(options) {
|
||
super();
|
||
init(this, options, instance, create_fragment, safe_not_equal, { render: 1, content: 2 }, add_css);
|
||
}
|
||
};
|
||
var TaskItemComponent_default = TaskItemComponent;
|
||
|
||
// src/utils.ts
|
||
var import_obsidian = require("obsidian");
|
||
var import_obsidian_daily_notes_interface = __toESM(require_main());
|
||
|
||
// src/serializer/TaskModels.ts
|
||
var _TaskRegularExpressions = class {
|
||
};
|
||
var TaskRegularExpressions = _TaskRegularExpressions;
|
||
TaskRegularExpressions.dateFormat = "YYYY-MM-DD";
|
||
TaskRegularExpressions.dateTimeFormat = "YYYY-MM-DD HH:mm";
|
||
// Matches indentation before a list marker (including > for potentially nested blockquotes or Obsidian callouts)
|
||
TaskRegularExpressions.indentationRegex = /^([\s\t>]*)/;
|
||
// Matches - * and + list markers, or numbered list markers (eg 1.)
|
||
TaskRegularExpressions.listMarkerRegex = /([-*+]|[0-9]+\.)/;
|
||
// Matches a checkbox and saves the status character inside
|
||
TaskRegularExpressions.checkboxRegex = /\[(.)\]/u;
|
||
// Matches the rest of the task after the checkbox.
|
||
TaskRegularExpressions.afterCheckboxRegex = / *(.*)/u;
|
||
// Main regex for parsing a line. It matches the following:
|
||
// - Indentation
|
||
// - List marker
|
||
// - Status character
|
||
// - Rest of task after checkbox markdown
|
||
// See Task.extractTaskComponents() for abstraction around this regular expression.
|
||
// That is private for now, but could be made public in future if needed.
|
||
TaskRegularExpressions.taskRegex = new RegExp(
|
||
_TaskRegularExpressions.indentationRegex.source + _TaskRegularExpressions.listMarkerRegex.source + " +" + _TaskRegularExpressions.checkboxRegex.source + _TaskRegularExpressions.afterCheckboxRegex.source,
|
||
"u"
|
||
);
|
||
// Used with the "Create or Edit Task" command to parse indentation and status if present
|
||
TaskRegularExpressions.nonTaskRegex = new RegExp(
|
||
_TaskRegularExpressions.indentationRegex.source + _TaskRegularExpressions.listMarkerRegex.source + "? *(" + _TaskRegularExpressions.checkboxRegex.source + ")?" + _TaskRegularExpressions.afterCheckboxRegex.source,
|
||
"u"
|
||
);
|
||
// Used with "Toggle Done" command to detect a list item that can get a checkbox added to it.
|
||
TaskRegularExpressions.listItemRegex = new RegExp(
|
||
_TaskRegularExpressions.indentationRegex.source + _TaskRegularExpressions.listMarkerRegex.source
|
||
);
|
||
// Match on block link at end.
|
||
TaskRegularExpressions.blockLinkRegex = / \^[a-zA-Z0-9-]+$/u;
|
||
// Regex to match all hash tags, basically hash followed by anything but the characters in the negation.
|
||
// To ensure URLs are not caught it is looking of beginning of string tag and any
|
||
// tag that has a space in front of it. Any # that has a character in front
|
||
// of it will be ignored.
|
||
// EXAMPLE:
|
||
// description: '#dog #car http://www/ddd#ere #house'
|
||
// matches: #dog, #car, #house
|
||
// MAINTENANCE NOTE:
|
||
// If hashTags is modified, please update 'Recognising Tags' in Tags.md in the docs.
|
||
TaskRegularExpressions.hashTags = /(^|\s)#[^ !@#$%^&*(),.?":{}|<>]+/g;
|
||
TaskRegularExpressions.hashTagsFromEnd = new RegExp(
|
||
_TaskRegularExpressions.hashTags.source + "$"
|
||
);
|
||
|
||
// src/utils.ts
|
||
function getTemplater(app) {
|
||
return app.plugins.plugins["templater-obsidian"];
|
||
}
|
||
async function parseWithTemplater(app, tfile, templateContent, log) {
|
||
const templater = getTemplater(app);
|
||
if (!templater)
|
||
return templateContent;
|
||
const preamble = `<%* const log = ${JSON.stringify(
|
||
log
|
||
)}; log.begin = moment(log.begin); log.end = moment(log.end); %>`;
|
||
return await templater.templater.parse_template(
|
||
{ target_file: tfile, run_mode: 4 },
|
||
`${preamble}${templateContent}`
|
||
);
|
||
}
|
||
var ensureFileExists = async (app, path) => {
|
||
const dirs = path.replace(/\\/g, "/").split("/");
|
||
dirs.pop();
|
||
if (dirs.length) {
|
||
const dir = join(...dirs);
|
||
if (!app.vault.getAbstractFileByPath(dir)) {
|
||
await app.vault.createFolder(dir);
|
||
}
|
||
}
|
||
const file = app.vault.getAbstractFileByPath(path);
|
||
if (file) {
|
||
if (file instanceof import_obsidian.TFile) {
|
||
const md = file;
|
||
if (md.extension == "md") {
|
||
return md;
|
||
} else {
|
||
throw new Error(`invalid file extension: ${md.extension}`);
|
||
}
|
||
} else {
|
||
throw new Error(`invalid file path: ${path}`);
|
||
}
|
||
} else {
|
||
return await app.vault.create(path, "");
|
||
}
|
||
};
|
||
var join = (...partSegments) => {
|
||
let parts = [];
|
||
for (let i = 0, l = partSegments.length; i < l; i++) {
|
||
parts = parts.concat(partSegments[i].split("/"));
|
||
}
|
||
const newParts = [];
|
||
for (let i = 0, l = parts.length; i < l; i++) {
|
||
const part = parts[i];
|
||
if (!part || part === ".")
|
||
continue;
|
||
else
|
||
newParts.push(part);
|
||
}
|
||
if (parts[0] === "")
|
||
newParts.unshift("");
|
||
return newParts.join("/");
|
||
};
|
||
var getDailyNoteFile = async () => {
|
||
const file = (0, import_obsidian_daily_notes_interface.getDailyNote)((0, import_obsidian.moment)(), (0, import_obsidian_daily_notes_interface.getAllDailyNotes)());
|
||
if (!file) {
|
||
return await (0, import_obsidian_daily_notes_interface.createDailyNote)((0, import_obsidian.moment)());
|
||
}
|
||
return file;
|
||
};
|
||
var HASH_TAGS_REG_EXP = /(^|\s)#[^ !@#$%^&*(),.?":{}|<>]+/g;
|
||
function extractHashtags(description) {
|
||
var _a, _b;
|
||
return (_b = (_a = description.match(HASH_TAGS_REG_EXP)) == null ? void 0 : _a.map((tag) => tag.trim())) != null ? _b : [];
|
||
}
|
||
function extractTaskComponents(line) {
|
||
const regexMatch = line.match(TaskRegularExpressions.taskRegex);
|
||
if (regexMatch === null) {
|
||
return null;
|
||
}
|
||
const indentation = regexMatch[1];
|
||
const listMarker = regexMatch[2];
|
||
const statusString = regexMatch[3];
|
||
const status = statusString;
|
||
let body = regexMatch[4].trim();
|
||
const blockLinkMatch = body.match(TaskRegularExpressions.blockLinkRegex);
|
||
const blockLink = blockLinkMatch !== null ? blockLinkMatch[0] : "";
|
||
if (blockLink !== "") {
|
||
body = body.replace(TaskRegularExpressions.blockLinkRegex, "").trim();
|
||
}
|
||
return { indentation, listMarker, status, body, blockLink };
|
||
}
|
||
function toInlineFieldRegex(innerFieldRegex) {
|
||
const fieldRegex = [
|
||
"(?:",
|
||
/* */
|
||
/(?=[^\]]+\])\[/,
|
||
// Try to match '[' if there's a ']' later in the string
|
||
/* */
|
||
"|",
|
||
/* */
|
||
/(?=[^)]+\))\(/,
|
||
// Otherwise, match '(' if there's a ')' later in the string
|
||
")",
|
||
/ */,
|
||
innerFieldRegex,
|
||
/ */,
|
||
/[)\]]/,
|
||
/(?: *,)?/,
|
||
// Allow trailing comma, enables workaround from #1913 for rendering issue
|
||
/$/
|
||
// Regexes are matched from the end of the string forwards
|
||
].map((val) => val instanceof RegExp ? val.source : val).join("");
|
||
return new RegExp(fieldRegex, innerFieldRegex.flags);
|
||
}
|
||
|
||
// node_modules/svelte/src/runtime/store/index.js
|
||
var subscriber_queue = [];
|
||
function readable(value, start) {
|
||
return {
|
||
subscribe: writable(value, start).subscribe
|
||
};
|
||
}
|
||
function writable(value, start = noop) {
|
||
let stop;
|
||
const subscribers = /* @__PURE__ */ new Set();
|
||
function set(new_value) {
|
||
if (safe_not_equal(value, new_value)) {
|
||
value = new_value;
|
||
if (stop) {
|
||
const run_queue = !subscriber_queue.length;
|
||
for (const subscriber of subscribers) {
|
||
subscriber[1]();
|
||
subscriber_queue.push(subscriber, value);
|
||
}
|
||
if (run_queue) {
|
||
for (let i = 0; i < subscriber_queue.length; i += 2) {
|
||
subscriber_queue[i][0](subscriber_queue[i + 1]);
|
||
}
|
||
subscriber_queue.length = 0;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
function update2(fn) {
|
||
set(fn(value));
|
||
}
|
||
function subscribe2(run2, invalidate = noop) {
|
||
const subscriber = [run2, invalidate];
|
||
subscribers.add(subscriber);
|
||
if (subscribers.size === 1) {
|
||
stop = start(set, update2) || noop;
|
||
}
|
||
run2(value);
|
||
return () => {
|
||
subscribers.delete(subscriber);
|
||
if (subscribers.size === 0 && stop) {
|
||
stop();
|
||
stop = null;
|
||
}
|
||
};
|
||
}
|
||
return { set, update: update2, subscribe: subscribe2 };
|
||
}
|
||
function derived(stores, fn, initial_value) {
|
||
const single = !Array.isArray(stores);
|
||
const stores_array = single ? [stores] : stores;
|
||
if (!stores_array.every(Boolean)) {
|
||
throw new Error("derived() expects stores as input, got a falsy value");
|
||
}
|
||
const auto = fn.length < 2;
|
||
return readable(initial_value, (set, update2) => {
|
||
let started = false;
|
||
const values = [];
|
||
let pending = 0;
|
||
let cleanup = noop;
|
||
const sync = () => {
|
||
if (pending) {
|
||
return;
|
||
}
|
||
cleanup();
|
||
const result = fn(single ? values[0] : values, set, update2);
|
||
if (auto) {
|
||
set(result);
|
||
} else {
|
||
cleanup = is_function(result) ? result : noop;
|
||
}
|
||
};
|
||
const unsubscribers = stores_array.map(
|
||
(store, i) => subscribe(
|
||
store,
|
||
(value) => {
|
||
values[i] = value;
|
||
pending &= ~(1 << i);
|
||
if (started) {
|
||
sync();
|
||
}
|
||
},
|
||
() => {
|
||
pending |= 1 << i;
|
||
}
|
||
)
|
||
);
|
||
started = true;
|
||
sync();
|
||
return function stop() {
|
||
run_all(unsubscribers);
|
||
cleanup();
|
||
started = false;
|
||
};
|
||
});
|
||
}
|
||
|
||
// src/serializer/DefaultTaskSerializer.ts
|
||
var DEFAULT_SYMBOLS = {
|
||
// NEW_TASK_FIELD_EDIT_REQUIRED
|
||
prioritySymbols: {
|
||
Highest: "\u{1F53A}",
|
||
High: "\u23EB",
|
||
Medium: "\u{1F53C}",
|
||
Low: "\u{1F53D}",
|
||
Lowest: "\u23EC",
|
||
None: ""
|
||
},
|
||
startDateSymbol: "\u{1F6EB}",
|
||
createdDateSymbol: "\u2795",
|
||
scheduledDateSymbol: "\u23F3",
|
||
dueDateSymbol: "\u{1F4C5}",
|
||
doneDateSymbol: "\u2705",
|
||
cancelledDateSymbol: "\u274C",
|
||
recurrenceSymbol: "\u{1F501}",
|
||
pomodorosSymbol: "\u{1F345}::",
|
||
TaskFormatRegularExpressions: {
|
||
// The following regex's end with `$` because they will be matched and
|
||
// removed from the end until none are left.
|
||
priorityRegex: /([🔺⏫🔼🔽⏬])$/u,
|
||
startDateRegex: /🛫 *(\d{4}-\d{2}-\d{2})$/u,
|
||
createdDateRegex: /➕ *(\d{4}-\d{2}-\d{2})$/u,
|
||
scheduledDateRegex: /[⏳⌛] *(\d{4}-\d{2}-\d{2})$/u,
|
||
dueDateRegex: /[📅📆🗓] *(\d{4}-\d{2}-\d{2})$/u,
|
||
doneDateRegex: /✅ *(\d{4}-\d{2}-\d{2})$/u,
|
||
cancelledDateRegex: /❌ *(\d{4}-\d{2}-\d{2})$/u,
|
||
recurrenceRegex: /🔁 ?([a-zA-Z0-9, !]+)$/iu,
|
||
pomodorosRegex: toInlineFieldRegex(/🍅:: *(\d* *\/? *\d*)/)
|
||
}
|
||
};
|
||
var DefaultTaskSerializer = class {
|
||
constructor(symbols) {
|
||
this.symbols = symbols;
|
||
}
|
||
/**
|
||
* Given the string captured in the first capture group of
|
||
* {@link DefaultTaskSerializerSymbols.TaskFormatRegularExpressions.priorityRegex},
|
||
* returns the corresponding Priority level.
|
||
*
|
||
* @param p String captured by priorityRegex
|
||
* @returns Corresponding priority if parsing was successful, otherwise {@link Priority.None}
|
||
*/
|
||
parsePriority(p) {
|
||
const { prioritySymbols } = this.symbols;
|
||
switch (p) {
|
||
case prioritySymbols.Lowest:
|
||
return "5" /* Lowest */;
|
||
case prioritySymbols.Low:
|
||
return "4" /* Low */;
|
||
case prioritySymbols.Medium:
|
||
return "2" /* Medium */;
|
||
case prioritySymbols.High:
|
||
return "1" /* High */;
|
||
case prioritySymbols.Highest:
|
||
return "0" /* Highest */;
|
||
default:
|
||
return "3" /* None */;
|
||
}
|
||
}
|
||
/* Parse TaskDetails from the textual description of a {@link Task}
|
||
*
|
||
* @param line The string to parse
|
||
*
|
||
* @return {TaskDetails}
|
||
*/
|
||
deserialize(line) {
|
||
const { TaskFormatRegularExpressions } = this.symbols;
|
||
let matched;
|
||
let priority = "3" /* None */;
|
||
let startDate = null;
|
||
let scheduledDate = null;
|
||
let dueDate = null;
|
||
let doneDate = null;
|
||
let cancelledDate = null;
|
||
let createdDate = null;
|
||
let recurrenceRule = "";
|
||
let pomodoros = "";
|
||
let trailingTags = "";
|
||
const maxRuns = 20;
|
||
let runs = 0;
|
||
do {
|
||
matched = false;
|
||
const pomodorosMatch = line.match(
|
||
TaskFormatRegularExpressions.pomodorosRegex
|
||
);
|
||
if (pomodorosMatch !== null) {
|
||
pomodoros = pomodorosMatch[1];
|
||
line = line.replace(TaskFormatRegularExpressions.pomodorosRegex, "").trim();
|
||
matched = true;
|
||
}
|
||
const priorityMatch = line.match(
|
||
TaskFormatRegularExpressions.priorityRegex
|
||
);
|
||
if (priorityMatch !== null) {
|
||
priority = this.parsePriority(priorityMatch[1]);
|
||
line = line.replace(TaskFormatRegularExpressions.priorityRegex, "").trim();
|
||
matched = true;
|
||
}
|
||
const doneDateMatch = line.match(
|
||
TaskFormatRegularExpressions.doneDateRegex
|
||
);
|
||
if (doneDateMatch !== null) {
|
||
doneDate = window.moment(
|
||
doneDateMatch[1],
|
||
TaskRegularExpressions.dateFormat
|
||
);
|
||
line = line.replace(TaskFormatRegularExpressions.doneDateRegex, "").trim();
|
||
matched = true;
|
||
}
|
||
const cancelledDateMatch = line.match(
|
||
TaskFormatRegularExpressions.cancelledDateRegex
|
||
);
|
||
if (cancelledDateMatch !== null) {
|
||
cancelledDate = window.moment(
|
||
cancelledDateMatch[1],
|
||
TaskRegularExpressions.dateFormat
|
||
);
|
||
line = line.replace(
|
||
TaskFormatRegularExpressions.cancelledDateRegex,
|
||
""
|
||
).trim();
|
||
matched = true;
|
||
}
|
||
const dueDateMatch = line.match(
|
||
TaskFormatRegularExpressions.dueDateRegex
|
||
);
|
||
if (dueDateMatch !== null) {
|
||
dueDate = window.moment(
|
||
dueDateMatch[1],
|
||
TaskRegularExpressions.dateFormat
|
||
);
|
||
line = line.replace(TaskFormatRegularExpressions.dueDateRegex, "").trim();
|
||
matched = true;
|
||
}
|
||
const scheduledDateMatch = line.match(
|
||
TaskFormatRegularExpressions.scheduledDateRegex
|
||
);
|
||
if (scheduledDateMatch !== null) {
|
||
scheduledDate = window.moment(
|
||
scheduledDateMatch[1],
|
||
TaskRegularExpressions.dateFormat
|
||
);
|
||
line = line.replace(
|
||
TaskFormatRegularExpressions.scheduledDateRegex,
|
||
""
|
||
).trim();
|
||
matched = true;
|
||
}
|
||
const startDateMatch = line.match(
|
||
TaskFormatRegularExpressions.startDateRegex
|
||
);
|
||
if (startDateMatch !== null) {
|
||
startDate = window.moment(
|
||
startDateMatch[1],
|
||
TaskRegularExpressions.dateFormat
|
||
);
|
||
line = line.replace(TaskFormatRegularExpressions.startDateRegex, "").trim();
|
||
matched = true;
|
||
}
|
||
const createdDateMatch = line.match(
|
||
TaskFormatRegularExpressions.createdDateRegex
|
||
);
|
||
if (createdDateMatch !== null) {
|
||
createdDate = window.moment(
|
||
createdDateMatch[1],
|
||
TaskRegularExpressions.dateFormat
|
||
);
|
||
line = line.replace(TaskFormatRegularExpressions.createdDateRegex, "").trim();
|
||
matched = true;
|
||
}
|
||
const recurrenceMatch = line.match(
|
||
TaskFormatRegularExpressions.recurrenceRegex
|
||
);
|
||
if (recurrenceMatch !== null) {
|
||
recurrenceRule = recurrenceMatch[1].trim();
|
||
line = line.replace(TaskFormatRegularExpressions.recurrenceRegex, "").trim();
|
||
matched = true;
|
||
}
|
||
const tagsMatch = line.match(TaskRegularExpressions.hashTagsFromEnd);
|
||
if (tagsMatch != null) {
|
||
line = line.replace(TaskRegularExpressions.hashTagsFromEnd, "").trim();
|
||
matched = true;
|
||
const tagName = tagsMatch[0].trim();
|
||
trailingTags = trailingTags.length > 0 ? [tagName, trailingTags].join(" ") : tagName;
|
||
}
|
||
runs++;
|
||
} while (matched && runs <= maxRuns);
|
||
if (trailingTags.length > 0)
|
||
line += " " + trailingTags;
|
||
return {
|
||
description: line,
|
||
priority,
|
||
startDate,
|
||
createdDate,
|
||
scheduledDate,
|
||
dueDate,
|
||
doneDate,
|
||
cancelledDate,
|
||
recurrenceRule,
|
||
pomodoros,
|
||
tags: extractHashtags(line)
|
||
};
|
||
}
|
||
};
|
||
|
||
// src/serializer/DataviewTaskSerializer.ts
|
||
var DATAVIEW_SYMBOLS = {
|
||
// NEW_TASK_FIELD_EDIT_REQUIRED
|
||
prioritySymbols: {
|
||
Highest: "priority:: highest",
|
||
High: "priority:: high",
|
||
Medium: "priority:: medium",
|
||
Low: "priority:: low",
|
||
Lowest: "priority:: lowest",
|
||
None: ""
|
||
},
|
||
startDateSymbol: "start::",
|
||
createdDateSymbol: "created::",
|
||
scheduledDateSymbol: "scheduled::",
|
||
dueDateSymbol: "due::",
|
||
doneDateSymbol: "completion::",
|
||
cancelledDateSymbol: "cancelled::",
|
||
recurrenceSymbol: "repeat::",
|
||
pomodorosSymbol: "\u{1F345}::",
|
||
TaskFormatRegularExpressions: {
|
||
priorityRegex: toInlineFieldRegex(
|
||
/priority:: *(highest|high|medium|low|lowest)/
|
||
),
|
||
startDateRegex: toInlineFieldRegex(/start:: *(\d{4}-\d{2}-\d{2})/),
|
||
createdDateRegex: toInlineFieldRegex(/created:: *(\d{4}-\d{2}-\d{2})/),
|
||
scheduledDateRegex: toInlineFieldRegex(
|
||
/scheduled:: *(\d{4}-\d{2}-\d{2})/
|
||
),
|
||
dueDateRegex: toInlineFieldRegex(/due:: *(\d{4}-\d{2}-\d{2})/),
|
||
doneDateRegex: toInlineFieldRegex(/completion:: *(\d{4}-\d{2}-\d{2})/),
|
||
cancelledDateRegex: toInlineFieldRegex(
|
||
/cancelled:: *(\d{4}-\d{2}-\d{2})/
|
||
),
|
||
recurrenceRegex: toInlineFieldRegex(/repeat:: *([a-zA-Z0-9, !]+)/),
|
||
pomodorosRegex: toInlineFieldRegex(/🍅:: *(\d* *\/? *\d*)/)
|
||
}
|
||
};
|
||
var DataviewTaskSerializer = class extends DefaultTaskSerializer {
|
||
constructor() {
|
||
super(DATAVIEW_SYMBOLS);
|
||
}
|
||
parsePriority(p) {
|
||
switch (p) {
|
||
case "highest":
|
||
return "0" /* Highest */;
|
||
case "high":
|
||
return "1" /* High */;
|
||
case "medium":
|
||
return "2" /* Medium */;
|
||
case "low":
|
||
return "4" /* Low */;
|
||
case "lowest":
|
||
return "5" /* Lowest */;
|
||
default:
|
||
return "3" /* None */;
|
||
}
|
||
}
|
||
};
|
||
|
||
// src/serializer/index.ts
|
||
var POMODORO_REGEX = new RegExp(
|
||
"(?:(?=[^\\]]+\\])\\[|(?=[^)]+\\))\\() *\u{1F345}:: *(\\d* *\\/? *\\d*) *[)\\]](?: *,)?"
|
||
);
|
||
var DESERIALIZERS = {
|
||
TASKS: new DefaultTaskSerializer(DEFAULT_SYMBOLS),
|
||
DATAVIEW: new DataviewTaskSerializer()
|
||
};
|
||
|
||
// src/Tasks.ts
|
||
var Tasks = class {
|
||
constructor(plugin) {
|
||
this.unsubscribers = [];
|
||
this.state = {
|
||
list: []
|
||
};
|
||
this.plugin = plugin;
|
||
this._store = writable(this.state);
|
||
this.unsubscribers.push(
|
||
this._store.subscribe((state) => {
|
||
this.state = state;
|
||
})
|
||
);
|
||
this.unsubscribers.push(
|
||
derived(this.plugin.tracker, ($tracker) => {
|
||
var _a;
|
||
return (_a = $tracker.file) == null ? void 0 : _a.path;
|
||
}).subscribe(() => {
|
||
var _a;
|
||
let file = (_a = this.plugin.tracker) == null ? void 0 : _a.file;
|
||
if (file) {
|
||
this.loadFileTasks(file);
|
||
} else {
|
||
this.clearTasks();
|
||
}
|
||
})
|
||
);
|
||
this.subscribe = this._store.subscribe;
|
||
this.plugin.registerEvent(
|
||
plugin.app.metadataCache.on(
|
||
"changed",
|
||
(file, content, cache) => {
|
||
var _a, _b;
|
||
if (file.extension === "md" && file == this.plugin.tracker.file) {
|
||
let tasks = resolveTasks(
|
||
this.plugin.getSettings().taskFormat,
|
||
file,
|
||
content,
|
||
cache
|
||
);
|
||
this._store.update((state) => {
|
||
state.list = tasks;
|
||
return state;
|
||
});
|
||
if ((_b = (_a = this.plugin.tracker) == null ? void 0 : _a.task) == null ? void 0 : _b.blockLink) {
|
||
let task = tasks.find(
|
||
(item) => {
|
||
var _a2, _b2;
|
||
return item.blockLink && item.blockLink === ((_b2 = (_a2 = this.plugin.tracker) == null ? void 0 : _a2.task) == null ? void 0 : _b2.blockLink);
|
||
}
|
||
);
|
||
if (task) {
|
||
this.plugin.tracker.sync(task);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
)
|
||
);
|
||
}
|
||
static getDeserializer(format) {
|
||
return DESERIALIZERS[format];
|
||
}
|
||
loadFileTasks(file) {
|
||
if (file.extension == "md") {
|
||
this.plugin.app.vault.cachedRead(file).then((c) => {
|
||
let tasks = resolveTasks(
|
||
this.plugin.getSettings().taskFormat,
|
||
file,
|
||
c,
|
||
this.plugin.app.metadataCache.getFileCache(file)
|
||
);
|
||
this._store.update(() => ({
|
||
list: tasks
|
||
}));
|
||
});
|
||
} else {
|
||
this._store.update(() => ({
|
||
file,
|
||
list: []
|
||
}));
|
||
}
|
||
}
|
||
clearTasks() {
|
||
this._store.update(() => ({
|
||
list: []
|
||
}));
|
||
}
|
||
destroy() {
|
||
for (let unsub of this.unsubscribers) {
|
||
unsub();
|
||
}
|
||
}
|
||
};
|
||
function resolveTasks(format, file, content, metadata) {
|
||
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
||
if (!content || !metadata) {
|
||
return [];
|
||
}
|
||
let cache = {};
|
||
const lines = content.split("\n");
|
||
for (let rawElement of metadata.listItems || []) {
|
||
if (rawElement.task) {
|
||
let lineNr = rawElement.position.start.line;
|
||
let line = lines[lineNr];
|
||
const components = extractTaskComponents(line);
|
||
if (!components) {
|
||
continue;
|
||
}
|
||
let detail = DESERIALIZERS[format].deserialize(components.body);
|
||
let [actual, expected] = detail.pomodoros.split("/");
|
||
const dateformat = "YYYY-MM-DD";
|
||
let item = {
|
||
text: line,
|
||
path: file.path,
|
||
fileName: file.name,
|
||
name: detail.description,
|
||
status: components.status,
|
||
blockLink: components.blockLink,
|
||
checked: rawElement.task != "" && rawElement.task != " ",
|
||
description: detail.description,
|
||
done: (_b = (_a = detail.doneDate) == null ? void 0 : _a.format(dateformat)) != null ? _b : "",
|
||
due: (_d = (_c = detail.dueDate) == null ? void 0 : _c.format(dateformat)) != null ? _d : "",
|
||
created: (_f = (_e = detail.createdDate) == null ? void 0 : _e.format(dateformat)) != null ? _f : "",
|
||
cancelled: (_h = (_g = detail.cancelledDate) == null ? void 0 : _g.format(dateformat)) != null ? _h : "",
|
||
scheduled: (_j = (_i = detail.scheduledDate) == null ? void 0 : _i.format(dateformat)) != null ? _j : "",
|
||
start: (_l = (_k = detail.startDate) == null ? void 0 : _k.format(dateformat)) != null ? _l : "",
|
||
priority: detail.priority,
|
||
recurrence: detail.recurrenceRule,
|
||
expected: expected ? parseInt(expected) : 0,
|
||
actual: actual === "" ? 0 : parseInt(actual),
|
||
tags: detail.tags,
|
||
line: lineNr
|
||
};
|
||
cache[lineNr] = item;
|
||
}
|
||
}
|
||
return Object.values(cache);
|
||
}
|
||
|
||
// src/Settings.ts
|
||
var import_obsidian2 = require("obsidian");
|
||
var _PomodoroSettings = class extends import_obsidian2.PluginSettingTab {
|
||
constructor(plugin, settings2) {
|
||
super(plugin.app, plugin);
|
||
this.updateSettings = (newSettings, refreshUI = false) => {
|
||
_PomodoroSettings.settings.update((settings2) => {
|
||
this._settings = { ...settings2, ...newSettings };
|
||
if (refreshUI) {
|
||
this.display();
|
||
}
|
||
return this._settings;
|
||
});
|
||
};
|
||
this.plugin = plugin;
|
||
this._settings = { ..._PomodoroSettings.DEFAULT_SETTINGS, ...settings2 };
|
||
_PomodoroSettings.settings.set(this._settings);
|
||
this.unsubscribe = _PomodoroSettings.settings.subscribe((settings3) => {
|
||
var _a;
|
||
this.plugin.saveData(settings3);
|
||
this._settings = settings3;
|
||
(_a = this.plugin.timer) == null ? void 0 : _a.setupTimer();
|
||
});
|
||
}
|
||
getSettings() {
|
||
return this._settings;
|
||
}
|
||
unload() {
|
||
this.unsubscribe();
|
||
}
|
||
display() {
|
||
const { containerEl } = this;
|
||
containerEl.empty();
|
||
new import_obsidian2.Setting(containerEl).setName("Enable Status Bar Timer").addToggle((toggle) => {
|
||
toggle.setValue(this._settings.useStatusBarTimer);
|
||
toggle.onChange((value) => {
|
||
this.updateSettings({ useStatusBarTimer: value });
|
||
});
|
||
});
|
||
new import_obsidian2.Setting(containerEl).setHeading().setName("Notification");
|
||
new import_obsidian2.Setting(containerEl).setName("Use System Notification").addToggle((toggle) => {
|
||
toggle.setValue(this._settings.useSystemNotification);
|
||
toggle.onChange((value) => {
|
||
this.updateSettings({ useSystemNotification: value });
|
||
});
|
||
});
|
||
new import_obsidian2.Setting(containerEl).setName("Sound Notification").addToggle((toggle) => {
|
||
toggle.setValue(this._settings.notificationSound);
|
||
toggle.onChange((value) => {
|
||
this.updateSettings({ notificationSound: value }, true);
|
||
});
|
||
});
|
||
if (this._settings.notificationSound) {
|
||
new import_obsidian2.Setting(containerEl).setName("Custom Notification Audio").addText((text2) => {
|
||
text2.inputEl.style.width = "100%";
|
||
text2.setPlaceholder("path/to/sound.mp3");
|
||
text2.setValue(this._settings.customSound);
|
||
text2.onChange((value) => {
|
||
this.updateSettings({ customSound: value });
|
||
});
|
||
}).addExtraButton((button) => {
|
||
button.setIcon("play");
|
||
button.setTooltip("play");
|
||
button.onClick(() => {
|
||
var _a;
|
||
(_a = this.plugin.timer) == null ? void 0 : _a.playAudio();
|
||
});
|
||
});
|
||
}
|
||
new import_obsidian2.Setting(containerEl).setHeading().setName("Task");
|
||
new import_obsidian2.Setting(containerEl).setName("Enable Task Tracking").setDesc(
|
||
"Important: Enabling this feature will automatically add a block ID when activating a task, unless a block ID is already present."
|
||
).addToggle((toggle) => {
|
||
toggle.setValue(this._settings.enableTaskTracking);
|
||
toggle.onChange((value) => {
|
||
this.updateSettings({ enableTaskTracking: value });
|
||
});
|
||
});
|
||
new import_obsidian2.Setting(containerEl).setName("Show Task Progress Background").addToggle((toggle) => {
|
||
toggle.setValue(this._settings.showTaskProgress);
|
||
toggle.onChange((value) => {
|
||
this.updateSettings({ showTaskProgress: value });
|
||
});
|
||
});
|
||
new import_obsidian2.Setting(containerEl).setName("Task Format").addDropdown((dropdown) => {
|
||
dropdown.selectEl.style.width = "160px";
|
||
dropdown.addOptions({
|
||
TASKS: "Tasks Emoji Format",
|
||
DATAVIEW: "Dataview"
|
||
});
|
||
dropdown.setValue(this._settings.taskFormat);
|
||
dropdown.onChange((value) => {
|
||
this.updateSettings(
|
||
{ taskFormat: value },
|
||
true
|
||
);
|
||
});
|
||
});
|
||
new import_obsidian2.Setting(containerEl).setHeading().setName("Log");
|
||
new import_obsidian2.Setting(containerEl).setName("Log File").addDropdown((dropdown) => {
|
||
dropdown.selectEl.style.width = "160px";
|
||
dropdown.addOptions({
|
||
NONE: "None",
|
||
DAILY: "Daily note",
|
||
FILE: "File"
|
||
});
|
||
dropdown.setValue(this._settings.logFile);
|
||
dropdown.onChange((value) => {
|
||
this.updateSettings({ logFile: value }, true);
|
||
});
|
||
});
|
||
if (this._settings.logFile != "NONE") {
|
||
if (this._settings.logFile === "FILE") {
|
||
new import_obsidian2.Setting(containerEl).setName("Log file path").setDesc("The file to log pomodoro sessions to").addText((text2) => {
|
||
text2.inputEl.style.width = "300px";
|
||
text2.setValue(this._settings.logPath);
|
||
text2.onChange((value) => {
|
||
this.updateSettings({ logPath: value });
|
||
});
|
||
});
|
||
}
|
||
new import_obsidian2.Setting(containerEl).setName("Log Level").addDropdown((dropdown) => {
|
||
dropdown.selectEl.style.width = "160px";
|
||
dropdown.addOptions({
|
||
ALL: "All",
|
||
WORK: "Work",
|
||
BREAK: "Break"
|
||
});
|
||
dropdown.setValue(this._settings.logLevel);
|
||
dropdown.onChange((value) => {
|
||
this.updateSettings({ logLevel: value });
|
||
});
|
||
});
|
||
const hasTemplater = !!getTemplater(this.app);
|
||
let example = "";
|
||
if (this._settings.logFormat == "SIMPLE") {
|
||
example = `**WORK(25m)**: from ${(0, import_obsidian2.moment)().subtract(25, "minutes").format("HH:mm")} - ${(0, import_obsidian2.moment)().format("HH:mm")}`;
|
||
}
|
||
if (this._settings.logFormat == "VERBOSE") {
|
||
example = `- \u{1F345} (pomodoro::WORK) (duration:: 25m) (begin:: ${(0, import_obsidian2.moment)().subtract(25, "minutes").format("YYYY-MM-DD HH:mm")}) - (end:: ${(0, import_obsidian2.moment)().format(
|
||
"YYYY-MM-DD HH:mm"
|
||
)})`;
|
||
}
|
||
new import_obsidian2.Setting(containerEl).setName("Log Format").setDesc(example).addDropdown((dropdown) => {
|
||
dropdown.selectEl.style.width = "160px";
|
||
dropdown.addOptions({
|
||
SIMPLE: "Simple",
|
||
VERBOSE: "Verbose",
|
||
CUSTOM: "Custom"
|
||
});
|
||
dropdown.setValue(this._settings.logFormat);
|
||
dropdown.onChange((value) => {
|
||
this.updateSettings(
|
||
{ logFormat: value },
|
||
true
|
||
);
|
||
});
|
||
});
|
||
if (this._settings.logFormat == "CUSTOM") {
|
||
const logTemplate = new import_obsidian2.Setting(containerEl).setName(
|
||
"Log template"
|
||
);
|
||
if (hasTemplater) {
|
||
logTemplate.addTextArea((text2) => {
|
||
text2.inputEl.style.width = "100%";
|
||
text2.inputEl.style.resize = "vertical";
|
||
text2.setPlaceholder("<% templater script goes here %>");
|
||
text2.setValue(this._settings.logTemplate);
|
||
text2.onChange((value) => {
|
||
this.updateSettings({ logTemplate: value });
|
||
});
|
||
});
|
||
} else {
|
||
logTemplate.setDesc(
|
||
createFragment((fragment) => {
|
||
const text1 = document.createElement("span");
|
||
text1.setText("Requires ");
|
||
text1.style.color = "var(--text-error)";
|
||
const a = document.createElement("a");
|
||
a.setText("Templater");
|
||
a.href = "obsidian://show-plugin?id=templater-obsidian";
|
||
const text2 = document.createElement("span");
|
||
text2.setText(
|
||
" plugin to be enabled, then click the refresh button"
|
||
);
|
||
text2.style.color = "var(--text-error)";
|
||
fragment.append(text1, a, text2);
|
||
})
|
||
).addButton((button) => {
|
||
button.setIcon("refresh-ccw");
|
||
button.onClick(() => {
|
||
this.display();
|
||
});
|
||
});
|
||
}
|
||
}
|
||
}
|
||
new import_obsidian2.Setting(containerEl).addButton((button) => {
|
||
button.setButtonText("Restore Settings");
|
||
button.onClick(() => {
|
||
this.updateSettings(_PomodoroSettings.DEFAULT_SETTINGS, true);
|
||
});
|
||
});
|
||
}
|
||
};
|
||
var PomodoroSettings = _PomodoroSettings;
|
||
PomodoroSettings.DEFAULT_SETTINGS = {
|
||
workLen: 25,
|
||
breakLen: 5,
|
||
autostart: false,
|
||
useStatusBarTimer: false,
|
||
notificationSound: true,
|
||
customSound: "",
|
||
showTaskProgress: true,
|
||
enableTaskTracking: false,
|
||
logFile: "NONE",
|
||
logFocused: false,
|
||
logPath: "",
|
||
logLevel: "ALL",
|
||
logTemplate: "",
|
||
logFormat: "VERBOSE",
|
||
useSystemNotification: false,
|
||
taskFormat: "TASKS"
|
||
};
|
||
PomodoroSettings.settings = writable(
|
||
_PomodoroSettings.DEFAULT_SETTINGS
|
||
);
|
||
|
||
// src/stores.ts
|
||
var settings = PomodoroSettings.settings;
|
||
|
||
// src/TasksComponent.svelte
|
||
var import_obsidian3 = require("obsidian");
|
||
function add_css2(target) {
|
||
append_styles(target, "svelte-1ipipwe", ".pomodoro-tasks-wrapper.svelte-1ipipwe.svelte-1ipipwe.svelte-1ipipwe{width:100%;border:1px solid var(--background-modifier-border);border-radius:5px}.pomodoro-tasks-header-title.svelte-1ipipwe.svelte-1ipipwe.svelte-1ipipwe{width:100%;background-color:var(--background-modifier-active-hover);padding:0.5rem 1rem;font-size:1rem;font-weight:bold;display:flex;justify-content:space-between;align-items:flex-end}.pomodoro-tasks-header-title.svelte-1ipipwe .pomodoro-tasks-file-name.svelte-1ipipwe.svelte-1ipipwe{flex:1;text-wrap:nowrap;overflow:hidden;text-overflow:ellipsis;padding-right:5px}.pomodoro-tasks-file-name.svelte-1ipipwe.svelte-1ipipwe.svelte-1ipipwe{cursor:pointer}.pomodoro-tasks-header-title.svelte-1ipipwe .pomodoro-tasks-count.svelte-1ipipwe.svelte-1ipipwe{width:50px}.pomodoro-tasks-list.svelte-1ipipwe.svelte-1ipipwe.svelte-1ipipwe,.pomodoro-tasks-active.svelte-1ipipwe.svelte-1ipipwe.svelte-1ipipwe{border-top:1px solid var(--background-modifier-border);width:100%}.pomodoro-tasks-item.svelte-1ipipwe.svelte-1ipipwe.svelte-1ipipwe{display:flex;flex-direction:column;width:100%;padding:0.5rem 1rem;display:flex}.pomodoro-tasks-list.svelte-1ipipwe .pomodoro-tasks-item.svelte-1ipipwe.svelte-1ipipwe{cursor:pointer}.pomodoro-tasks-toolbar.svelte-1ipipwe.svelte-1ipipwe.svelte-1ipipwe{width:100%}.pomodoro-tasks-count.svelte-1ipipwe.svelte-1ipipwe.svelte-1ipipwe{color:var(--text-faint);font-size:0.8rem;text-wrap:nowrap}.pomodoro-tasks-filters.svelte-1ipipwe.svelte-1ipipwe.svelte-1ipipwe{padding:0.5rem 1rem}.pomodoro-tasks-text-filter.svelte-1ipipwe.svelte-1ipipwe.svelte-1ipipwe{border-top:1px solid var(--background-modifier-border);padding:0.5rem 0rem}.pomodoro-tasks-wrapper.svelte-1ipipwe input.svelte-1ipipwe.svelte-1ipipwe{width:100%;font-size:0.8rem;border:none;border-radius:0;background:transparent}.pomodoro-tasks-wrapper.svelte-1ipipwe input.svelte-1ipipwe.svelte-1ipipwe:active{border:none;box-shadow:none}.pomodoro-tasks-wrapper.svelte-1ipipwe input.svelte-1ipipwe.svelte-1ipipwe:focus{border:none;box-shadow:none}.pomodoro-tasks-text-filter.svelte-1ipipwe input.svelte-1ipipwe.svelte-1ipipwe{height:0.8rem}.pomodoro-tasks-filter.svelte-1ipipwe.svelte-1ipipwe.svelte-1ipipwe{font-size:0.8rem;padding:1px 7px;border-radius:10px;cursor:pointer;color:var(--text-muted)}.pomodoro-tasks-name.svelte-1ipipwe svg.svelte-1ipipwe.svelte-1ipipwe{margin-right:5px}.pomodoro-tasks-name.svelte-1ipipwe svg.svelte-1ipipwe.svelte-1ipipwe{color:var(--color-blue)}.pomodoro-tasks-checked.svelte-1ipipwe .pomodoro-tasks-name.svelte-1ipipwe svg.svelte-1ipipwe{color:var(--color-green)}.pomodoro-tasks-name.svelte-1ipipwe.svelte-1ipipwe.svelte-1ipipwe{width:100%;display:flex;align-items:baseline}.filter-active.svelte-1ipipwe.svelte-1ipipwe.svelte-1ipipwe{background-color:var(--interactive-accent);color:var(--text-on-accent-inverted)}.pomodoro-tasks-item.svelte-1ipipwe+.pomodoro-tasks-item.svelte-1ipipwe.svelte-1ipipwe{border-top:1px solid var(--background-modifier-border)}.pomodoro-tasks-checked.svelte-1ipipwe .pomodoro-tasks-name.svelte-1ipipwe.svelte-1ipipwe{text-decoration:line-through;color:var(--text-muted)}.pomodoro-tasks-pin.svelte-1ipipwe.svelte-1ipipwe.svelte-1ipipwe{cursor:pointer;padding-right:3px}.pomodoro-tasks-remove.svelte-1ipipwe.svelte-1ipipwe.svelte-1ipipwe{cursor:pointer}.pomodoro-tasks-progress.svelte-1ipipwe.svelte-1ipipwe.svelte-1ipipwe{font-size:0.7rem;color:var(--text-muted);text-align:end;text-wrap:nowrap;overflow:hidden}");
|
||
}
|
||
function get_each_context(ctx, list, i) {
|
||
const child_ctx = ctx.slice();
|
||
child_ctx[23] = list[i];
|
||
return child_ctx;
|
||
}
|
||
function create_if_block(ctx) {
|
||
let div2;
|
||
let div1;
|
||
let div0;
|
||
let span0;
|
||
let t0;
|
||
let span1;
|
||
let t1_value = (
|
||
/*$tracker*/
|
||
ctx[6].file.name + ""
|
||
);
|
||
let t1;
|
||
let t2;
|
||
let span2;
|
||
let t3_value = (
|
||
/*filtered*/
|
||
ctx[5].length + ""
|
||
);
|
||
let t3;
|
||
let t4;
|
||
let t5;
|
||
let t6;
|
||
let current;
|
||
let mounted;
|
||
let dispose;
|
||
function select_block_type(ctx2, dirty) {
|
||
if (!/*$tracker*/
|
||
ctx2[6].pinned)
|
||
return create_if_block_5;
|
||
return create_else_block_1;
|
||
}
|
||
let current_block_type = select_block_type(ctx, -1);
|
||
let if_block0 = current_block_type(ctx);
|
||
let if_block1 = (
|
||
/*$tasks*/
|
||
ctx[4].list.length > 0 && create_if_block_3(ctx)
|
||
);
|
||
let if_block2 = (
|
||
/*filtered*/
|
||
ctx[5].length > 0 && create_if_block_1(ctx)
|
||
);
|
||
return {
|
||
c() {
|
||
div2 = element("div");
|
||
div1 = element("div");
|
||
div0 = element("div");
|
||
span0 = element("span");
|
||
if_block0.c();
|
||
t0 = space();
|
||
span1 = element("span");
|
||
t1 = text(t1_value);
|
||
t2 = space();
|
||
span2 = element("span");
|
||
t3 = text(t3_value);
|
||
t4 = text(" tasks");
|
||
t5 = space();
|
||
if (if_block1)
|
||
if_block1.c();
|
||
t6 = space();
|
||
if (if_block2)
|
||
if_block2.c();
|
||
attr(span0, "class", "pomodoro-tasks-pin svelte-1ipipwe");
|
||
attr(span1, "class", "pomodoro-tasks-file-name svelte-1ipipwe");
|
||
attr(span2, "class", "pomodoro-tasks-count svelte-1ipipwe");
|
||
attr(div0, "class", "pomodoro-tasks-header-title svelte-1ipipwe");
|
||
attr(div1, "class", "pomodoro-tasks-header");
|
||
attr(div2, "class", "pomodoro-tasks-wrapper svelte-1ipipwe");
|
||
},
|
||
m(target, anchor) {
|
||
insert(target, div2, anchor);
|
||
append(div2, div1);
|
||
append(div1, div0);
|
||
append(div0, span0);
|
||
if_block0.m(span0, null);
|
||
append(div0, t0);
|
||
append(div0, span1);
|
||
append(span1, t1);
|
||
append(div0, t2);
|
||
append(div0, span2);
|
||
append(span2, t3);
|
||
append(span2, t4);
|
||
append(div1, t5);
|
||
if (if_block1)
|
||
if_block1.m(div1, null);
|
||
append(div2, t6);
|
||
if (if_block2)
|
||
if_block2.m(div2, null);
|
||
current = true;
|
||
if (!mounted) {
|
||
dispose = [
|
||
listen(
|
||
span0,
|
||
"click",
|
||
/*togglePinned*/
|
||
ctx[9]
|
||
),
|
||
listen(
|
||
span1,
|
||
"click",
|
||
/*openFile*/
|
||
ctx[14]
|
||
)
|
||
];
|
||
mounted = true;
|
||
}
|
||
},
|
||
p(ctx2, dirty) {
|
||
if (current_block_type !== (current_block_type = select_block_type(ctx2, dirty))) {
|
||
if_block0.d(1);
|
||
if_block0 = current_block_type(ctx2);
|
||
if (if_block0) {
|
||
if_block0.c();
|
||
if_block0.m(span0, null);
|
||
}
|
||
}
|
||
if ((!current || dirty & /*$tracker*/
|
||
64) && t1_value !== (t1_value = /*$tracker*/
|
||
ctx2[6].file.name + ""))
|
||
set_data(t1, t1_value);
|
||
if ((!current || dirty & /*filtered*/
|
||
32) && t3_value !== (t3_value = /*filtered*/
|
||
ctx2[5].length + ""))
|
||
set_data(t3, t3_value);
|
||
if (
|
||
/*$tasks*/
|
||
ctx2[4].list.length > 0
|
||
) {
|
||
if (if_block1) {
|
||
if_block1.p(ctx2, dirty);
|
||
} else {
|
||
if_block1 = create_if_block_3(ctx2);
|
||
if_block1.c();
|
||
if_block1.m(div1, null);
|
||
}
|
||
} else if (if_block1) {
|
||
if_block1.d(1);
|
||
if_block1 = null;
|
||
}
|
||
if (
|
||
/*filtered*/
|
||
ctx2[5].length > 0
|
||
) {
|
||
if (if_block2) {
|
||
if_block2.p(ctx2, dirty);
|
||
if (dirty & /*filtered*/
|
||
32) {
|
||
transition_in(if_block2, 1);
|
||
}
|
||
} else {
|
||
if_block2 = create_if_block_1(ctx2);
|
||
if_block2.c();
|
||
transition_in(if_block2, 1);
|
||
if_block2.m(div2, null);
|
||
}
|
||
} else if (if_block2) {
|
||
group_outros();
|
||
transition_out(if_block2, 1, 1, () => {
|
||
if_block2 = null;
|
||
});
|
||
check_outros();
|
||
}
|
||
},
|
||
i(local) {
|
||
if (current)
|
||
return;
|
||
transition_in(if_block2);
|
||
current = true;
|
||
},
|
||
o(local) {
|
||
transition_out(if_block2);
|
||
current = false;
|
||
},
|
||
d(detaching) {
|
||
if (detaching) {
|
||
detach(div2);
|
||
}
|
||
if_block0.d();
|
||
if (if_block1)
|
||
if_block1.d();
|
||
if (if_block2)
|
||
if_block2.d();
|
||
mounted = false;
|
||
run_all(dispose);
|
||
}
|
||
};
|
||
}
|
||
function create_else_block_1(ctx) {
|
||
let svg;
|
||
let line0;
|
||
let line1;
|
||
let path0;
|
||
let path1;
|
||
return {
|
||
c() {
|
||
svg = svg_element("svg");
|
||
line0 = svg_element("line");
|
||
line1 = svg_element("line");
|
||
path0 = svg_element("path");
|
||
path1 = svg_element("path");
|
||
attr(line0, "x1", "2");
|
||
attr(line0, "x2", "22");
|
||
attr(line0, "y1", "2");
|
||
attr(line0, "y2", "22");
|
||
attr(line1, "x1", "12");
|
||
attr(line1, "x2", "12");
|
||
attr(line1, "y1", "17");
|
||
attr(line1, "y2", "22");
|
||
attr(path0, "d", "M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V17h12");
|
||
attr(path1, "d", "M15 9.34V6h1a2 2 0 0 0 0-4H7.89");
|
||
attr(svg, "xmlns", "http://www.w3.org/2000/svg");
|
||
attr(svg, "width", "12");
|
||
attr(svg, "height", "12");
|
||
attr(svg, "viewBox", "0 0 24 24");
|
||
attr(svg, "fill", "none");
|
||
attr(svg, "stroke", "currentColor");
|
||
attr(svg, "stroke-width", "2");
|
||
attr(svg, "stroke-linecap", "round");
|
||
attr(svg, "stroke-linejoin", "round");
|
||
attr(svg, "class", "lucide lucide-pin-off");
|
||
},
|
||
m(target, anchor) {
|
||
insert(target, svg, anchor);
|
||
append(svg, line0);
|
||
append(svg, line1);
|
||
append(svg, path0);
|
||
append(svg, path1);
|
||
},
|
||
d(detaching) {
|
||
if (detaching) {
|
||
detach(svg);
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function create_if_block_5(ctx) {
|
||
let svg;
|
||
let line;
|
||
let path;
|
||
return {
|
||
c() {
|
||
svg = svg_element("svg");
|
||
line = svg_element("line");
|
||
path = svg_element("path");
|
||
attr(line, "x1", "12");
|
||
attr(line, "x2", "12");
|
||
attr(line, "y1", "17");
|
||
attr(line, "y2", "22");
|
||
attr(path, "d", "M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24Z");
|
||
attr(svg, "xmlns", "http://www.w3.org/2000/svg");
|
||
attr(svg, "width", "12");
|
||
attr(svg, "height", "12");
|
||
attr(svg, "viewBox", "0 0 24 24");
|
||
attr(svg, "fill", "none");
|
||
attr(svg, "stroke", "currentColor");
|
||
attr(svg, "stroke-width", "2");
|
||
attr(svg, "stroke-linecap", "round");
|
||
attr(svg, "stroke-linejoin", "round");
|
||
attr(svg, "class", "lucide lucide-pin");
|
||
},
|
||
m(target, anchor) {
|
||
insert(target, svg, anchor);
|
||
append(svg, line);
|
||
append(svg, path);
|
||
},
|
||
d(detaching) {
|
||
if (detaching) {
|
||
detach(svg);
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function create_if_block_3(ctx) {
|
||
let div0;
|
||
let t0;
|
||
let div2;
|
||
let div1;
|
||
let span0;
|
||
let t1;
|
||
let span0_class_value;
|
||
let t2;
|
||
let span1;
|
||
let t3;
|
||
let span1_class_value;
|
||
let t4;
|
||
let span2;
|
||
let t5;
|
||
let span2_class_value;
|
||
let t6;
|
||
let div3;
|
||
let input;
|
||
let mounted;
|
||
let dispose;
|
||
let if_block = (
|
||
/*$tracker*/
|
||
ctx[6].task && create_if_block_4(ctx)
|
||
);
|
||
return {
|
||
c() {
|
||
div0 = element("div");
|
||
if (if_block)
|
||
if_block.c();
|
||
t0 = space();
|
||
div2 = element("div");
|
||
div1 = element("div");
|
||
span0 = element("span");
|
||
t1 = text("All");
|
||
t2 = space();
|
||
span1 = element("span");
|
||
t3 = text("Todo");
|
||
t4 = space();
|
||
span2 = element("span");
|
||
t5 = text("Completed");
|
||
t6 = space();
|
||
div3 = element("div");
|
||
input = element("input");
|
||
attr(div0, "class", "pomodoro-tasks-active svelte-1ipipwe");
|
||
attr(span0, "class", span0_class_value = "pomodoro-tasks-filter " + /*status*/
|
||
(ctx[2] === "" ? "filter-active" : "") + " svelte-1ipipwe");
|
||
attr(span1, "class", span1_class_value = "pomodoro-tasks-filter " + /*status*/
|
||
(ctx[2] === "todo" ? "filter-active" : "") + " svelte-1ipipwe");
|
||
attr(span2, "class", span2_class_value = "pomodoro-tasks-filter " + /*status*/
|
||
(ctx[2] === "completed" ? "filter-active" : "") + " svelte-1ipipwe");
|
||
attr(div1, "class", "pomodoro-tasks-filters svelte-1ipipwe");
|
||
attr(div2, "class", "pomodoro-tasks-toolbar svelte-1ipipwe");
|
||
attr(input, "type", "text");
|
||
attr(input, "placeholder", "Search...");
|
||
attr(input, "class", "svelte-1ipipwe");
|
||
attr(div3, "class", "pomodoro-tasks-text-filter svelte-1ipipwe");
|
||
},
|
||
m(target, anchor) {
|
||
insert(target, div0, anchor);
|
||
if (if_block)
|
||
if_block.m(div0, null);
|
||
insert(target, t0, anchor);
|
||
insert(target, div2, anchor);
|
||
append(div2, div1);
|
||
append(div1, span0);
|
||
append(span0, t1);
|
||
append(div1, t2);
|
||
append(div1, span1);
|
||
append(span1, t3);
|
||
append(div1, t4);
|
||
append(div1, span2);
|
||
append(span2, t5);
|
||
insert(target, t6, anchor);
|
||
insert(target, div3, anchor);
|
||
append(div3, input);
|
||
set_input_value(
|
||
input,
|
||
/*query*/
|
||
ctx[3]
|
||
);
|
||
if (!mounted) {
|
||
dispose = [
|
||
listen(
|
||
span0,
|
||
"click",
|
||
/*click_handler*/
|
||
ctx[17]
|
||
),
|
||
listen(
|
||
span1,
|
||
"click",
|
||
/*click_handler_1*/
|
||
ctx[18]
|
||
),
|
||
listen(
|
||
span2,
|
||
"click",
|
||
/*click_handler_2*/
|
||
ctx[19]
|
||
),
|
||
listen(
|
||
input,
|
||
"input",
|
||
/*input_input_handler*/
|
||
ctx[20]
|
||
)
|
||
];
|
||
mounted = true;
|
||
}
|
||
},
|
||
p(ctx2, dirty) {
|
||
if (
|
||
/*$tracker*/
|
||
ctx2[6].task
|
||
) {
|
||
if (if_block) {
|
||
if_block.p(ctx2, dirty);
|
||
} else {
|
||
if_block = create_if_block_4(ctx2);
|
||
if_block.c();
|
||
if_block.m(div0, null);
|
||
}
|
||
} else if (if_block) {
|
||
if_block.d(1);
|
||
if_block = null;
|
||
}
|
||
if (dirty & /*status*/
|
||
4 && span0_class_value !== (span0_class_value = "pomodoro-tasks-filter " + /*status*/
|
||
(ctx2[2] === "" ? "filter-active" : "") + " svelte-1ipipwe")) {
|
||
attr(span0, "class", span0_class_value);
|
||
}
|
||
if (dirty & /*status*/
|
||
4 && span1_class_value !== (span1_class_value = "pomodoro-tasks-filter " + /*status*/
|
||
(ctx2[2] === "todo" ? "filter-active" : "") + " svelte-1ipipwe")) {
|
||
attr(span1, "class", span1_class_value);
|
||
}
|
||
if (dirty & /*status*/
|
||
4 && span2_class_value !== (span2_class_value = "pomodoro-tasks-filter " + /*status*/
|
||
(ctx2[2] === "completed" ? "filter-active" : "") + " svelte-1ipipwe")) {
|
||
attr(span2, "class", span2_class_value);
|
||
}
|
||
if (dirty & /*query*/
|
||
8 && input.value !== /*query*/
|
||
ctx2[3]) {
|
||
set_input_value(
|
||
input,
|
||
/*query*/
|
||
ctx2[3]
|
||
);
|
||
}
|
||
},
|
||
d(detaching) {
|
||
if (detaching) {
|
||
detach(div0);
|
||
detach(t0);
|
||
detach(div2);
|
||
detach(t6);
|
||
detach(div3);
|
||
}
|
||
if (if_block)
|
||
if_block.d();
|
||
mounted = false;
|
||
run_all(dispose);
|
||
}
|
||
};
|
||
}
|
||
function create_if_block_4(ctx) {
|
||
let div1;
|
||
let div0;
|
||
let input;
|
||
let input_value_value;
|
||
let t;
|
||
let span;
|
||
let mounted;
|
||
let dispose;
|
||
return {
|
||
c() {
|
||
var _a;
|
||
div1 = element("div");
|
||
div0 = element("div");
|
||
input = element("input");
|
||
t = space();
|
||
span = element("span");
|
||
span.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-x svelte-1ipipwe"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></svg>`;
|
||
attr(input, "type", "text");
|
||
input.value = input_value_value = /*$tracker*/
|
||
(_a = ctx[6].task) == null ? void 0 : _a.name;
|
||
attr(input, "class", "svelte-1ipipwe");
|
||
attr(span, "class", "pomodoro-tasks-remove svelte-1ipipwe");
|
||
attr(div0, "class", "pomodoro-tasks-name svelte-1ipipwe");
|
||
attr(div1, "class", "pomodoro-tasks-item svelte-1ipipwe");
|
||
},
|
||
m(target, anchor) {
|
||
insert(target, div1, anchor);
|
||
append(div1, div0);
|
||
append(div0, input);
|
||
append(div0, t);
|
||
append(div0, span);
|
||
if (!mounted) {
|
||
dispose = [
|
||
listen(
|
||
input,
|
||
"input",
|
||
/*changeTaskName*/
|
||
ctx[10]
|
||
),
|
||
listen(
|
||
span,
|
||
"click",
|
||
/*removeTask*/
|
||
ctx[11]
|
||
)
|
||
];
|
||
mounted = true;
|
||
}
|
||
},
|
||
p(ctx2, dirty) {
|
||
var _a;
|
||
if (dirty & /*$tracker*/
|
||
64 && input_value_value !== (input_value_value = /*$tracker*/
|
||
(_a = ctx2[6].task) == null ? void 0 : _a.name) && input.value !== input_value_value) {
|
||
input.value = input_value_value;
|
||
}
|
||
},
|
||
d(detaching) {
|
||
if (detaching) {
|
||
detach(div1);
|
||
}
|
||
mounted = false;
|
||
run_all(dispose);
|
||
}
|
||
};
|
||
}
|
||
function create_if_block_1(ctx) {
|
||
let div;
|
||
let current;
|
||
let each_value = ensure_array_like(
|
||
/*filtered*/
|
||
ctx[5]
|
||
);
|
||
let each_blocks = [];
|
||
for (let i = 0; i < each_value.length; i += 1) {
|
||
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
|
||
}
|
||
const out = (i) => transition_out(each_blocks[i], 1, 1, () => {
|
||
each_blocks[i] = null;
|
||
});
|
||
return {
|
||
c() {
|
||
div = element("div");
|
||
for (let i = 0; i < each_blocks.length; i += 1) {
|
||
each_blocks[i].c();
|
||
}
|
||
attr(div, "class", "pomodoro-tasks-list svelte-1ipipwe");
|
||
},
|
||
m(target, anchor) {
|
||
insert(target, div, anchor);
|
||
for (let i = 0; i < each_blocks.length; i += 1) {
|
||
if (each_blocks[i]) {
|
||
each_blocks[i].m(div, null);
|
||
}
|
||
}
|
||
current = true;
|
||
},
|
||
p(ctx2, dirty) {
|
||
if (dirty & /*progress, filtered, activeTask, showTaskMenu, progressText, r*/
|
||
45472) {
|
||
each_value = ensure_array_like(
|
||
/*filtered*/
|
||
ctx2[5]
|
||
);
|
||
let i;
|
||
for (i = 0; i < each_value.length; i += 1) {
|
||
const child_ctx = get_each_context(ctx2, each_value, i);
|
||
if (each_blocks[i]) {
|
||
each_blocks[i].p(child_ctx, dirty);
|
||
transition_in(each_blocks[i], 1);
|
||
} else {
|
||
each_blocks[i] = create_each_block(child_ctx);
|
||
each_blocks[i].c();
|
||
transition_in(each_blocks[i], 1);
|
||
each_blocks[i].m(div, null);
|
||
}
|
||
}
|
||
group_outros();
|
||
for (i = each_value.length; i < each_blocks.length; i += 1) {
|
||
out(i);
|
||
}
|
||
check_outros();
|
||
}
|
||
},
|
||
i(local) {
|
||
if (current)
|
||
return;
|
||
for (let i = 0; i < each_value.length; i += 1) {
|
||
transition_in(each_blocks[i]);
|
||
}
|
||
current = true;
|
||
},
|
||
o(local) {
|
||
each_blocks = each_blocks.filter(Boolean);
|
||
for (let i = 0; i < each_blocks.length; i += 1) {
|
||
transition_out(each_blocks[i]);
|
||
}
|
||
current = false;
|
||
},
|
||
d(detaching) {
|
||
if (detaching) {
|
||
detach(div);
|
||
}
|
||
destroy_each(each_blocks, detaching);
|
||
}
|
||
};
|
||
}
|
||
function create_else_block(ctx) {
|
||
let svg;
|
||
let circle;
|
||
return {
|
||
c() {
|
||
svg = svg_element("svg");
|
||
circle = svg_element("circle");
|
||
attr(circle, "cx", "12");
|
||
attr(circle, "cy", "12");
|
||
attr(circle, "r", "10");
|
||
attr(svg, "xmlns", "http://www.w3.org/2000/svg");
|
||
attr(svg, "width", "12");
|
||
attr(svg, "height", "12");
|
||
attr(svg, "viewBox", "0 0 24 24");
|
||
attr(svg, "fill", "none");
|
||
attr(svg, "stroke", "currentColor");
|
||
attr(svg, "stroke-width", "2");
|
||
attr(svg, "stroke-linecap", "round");
|
||
attr(svg, "stroke-linejoin", "round");
|
||
attr(svg, "class", "lucide lucide-circle svelte-1ipipwe");
|
||
},
|
||
m(target, anchor) {
|
||
insert(target, svg, anchor);
|
||
append(svg, circle);
|
||
},
|
||
d(detaching) {
|
||
if (detaching) {
|
||
detach(svg);
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function create_if_block_2(ctx) {
|
||
let svg;
|
||
let path;
|
||
return {
|
||
c() {
|
||
svg = svg_element("svg");
|
||
path = svg_element("path");
|
||
attr(path, "d", "M20 6 9 17l-5-5");
|
||
attr(svg, "xmlns", "http://www.w3.org/2000/svg");
|
||
attr(svg, "width", "12");
|
||
attr(svg, "height", "12");
|
||
attr(svg, "viewBox", "0 0 24 24");
|
||
attr(svg, "fill", "none");
|
||
attr(svg, "stroke", "currentColor");
|
||
attr(svg, "stroke-width", "2");
|
||
attr(svg, "stroke-linecap", "round");
|
||
attr(svg, "stroke-linejoin", "round");
|
||
attr(svg, "class", "lucide lucide-check svelte-1ipipwe");
|
||
},
|
||
m(target, anchor) {
|
||
insert(target, svg, anchor);
|
||
append(svg, path);
|
||
},
|
||
d(detaching) {
|
||
if (detaching) {
|
||
detach(svg);
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function create_each_block(ctx) {
|
||
let div2;
|
||
let div0;
|
||
let t0;
|
||
let taskitemcomponent;
|
||
let t1;
|
||
let div1;
|
||
let t2_value = (
|
||
/*progressText*/
|
||
ctx[13](
|
||
/*item*/
|
||
ctx[23]
|
||
) + ""
|
||
);
|
||
let t2;
|
||
let t3;
|
||
let div2_class_value;
|
||
let current;
|
||
let mounted;
|
||
let dispose;
|
||
function select_block_type_1(ctx2, dirty) {
|
||
if (
|
||
/*item*/
|
||
ctx2[23].checked
|
||
)
|
||
return create_if_block_2;
|
||
return create_else_block;
|
||
}
|
||
let current_block_type = select_block_type_1(ctx, -1);
|
||
let if_block = current_block_type(ctx);
|
||
taskitemcomponent = new TaskItemComponent_default({
|
||
props: {
|
||
render: (
|
||
/*r*/
|
||
ctx[7]
|
||
),
|
||
content: (
|
||
/*item*/
|
||
ctx[23].description
|
||
)
|
||
}
|
||
});
|
||
function click_handler_3() {
|
||
return (
|
||
/*click_handler_3*/
|
||
ctx[21](
|
||
/*item*/
|
||
ctx[23]
|
||
)
|
||
);
|
||
}
|
||
return {
|
||
c() {
|
||
div2 = element("div");
|
||
div0 = element("div");
|
||
if_block.c();
|
||
t0 = space();
|
||
create_component(taskitemcomponent.$$.fragment);
|
||
t1 = space();
|
||
div1 = element("div");
|
||
t2 = text(t2_value);
|
||
t3 = space();
|
||
attr(div0, "class", "pomodoro-tasks-name svelte-1ipipwe");
|
||
attr(div1, "class", "pomodoro-tasks-progress svelte-1ipipwe");
|
||
set_style(div2, "background", "linear-gradient(to right, rgba(var(--color-green-rgb),0.25) " + /*progress*/
|
||
ctx[12](
|
||
/*item*/
|
||
ctx[23]
|
||
) + "%, transparent 0%)");
|
||
attr(div2, "class", div2_class_value = "pomodoro-tasks-item " + /*item*/
|
||
(ctx[23].checked ? "pomodoro-tasks-checked" : "") + " svelte-1ipipwe");
|
||
},
|
||
m(target, anchor) {
|
||
insert(target, div2, anchor);
|
||
append(div2, div0);
|
||
if_block.m(div0, null);
|
||
append(div0, t0);
|
||
mount_component(taskitemcomponent, div0, null);
|
||
append(div2, t1);
|
||
append(div2, div1);
|
||
append(div1, t2);
|
||
append(div2, t3);
|
||
current = true;
|
||
if (!mounted) {
|
||
dispose = [
|
||
listen(div2, "click", click_handler_3),
|
||
listen(div2, "contextmenu", function() {
|
||
if (is_function(
|
||
/*showTaskMenu*/
|
||
ctx[15](
|
||
/*item*/
|
||
ctx[23]
|
||
)
|
||
))
|
||
ctx[15](
|
||
/*item*/
|
||
ctx[23]
|
||
).apply(this, arguments);
|
||
})
|
||
];
|
||
mounted = true;
|
||
}
|
||
},
|
||
p(new_ctx, dirty) {
|
||
ctx = new_ctx;
|
||
if (current_block_type !== (current_block_type = select_block_type_1(ctx, dirty))) {
|
||
if_block.d(1);
|
||
if_block = current_block_type(ctx);
|
||
if (if_block) {
|
||
if_block.c();
|
||
if_block.m(div0, t0);
|
||
}
|
||
}
|
||
const taskitemcomponent_changes = {};
|
||
if (dirty & /*filtered*/
|
||
32)
|
||
taskitemcomponent_changes.content = /*item*/
|
||
ctx[23].description;
|
||
taskitemcomponent.$set(taskitemcomponent_changes);
|
||
if ((!current || dirty & /*filtered*/
|
||
32) && t2_value !== (t2_value = /*progressText*/
|
||
ctx[13](
|
||
/*item*/
|
||
ctx[23]
|
||
) + ""))
|
||
set_data(t2, t2_value);
|
||
if (!current || dirty & /*filtered*/
|
||
32) {
|
||
set_style(div2, "background", "linear-gradient(to right, rgba(var(--color-green-rgb),0.25) " + /*progress*/
|
||
ctx[12](
|
||
/*item*/
|
||
ctx[23]
|
||
) + "%, transparent 0%)");
|
||
}
|
||
if (!current || dirty & /*filtered*/
|
||
32 && div2_class_value !== (div2_class_value = "pomodoro-tasks-item " + /*item*/
|
||
(ctx[23].checked ? "pomodoro-tasks-checked" : "") + " svelte-1ipipwe")) {
|
||
attr(div2, "class", div2_class_value);
|
||
}
|
||
},
|
||
i(local) {
|
||
if (current)
|
||
return;
|
||
transition_in(taskitemcomponent.$$.fragment, local);
|
||
current = true;
|
||
},
|
||
o(local) {
|
||
transition_out(taskitemcomponent.$$.fragment, local);
|
||
current = false;
|
||
},
|
||
d(detaching) {
|
||
if (detaching) {
|
||
detach(div2);
|
||
}
|
||
if_block.d();
|
||
destroy_component(taskitemcomponent);
|
||
mounted = false;
|
||
run_all(dispose);
|
||
}
|
||
};
|
||
}
|
||
function create_fragment2(ctx) {
|
||
let if_block_anchor;
|
||
let current;
|
||
let if_block = (
|
||
/*$tracker*/
|
||
ctx[6].file && create_if_block(ctx)
|
||
);
|
||
return {
|
||
c() {
|
||
if (if_block)
|
||
if_block.c();
|
||
if_block_anchor = empty();
|
||
},
|
||
m(target, anchor) {
|
||
if (if_block)
|
||
if_block.m(target, anchor);
|
||
insert(target, if_block_anchor, anchor);
|
||
current = true;
|
||
},
|
||
p(ctx2, [dirty]) {
|
||
if (
|
||
/*$tracker*/
|
||
ctx2[6].file
|
||
) {
|
||
if (if_block) {
|
||
if_block.p(ctx2, dirty);
|
||
if (dirty & /*$tracker*/
|
||
64) {
|
||
transition_in(if_block, 1);
|
||
}
|
||
} else {
|
||
if_block = create_if_block(ctx2);
|
||
if_block.c();
|
||
transition_in(if_block, 1);
|
||
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
||
}
|
||
} else if (if_block) {
|
||
group_outros();
|
||
transition_out(if_block, 1, 1, () => {
|
||
if_block = null;
|
||
});
|
||
check_outros();
|
||
}
|
||
},
|
||
i(local) {
|
||
if (current)
|
||
return;
|
||
transition_in(if_block);
|
||
current = true;
|
||
},
|
||
o(local) {
|
||
transition_out(if_block);
|
||
current = false;
|
||
},
|
||
d(detaching) {
|
||
if (detaching) {
|
||
detach(if_block_anchor);
|
||
}
|
||
if (if_block)
|
||
if_block.d(detaching);
|
||
}
|
||
};
|
||
}
|
||
function instance2($$self, $$props, $$invalidate) {
|
||
let filtered;
|
||
let $settings;
|
||
let $tasks, $$unsubscribe_tasks = noop, $$subscribe_tasks = () => ($$unsubscribe_tasks(), $$unsubscribe_tasks = subscribe(tasks, ($$value) => $$invalidate(4, $tasks = $$value)), tasks);
|
||
let $tracker, $$unsubscribe_tracker = noop, $$subscribe_tracker = () => ($$unsubscribe_tracker(), $$unsubscribe_tracker = subscribe(tracker, ($$value) => $$invalidate(6, $tracker = $$value)), tracker);
|
||
component_subscribe($$self, settings, ($$value) => $$invalidate(22, $settings = $$value));
|
||
$$self.$$.on_destroy.push(() => $$unsubscribe_tasks());
|
||
$$self.$$.on_destroy.push(() => $$unsubscribe_tracker());
|
||
let { tasks } = $$props;
|
||
$$subscribe_tasks();
|
||
let { tracker } = $$props;
|
||
$$subscribe_tracker();
|
||
let { render } = $$props;
|
||
const r = (content, el) => {
|
||
render(content, el);
|
||
};
|
||
let status = "";
|
||
let query = "";
|
||
const activeTask = (task) => {
|
||
tracker.active(task);
|
||
};
|
||
const togglePinned = () => {
|
||
tracker.togglePinned();
|
||
};
|
||
const changeTaskName = (e) => {
|
||
let target = e.target;
|
||
tracker.setTaskName(target.value);
|
||
};
|
||
const removeTask = () => {
|
||
tracker.clear();
|
||
};
|
||
const progress = (item) => {
|
||
if (!$settings.showTaskProgress) {
|
||
return 0;
|
||
}
|
||
if (item.expected > 0 && item.actual >= 0) {
|
||
return (item.actual / item.expected * 100).toFixed(2);
|
||
}
|
||
return 0;
|
||
};
|
||
const progressText = (item) => {
|
||
let { actual, expected } = item;
|
||
if (expected > 0) {
|
||
let unfinished = expected - actual;
|
||
let max = Math.max(expected, actual);
|
||
if (max > 10) {
|
||
if (unfinished > 0) {
|
||
return `\u25CC x ${unfinished} \u{1F345} x ${actual}`;
|
||
} else {
|
||
return `\u{1F345} x ${expected} \u{1F96B} x ${Math.abs(unfinished)}`;
|
||
}
|
||
} else {
|
||
if (unfinished > 0) {
|
||
return `${"\u{1F345}".repeat(actual)}${"\u25CC".repeat(unfinished)}`;
|
||
} else {
|
||
return `${"\u{1F345}".repeat(expected)}${"\u{1F96B}".repeat(Math.abs(unfinished))}`;
|
||
}
|
||
}
|
||
} else {
|
||
return actual > 10 ? `\u{1F345} x ${actual}` : actual > 0 ? `${"\u{1F345}".repeat(actual)}` : `- -`;
|
||
}
|
||
};
|
||
const openFile = (e) => {
|
||
tracker.openFile(e);
|
||
};
|
||
const showTaskMenu = (task) => (e) => {
|
||
const menu = new import_obsidian3.Menu();
|
||
menu.addItem((item) => {
|
||
item.setTitle("Open").onClick(() => {
|
||
tracker.openTask(e, task);
|
||
});
|
||
});
|
||
menu.showAtMouseEvent(e);
|
||
};
|
||
const click_handler = () => $$invalidate(2, status = "");
|
||
const click_handler_1 = () => $$invalidate(2, status = "todo");
|
||
const click_handler_2 = () => $$invalidate(2, status = "completed");
|
||
function input_input_handler() {
|
||
query = this.value;
|
||
$$invalidate(3, query);
|
||
}
|
||
const click_handler_3 = (item) => {
|
||
activeTask(item);
|
||
};
|
||
$$self.$$set = ($$props2) => {
|
||
if ("tasks" in $$props2)
|
||
$$subscribe_tasks($$invalidate(0, tasks = $$props2.tasks));
|
||
if ("tracker" in $$props2)
|
||
$$subscribe_tracker($$invalidate(1, tracker = $$props2.tracker));
|
||
if ("render" in $$props2)
|
||
$$invalidate(16, render = $$props2.render);
|
||
};
|
||
$$self.$$.update = () => {
|
||
if ($$self.$$.dirty & /*$tasks, query, status*/
|
||
28) {
|
||
$:
|
||
$$invalidate(5, filtered = $tasks ? $tasks.list.filter((item) => {
|
||
let statusMatch = true;
|
||
let textMatch = true;
|
||
if (query) {
|
||
textMatch = item.name.toLowerCase().includes(query.toLowerCase());
|
||
}
|
||
if (status) {
|
||
if (status === "todo")
|
||
statusMatch = !item.checked;
|
||
if (status === "completed")
|
||
statusMatch = item.checked;
|
||
}
|
||
return statusMatch && textMatch;
|
||
}) : []);
|
||
}
|
||
};
|
||
return [
|
||
tasks,
|
||
tracker,
|
||
status,
|
||
query,
|
||
$tasks,
|
||
filtered,
|
||
$tracker,
|
||
r,
|
||
activeTask,
|
||
togglePinned,
|
||
changeTaskName,
|
||
removeTask,
|
||
progress,
|
||
progressText,
|
||
openFile,
|
||
showTaskMenu,
|
||
render,
|
||
click_handler,
|
||
click_handler_1,
|
||
click_handler_2,
|
||
input_input_handler,
|
||
click_handler_3
|
||
];
|
||
}
|
||
var TasksComponent = class extends SvelteComponent {
|
||
constructor(options) {
|
||
super();
|
||
init(this, options, instance2, create_fragment2, safe_not_equal, { tasks: 0, tracker: 1, render: 16 }, add_css2);
|
||
}
|
||
};
|
||
var TasksComponent_default = TasksComponent;
|
||
|
||
// src/TimerSettingsComponent.svelte
|
||
function add_css3(target) {
|
||
append_styles(target, "svelte-5jyrhn", ".pomodoro-settings-wrapper.svelte-5jyrhn.svelte-5jyrhn,.pomodoro-settings-list.svelte-5jyrhn.svelte-5jyrhn,.pomodoro-settings-item.svelte-5jyrhn.svelte-5jyrhn{width:100%}.pomodoro-settings-wrapper.svelte-5jyrhn.svelte-5jyrhn{border:1px solid var(--background-modifier-border);border-radius:5px}.pomodoro-settings-item.svelte-5jyrhn.svelte-5jyrhn{display:flex;font-size:0.8rem;align-items:center;justify-content:space-between;height:2rem;padding:0.5rem 1rem}.pomodoro-settings-item.svelte-5jyrhn+.pomodoro-settings-item.svelte-5jyrhn{border-top:1px solid var(--background-modifier-border)}.pomodoro-settings-item.svelte-5jyrhn input[type='number'].svelte-5jyrhn{font-size:0.8rem;border:none;border-radius:0;height:0.8rem;text-align:end;background:transparent}.pomodoro-settings-item.svelte-5jyrhn input[type='number'].svelte-5jyrhn:active{border:none;box-shadow:none}.pomodoro-settings-item.svelte-5jyrhn input[type='number'].svelte-5jyrhn:focus{border:none;box-shadow:none}");
|
||
}
|
||
function create_fragment3(ctx) {
|
||
let div16;
|
||
let div15;
|
||
let div2;
|
||
let div0;
|
||
let t1;
|
||
let div1;
|
||
let input0;
|
||
let input0_value_value;
|
||
let t2;
|
||
let div5;
|
||
let div3;
|
||
let t4;
|
||
let div4;
|
||
let input1;
|
||
let input1_value_value;
|
||
let t5;
|
||
let div8;
|
||
let div6;
|
||
let t7;
|
||
let div7;
|
||
let input2;
|
||
let t8;
|
||
let div11;
|
||
let div9;
|
||
let t10;
|
||
let div10;
|
||
let input3;
|
||
let t11;
|
||
let div14;
|
||
let div12;
|
||
let t13;
|
||
let div13;
|
||
let input4;
|
||
let mounted;
|
||
let dispose;
|
||
return {
|
||
c() {
|
||
div16 = element("div");
|
||
div15 = element("div");
|
||
div2 = element("div");
|
||
div0 = element("div");
|
||
div0.textContent = "Work";
|
||
t1 = space();
|
||
div1 = element("div");
|
||
input0 = element("input");
|
||
t2 = space();
|
||
div5 = element("div");
|
||
div3 = element("div");
|
||
div3.textContent = "Break";
|
||
t4 = space();
|
||
div4 = element("div");
|
||
input1 = element("input");
|
||
t5 = space();
|
||
div8 = element("div");
|
||
div6 = element("div");
|
||
div6.textContent = "Auto-start";
|
||
t7 = space();
|
||
div7 = element("div");
|
||
input2 = element("input");
|
||
t8 = space();
|
||
div11 = element("div");
|
||
div9 = element("div");
|
||
div9.textContent = "Notification Sound";
|
||
t10 = space();
|
||
div10 = element("div");
|
||
input3 = element("input");
|
||
t11 = space();
|
||
div14 = element("div");
|
||
div12 = element("div");
|
||
div12.textContent = "Prefer Saving to Task File";
|
||
t13 = space();
|
||
div13 = element("div");
|
||
input4 = element("input");
|
||
attr(div0, "class", "pomodoro-settings-label");
|
||
input0.value = input0_value_value = /*$settings*/
|
||
ctx[0].workLen;
|
||
attr(input0, "min", "1");
|
||
attr(input0, "type", "number");
|
||
attr(input0, "class", "svelte-5jyrhn");
|
||
attr(div1, "class", "pomodoro-settings-control");
|
||
attr(div2, "class", "pomodoro-settings-item svelte-5jyrhn");
|
||
attr(div3, "class", "pomodoro-settings-label");
|
||
input1.value = input1_value_value = /*$settings*/
|
||
ctx[0].breakLen;
|
||
attr(input1, "min", "0");
|
||
attr(input1, "type", "number");
|
||
attr(input1, "class", "svelte-5jyrhn");
|
||
attr(div4, "class", "pomodoro-settings-control");
|
||
attr(div5, "class", "pomodoro-settings-item svelte-5jyrhn");
|
||
attr(div6, "class", "pomodoro-settings-label");
|
||
attr(input2, "type", "checkbox");
|
||
attr(div7, "class", "pomodoro-settings-control");
|
||
attr(div8, "class", "pomodoro-settings-item svelte-5jyrhn");
|
||
attr(div9, "class", "pomodoro-settings-label");
|
||
attr(input3, "type", "checkbox");
|
||
attr(div10, "class", "pomodoro-settings-control");
|
||
attr(div11, "class", "pomodoro-settings-item svelte-5jyrhn");
|
||
attr(div12, "class", "pomodoro-settings-label");
|
||
attr(input4, "type", "checkbox");
|
||
attr(div13, "class", "pomodoro-settings-control");
|
||
attr(div14, "class", "pomodoro-settings-item svelte-5jyrhn");
|
||
attr(div15, "class", "pomodoro-settings-list svelte-5jyrhn");
|
||
attr(div16, "class", "pomodoro-settings-wrapper svelte-5jyrhn");
|
||
},
|
||
m(target, anchor) {
|
||
insert(target, div16, anchor);
|
||
append(div16, div15);
|
||
append(div15, div2);
|
||
append(div2, div0);
|
||
append(div2, t1);
|
||
append(div2, div1);
|
||
append(div1, input0);
|
||
append(div15, t2);
|
||
append(div15, div5);
|
||
append(div5, div3);
|
||
append(div5, t4);
|
||
append(div5, div4);
|
||
append(div4, input1);
|
||
append(div15, t5);
|
||
append(div15, div8);
|
||
append(div8, div6);
|
||
append(div8, t7);
|
||
append(div8, div7);
|
||
append(div7, input2);
|
||
input2.checked = /*$settings*/
|
||
ctx[0].autostart;
|
||
append(div15, t8);
|
||
append(div15, div11);
|
||
append(div11, div9);
|
||
append(div11, t10);
|
||
append(div11, div10);
|
||
append(div10, input3);
|
||
input3.checked = /*$settings*/
|
||
ctx[0].notificationSound;
|
||
append(div15, t11);
|
||
append(div15, div14);
|
||
append(div14, div12);
|
||
append(div14, t13);
|
||
append(div14, div13);
|
||
append(div13, input4);
|
||
input4.checked = /*$settings*/
|
||
ctx[0].logFocused;
|
||
if (!mounted) {
|
||
dispose = [
|
||
listen(
|
||
input0,
|
||
"change",
|
||
/*updateWorkLen*/
|
||
ctx[1]
|
||
),
|
||
listen(
|
||
input1,
|
||
"change",
|
||
/*updateBreakLen*/
|
||
ctx[2]
|
||
),
|
||
listen(
|
||
input2,
|
||
"change",
|
||
/*input2_change_handler*/
|
||
ctx[3]
|
||
),
|
||
listen(
|
||
input3,
|
||
"change",
|
||
/*input3_change_handler*/
|
||
ctx[4]
|
||
),
|
||
listen(
|
||
input4,
|
||
"change",
|
||
/*input4_change_handler*/
|
||
ctx[5]
|
||
)
|
||
];
|
||
mounted = true;
|
||
}
|
||
},
|
||
p(ctx2, [dirty]) {
|
||
if (dirty & /*$settings*/
|
||
1 && input0_value_value !== (input0_value_value = /*$settings*/
|
||
ctx2[0].workLen) && input0.value !== input0_value_value) {
|
||
input0.value = input0_value_value;
|
||
}
|
||
if (dirty & /*$settings*/
|
||
1 && input1_value_value !== (input1_value_value = /*$settings*/
|
||
ctx2[0].breakLen) && input1.value !== input1_value_value) {
|
||
input1.value = input1_value_value;
|
||
}
|
||
if (dirty & /*$settings*/
|
||
1) {
|
||
input2.checked = /*$settings*/
|
||
ctx2[0].autostart;
|
||
}
|
||
if (dirty & /*$settings*/
|
||
1) {
|
||
input3.checked = /*$settings*/
|
||
ctx2[0].notificationSound;
|
||
}
|
||
if (dirty & /*$settings*/
|
||
1) {
|
||
input4.checked = /*$settings*/
|
||
ctx2[0].logFocused;
|
||
}
|
||
},
|
||
i: noop,
|
||
o: noop,
|
||
d(detaching) {
|
||
if (detaching) {
|
||
detach(div16);
|
||
}
|
||
mounted = false;
|
||
run_all(dispose);
|
||
}
|
||
};
|
||
}
|
||
function instance3($$self, $$props, $$invalidate) {
|
||
let $settings;
|
||
component_subscribe($$self, settings, ($$value) => $$invalidate(0, $settings = $$value));
|
||
const updateWorkLen = (e) => {
|
||
const target = e.target;
|
||
const value = parseInt(target.value);
|
||
settings.update((s) => {
|
||
if (value >= 1) {
|
||
s.workLen = value;
|
||
}
|
||
target.value = s.workLen.toString();
|
||
return s;
|
||
});
|
||
};
|
||
const updateBreakLen = (e) => {
|
||
const target = e.target;
|
||
const value = parseInt(target.value);
|
||
settings.update((s) => {
|
||
if (value >= 0) {
|
||
s.breakLen = value;
|
||
}
|
||
target.value = s.workLen.toString();
|
||
return s;
|
||
});
|
||
};
|
||
function input2_change_handler() {
|
||
$settings.autostart = this.checked;
|
||
settings.set($settings);
|
||
}
|
||
function input3_change_handler() {
|
||
$settings.notificationSound = this.checked;
|
||
settings.set($settings);
|
||
}
|
||
function input4_change_handler() {
|
||
$settings.logFocused = this.checked;
|
||
settings.set($settings);
|
||
}
|
||
return [
|
||
$settings,
|
||
updateWorkLen,
|
||
updateBreakLen,
|
||
input2_change_handler,
|
||
input3_change_handler,
|
||
input4_change_handler
|
||
];
|
||
}
|
||
var TimerSettingsComponent = class extends SvelteComponent {
|
||
constructor(options) {
|
||
super();
|
||
init(this, options, instance3, create_fragment3, safe_not_equal, {}, add_css3);
|
||
}
|
||
};
|
||
var TimerSettingsComponent_default = TimerSettingsComponent;
|
||
|
||
// src/TimerViewComponent.svelte
|
||
function add_css4(target) {
|
||
append_styles(target, "svelte-1bkzjfd", ".container.svelte-1bkzjfd.svelte-1bkzjfd{width:100%;min-width:200px;display:flex;flex-direction:column;height:100%}.main.svelte-1bkzjfd.svelte-1bkzjfd{width:100%;display:flex;flex-direction:column;align-items:center;z-index:2}.timer.svelte-1bkzjfd.svelte-1bkzjfd{position:relative;width:160px;height:160px}.timer.svelte-1bkzjfd svg.svelte-1bkzjfd{-webkit-transform:rotate(-90deg);transform:rotate(-90deg);z-index:3}.timer-display.svelte-1bkzjfd.svelte-1bkzjfd{position:absolute;width:100%;height:160px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;z-index:4;padding:30px}.timer-text.svelte-1bkzjfd.svelte-1bkzjfd{display:block;color:var(--pomodoro-timer-text-color);font-size:1.1em;font-weight:bold;margin-block-start:1rem;margin-block-end:1.75rem}.status.svelte-1bkzjfd.svelte-1bkzjfd{font-size:0.7rem;display:flex;align-items:center}.status.svelte-1bkzjfd span.svelte-1bkzjfd{display:inline-block}.circle_timer.svelte-1bkzjfd.svelte-1bkzjfd{stroke:var(--pomodoro-timer-color)}.circle_animation.svelte-1bkzjfd.svelte-1bkzjfd{stroke-dasharray:440;stroke-dashoffset:440;stroke:var(--pomodoro-timer-elapsed-color)}.btn-group.svelte-1bkzjfd.svelte-1bkzjfd{margin-top:1rem;display:flex;justify-content:space-between;width:160px}.control.svelte-1bkzjfd.svelte-1bkzjfd{cursor:pointer}.control.svelte-1bkzjfd.svelte-1bkzjfd:hover{opacity:0.7}.control.svelte-1bkzjfd svg.svelte-1bkzjfd:active{opacity:0.5}.pomodoro-extra.svelte-1bkzjfd.svelte-1bkzjfd{width:100%;margin-top:2rem}.breath.svelte-1bkzjfd.svelte-1bkzjfd{width:5px;height:5px;margin-top:5px;display:inline-block;position:absolute;left:55px;background-color:var(--pomodoro-timer-dot-color);border-radius:5px;transform:translate(-50%, -50%);animation:svelte-1bkzjfd-blink 1s linear infinite}@keyframes svelte-1bkzjfd-blink{0%,100%{opacity:1}50%{opacity:0}}");
|
||
}
|
||
function create_if_block_42(ctx) {
|
||
let span;
|
||
return {
|
||
c() {
|
||
span = element("span");
|
||
attr(span, "class", "breath svelte-1bkzjfd");
|
||
},
|
||
m(target, anchor) {
|
||
insert(target, span, anchor);
|
||
},
|
||
d(detaching) {
|
||
if (detaching) {
|
||
detach(span);
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function create_else_block_12(ctx) {
|
||
let span;
|
||
return {
|
||
c() {
|
||
span = element("span");
|
||
span.textContent = "Break";
|
||
attr(span, "class", "mode svelte-1bkzjfd");
|
||
},
|
||
m(target, anchor) {
|
||
insert(target, span, anchor);
|
||
},
|
||
d(detaching) {
|
||
if (detaching) {
|
||
detach(span);
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function create_if_block_32(ctx) {
|
||
let span;
|
||
return {
|
||
c() {
|
||
span = element("span");
|
||
span.textContent = "Work";
|
||
attr(span, "class", "mode svelte-1bkzjfd");
|
||
},
|
||
m(target, anchor) {
|
||
insert(target, span, anchor);
|
||
},
|
||
d(detaching) {
|
||
if (detaching) {
|
||
detach(span);
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function create_else_block2(ctx) {
|
||
let span;
|
||
let mounted;
|
||
let dispose;
|
||
return {
|
||
c() {
|
||
span = element("span");
|
||
span.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-pause svelte-1bkzjfd"><rect width="4" height="16" x="6" y="4"></rect><rect width="4" height="16" x="14" y="4"></rect></svg>`;
|
||
attr(span, "class", "control svelte-1bkzjfd");
|
||
},
|
||
m(target, anchor) {
|
||
insert(target, span, anchor);
|
||
if (!mounted) {
|
||
dispose = listen(
|
||
span,
|
||
"click",
|
||
/*pause*/
|
||
ctx[9]
|
||
);
|
||
mounted = true;
|
||
}
|
||
},
|
||
p: noop,
|
||
d(detaching) {
|
||
if (detaching) {
|
||
detach(span);
|
||
}
|
||
mounted = false;
|
||
dispose();
|
||
}
|
||
};
|
||
}
|
||
function create_if_block_22(ctx) {
|
||
let span;
|
||
let mounted;
|
||
let dispose;
|
||
return {
|
||
c() {
|
||
span = element("span");
|
||
span.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-play svelte-1bkzjfd"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg>`;
|
||
attr(span, "class", "control svelte-1bkzjfd");
|
||
},
|
||
m(target, anchor) {
|
||
insert(target, span, anchor);
|
||
if (!mounted) {
|
||
dispose = listen(
|
||
span,
|
||
"click",
|
||
/*start*/
|
||
ctx[7]
|
||
);
|
||
mounted = true;
|
||
}
|
||
},
|
||
p: noop,
|
||
d(detaching) {
|
||
if (detaching) {
|
||
detach(span);
|
||
}
|
||
mounted = false;
|
||
dispose();
|
||
}
|
||
};
|
||
}
|
||
function create_if_block_12(ctx) {
|
||
let timersettingscomponent;
|
||
let current;
|
||
timersettingscomponent = new TimerSettingsComponent_default({});
|
||
return {
|
||
c() {
|
||
create_component(timersettingscomponent.$$.fragment);
|
||
},
|
||
m(target, anchor) {
|
||
mount_component(timersettingscomponent, target, anchor);
|
||
current = true;
|
||
},
|
||
p: noop,
|
||
i(local) {
|
||
if (current)
|
||
return;
|
||
transition_in(timersettingscomponent.$$.fragment, local);
|
||
current = true;
|
||
},
|
||
o(local) {
|
||
transition_out(timersettingscomponent.$$.fragment, local);
|
||
current = false;
|
||
},
|
||
d(detaching) {
|
||
destroy_component(timersettingscomponent, detaching);
|
||
}
|
||
};
|
||
}
|
||
function create_if_block2(ctx) {
|
||
let taskscomponent;
|
||
let current;
|
||
taskscomponent = new TasksComponent_default({
|
||
props: {
|
||
tasks: (
|
||
/*tasks*/
|
||
ctx[1]
|
||
),
|
||
tracker: (
|
||
/*tracker*/
|
||
ctx[2]
|
||
),
|
||
render: (
|
||
/*render*/
|
||
ctx[3]
|
||
)
|
||
}
|
||
});
|
||
return {
|
||
c() {
|
||
create_component(taskscomponent.$$.fragment);
|
||
},
|
||
m(target, anchor) {
|
||
mount_component(taskscomponent, target, anchor);
|
||
current = true;
|
||
},
|
||
p(ctx2, dirty) {
|
||
const taskscomponent_changes = {};
|
||
if (dirty & /*tasks*/
|
||
2)
|
||
taskscomponent_changes.tasks = /*tasks*/
|
||
ctx2[1];
|
||
if (dirty & /*tracker*/
|
||
4)
|
||
taskscomponent_changes.tracker = /*tracker*/
|
||
ctx2[2];
|
||
if (dirty & /*render*/
|
||
8)
|
||
taskscomponent_changes.render = /*render*/
|
||
ctx2[3];
|
||
taskscomponent.$set(taskscomponent_changes);
|
||
},
|
||
i(local) {
|
||
if (current)
|
||
return;
|
||
transition_in(taskscomponent.$$.fragment, local);
|
||
current = true;
|
||
},
|
||
o(local) {
|
||
transition_out(taskscomponent.$$.fragment, local);
|
||
current = false;
|
||
},
|
||
d(detaching) {
|
||
destroy_component(taskscomponent, detaching);
|
||
}
|
||
};
|
||
}
|
||
function create_fragment4(ctx) {
|
||
let div7;
|
||
let div5;
|
||
let div3;
|
||
let div2;
|
||
let div0;
|
||
let t0;
|
||
let t1;
|
||
let span0;
|
||
let t2;
|
||
let div1;
|
||
let span1;
|
||
let t3_value = (
|
||
/*$timer*/
|
||
ctx[4].remained.human + ""
|
||
);
|
||
let t3;
|
||
let t4;
|
||
let svg0;
|
||
let g;
|
||
let circle0;
|
||
let circle1;
|
||
let t5;
|
||
let div4;
|
||
let span2;
|
||
let t6;
|
||
let t7;
|
||
let span3;
|
||
let t8;
|
||
let span4;
|
||
let t9;
|
||
let div6;
|
||
let current_block_type_index;
|
||
let if_block3;
|
||
let current;
|
||
let mounted;
|
||
let dispose;
|
||
let if_block0 = (
|
||
/*$timer*/
|
||
ctx[4].running && create_if_block_42(ctx)
|
||
);
|
||
function select_block_type(ctx2, dirty) {
|
||
if (
|
||
/*$timer*/
|
||
ctx2[4].mode === "WORK"
|
||
)
|
||
return create_if_block_32;
|
||
return create_else_block_12;
|
||
}
|
||
let current_block_type = select_block_type(ctx, -1);
|
||
let if_block1 = current_block_type(ctx);
|
||
function select_block_type_1(ctx2, dirty) {
|
||
if (!/*$timer*/
|
||
ctx2[4].running)
|
||
return create_if_block_22;
|
||
return create_else_block2;
|
||
}
|
||
let current_block_type_1 = select_block_type_1(ctx, -1);
|
||
let if_block2 = current_block_type_1(ctx);
|
||
const if_block_creators = [create_if_block2, create_if_block_12];
|
||
const if_blocks = [];
|
||
function select_block_type_2(ctx2, dirty) {
|
||
if (
|
||
/*extra*/
|
||
ctx2[5] == "tasks"
|
||
)
|
||
return 0;
|
||
if (
|
||
/*extra*/
|
||
ctx2[5] == "settings"
|
||
)
|
||
return 1;
|
||
return -1;
|
||
}
|
||
if (~(current_block_type_index = select_block_type_2(ctx, -1))) {
|
||
if_block3 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
|
||
}
|
||
return {
|
||
c() {
|
||
div7 = element("div");
|
||
div5 = element("div");
|
||
div3 = element("div");
|
||
div2 = element("div");
|
||
div0 = element("div");
|
||
if (if_block0)
|
||
if_block0.c();
|
||
t0 = space();
|
||
if_block1.c();
|
||
t1 = space();
|
||
span0 = element("span");
|
||
t2 = space();
|
||
div1 = element("div");
|
||
span1 = element("span");
|
||
t3 = text(t3_value);
|
||
t4 = space();
|
||
svg0 = svg_element("svg");
|
||
g = svg_element("g");
|
||
circle0 = svg_element("circle");
|
||
circle1 = svg_element("circle");
|
||
t5 = space();
|
||
div4 = element("div");
|
||
span2 = element("span");
|
||
span2.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-list-todo svelte-1bkzjfd"><rect x="3" y="5" width="6" height="6" rx="1"></rect><path d="m3 17 2 2 4-4"></path><path d="M13 6h8"></path><path d="M13 12h8"></path><path d="M13 18h8"></path></svg>`;
|
||
t6 = space();
|
||
if_block2.c();
|
||
t7 = space();
|
||
span3 = element("span");
|
||
span3.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-ccw svelte-1bkzjfd"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"></path><path d="M3 3v5h5"></path></svg>`;
|
||
t8 = space();
|
||
span4 = element("span");
|
||
span4.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings-2 svelte-1bkzjfd"><path d="M20 7h-9"></path><path d="M14 17H5"></path><circle cx="17" cy="17" r="3"></circle><circle cx="7" cy="7" r="3"></circle></svg>`;
|
||
t9 = space();
|
||
div6 = element("div");
|
||
if (if_block3)
|
||
if_block3.c();
|
||
attr(span0, "class", "svelte-1bkzjfd");
|
||
attr(div0, "class", "status control svelte-1bkzjfd");
|
||
attr(span1, "class", "timer-text svelte-1bkzjfd");
|
||
attr(div1, "class", "control svelte-1bkzjfd");
|
||
attr(div2, "class", "timer-display svelte-1bkzjfd");
|
||
attr(circle0, "class", "circle_timer svelte-1bkzjfd");
|
||
attr(circle0, "r", "69.85699");
|
||
attr(circle0, "cy", "81");
|
||
attr(circle0, "cx", "81");
|
||
attr(circle0, "stroke-width", "2");
|
||
attr(circle0, "fill", "none");
|
||
attr(circle1, "class", "circle_animation svelte-1bkzjfd");
|
||
attr(circle1, "r", "69.85699");
|
||
attr(circle1, "cy", "81");
|
||
attr(circle1, "cx", "81");
|
||
attr(circle1, "stroke-width", "8");
|
||
attr(circle1, "fill", "none");
|
||
set_style(
|
||
circle1,
|
||
"stroke-dashoffset",
|
||
/*strokeOffset*/
|
||
ctx[6]
|
||
);
|
||
attr(svg0, "class", "timer svelte-1bkzjfd");
|
||
attr(svg0, "width", "160");
|
||
attr(svg0, "height", "160");
|
||
attr(svg0, "xmlns", "http://www.w3.org/2000/svg");
|
||
attr(div3, "class", "timer svelte-1bkzjfd");
|
||
attr(span2, "class", "control svelte-1bkzjfd");
|
||
attr(span3, "class", "control svelte-1bkzjfd");
|
||
attr(span4, "class", "control svelte-1bkzjfd");
|
||
attr(div4, "class", "btn-group svelte-1bkzjfd");
|
||
attr(div5, "class", "main svelte-1bkzjfd");
|
||
attr(div6, "class", "pomodoro-extra svelte-1bkzjfd");
|
||
attr(div7, "class", "container svelte-1bkzjfd");
|
||
},
|
||
m(target, anchor) {
|
||
insert(target, div7, anchor);
|
||
append(div7, div5);
|
||
append(div5, div3);
|
||
append(div3, div2);
|
||
append(div2, div0);
|
||
if (if_block0)
|
||
if_block0.m(div0, null);
|
||
append(div0, t0);
|
||
if_block1.m(div0, null);
|
||
append(div0, t1);
|
||
append(div0, span0);
|
||
append(div2, t2);
|
||
append(div2, div1);
|
||
append(div1, span1);
|
||
append(span1, t3);
|
||
append(div3, t4);
|
||
append(div3, svg0);
|
||
append(svg0, g);
|
||
append(g, circle0);
|
||
append(g, circle1);
|
||
append(div5, t5);
|
||
append(div5, div4);
|
||
append(div4, span2);
|
||
append(div4, t6);
|
||
if_block2.m(div4, null);
|
||
append(div4, t7);
|
||
append(div4, span3);
|
||
append(div4, t8);
|
||
append(div4, span4);
|
||
append(div7, t9);
|
||
append(div7, div6);
|
||
if (~current_block_type_index) {
|
||
if_blocks[current_block_type_index].m(div6, null);
|
||
}
|
||
current = true;
|
||
if (!mounted) {
|
||
dispose = [
|
||
listen(
|
||
div0,
|
||
"click",
|
||
/*toggleMode*/
|
||
ctx[11]
|
||
),
|
||
listen(
|
||
div1,
|
||
"click",
|
||
/*toggleTimer*/
|
||
ctx[10]
|
||
),
|
||
listen(
|
||
span2,
|
||
"click",
|
||
/*click_handler*/
|
||
ctx[13]
|
||
),
|
||
listen(
|
||
span3,
|
||
"click",
|
||
/*reset*/
|
||
ctx[8]
|
||
),
|
||
listen(
|
||
span4,
|
||
"click",
|
||
/*click_handler_1*/
|
||
ctx[14]
|
||
)
|
||
];
|
||
mounted = true;
|
||
}
|
||
},
|
||
p(ctx2, [dirty]) {
|
||
if (
|
||
/*$timer*/
|
||
ctx2[4].running
|
||
) {
|
||
if (if_block0) {
|
||
} else {
|
||
if_block0 = create_if_block_42(ctx2);
|
||
if_block0.c();
|
||
if_block0.m(div0, t0);
|
||
}
|
||
} else if (if_block0) {
|
||
if_block0.d(1);
|
||
if_block0 = null;
|
||
}
|
||
if (current_block_type !== (current_block_type = select_block_type(ctx2, dirty))) {
|
||
if_block1.d(1);
|
||
if_block1 = current_block_type(ctx2);
|
||
if (if_block1) {
|
||
if_block1.c();
|
||
if_block1.m(div0, t1);
|
||
}
|
||
}
|
||
if ((!current || dirty & /*$timer*/
|
||
16) && t3_value !== (t3_value = /*$timer*/
|
||
ctx2[4].remained.human + ""))
|
||
set_data(t3, t3_value);
|
||
if (!current || dirty & /*strokeOffset*/
|
||
64) {
|
||
set_style(
|
||
circle1,
|
||
"stroke-dashoffset",
|
||
/*strokeOffset*/
|
||
ctx2[6]
|
||
);
|
||
}
|
||
if (current_block_type_1 === (current_block_type_1 = select_block_type_1(ctx2, dirty)) && if_block2) {
|
||
if_block2.p(ctx2, dirty);
|
||
} else {
|
||
if_block2.d(1);
|
||
if_block2 = current_block_type_1(ctx2);
|
||
if (if_block2) {
|
||
if_block2.c();
|
||
if_block2.m(div4, t7);
|
||
}
|
||
}
|
||
let previous_block_index = current_block_type_index;
|
||
current_block_type_index = select_block_type_2(ctx2, dirty);
|
||
if (current_block_type_index === previous_block_index) {
|
||
if (~current_block_type_index) {
|
||
if_blocks[current_block_type_index].p(ctx2, dirty);
|
||
}
|
||
} else {
|
||
if (if_block3) {
|
||
group_outros();
|
||
transition_out(if_blocks[previous_block_index], 1, 1, () => {
|
||
if_blocks[previous_block_index] = null;
|
||
});
|
||
check_outros();
|
||
}
|
||
if (~current_block_type_index) {
|
||
if_block3 = if_blocks[current_block_type_index];
|
||
if (!if_block3) {
|
||
if_block3 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2);
|
||
if_block3.c();
|
||
} else {
|
||
if_block3.p(ctx2, dirty);
|
||
}
|
||
transition_in(if_block3, 1);
|
||
if_block3.m(div6, null);
|
||
} else {
|
||
if_block3 = null;
|
||
}
|
||
}
|
||
},
|
||
i(local) {
|
||
if (current)
|
||
return;
|
||
transition_in(if_block3);
|
||
current = true;
|
||
},
|
||
o(local) {
|
||
transition_out(if_block3);
|
||
current = false;
|
||
},
|
||
d(detaching) {
|
||
if (detaching) {
|
||
detach(div7);
|
||
}
|
||
if (if_block0)
|
||
if_block0.d();
|
||
if_block1.d();
|
||
if_block2.d();
|
||
if (~current_block_type_index) {
|
||
if_blocks[current_block_type_index].d();
|
||
}
|
||
mounted = false;
|
||
run_all(dispose);
|
||
}
|
||
};
|
||
}
|
||
var offset = 440;
|
||
function instance4($$self, $$props, $$invalidate) {
|
||
let strokeOffset;
|
||
let $timer, $$unsubscribe_timer = noop, $$subscribe_timer = () => ($$unsubscribe_timer(), $$unsubscribe_timer = subscribe(timer, ($$value) => $$invalidate(4, $timer = $$value)), timer);
|
||
$$self.$$.on_destroy.push(() => $$unsubscribe_timer());
|
||
let { timer } = $$props;
|
||
$$subscribe_timer();
|
||
let { tasks } = $$props;
|
||
let { tracker } = $$props;
|
||
let { render } = $$props;
|
||
let extra = "tasks";
|
||
const start = () => {
|
||
if (!$timer.running) {
|
||
timer.start();
|
||
}
|
||
};
|
||
const reset = () => {
|
||
timer.reset();
|
||
};
|
||
const pause = () => {
|
||
if ($timer.running) {
|
||
timer.pause();
|
||
}
|
||
};
|
||
const toggleTimer = () => {
|
||
timer.toggleTimer();
|
||
};
|
||
const toggleMode = () => {
|
||
timer.toggleMode();
|
||
};
|
||
const toggleExtra = (value) => {
|
||
if (extra === value) {
|
||
$$invalidate(5, extra = "close");
|
||
return;
|
||
}
|
||
$$invalidate(5, extra = value);
|
||
};
|
||
const click_handler = () => {
|
||
toggleExtra("tasks");
|
||
};
|
||
const click_handler_1 = () => {
|
||
toggleExtra("settings");
|
||
};
|
||
$$self.$$set = ($$props2) => {
|
||
if ("timer" in $$props2)
|
||
$$subscribe_timer($$invalidate(0, timer = $$props2.timer));
|
||
if ("tasks" in $$props2)
|
||
$$invalidate(1, tasks = $$props2.tasks);
|
||
if ("tracker" in $$props2)
|
||
$$invalidate(2, tracker = $$props2.tracker);
|
||
if ("render" in $$props2)
|
||
$$invalidate(3, render = $$props2.render);
|
||
};
|
||
$$self.$$.update = () => {
|
||
if ($$self.$$.dirty & /*$timer*/
|
||
16) {
|
||
$:
|
||
$$invalidate(6, strokeOffset = $timer.remained.millis * offset / $timer.count);
|
||
}
|
||
};
|
||
return [
|
||
timer,
|
||
tasks,
|
||
tracker,
|
||
render,
|
||
$timer,
|
||
extra,
|
||
strokeOffset,
|
||
start,
|
||
reset,
|
||
pause,
|
||
toggleTimer,
|
||
toggleMode,
|
||
toggleExtra,
|
||
click_handler,
|
||
click_handler_1
|
||
];
|
||
}
|
||
var TimerViewComponent = class extends SvelteComponent {
|
||
constructor(options) {
|
||
super();
|
||
init(
|
||
this,
|
||
options,
|
||
instance4,
|
||
create_fragment4,
|
||
safe_not_equal,
|
||
{
|
||
timer: 0,
|
||
tasks: 1,
|
||
tracker: 2,
|
||
render: 3
|
||
},
|
||
add_css4
|
||
);
|
||
}
|
||
};
|
||
var TimerViewComponent_default = TimerViewComponent;
|
||
|
||
// src/TimerView.ts
|
||
var import_obsidian5 = require("obsidian");
|
||
var VIEW_TYPE_TIMER = "timer-view";
|
||
var TimerView = class extends import_obsidian4.ItemView {
|
||
constructor(plugin, leaf) {
|
||
super(leaf);
|
||
this.plugin = plugin;
|
||
this.icon = "timer";
|
||
}
|
||
getViewType() {
|
||
return VIEW_TYPE_TIMER;
|
||
}
|
||
getDisplayText() {
|
||
return "Timer";
|
||
}
|
||
async onOpen() {
|
||
this.component = new TimerViewComponent_default({
|
||
target: this.contentEl,
|
||
props: {
|
||
timer: this.plugin.timer,
|
||
tasks: this.plugin.tasks,
|
||
tracker: this.plugin.tracker,
|
||
render: (content, el) => {
|
||
import_obsidian5.MarkdownRenderer.render(
|
||
this.plugin.app,
|
||
content,
|
||
el,
|
||
"",
|
||
this
|
||
);
|
||
}
|
||
}
|
||
});
|
||
}
|
||
async onClose() {
|
||
var _a;
|
||
(_a = this.component) == null ? void 0 : _a.$destroy();
|
||
}
|
||
};
|
||
|
||
// src/main.ts
|
||
var import_obsidian10 = require("obsidian");
|
||
|
||
// src/StatusBarComponent.svelte
|
||
var import_obsidian8 = require("obsidian");
|
||
|
||
// src/clock.worker.ts
|
||
function inlineWorker() {
|
||
let blob = new Blob(['"use strict";var e=!1,s=()=>{e&&(self.postMessage(new Date().getTime()),requestAnimationFrame(s))};self.onmessage=async({data:n})=>{n?e||(e=!0,s()):e=!1};\n'], { type: "text/javascript" });
|
||
let url = URL.createObjectURL(blob);
|
||
let worker = new Worker(url);
|
||
URL.revokeObjectURL(url);
|
||
return worker;
|
||
}
|
||
|
||
// src/Timer.ts
|
||
var import_obsidian7 = require("obsidian");
|
||
|
||
// src/Logger.ts
|
||
var import_obsidian6 = require("obsidian");
|
||
var Logger = class {
|
||
constructor(plugin) {
|
||
this.plugin = plugin;
|
||
}
|
||
async log(ctx) {
|
||
const logFile = await this.resolveLogFile(ctx);
|
||
const log = this.createLog(ctx);
|
||
if (logFile) {
|
||
const logText = await this.toText(log, logFile);
|
||
if (logText) {
|
||
await this.plugin.app.vault.append(logFile, `
|
||
${logText}`);
|
||
}
|
||
}
|
||
return logFile;
|
||
}
|
||
async resolveLogFile(ctx) {
|
||
const settings2 = this.plugin.getSettings();
|
||
if (settings2.logLevel !== "ALL" && settings2.logLevel !== ctx.mode) {
|
||
return;
|
||
}
|
||
if (settings2.logFocused && ctx.task.path && ctx.task.path.endsWith("md")) {
|
||
const file = this.plugin.app.vault.getAbstractFileByPath(
|
||
ctx.task.path
|
||
);
|
||
if (file && file instanceof import_obsidian6.TFile) {
|
||
return file;
|
||
}
|
||
}
|
||
if (settings2.logFile === "NONE") {
|
||
return;
|
||
}
|
||
if (settings2.logFile === "DAILY") {
|
||
return await getDailyNoteFile();
|
||
}
|
||
if (settings2.logFile === "FILE") {
|
||
if (settings2.logPath) {
|
||
let path = settings2.logPath;
|
||
if (!path.endsWith("md")) {
|
||
path += ".md";
|
||
}
|
||
try {
|
||
return await ensureFileExists(this.plugin.app, path);
|
||
} catch (error) {
|
||
if (error instanceof Error) {
|
||
new import_obsidian6.Notice(error.message);
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
createLog(ctx) {
|
||
return {
|
||
mode: ctx.mode,
|
||
duration: Math.floor(ctx.elapsed / 6e4),
|
||
begin: ctx.startTime,
|
||
end: new Date().getTime(),
|
||
session: ctx.duration,
|
||
task: ctx.task,
|
||
finished: ctx.count == ctx.elapsed
|
||
};
|
||
}
|
||
async toText(log, file) {
|
||
const settings2 = this.plugin.getSettings();
|
||
if (settings2.logFormat === "CUSTOM" && getTemplater(this.plugin.app)) {
|
||
try {
|
||
return await parseWithTemplater(
|
||
this.plugin.app,
|
||
file,
|
||
settings2.logTemplate,
|
||
log
|
||
);
|
||
} catch (e) {
|
||
new import_obsidian6.Notice("Invalid template");
|
||
console.error("invalid templat:", e);
|
||
return "";
|
||
}
|
||
} else {
|
||
if (!log.finished) {
|
||
return "";
|
||
}
|
||
let begin = (0, import_obsidian6.moment)(log.begin);
|
||
let end = (0, import_obsidian6.moment)(log.end);
|
||
if (settings2.logFormat === "SIMPLE") {
|
||
return `**${log.mode}(${log.duration}m)**: ${begin.format(
|
||
"HH:mm"
|
||
)} - ${end.format("HH:mm")}`;
|
||
}
|
||
if (settings2.logFormat === "VERBOSE") {
|
||
const emoji = log.mode == "WORK" ? "\u{1F345}" : "\u{1F964}";
|
||
return `- ${emoji} (pomodoro::${log.mode}) (duration:: ${log.duration}m) (begin:: ${begin.format(
|
||
"YYYY-MM-DD HH:mm"
|
||
)}) - (end:: ${end.format("YYYY-MM-DD HH:mm")})`;
|
||
}
|
||
return "";
|
||
}
|
||
}
|
||
};
|
||
|
||
// src/Notification.ts
|
||
var Notification_default = "data:audio/ogg;base64,T2dnUwACAAAAAAAAAACJwwLMAAAAAJ4PAf8BHgF2b3JiaXMAAAAAAkSsAAAAAAAAgLUBAAAAAAC4AU9nZ1MAAAAAAAAAAAAAicMCzAEAAAC2HLmLEUH///////////////////8HA3ZvcmJpcw0AAABMYXZmNTguNzYuMTAwAQAAACAAAABlbmNvZGVyPUxhdmM1OC4xMzQuMTAwIGxpYnZvcmJpcwEFdm9yYmlzJUJDVgEAQAAAJHMYKkalcxaEEBpCUBnjHELOa+wZQkwRghwyTFvLJXOQIaSgQohbKIHQkFUAAEAAAIdBeBSEikEIIYQlPViSgyc9CCGEiDl4FIRpQQghhBBCCCGEEEIIIYRFOWiSgydBCB2E4zA4DIPlOPgchEU5WBCDJ0HoIIQPQriag6w5CCGEJDVIUIMGOegchMIsKIqCxDC4FoQENSiMguQwyNSDC0KImoNJNfgahGdBeBaEaUEIIYQkQUiQgwZByBiERkFYkoMGObgUhMtBqBqEKjkIH4QgNGQVAJAAAKCiKIqiKAoQGrIKAMgAABBAURTHcRzJkRzJsRwLCA1ZBQAAAQAIAACgSIqkSI7kSJIkWZIlWZIlWZLmiaosy7Isy7IsyzIQGrIKAEgAAFBRDEVxFAcIDVkFAGQAAAigOIqlWIqlaIrniI4IhIasAgCAAAAEAAAQNENTPEeURM9UVde2bdu2bdu2bdu2bdu2bVuWZRkIDVkFAEAAABDSaWapBogwAxkGQkNWAQAIAACAEYowxIDQkFUAAEAAAIAYSg6iCa0535zjoFkOmkqxOR2cSLV5kpu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lzzDnnpJTOOeecc1JK5pxzzjkppXPOOeeclFJK55xzTkopJYTOQSellNI555wTAABU4AAAEGCjyOYEI0GFhqwEAFIBAAyOY1ma5nmiaJqWJGma53meKJqmJkma5nmeJ4qqyfM8TxRF0TRVled5niiKommqKtcVRdM0TVVVXbIsiqZpmqrqujBN01RV13VdmKZpqqrrui5sW1VV1XVlGbatqqrqurIMXNd1ZdmWgSy7ruzasgAA8AQHAKACG1ZHOCkaCyw0ZCUAkAEAQBiDkEIIIWUQQgohhJRSCAkAABhwAAAIMKEMFBqyEgBIBQAAjLHWWmuttdZAZ6211lprrYDMWmuttdZaa6211lprrbXWUmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaay2llFJKKaWUUkoppZRSSimllFJKBQD6VTgA+D/YsDrCSdFYYKEhKwGAcAAAwBilGHMMQimlVAgx5px0VFqLsUKIMeckpNRabMVzzkEoIZXWYiyecw5CKSnFVmNRKYRSUkottliLSqGjklJKrdVYjDGppNZai63GYoxJKbTUWosxFiNsTam12GqrsRhjayottBhjjMUIX2RsLabaag3GCCNbLC3VWmswxhjdW4ultpqLMT742lIsMdZcAAB3gwMARIKNM6wknRWOBhcashIACAkAIBBSijHGGHPOOeekUow55pxzDkIIoVSKMcaccw5CCCGUjDHmnHMQQgghhFJKxpxzEEIIIYSQUuqccxBCCCGEEEopnXMOQgghhBBCKaWDEEIIIYQQSiilpBRCCCGEEEIIqaSUQgghhFJCKCGVlFIIIYQQQiklpJRSCiGEUkIIoYSUUkophRBCCKWUklJKKaUSSgklhBJSKSmlFEoIIZRSSkoppVRKCaGEEkopJaWUUkohhBBKKQUAABw4AAAEGEEnGVUWYaMJFx6AQkNWAgBkAACQopRSKS1FgiKlGKQYS0YVc1BaiqhyDFLNqVLOIOYklogxhJSTVDLmFEIMQuocdUwpBi2VGELGGKTYckuhcw4AAABBAICAkAAAAwQFMwDA4ADhcxB0AgRHGwCAIERmiETDQnB4UAkQEVMBQGKCQ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abfBraJEXtqnpGhgAJX590fr/+wwZ0IftGBshMX50QQPqx0DUr1gCd0NNzTjIhFbzwevr7YqMtqtWBZPdSdGauKcC72WxAisERmonmr1C/JMN6QNvQFDv6jB9iOsZb+d9CwBsEgyNXAT6m/N9H/AIDBjCW/O9MXzoDbgAAGFBhMQBUqliJsIogVSEYAFA1AH3FikpeMFTVUKHq1dYwjjR3APRPq9MNSzxxLDh4j1ft6d7Tl6mnx8wI8LwH7pfIrl/Loj0fpieXC9eADAAS6P3ZMsiyDJDYrahUvv8XqVTOCwubdpieaEMTwNs0vanrlkB7ReqS1rHzc/L2lot1fS5TB1nOCVQcbAA=";
|
||
|
||
// src/Timer.ts
|
||
var DEFAULT_TASK = {
|
||
actual: 0,
|
||
expected: 0,
|
||
path: "",
|
||
fileName: "",
|
||
text: "",
|
||
name: "",
|
||
status: "",
|
||
blockLink: "",
|
||
checked: false,
|
||
done: "",
|
||
due: "",
|
||
created: "",
|
||
cancelled: "",
|
||
scheduled: "",
|
||
start: "",
|
||
description: "",
|
||
priority: "",
|
||
recurrence: "",
|
||
tags: [],
|
||
line: -1
|
||
};
|
||
var _Timer = class {
|
||
constructor(plugin) {
|
||
this.unsubscribers = [];
|
||
this.plugin = plugin;
|
||
this.logger = new Logger(plugin);
|
||
let count = this.toMillis(plugin.getSettings().workLen);
|
||
this.state = {
|
||
autostart: plugin.getSettings().autostart,
|
||
workLen: plugin.getSettings().workLen,
|
||
breakLen: plugin.getSettings().breakLen,
|
||
running: false,
|
||
lastTick: 0,
|
||
mode: "WORK",
|
||
elapsed: 0,
|
||
startTime: null,
|
||
inSession: false,
|
||
duration: plugin.getSettings().workLen,
|
||
count
|
||
};
|
||
let store = writable(this.state);
|
||
this.update = store.update;
|
||
this.store = derived(store, ($state) => ({
|
||
...$state,
|
||
remained: this.remain($state.count, $state.elapsed),
|
||
finished: $state.count == $state.elapsed
|
||
}));
|
||
this.subscribe = this.store.subscribe;
|
||
this.unsubscribers.push(
|
||
this.store.subscribe((state) => {
|
||
this.state = state;
|
||
})
|
||
);
|
||
this.clock = inlineWorker();
|
||
this.clock.onmessage = ({ data }) => {
|
||
this.tick(data);
|
||
};
|
||
}
|
||
remain(count, elapsed) {
|
||
let remained = count - elapsed;
|
||
let min = Math.floor(remained / 6e4);
|
||
let sec = Math.floor(remained % 6e4 / 1e3);
|
||
let minStr = min < 10 ? `0${min}` : min.toString();
|
||
let secStr = sec < 10 ? `0${sec}` : sec.toString();
|
||
return {
|
||
millis: remained,
|
||
human: `${minStr} : ${secStr}`
|
||
};
|
||
}
|
||
toMillis(minutes) {
|
||
return minutes * 60 * 1e3;
|
||
}
|
||
tick(t) {
|
||
let timeup = false;
|
||
let pause = false;
|
||
this.update((s) => {
|
||
if (s.running && s.lastTick) {
|
||
let diff = t - s.lastTick;
|
||
s.lastTick = t;
|
||
s.elapsed += diff;
|
||
if (s.elapsed >= s.count) {
|
||
s.elapsed = s.count;
|
||
}
|
||
timeup = s.elapsed >= s.count;
|
||
} else {
|
||
pause = true;
|
||
}
|
||
return s;
|
||
});
|
||
if (!pause && timeup) {
|
||
this.timeup();
|
||
}
|
||
}
|
||
timeup() {
|
||
let autostart = false;
|
||
this.update((state) => {
|
||
const ctx = this.createLogContext(state);
|
||
this.processLog(ctx);
|
||
autostart = state.autostart;
|
||
return this.endSession(state);
|
||
});
|
||
if (autostart) {
|
||
this.start();
|
||
}
|
||
}
|
||
createLogContext(s) {
|
||
var _a, _b, _c, _d, _e, _f, _g;
|
||
let state = { ...s };
|
||
let task = ((_a = this.plugin.tracker) == null ? void 0 : _a.task) ? { ...this.plugin.tracker.task } : { ...DEFAULT_TASK };
|
||
if (!task.path) {
|
||
task.path = (_d = (_c = (_b = this.plugin.tracker) == null ? void 0 : _b.file) == null ? void 0 : _c.path) != null ? _d : "";
|
||
task.fileName = (_g = (_f = (_e = this.plugin.tracker) == null ? void 0 : _e.file) == null ? void 0 : _f.name) != null ? _g : "";
|
||
}
|
||
return { ...state, task };
|
||
}
|
||
async processLog(ctx) {
|
||
var _a;
|
||
if (ctx.mode == "WORK") {
|
||
await ((_a = this.plugin.tracker) == null ? void 0 : _a.updateActual());
|
||
}
|
||
const logFile = await this.logger.log(ctx);
|
||
this.notify(ctx, logFile);
|
||
}
|
||
start() {
|
||
this.update((s) => {
|
||
let now2 = new Date().getTime();
|
||
if (!s.inSession) {
|
||
s.elapsed = 0;
|
||
s.duration = s.mode === "WORK" ? s.workLen : s.breakLen;
|
||
s.count = s.duration * 60 * 1e3;
|
||
s.startTime = now2;
|
||
}
|
||
s.lastTick = now2;
|
||
s.inSession = true;
|
||
s.running = true;
|
||
this.clock.postMessage(true);
|
||
return s;
|
||
});
|
||
}
|
||
endSession(state) {
|
||
if (state.breakLen == 0) {
|
||
state.mode = "WORK";
|
||
} else {
|
||
state.mode = state.mode == "WORK" ? "BREAK" : "WORK";
|
||
}
|
||
state.duration = state.mode == "WORK" ? state.workLen : state.breakLen;
|
||
state.count = state.duration * 60 * 1e3;
|
||
state.inSession = false;
|
||
state.running = false;
|
||
this.clock.postMessage(false);
|
||
state.startTime = null;
|
||
state.elapsed = 0;
|
||
return state;
|
||
}
|
||
notify(state, logFile) {
|
||
const emoji = state.mode == "WORK" ? "\u{1F345}" : "\u{1F964}";
|
||
const text2 = `${emoji} You have been ${state.mode === "WORK" ? "working" : "breaking"} for ${state.duration} minutes.`;
|
||
if (this.plugin.getSettings().useSystemNotification) {
|
||
const Notification = require("electron").remote.Notification;
|
||
const sysNotification = new Notification({
|
||
title: "Pomodoro Timer",
|
||
body: text2,
|
||
silent: true
|
||
});
|
||
sysNotification.on("click", () => {
|
||
if (logFile) {
|
||
this.plugin.app.workspace.getLeaf("split").openFile(logFile);
|
||
}
|
||
sysNotification.close();
|
||
});
|
||
sysNotification.show();
|
||
} else {
|
||
let fragment = new DocumentFragment();
|
||
let span = fragment.createEl("span");
|
||
span.setText(`${text2}`);
|
||
fragment.addEventListener("click", () => {
|
||
if (logFile) {
|
||
this.plugin.app.workspace.getLeaf("split").openFile(logFile);
|
||
}
|
||
});
|
||
new import_obsidian7.Notice(fragment);
|
||
}
|
||
if (this.plugin.getSettings().notificationSound) {
|
||
this.playAudio();
|
||
}
|
||
}
|
||
pause() {
|
||
this.update((state) => {
|
||
state.running = false;
|
||
this.clock.postMessage(false);
|
||
return state;
|
||
});
|
||
}
|
||
reset() {
|
||
this.update((state) => {
|
||
if (state.elapsed > 0) {
|
||
this.logger.log(this.createLogContext(state));
|
||
}
|
||
state.duration = state.mode == "WORK" ? state.workLen : state.breakLen;
|
||
state.count = state.duration * 60 * 1e3;
|
||
state.inSession = false;
|
||
state.running = false;
|
||
if (!this.plugin.tracker.pinned) {
|
||
this.plugin.tracker.clear();
|
||
}
|
||
this.clock.postMessage(false);
|
||
state.startTime = null;
|
||
state.elapsed = 0;
|
||
return state;
|
||
});
|
||
}
|
||
toggleMode(callback) {
|
||
this.update((s) => {
|
||
let updated = this.endSession(s);
|
||
if (callback) {
|
||
callback(updated);
|
||
}
|
||
return updated;
|
||
});
|
||
}
|
||
toggleTimer() {
|
||
this.state.running ? this.pause() : this.start();
|
||
}
|
||
playAudio() {
|
||
let audio = _Timer.DEFAULT_NOTIFICATION_AUDIO;
|
||
let customSound = this.plugin.getSettings().customSound;
|
||
if (customSound) {
|
||
const soundFile = this.plugin.app.vault.getAbstractFileByPath(customSound);
|
||
if (soundFile && soundFile instanceof import_obsidian7.TFile) {
|
||
const soundSrc = this.plugin.app.vault.getResourcePath(soundFile);
|
||
audio = new Audio(soundSrc);
|
||
}
|
||
}
|
||
audio.play();
|
||
}
|
||
setupTimer() {
|
||
this.update((state) => {
|
||
const { workLen, breakLen, autostart } = this.plugin.getSettings();
|
||
state.workLen = workLen;
|
||
state.breakLen = breakLen;
|
||
state.autostart = autostart;
|
||
if (!state.running && !state.inSession) {
|
||
state.duration = state.mode == "WORK" ? state.workLen : state.breakLen;
|
||
state.count = state.duration * 60 * 1e3;
|
||
}
|
||
return state;
|
||
});
|
||
}
|
||
destroy() {
|
||
var _a;
|
||
this.pause();
|
||
(_a = this.clock) == null ? void 0 : _a.terminate();
|
||
for (let unsub of this.unsubscribers) {
|
||
unsub();
|
||
}
|
||
}
|
||
};
|
||
var Timer = _Timer;
|
||
Timer.DEFAULT_NOTIFICATION_AUDIO = new Audio(Notification_default);
|
||
|
||
// src/StatusBarComponent.svelte
|
||
function add_css5(target) {
|
||
append_styles(target, "svelte-1azmbrd", ".item-icon.svelte-1azmbrd{padding-top:0}.st-timer.svelte-1azmbrd{display:inline-flex;align-items:center}");
|
||
}
|
||
function create_if_block3(ctx) {
|
||
let span1;
|
||
let span0;
|
||
let t0;
|
||
let t1_value = (
|
||
/*$store*/
|
||
ctx[2].remained.human + ""
|
||
);
|
||
let t1;
|
||
let mounted;
|
||
let dispose;
|
||
function select_block_type(ctx2, dirty) {
|
||
if (
|
||
/*$store*/
|
||
ctx2[2].running
|
||
)
|
||
return create_if_block_13;
|
||
return create_else_block3;
|
||
}
|
||
let current_block_type = select_block_type(ctx, -1);
|
||
let if_block = current_block_type(ctx);
|
||
return {
|
||
c() {
|
||
span1 = element("span");
|
||
span0 = element("span");
|
||
if_block.c();
|
||
t0 = space();
|
||
t1 = text(t1_value);
|
||
set_style(span0, "margin-right", "3px");
|
||
attr(span0, "class", "item-icon svelte-1azmbrd");
|
||
attr(span1, "class", "st-timer svelte-1azmbrd");
|
||
},
|
||
m(target, anchor) {
|
||
insert(target, span1, anchor);
|
||
append(span1, span0);
|
||
if_block.m(span0, null);
|
||
append(span1, t0);
|
||
append(span1, t1);
|
||
ctx[7](span1);
|
||
if (!mounted) {
|
||
dispose = [
|
||
listen(
|
||
span1,
|
||
"click",
|
||
/*toggleTimer*/
|
||
ctx[4]
|
||
),
|
||
listen(
|
||
span1,
|
||
"contextmenu",
|
||
/*ctxMenu*/
|
||
ctx[5]
|
||
)
|
||
];
|
||
mounted = true;
|
||
}
|
||
},
|
||
p(ctx2, dirty) {
|
||
if (current_block_type !== (current_block_type = select_block_type(ctx2, dirty))) {
|
||
if_block.d(1);
|
||
if_block = current_block_type(ctx2);
|
||
if (if_block) {
|
||
if_block.c();
|
||
if_block.m(span0, null);
|
||
}
|
||
}
|
||
if (dirty & /*$store*/
|
||
4 && t1_value !== (t1_value = /*$store*/
|
||
ctx2[2].remained.human + ""))
|
||
set_data(t1, t1_value);
|
||
},
|
||
d(detaching) {
|
||
if (detaching) {
|
||
detach(span1);
|
||
}
|
||
if_block.d();
|
||
ctx[7](null);
|
||
mounted = false;
|
||
run_all(dispose);
|
||
}
|
||
};
|
||
}
|
||
function create_else_block3(ctx) {
|
||
let svg;
|
||
let path0;
|
||
let path1;
|
||
let path2;
|
||
let path3;
|
||
let path4;
|
||
return {
|
||
c() {
|
||
svg = svg_element("svg");
|
||
path0 = svg_element("path");
|
||
path1 = svg_element("path");
|
||
path2 = svg_element("path");
|
||
path3 = svg_element("path");
|
||
path4 = svg_element("path");
|
||
attr(path0, "d", "M10 2h4");
|
||
attr(path1, "d", "M4.6 11a8 8 0 0 0 1.7 8.7 8 8 0 0 0 8.7 1.7");
|
||
attr(path2, "d", "M7.4 7.4a8 8 0 0 1 10.3 1 8 8 0 0 1 .9 10.2");
|
||
attr(path3, "d", "m2 2 20 20");
|
||
attr(path4, "d", "M12 12v-2");
|
||
attr(svg, "xmlns", "http://www.w3.org/2000/svg");
|
||
attr(svg, "width", "16");
|
||
attr(svg, "height", "16");
|
||
attr(svg, "viewBox", "0 0 24 24");
|
||
attr(svg, "fill", "none");
|
||
attr(svg, "stroke", "currentColor");
|
||
attr(svg, "stroke-width", "2");
|
||
attr(svg, "stroke-linecap", "round");
|
||
attr(svg, "stroke-linejoin", "round");
|
||
attr(svg, "class", "lucide lucide-timer-off");
|
||
},
|
||
m(target, anchor) {
|
||
insert(target, svg, anchor);
|
||
append(svg, path0);
|
||
append(svg, path1);
|
||
append(svg, path2);
|
||
append(svg, path3);
|
||
append(svg, path4);
|
||
},
|
||
d(detaching) {
|
||
if (detaching) {
|
||
detach(svg);
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function create_if_block_13(ctx) {
|
||
let svg;
|
||
let line0;
|
||
let line1;
|
||
let circle;
|
||
return {
|
||
c() {
|
||
svg = svg_element("svg");
|
||
line0 = svg_element("line");
|
||
line1 = svg_element("line");
|
||
circle = svg_element("circle");
|
||
attr(line0, "x1", "10");
|
||
attr(line0, "x2", "14");
|
||
attr(line0, "y1", "2");
|
||
attr(line0, "y2", "2");
|
||
attr(line1, "x1", "12");
|
||
attr(line1, "x2", "15");
|
||
attr(line1, "y1", "14");
|
||
attr(line1, "y2", "11");
|
||
attr(circle, "cx", "12");
|
||
attr(circle, "cy", "14");
|
||
attr(circle, "r", "8");
|
||
attr(svg, "xmlns", "http://www.w3.org/2000/svg");
|
||
attr(svg, "width", "16");
|
||
attr(svg, "height", "16");
|
||
attr(svg, "viewBox", "0 0 24 24");
|
||
attr(svg, "fill", "none");
|
||
attr(svg, "stroke", "currentColor");
|
||
attr(svg, "stroke-width", "2");
|
||
attr(svg, "stroke-linecap", "round");
|
||
attr(svg, "stroke-linejoin", "round");
|
||
attr(svg, "class", "lucide lucide-timer");
|
||
},
|
||
m(target, anchor) {
|
||
insert(target, svg, anchor);
|
||
append(svg, line0);
|
||
append(svg, line1);
|
||
append(svg, circle);
|
||
},
|
||
d(detaching) {
|
||
if (detaching) {
|
||
detach(svg);
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function create_fragment5(ctx) {
|
||
let if_block_anchor;
|
||
let if_block = (
|
||
/*$settings*/
|
||
ctx[3].useStatusBarTimer && create_if_block3(ctx)
|
||
);
|
||
return {
|
||
c() {
|
||
if (if_block)
|
||
if_block.c();
|
||
if_block_anchor = empty();
|
||
},
|
||
m(target, anchor) {
|
||
if (if_block)
|
||
if_block.m(target, anchor);
|
||
insert(target, if_block_anchor, anchor);
|
||
},
|
||
p(ctx2, [dirty]) {
|
||
if (
|
||
/*$settings*/
|
||
ctx2[3].useStatusBarTimer
|
||
) {
|
||
if (if_block) {
|
||
if_block.p(ctx2, dirty);
|
||
} else {
|
||
if_block = create_if_block3(ctx2);
|
||
if_block.c();
|
||
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
||
}
|
||
} else if (if_block) {
|
||
if_block.d(1);
|
||
if_block = null;
|
||
}
|
||
},
|
||
i: noop,
|
||
o: noop,
|
||
d(detaching) {
|
||
if (detaching) {
|
||
detach(if_block_anchor);
|
||
}
|
||
if (if_block)
|
||
if_block.d(detaching);
|
||
}
|
||
};
|
||
}
|
||
function instance5($$self, $$props, $$invalidate) {
|
||
let $settings;
|
||
let $store, $$unsubscribe_store = noop, $$subscribe_store = () => ($$unsubscribe_store(), $$unsubscribe_store = subscribe(store, ($$value) => $$invalidate(2, $store = $$value)), store);
|
||
component_subscribe($$self, settings, ($$value) => $$invalidate(3, $settings = $$value));
|
||
$$self.$$.on_destroy.push(() => $$unsubscribe_store());
|
||
let { store } = $$props;
|
||
$$subscribe_store();
|
||
let statusbar;
|
||
let mode;
|
||
const toggleTimer = () => {
|
||
store.toggleTimer();
|
||
};
|
||
const ctxMenu = (e) => {
|
||
const menu = new import_obsidian8.Menu();
|
||
menu.addItem((item) => {
|
||
const p = $store.running ? "Pause" : $store.inSession ? "Resume" : "Start";
|
||
item.setTitle(p).onClick(() => {
|
||
store.toggleTimer();
|
||
});
|
||
});
|
||
menu.addItem((item) => {
|
||
item.setTitle("Reset").onClick(() => {
|
||
store.reset();
|
||
});
|
||
});
|
||
menu.addItem((item) => {
|
||
const mode2 = `Switch ${$store.mode === "WORK" ? "Break" : "Work"} `;
|
||
item.setTitle(mode2);
|
||
item.onClick(() => {
|
||
store.toggleMode();
|
||
});
|
||
});
|
||
menu.addSeparator();
|
||
menu.addItem((item) => {
|
||
item.setTitle("Auto-start");
|
||
item.setChecked($settings.autostart);
|
||
item.onClick(() => {
|
||
settings.update((s) => {
|
||
s.autostart = !s.autostart;
|
||
return s;
|
||
});
|
||
});
|
||
});
|
||
menu.addItem((item) => {
|
||
item.setTitle("Sound");
|
||
item.setChecked($settings.notificationSound);
|
||
item.onClick(() => {
|
||
settings.update((s) => {
|
||
s.notificationSound = !s.notificationSound;
|
||
return s;
|
||
});
|
||
});
|
||
});
|
||
menu.showAtMouseEvent(e);
|
||
};
|
||
import_obsidian8.setTooltip;
|
||
function span1_binding($$value) {
|
||
binding_callbacks[$$value ? "unshift" : "push"](() => {
|
||
statusbar = $$value;
|
||
$$invalidate(1, statusbar);
|
||
});
|
||
}
|
||
$$self.$$set = ($$props2) => {
|
||
if ("store" in $$props2)
|
||
$$subscribe_store($$invalidate(0, store = $$props2.store));
|
||
};
|
||
$$self.$$.update = () => {
|
||
if ($$self.$$.dirty & /*statusbar, mode, $store*/
|
||
70) {
|
||
$: {
|
||
if (statusbar && mode !== $store.mode) {
|
||
$$invalidate(6, mode = $store.mode);
|
||
const tooltip = mode === "WORK" ? "Work" : "Break";
|
||
(0, import_obsidian8.setTooltip)(statusbar, tooltip, { delay: 300, placement: "top" });
|
||
}
|
||
}
|
||
}
|
||
};
|
||
return [store, statusbar, $store, $settings, toggleTimer, ctxMenu, mode, span1_binding];
|
||
}
|
||
var StatusBarComponent = class extends SvelteComponent {
|
||
constructor(options) {
|
||
super();
|
||
init(this, options, instance5, create_fragment5, safe_not_equal, { store: 0 }, add_css5);
|
||
}
|
||
};
|
||
var StatusBarComponent_default = StatusBarComponent;
|
||
|
||
// src/TaskTracker.ts
|
||
var import_obsidian9 = require("obsidian");
|
||
var DEFAULT_TRACKER_STATE = {
|
||
pinned: false
|
||
};
|
||
var TaskTracker = class {
|
||
constructor(plugin) {
|
||
this.unsubscribers = [];
|
||
this.openTask = (event, task) => {
|
||
let file = this.plugin.app.vault.getAbstractFileByPath(task.path);
|
||
if (file && file instanceof import_obsidian9.TFile && task.line >= 0) {
|
||
const leaf = this.plugin.app.workspace.getLeaf(
|
||
import_obsidian9.Keymap.isModEvent(event)
|
||
);
|
||
leaf.openFile(file, { eState: { line: task.line } });
|
||
}
|
||
};
|
||
this.plugin = plugin;
|
||
this.state = DEFAULT_TRACKER_STATE;
|
||
this.store = writable(this.state);
|
||
this.subscribe = this.store.subscribe;
|
||
this.unsubscribers.push(
|
||
this.store.subscribe((state) => {
|
||
this.state = state;
|
||
})
|
||
);
|
||
plugin.registerEvent(
|
||
//loadtasks on file change
|
||
plugin.app.workspace.on("active-leaf-change", () => {
|
||
let file = this.plugin.app.workspace.getActiveFile();
|
||
if (!this.state.pinned) {
|
||
this.store.update((state) => {
|
||
var _a;
|
||
if (((_a = state.file) == null ? void 0 : _a.path) !== (file == null ? void 0 : file.path)) {
|
||
state.task = void 0;
|
||
}
|
||
state.file = file != null ? file : state.file;
|
||
return state;
|
||
});
|
||
}
|
||
})
|
||
);
|
||
plugin.app.workspace.onLayoutReady(() => {
|
||
let file = this.plugin.app.workspace.getActiveFile();
|
||
this.store.update((state) => {
|
||
state.file = file != null ? file : state.file;
|
||
return state;
|
||
});
|
||
});
|
||
}
|
||
get task() {
|
||
return this.state.task;
|
||
}
|
||
get file() {
|
||
return this.state.file;
|
||
}
|
||
togglePinned() {
|
||
this.store.update((state) => {
|
||
state.pinned = !state.pinned;
|
||
return state;
|
||
});
|
||
}
|
||
async active(task) {
|
||
await this.ensureBlockId(task);
|
||
this.store.update((state) => {
|
||
state.task = task;
|
||
return state;
|
||
});
|
||
}
|
||
setTaskName(name) {
|
||
this.store.update((state) => {
|
||
if (state.task) {
|
||
state.task.name = name;
|
||
}
|
||
return state;
|
||
});
|
||
}
|
||
async ensureBlockId(task) {
|
||
let file = this.plugin.app.vault.getAbstractFileByPath(task.path);
|
||
if (file && file instanceof import_obsidian9.TFile) {
|
||
const f = file;
|
||
if (f.extension === "md") {
|
||
let content = await this.plugin.app.vault.read(f);
|
||
let lines = content.split("\n");
|
||
if (lines.length > task.line) {
|
||
let line = lines[task.line];
|
||
if (task.blockLink) {
|
||
if (!line.endsWith(task.blockLink)) {
|
||
lines[task.line] += `${task.blockLink}`;
|
||
this.plugin.app.vault.modify(f, lines.join("\n"));
|
||
return;
|
||
}
|
||
} else {
|
||
let blockId = this.createBlockId();
|
||
task.blockLink = blockId;
|
||
lines[task.line] += `${blockId}`;
|
||
this.plugin.app.vault.modify(f, lines.join("\n"));
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
createBlockId() {
|
||
return ` ^${Math.random().toString(36).substring(2, 6)}`;
|
||
}
|
||
clear() {
|
||
this.store.update((state) => {
|
||
state.task = void 0;
|
||
return state;
|
||
});
|
||
}
|
||
openFile(event) {
|
||
if (this.state.file) {
|
||
const leaf = this.plugin.app.workspace.getLeaf(
|
||
import_obsidian9.Keymap.isModEvent(event)
|
||
);
|
||
leaf.openFile(this.state.file);
|
||
}
|
||
}
|
||
get pinned() {
|
||
return this.state.pinned;
|
||
}
|
||
finish() {
|
||
}
|
||
destory() {
|
||
for (let unsub of this.unsubscribers) {
|
||
unsub();
|
||
}
|
||
}
|
||
sync(task) {
|
||
var _a;
|
||
if (((_a = this.state.task) == null ? void 0 : _a.blockLink) && this.state.task.blockLink === task.blockLink) {
|
||
this.store.update((state) => {
|
||
if (state.task) {
|
||
let name = state.task.name;
|
||
state.task = { ...task, name };
|
||
}
|
||
return state;
|
||
});
|
||
}
|
||
}
|
||
async updateActual() {
|
||
if (this.plugin.getSettings().enableTaskTracking && this.task && this.task.blockLink) {
|
||
let file = this.plugin.app.vault.getAbstractFileByPath(
|
||
this.task.path
|
||
);
|
||
if (file && file instanceof import_obsidian9.TFile) {
|
||
let f = file;
|
||
this.store.update((state) => {
|
||
if (state.task) {
|
||
if (state.task.actual >= 0) {
|
||
state.task.actual += 1;
|
||
} else {
|
||
state.task.actual = 1;
|
||
}
|
||
}
|
||
return state;
|
||
});
|
||
await this.incrTaskActual(this.task.blockLink, f);
|
||
}
|
||
}
|
||
}
|
||
async incrTaskActual(blockLink, file) {
|
||
var _a;
|
||
const format = this.plugin.getSettings().taskFormat;
|
||
if (file.extension !== "md") {
|
||
return;
|
||
}
|
||
let metadata = this.plugin.app.metadataCache.getFileCache(file);
|
||
let content = await this.plugin.app.vault.read(file);
|
||
if (!content || !metadata) {
|
||
return;
|
||
}
|
||
const lines = content.split("\n");
|
||
for (let rawElement of metadata.listItems || []) {
|
||
if (rawElement.task) {
|
||
let lineNr = rawElement.position.start.line;
|
||
let line = lines[lineNr];
|
||
const components = extractTaskComponents(line);
|
||
if (!components) {
|
||
continue;
|
||
}
|
||
if (components.blockLink === blockLink) {
|
||
const match = components.body.match(POMODORO_REGEX);
|
||
if (match !== null) {
|
||
let pomodoros = match[1];
|
||
let [actual, expected] = pomodoros.split("/");
|
||
actual = actual || "0";
|
||
let text2 = `\u{1F345}:: ${parseInt(actual) + 1}`;
|
||
if (expected !== void 0) {
|
||
text2 += `/${expected.trim()}`;
|
||
}
|
||
line = line.replace(/🍅:: *(\d* *\/? *\d* *)/, text2).trim();
|
||
} else {
|
||
let detail = DESERIALIZERS[format].deserialize(
|
||
components.body
|
||
);
|
||
line = line.replace(
|
||
detail.description,
|
||
`${detail.description} [\u{1F345}:: 1]`
|
||
);
|
||
}
|
||
lines[lineNr] = line;
|
||
await this.plugin.app.vault.modify(file, lines.join("\n"));
|
||
this.plugin.app.metadataCache.trigger(
|
||
"changed",
|
||
file,
|
||
content,
|
||
metadata
|
||
);
|
||
(_a = this.plugin.app.workspace.getActiveViewOfType(import_obsidian9.MarkdownView)) == null ? void 0 : _a.load();
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
};
|
||
|
||
// src/main.ts
|
||
var PomodoroTimerPlugin = class extends import_obsidian10.Plugin {
|
||
async onload() {
|
||
const settings2 = await this.loadData();
|
||
this.settingTab = new PomodoroSettings(this, settings2);
|
||
this.addSettingTab(this.settingTab);
|
||
this.tracker = new TaskTracker(this);
|
||
this.timer = new Timer(this);
|
||
this.tasks = new Tasks(this);
|
||
this.registerView(VIEW_TYPE_TIMER, (leaf) => new TimerView(this, leaf));
|
||
this.addRibbonIcon("timer", "Toggle timer panel", () => {
|
||
let { workspace } = this.app;
|
||
let leaves = workspace.getLeavesOfType(VIEW_TYPE_TIMER);
|
||
if (leaves.length > 0) {
|
||
workspace.detachLeavesOfType(VIEW_TYPE_TIMER);
|
||
} else {
|
||
this.activateView();
|
||
}
|
||
});
|
||
const status = this.addStatusBarItem();
|
||
status.className = `${status.className} mod-clickable`;
|
||
new StatusBarComponent_default({ target: status, props: { store: this.timer } });
|
||
this.addCommand({
|
||
id: "toggle-timer",
|
||
name: "Toggle timer",
|
||
callback: () => {
|
||
var _a;
|
||
(_a = this.timer) == null ? void 0 : _a.toggleTimer();
|
||
}
|
||
});
|
||
this.addCommand({
|
||
id: "toggle-timer-panel",
|
||
name: "Toggle timer panel",
|
||
callback: () => {
|
||
let { workspace } = this.app;
|
||
let leaves = workspace.getLeavesOfType(VIEW_TYPE_TIMER);
|
||
if (leaves.length > 0) {
|
||
workspace.detachLeavesOfType(VIEW_TYPE_TIMER);
|
||
} else {
|
||
this.activateView();
|
||
}
|
||
}
|
||
});
|
||
this.addCommand({
|
||
id: "reset-timer",
|
||
name: "Reset timer",
|
||
callback: () => {
|
||
var _a;
|
||
(_a = this.timer) == null ? void 0 : _a.reset();
|
||
new import_obsidian10.Notice("Timer reset");
|
||
}
|
||
});
|
||
this.addCommand({
|
||
id: "toggle-mode",
|
||
name: "Toggle timer mode",
|
||
callback: () => {
|
||
var _a;
|
||
(_a = this.timer) == null ? void 0 : _a.toggleMode((t) => {
|
||
new import_obsidian10.Notice(`Timer mode: ${t.mode}`);
|
||
});
|
||
}
|
||
});
|
||
}
|
||
getSettings() {
|
||
var _a;
|
||
return ((_a = this.settingTab) == null ? void 0 : _a.getSettings()) || PomodoroSettings.DEFAULT_SETTINGS;
|
||
}
|
||
onunload() {
|
||
var _a, _b, _c, _d;
|
||
(_a = this.settingTab) == null ? void 0 : _a.unload();
|
||
(_b = this.timer) == null ? void 0 : _b.destroy();
|
||
(_c = this.tasks) == null ? void 0 : _c.destroy();
|
||
(_d = this.tracker) == null ? void 0 : _d.destory();
|
||
}
|
||
async activateView() {
|
||
let { workspace } = this.app;
|
||
let leaf = null;
|
||
let leaves = workspace.getLeavesOfType(VIEW_TYPE_TIMER);
|
||
if (leaves.length > 0) {
|
||
leaf = leaves[0];
|
||
} else {
|
||
leaf = workspace.getRightLeaf(false);
|
||
await leaf.setViewState({
|
||
type: VIEW_TYPE_TIMER,
|
||
active: true
|
||
});
|
||
}
|
||
workspace.revealLeaf(leaf);
|
||
}
|
||
};
|