diff --git a/package.json b/package.json
index fb36f3f52..78e106346 100644
--- a/package.json
+++ b/package.json
@@ -26,8 +26,9 @@
"scripts": {
"assemble:android:prod": "cd android && ./gradlew assembleRelease && cd ..",
"assemble:android:stage": "cd android && ./gradlew assembleDebug && cd ..",
- "prebuild": "node ./tools/git-version.js",
+ "prebuild": "node ./tools/git-version.js && npm run build:packages",
"build": "npm run buildAllElectron:noTests:prod",
+ "build:packages": "node ./packages/build-packages.js",
"buildAllElectron:noTests:prod": "npm run lint && npm run buildFrontend:prod:es6 && npm run electron:build",
"buildAllElectron:prod": "npm run preCheck && npm run buildFrontend:prod:es6 && npm run electron:build",
"buildAllElectron:stage": "npm run preCheck && npm run buildFrontend:stage:es6 && npm run electron:build",
diff --git a/packages/README.md b/packages/README.md
new file mode 100644
index 000000000..b4f7427ab
--- /dev/null
+++ b/packages/README.md
@@ -0,0 +1,49 @@
+# Super Productivity Packages
+
+This directory contains plugin packages and the plugin API for Super Productivity.
+
+## Structure
+
+- `plugin-api/` - TypeScript definitions for the plugin API
+- `plugin-dev/` - Plugin development examples and tools
+ - `api-test-plugin/` - Basic API test plugin
+ - `procrastination-buster/` - Example SolidJS-based plugin
+ - `yesterday-tasks-plugin/` - Simple plugin showing yesterday's tasks
+ - `boilerplate-solid-js/` - Template for creating new SolidJS plugins (not built)
+ - `sync-md/` - Markdown sync plugin (not built)
+
+## Building Packages
+
+All packages are built automatically when running the main build process:
+
+```bash
+npm run build:packages
+```
+
+This command:
+
+1. Builds the plugin-api TypeScript definitions
+2. Builds plugins that require compilation (e.g., procrastination-buster)
+3. Copies plugin files to `src/assets/` for inclusion in the app
+
+## Development
+
+To work on a specific plugin:
+
+```bash
+cd plugin-dev/[plugin-name]
+npm install
+npm run dev
+```
+
+## Adding a New Plugin
+
+1. Create a new directory in `plugin-dev/`
+2. Add the plugin configuration to `/packages/build-packages.js`
+3. Run `npm run build:packages` to test the build
+
+## Notes
+
+- The `boilerplate-solid-js` and `sync-md` plugins are development templates and are not included in production builds
+- Plugin files are automatically copied to `src/assets/` during the build process
+- The build script handles dependency installation automatically
diff --git a/packages/build-packages.js b/packages/build-packages.js
new file mode 100755
index 000000000..e34c167ee
--- /dev/null
+++ b/packages/build-packages.js
@@ -0,0 +1,194 @@
+#!/usr/bin/env node
+
+const { exec } = require('child_process');
+const { promisify } = require('util');
+const fs = require('fs').promises;
+const path = require('path');
+
+const execAsync = promisify(exec);
+
+// Colors for console output
+const colors = {
+ reset: '\x1b[0m',
+ bright: '\x1b[1m',
+ green: '\x1b[32m',
+ yellow: '\x1b[33m',
+ red: '\x1b[31m',
+ cyan: '\x1b[36m',
+};
+
+function log(message, color = '') {
+ console.log(`${color}${message}${colors.reset}`);
+}
+
+// Plugin configurations
+const plugins = [
+ {
+ name: 'plugin-api',
+ path: 'packages/plugin-api',
+ buildCommand: 'npm run build',
+ skipCopy: true, // TypeScript definitions, no need to copy
+ },
+ {
+ name: 'api-test-plugin',
+ path: 'packages/plugin-dev/api-test-plugin',
+ files: ['manifest.json', 'plugin.js', 'index.html', 'icon.svg'],
+ },
+ {
+ name: 'procrastination-buster',
+ path: 'packages/plugin-dev/procrastination-buster',
+ buildCommand: 'npm run build',
+ distFiles: [
+ 'manifest.json',
+ 'plugin.js',
+ 'index.html',
+ 'index.js',
+ 'index.css',
+ 'icon.svg',
+ ],
+ sourcePath: 'dist',
+ },
+ {
+ name: 'yesterday-tasks-plugin',
+ path: 'packages/plugin-dev/yesterday-tasks-plugin',
+ files: ['manifest.json', 'plugin.js', 'index.html', 'icon.svg'],
+ },
+ // Explicitly excluding:
+ // - boilerplate-solid-js
+ // - sync-md
+];
+
+async function ensureDir(dir) {
+ try {
+ await fs.mkdir(dir, { recursive: true });
+ } catch (error) {
+ // Directory might already exist
+ }
+}
+
+async function copyFile(src, dest) {
+ try {
+ await fs.copyFile(src, dest);
+ return true;
+ } catch (error) {
+ if (error.code !== 'ENOENT') {
+ log(` ā ļø Failed to copy ${path.basename(src)}: ${error.message}`, colors.yellow);
+ }
+ return false;
+ }
+}
+
+async function buildPlugin(plugin) {
+ const startTime = Date.now();
+ log(`\nš¦ Processing ${plugin.name}...`, colors.cyan);
+
+ try {
+ // Check if plugin directory exists
+ const pluginPath = path.resolve(plugin.path);
+ try {
+ await fs.access(pluginPath);
+ } catch {
+ throw new Error(`Plugin directory not found: ${plugin.path}`);
+ }
+
+ // Run build command if specified
+ if (plugin.buildCommand) {
+ log(` Building...`, colors.yellow);
+ const packageJsonPath = path.join(pluginPath, 'package.json');
+
+ // Check if package.json exists and install dependencies if needed
+ try {
+ await fs.access(packageJsonPath);
+ const nodeModulesPath = path.join(pluginPath, 'node_modules');
+ try {
+ await fs.access(nodeModulesPath);
+ } catch {
+ log(` Installing dependencies...`, colors.yellow);
+ await execAsync(`cd ${pluginPath} && npm install`);
+ }
+ } catch {
+ // No package.json, skip install
+ }
+
+ await execAsync(`cd ${pluginPath} && ${plugin.buildCommand}`);
+ }
+
+ // Copy files to assets if not skipped
+ if (!plugin.skipCopy) {
+ const targetDir = path.join('src/assets', plugin.name);
+ await ensureDir(targetDir);
+
+ const filesToCopy = plugin.distFiles || plugin.files || [];
+ const sourcePath = plugin.sourcePath
+ ? path.join(pluginPath, plugin.sourcePath)
+ : pluginPath;
+
+ let copiedCount = 0;
+ for (const file of filesToCopy) {
+ const src = path.join(sourcePath, file);
+ const dest = path.join(targetDir, file);
+ if (await copyFile(src, dest)) {
+ copiedCount++;
+ }
+ }
+
+ log(
+ ` ā Copied ${copiedCount}/${filesToCopy.length} files to assets`,
+ colors.green,
+ );
+ }
+
+ const duration = ((Date.now() - startTime) / 1000).toFixed(1);
+ log(`ā ${plugin.name} completed (${duration}s)`, colors.green);
+
+ return { plugin: plugin.name, success: true, duration };
+ } catch (error) {
+ const duration = ((Date.now() - startTime) / 1000).toFixed(1);
+ log(`ā ${plugin.name} failed: ${error.message} (${duration}s)`, colors.red);
+ return { plugin: plugin.name, success: false, error: error.message, duration };
+ }
+}
+
+async function buildAll() {
+ log('š Building all packages...', colors.bright);
+ const startTime = Date.now();
+
+ // Build plugins sequentially to avoid conflicts
+ const results = [];
+ for (const plugin of plugins) {
+ const result = await buildPlugin(plugin);
+ results.push(result);
+ }
+
+ // Summary
+ const totalDuration = ((Date.now() - startTime) / 1000).toFixed(1);
+ const successful = results.filter((r) => r.success).length;
+ const failed = results.filter((r) => !r.success).length;
+
+ log('\nš Build Summary:', colors.bright);
+ log(` Total packages: ${plugins.length}`);
+ log(` Successful: ${successful}`, colors.green);
+ if (failed > 0) {
+ log(` Failed: ${failed}`, colors.red);
+ results
+ .filter((r) => !r.success)
+ .forEach((r) => {
+ log(` - ${r.plugin}: ${r.error}`, colors.red);
+ });
+ }
+ log(` Total time: ${totalDuration}s`);
+
+ if (failed > 0) {
+ process.exit(1);
+ }
+}
+
+// Run if called directly
+if (require.main === module) {
+ buildAll().catch((error) => {
+ log(`\nā Build failed: ${error.message}`, colors.red);
+ process.exit(1);
+ });
+}
+
+module.exports = { buildAll };
diff --git a/packages/plugin-api/package.json b/packages/plugin-api/package.json
index dd5f70d86..622d18459 100644
--- a/packages/plugin-api/package.json
+++ b/packages/plugin-api/package.json
@@ -5,8 +5,9 @@
"main": "src/index.ts",
"types": "src/index.ts",
"scripts": {
- "build": "tsc --emitDeclarationOnly",
+ "build": "tsc",
"build:watch": "tsc --emitDeclarationOnly --watch",
+ "clean": "rm -rf dist",
"typecheck": "tsc --noEmit"
},
"keywords": [
diff --git a/packages/plugin-api/tsconfig.json b/packages/plugin-api/tsconfig.json
index 65e50324b..2cc7b298f 100644
--- a/packages/plugin-api/tsconfig.json
+++ b/packages/plugin-api/tsconfig.json
@@ -4,8 +4,6 @@
"module": "commonjs",
"lib": ["ES2020", "DOM"],
"declaration": true,
- "declarationMap": true,
- "emitDeclarationOnly": true,
"outDir": "./dist",
"rootDir": "./src",
"strict": true,
@@ -14,8 +12,7 @@
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"resolveJsonModule": true,
- "noEmitOnError": true,
- "noEmit": false
+ "noEmitOnError": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
diff --git a/src/assets/procrastination-buster/index.html b/src/assets/procrastination-buster/index.html
index 640185bdf..ee4293771 100644
--- a/src/assets/procrastination-buster/index.html
+++ b/src/assets/procrastination-buster/index.html
@@ -7,1189 +7,16 @@
content="width=device-width, initial-scale=1.0"
/>
Procrastination Buster
-
-
+
+
diff --git a/src/assets/procrastination-buster/index.js b/src/assets/procrastination-buster/index.js
index 162795702..36f2f8c4e 100644
--- a/src/assets/procrastination-buster/index.js
+++ b/src/assets/procrastination-buster/index.js
@@ -1,58 +1,58 @@
(function () {
const t = document.createElement('link').relList;
if (t && t.supports && t.supports('modulepreload')) return;
- for (const i of document.querySelectorAll('link[rel="modulepreload"]')) r(i);
- new MutationObserver((i) => {
- for (const s of i)
- if (s.type === 'childList')
- for (const l of s.addedNodes)
+ for (const s of document.querySelectorAll('link[rel="modulepreload"]')) r(s);
+ new MutationObserver((s) => {
+ for (const i of s)
+ if (i.type === 'childList')
+ for (const l of i.addedNodes)
l.tagName === 'LINK' && l.rel === 'modulepreload' && r(l);
}).observe(document, { childList: !0, subtree: !0 });
- function n(i) {
- const s = {};
+ function n(s) {
+ const i = {};
return (
- i.integrity && (s.integrity = i.integrity),
- i.referrerPolicy && (s.referrerPolicy = i.referrerPolicy),
- i.crossOrigin === 'use-credentials'
- ? (s.credentials = 'include')
- : i.crossOrigin === 'anonymous'
- ? (s.credentials = 'omit')
- : (s.credentials = 'same-origin'),
- s
+ s.integrity && (i.integrity = s.integrity),
+ s.referrerPolicy && (i.referrerPolicy = s.referrerPolicy),
+ s.crossOrigin === 'use-credentials'
+ ? (i.credentials = 'include')
+ : s.crossOrigin === 'anonymous'
+ ? (i.credentials = 'omit')
+ : (i.credentials = 'same-origin'),
+ i
);
}
- function r(i) {
- if (i.ep) return;
- i.ep = !0;
- const s = n(i);
- fetch(i.href, s);
+ function r(s) {
+ if (s.ep) return;
+ s.ep = !0;
+ const i = n(s);
+ fetch(s.href, i);
}
})();
-const ce = !0,
- ue = (e, t) => e === t,
- fe = Symbol('solid-track'),
- de = Symbol('solid-dev-component'),
- B = { equals: ue };
-let he = ie;
+const ae = !0,
+ ce = (e, t) => e === t,
+ ue = Symbol('solid-track'),
+ fe = Symbol('solid-dev-component'),
+ N = { equals: ce };
+let de = ne;
const T = 1,
- U = 2,
- pe = {};
+ W = 2,
+ he = {};
var d = null;
-let G = null,
+let V = null,
ge = null,
h = null,
p = null,
A = null,
j = 0;
-function N(e, t) {
+function B(e, t) {
const n = h,
r = d,
- i = e.length === 0,
- s = t === void 0 ? r : t,
- l = i
+ s = e.length === 0,
+ i = t === void 0 ? r : t,
+ l = s
? { owned: null, cleanups: null, context: null, owner: null }
- : { owned: null, cleanups: null, context: s ? s.context : null, owner: s },
- o = i
+ : { owned: null, cleanups: null, context: i ? i.context : null, owner: i },
+ o = s
? () =>
e(() => {
throw new Error(
@@ -67,31 +67,31 @@ function N(e, t) {
(h = n), (d = r);
}
}
-function V(e, t) {
- t = t ? Object.assign({}, B, t) : B;
+function q(e, t) {
+ t = t ? Object.assign({}, N, t) : N;
const n = {
value: e,
observers: null,
observerSlots: null,
comparator: t.equals || void 0,
};
- t.name && (n.name = t.name), t.internal ? (n.internal = !0) : be(n);
- const r = (i) => (typeof i == 'function' && (i = i(n.value)), te(n, i));
- return [ee.bind(n), r];
+ t.name && (n.name = t.name), t.internal ? (n.internal = !0) : we(n);
+ const r = (s) => (typeof s == 'function' && (s = s(n.value)), ee(n, s));
+ return [z.bind(n), r];
}
-function q(e, t, n) {
- const r = X(e, t, !1, T, n);
+function G(e, t, n) {
+ const r = H(e, t, !1, T, n);
L(r);
}
function M(e, t, n) {
- n = n ? Object.assign({}, B, n) : B;
- const r = X(e, t, !0, 0, n);
+ n = n ? Object.assign({}, N, n) : N;
+ const r = H(e, t, !0, 0, n);
return (
(r.observers = null),
(r.observerSlots = null),
(r.comparator = n.equals || void 0),
L(r),
- ee.bind(r)
+ z.bind(r)
);
}
function I(e) {
@@ -104,7 +104,7 @@ function I(e) {
h = t;
}
}
-function me(e) {
+function pe(e) {
return (
d === null
? console.warn(
@@ -116,8 +116,8 @@ function me(e) {
e
);
}
-function we(e, t) {
- const n = X(() => I(() => (Object.assign(e, { [de]: !0 }), e(t))), void 0, !0, 0);
+function me(e, t) {
+ const n = H(() => I(() => (Object.assign(e, { [fe]: !0 }), e(t))), void 0, !0, 0);
return (
(n.props = t),
(n.observers = null),
@@ -128,15 +128,15 @@ function we(e, t) {
n.tValue !== void 0 ? n.tValue : n.value
);
}
-function be(e) {
+function we(e) {
d && (d.sourceMap ? d.sourceMap.push(e) : (d.sourceMap = [e]), (e.graph = d));
}
-function ee() {
+function z() {
if (this.sources && this.state)
if (this.state === T) L(this);
else {
const e = p;
- (p = null), R(() => W(this), !1), (p = e);
+ (p = null), R(() => U(this), !1), (p = e);
}
if (h) {
const e = this.observers ? this.observers.length : 0;
@@ -149,7 +149,7 @@ function ee() {
}
return this.value;
}
-function te(e, t, n) {
+function ee(e, t, n) {
let r = e.value;
return (
(!e.comparator || !e.comparator(r, t)) &&
@@ -157,18 +157,18 @@ function te(e, t, n) {
e.observers &&
e.observers.length &&
R(() => {
- for (let i = 0; i < e.observers.length; i += 1) {
- const s = e.observers[i],
- l = G && G.running;
- l && G.disposed.has(s),
- (l ? !s.tState : !s.state) &&
- (s.pure ? p.push(s) : A.push(s), s.observers && se(s)),
- l || (s.state = T);
+ for (let s = 0; s < e.observers.length; s += 1) {
+ const i = e.observers[s],
+ l = V && V.running;
+ l && V.disposed.has(i),
+ (l ? !i.tState : !i.state) &&
+ (i.pure ? p.push(i) : A.push(i), i.observers && se(i)),
+ l || (i.state = T);
}
if (p.length > 1e6)
throw (
((p = []),
- ce ? new Error('Potential Infinite Loop Detected.') : new Error())
+ ae ? new Error('Potential Infinite Loop Detected.') : new Error())
);
}, !1)),
t
@@ -178,12 +178,12 @@ function L(e) {
if (!e.fn) return;
D(e);
const t = j;
- ye(e, e.value, t);
+ be(e, e.value, t);
}
-function ye(e, t, n) {
+function be(e, t, n) {
let r;
- const i = d,
- s = h;
+ const s = d,
+ i = h;
h = d = e;
try {
r = e.fn(t);
@@ -191,17 +191,17 @@ function ye(e, t, n) {
return (
e.pure && ((e.state = T), e.owned && e.owned.forEach(D), (e.owned = null)),
(e.updatedAt = n + 1),
- re(l)
+ ie(l)
);
} finally {
- (h = s), (d = i);
+ (h = i), (d = s);
}
(!e.updatedAt || e.updatedAt <= n) &&
- (e.updatedAt != null && 'observers' in e ? te(e, r) : (e.value = r),
+ (e.updatedAt != null && 'observers' in e ? ee(e, r) : (e.value = r),
(e.updatedAt = n));
}
-function X(e, t, n, r = T, i) {
- const s = {
+function H(e, t, n, r = T, s) {
+ const i = {
fn: e,
state: r,
updatedAt: null,
@@ -219,22 +219,22 @@ function X(e, t, n, r = T, i) {
? console.warn(
'computations created outside a `createRoot` or `render` will never be disposed',
)
- : d !== pe && (d.owned ? d.owned.push(s) : (d.owned = [s])),
- i && i.name && (s.name = i.name),
- s
+ : d !== he && (d.owned ? d.owned.push(i) : (d.owned = [i])),
+ s && s.name && (i.name = s.name),
+ i
);
}
-function ne(e) {
+function te(e) {
if (e.state === 0) return;
- if (e.state === U) return W(e);
+ if (e.state === W) return U(e);
if (e.suspense && I(e.suspense.inFallback)) return e.suspense.effects.push(e);
const t = [e];
for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < j); ) e.state && t.push(e);
for (let n = t.length - 1; n >= 0; n--)
if (((e = t[n]), e.state === T)) L(e);
- else if (e.state === U) {
+ else if (e.state === W) {
const r = p;
- (p = null), R(() => W(e, t[0]), !1), (p = r);
+ (p = null), R(() => U(e, t[0]), !1), (p = r);
}
}
function R(e, t) {
@@ -243,35 +243,35 @@ function R(e, t) {
t || (p = []), A ? (n = !0) : (A = []), j++;
try {
const r = e();
- return ve(n), r;
+ return ye(n), r;
} catch (r) {
- n || (A = null), (p = null), re(r);
+ n || (A = null), (p = null), ie(r);
}
}
-function ve(e) {
- if ((p && (ie(p), (p = null)), e)) return;
+function ye(e) {
+ if ((p && (ne(p), (p = null)), e)) return;
const t = A;
- (A = null), t.length && R(() => he(t), !1);
+ (A = null), t.length && R(() => de(t), !1);
}
-function ie(e) {
- for (let t = 0; t < e.length; t++) ne(e[t]);
+function ne(e) {
+ for (let t = 0; t < e.length; t++) te(e[t]);
}
-function W(e, t) {
+function U(e, t) {
e.state = 0;
for (let n = 0; n < e.sources.length; n += 1) {
const r = e.sources[n];
if (r.sources) {
- const i = r.state;
- i === T
- ? r !== t && (!r.updatedAt || r.updatedAt < j) && ne(r)
- : i === U && W(r, t);
+ const s = r.state;
+ s === T
+ ? r !== t && (!r.updatedAt || r.updatedAt < j) && te(r)
+ : s === W && U(r, t);
}
}
}
function se(e) {
for (let t = 0; t < e.observers.length; t += 1) {
const n = e.observers[t];
- n.state || ((n.state = U), n.pure ? p.push(n) : A.push(n), n.observers && se(n));
+ n.state || ((n.state = W), n.pure ? p.push(n) : A.push(n), n.observers && se(n));
}
}
function D(e) {
@@ -280,11 +280,11 @@ function D(e) {
for (; e.sources.length; ) {
const n = e.sources.pop(),
r = e.sourceSlots.pop(),
- i = n.observers;
- if (i && i.length) {
- const s = i.pop(),
+ s = n.observers;
+ if (s && s.length) {
+ const i = s.pop(),
l = n.observerSlots.pop();
- r < i.length && ((s.sourceSlots[l] = r), (i[r] = s), (n.observerSlots[r] = l));
+ r < s.length && ((i.sourceSlots[l] = r), (s[r] = i), (n.observerSlots[r] = l));
}
}
if (e.tOwned) {
@@ -301,41 +301,41 @@ function D(e) {
}
(e.state = 0), delete e.sourceMap;
}
-function Se(e) {
+function ve(e) {
return e instanceof Error
? e
: new Error(typeof e == 'string' ? e : 'Unknown error', { cause: e });
}
-function re(e, t = d) {
- throw Se(e);
+function ie(e, t = d) {
+ throw ve(e);
}
-const $e = Symbol('fallback');
-function Y(e) {
+const Se = Symbol('fallback');
+function X(e) {
for (let t = 0; t < e.length; t++) e[t]();
}
-function _e(e, t, n = {}) {
+function $e(e, t, n = {}) {
let r = [],
- i = [],
s = [],
+ i = [],
l = 0,
o = t.length > 1 ? [] : null;
return (
- me(() => Y(s)),
+ pe(() => X(i)),
() => {
let c = e() || [],
u = c.length,
f,
a;
return (
- c[fe],
+ c[ue],
I(() => {
- let g, $, w, C, E, b, y, S, _;
+ let m, $, w, C, E, b, y, S, x;
if (u === 0)
- l !== 0 && (Y(s), (s = []), (r = []), (i = []), (l = 0), o && (o = [])),
+ l !== 0 && (X(i), (i = []), (r = []), (s = []), (l = 0), o && (o = [])),
n.fallback &&
- ((r = [$e]), (i[0] = N((ae) => ((s[0] = ae), n.fallback()))), (l = 1));
+ ((r = [Se]), (s[0] = B((le) => ((i[0] = le), n.fallback()))), (l = 1));
else if (l === 0) {
- for (i = new Array(u), a = 0; a < u; a++) (r[a] = c[a]), (i[a] = N(m));
+ for (s = new Array(u), a = 0; a < u; a++) (r[a] = c[a]), (s[a] = B(g));
l = u;
} else {
for (
@@ -348,31 +348,31 @@ function _e(e, t, n = {}) {
b++
);
for (y = l - 1, S = u - 1; y >= b && S >= b && r[y] === c[S]; y--, S--)
- (w[S] = i[y]), (C[S] = s[y]), o && (E[S] = o[y]);
- for (g = new Map(), $ = new Array(S + 1), a = S; a >= b; a--)
- (_ = c[a]), (f = g.get(_)), ($[a] = f === void 0 ? -1 : f), g.set(_, a);
+ (w[S] = s[y]), (C[S] = i[y]), o && (E[S] = o[y]);
+ for (m = new Map(), $ = new Array(S + 1), a = S; a >= b; a--)
+ (x = c[a]), (f = m.get(x)), ($[a] = f === void 0 ? -1 : f), m.set(x, a);
for (f = b; f <= y; f++)
- (_ = r[f]),
- (a = g.get(_)),
+ (x = r[f]),
+ (a = m.get(x)),
a !== void 0 && a !== -1
- ? ((w[a] = i[f]),
- (C[a] = s[f]),
+ ? ((w[a] = s[f]),
+ (C[a] = i[f]),
o && (E[a] = o[f]),
(a = $[a]),
- g.set(_, a))
- : s[f]();
+ m.set(x, a))
+ : i[f]();
for (a = b; a < u; a++)
a in w
- ? ((i[a] = w[a]), (s[a] = C[a]), o && ((o[a] = E[a]), o[a](a)))
- : (i[a] = N(m));
- (i = i.slice(0, (l = u))), (r = c.slice(0));
+ ? ((s[a] = w[a]), (i[a] = C[a]), o && ((o[a] = E[a]), o[a](a)))
+ : (s[a] = B(g));
+ (s = s.slice(0, (l = u))), (r = c.slice(0));
}
- return i;
+ return s;
})
);
- function m(g) {
- if (((s[a] = g), o)) {
- const [$, w] = V(a, { name: 'index' });
+ function g(m) {
+ if (((i[a] = m), o)) {
+ const [$, w] = q(a, { name: 'index' });
return (o[a] = w), t(c[a], $);
}
return t(c[a]);
@@ -380,15 +380,15 @@ function _e(e, t, n = {}) {
}
);
}
-function x(e, t) {
- return we(e, t || {});
+function k(e, t) {
+ return me(e, t || {});
}
const xe = (e) =>
`Attempting to access a stale value from <${e}> that could possibly be undefined. This may occur because you are reading the accessor returned from the component at a time where it has already been unmounted. We recommend cleaning up any stale timers or async, or reading from the initial condition.`;
-function J(e) {
+function Y(e) {
const t = 'fallback' in e && { fallback: () => e.fallback };
return M(
- _e(() => e.each, e.children, t || void 0),
+ $e(() => e.each, e.children, t || void 0),
void 0,
{ name: 'value' },
);
@@ -396,24 +396,24 @@ function J(e) {
function P(e) {
const t = e.keyed,
n = M(() => e.when, void 0, { name: 'condition value' }),
- r = t ? n : M(n, void 0, { equals: (i, s) => !i == !s, name: 'condition' });
+ r = t ? n : M(n, void 0, { equals: (s, i) => !s == !i, name: 'condition' });
return M(
() => {
- const i = r();
- if (i) {
- const s = e.children;
- return typeof s == 'function' && s.length > 0
+ const s = r();
+ if (s) {
+ const i = e.children;
+ return typeof i == 'function' && i.length > 0
? I(() =>
- s(
+ i(
t
- ? i
+ ? s
: () => {
if (!I(r)) throw xe('Show');
return n();
},
),
)
- : s;
+ : i;
}
return e.fallback;
},
@@ -428,43 +428,43 @@ globalThis &&
)
: (globalThis.Solid$$ = !0));
const ke = (e) => M(() => e());
-function Ae(e, t, n) {
+function _e(e, t, n) {
let r = n.length,
- i = t.length,
- s = r,
+ s = t.length,
+ i = r,
l = 0,
o = 0,
- c = t[i - 1].nextSibling,
+ c = t[s - 1].nextSibling,
u = null;
- for (; l < i || o < s; ) {
+ for (; l < s || o < i; ) {
if (t[l] === n[o]) {
l++, o++;
continue;
}
- for (; t[i - 1] === n[s - 1]; ) i--, s--;
- if (i === l) {
- const f = s < r ? (o ? n[o - 1].nextSibling : n[s - o]) : c;
- for (; o < s; ) e.insertBefore(n[o++], f);
- } else if (s === o) for (; l < i; ) (!u || !u.has(t[l])) && t[l].remove(), l++;
- else if (t[l] === n[s - 1] && n[o] === t[i - 1]) {
- const f = t[--i].nextSibling;
+ for (; t[s - 1] === n[i - 1]; ) s--, i--;
+ if (s === l) {
+ const f = i < r ? (o ? n[o - 1].nextSibling : n[i - o]) : c;
+ for (; o < i; ) e.insertBefore(n[o++], f);
+ } else if (i === o) for (; l < s; ) (!u || !u.has(t[l])) && t[l].remove(), l++;
+ else if (t[l] === n[i - 1] && n[o] === t[s - 1]) {
+ const f = t[--s].nextSibling;
e.insertBefore(n[o++], t[l++].nextSibling),
- e.insertBefore(n[--s], f),
- (t[i] = n[s]);
+ e.insertBefore(n[--i], f),
+ (t[s] = n[i]);
} else {
if (!u) {
u = new Map();
let a = o;
- for (; a < s; ) u.set(n[a], a++);
+ for (; a < i; ) u.set(n[a], a++);
}
const f = u.get(t[l]);
if (f != null)
- if (o < f && f < s) {
+ if (o < f && f < i) {
let a = l,
- m = 1,
- g;
- for (; ++a < i && a < s && !((g = u.get(t[a])) == null || g !== f + m); ) m++;
- if (m > f - o) {
+ g = 1,
+ m;
+ for (; ++a < s && a < i && !((m = u.get(t[a])) == null || m !== f + g); ) g++;
+ if (g > f - o) {
const $ = t[l];
for (; o < f; ) e.insertBefore(n[o++], $);
} else e.replaceChild(n[o++], t[l++]);
@@ -473,51 +473,51 @@ function Ae(e, t, n) {
}
}
}
-const Q = '_$DX_DELEGATE';
-function Te(e, t, n, r = {}) {
+const J = '_$DX_DELEGATE';
+function Ae(e, t, n, r = {}) {
if (!t)
throw new Error(
"The `element` passed to `render(..., element)` doesn't exist. Make sure `element` exists in the document.",
);
- let i;
+ let s;
return (
- N((s) => {
- (i = s), t === document ? e() : v(t, e(), t.firstChild ? null : void 0, n);
+ B((i) => {
+ (s = i), t === document ? e() : v(t, e(), t.firstChild ? null : void 0, n);
}, r.owner),
() => {
- i(), (t.textContent = '');
+ s(), (t.textContent = '');
}
);
}
-function k(e, t, n, r) {
- let i;
- const s = () => {
+function _(e, t, n, r) {
+ let s;
+ const i = () => {
const o = document.createElement('template');
return (o.innerHTML = e), o.content.firstChild;
},
- l = () => (i || (i = s())).cloneNode(!0);
+ l = () => (s || (s = i())).cloneNode(!0);
return (l.cloneNode = l), l;
}
-function oe(e, t = window.document) {
- const n = t[Q] || (t[Q] = new Set());
- for (let r = 0, i = e.length; r < i; r++) {
- const s = e[r];
- n.has(s) || (n.add(s), t.addEventListener(s, Ee));
+function re(e, t = window.document) {
+ const n = t[J] || (t[J] = new Set());
+ for (let r = 0, s = e.length; r < s; r++) {
+ const i = e[r];
+ n.has(i) || (n.add(i), t.addEventListener(i, Ce));
}
}
-function Ce(e, t, n, r) {
+function Te(e, t, n, r) {
Array.isArray(n) ? ((e[`$$${t}`] = n[0]), (e[`$$${t}Data`] = n[1])) : (e[`$$${t}`] = n);
}
function v(e, t, n, r) {
if ((n !== void 0 && !r && (r = []), typeof t != 'function')) return F(e, t, r, n);
- q((i) => F(e, t(), i, n), r);
+ G((s) => F(e, t(), s, n), r);
}
-function Ee(e) {
+function Ce(e) {
let t = e.target;
const n = `$$${e.type}`,
r = e.target,
- i = e.currentTarget,
- s = (c) => Object.defineProperty(e, 'target', { configurable: !0, value: c }),
+ s = e.currentTarget,
+ i = (c) => Object.defineProperty(e, 'target', { configurable: !0, value: c }),
l = () => {
const c = t[n];
if (c && !t.disabled) {
@@ -529,7 +529,7 @@ function Ee(e) {
typeof t.host != 'string' &&
!t.host._$host &&
t.contains(e.target) &&
- s(t.host),
+ i(t.host),
!0
);
},
@@ -546,24 +546,24 @@ function Ee(e) {
e.composedPath)
) {
const c = e.composedPath();
- s(c[0]);
+ i(c[0]);
for (let u = 0; u < c.length - 2 && ((t = c[u]), !!l()); u++) {
if (t._$host) {
(t = t._$host), o();
break;
}
- if (t.parentNode === i) break;
+ if (t.parentNode === s) break;
}
} else o();
- s(r);
+ i(r);
}
-function F(e, t, n, r, i) {
+function F(e, t, n, r, s) {
for (; typeof n == 'function'; ) n = n();
if (t === n) return n;
- const s = typeof t,
+ const i = typeof t,
l = r !== void 0;
- if (((e = (l && n[0] && n[0].parentNode) || e), s === 'string' || s === 'number')) {
- if (s === 'number' && ((t = t.toString()), t === n)) return n;
+ if (((e = (l && n[0] && n[0].parentNode) || e), i === 'string' || i === 'number')) {
+ if (i === 'number' && ((t = t.toString()), t === n)) return n;
if (l) {
let o = n[0];
o && o.nodeType === 3
@@ -574,11 +574,11 @@ function F(e, t, n, r, i) {
n !== '' && typeof n == 'string'
? (n = e.firstChild.data = t)
: (n = e.textContent = t);
- } else if (t == null || s === 'boolean') n = O(e, n, r);
+ } else if (t == null || i === 'boolean') n = O(e, n, r);
else {
- if (s === 'function')
+ if (i === 'function')
return (
- q(() => {
+ G(() => {
let o = t();
for (; typeof o == 'function'; ) o = o();
n = F(e, o, n, r);
@@ -588,10 +588,10 @@ function F(e, t, n, r, i) {
if (Array.isArray(t)) {
const o = [],
c = n && Array.isArray(n);
- if (K(o, t, n, i)) return q(() => (n = F(e, o, n, r, !0))), () => n;
+ if (K(o, t, n, s)) return G(() => (n = F(e, o, n, r, !0))), () => n;
if (o.length === 0) {
if (((n = O(e, n, r)), l)) return n;
- } else c ? (n.length === 0 ? Z(e, o, r) : Ae(e, n, o)) : (n && O(e), Z(e, o));
+ } else c ? (n.length === 0 ? Q(e, o, r) : _e(e, n, o)) : (n && O(e), Q(e, o));
n = o;
} else if (t.nodeType) {
if (Array.isArray(n)) {
@@ -607,19 +607,19 @@ function F(e, t, n, r, i) {
return n;
}
function K(e, t, n, r) {
- let i = !1;
- for (let s = 0, l = t.length; s < l; s++) {
- let o = t[s],
+ let s = !1;
+ for (let i = 0, l = t.length; i < l; i++) {
+ let o = t[i],
c = n && n[e.length],
u;
if (!(o == null || o === !0 || o === !1))
if ((u = typeof o) == 'object' && o.nodeType) e.push(o);
- else if (Array.isArray(o)) i = K(e, o, c) || i;
+ else if (Array.isArray(o)) s = K(e, o, c) || s;
else if (u === 'function')
if (r) {
for (; typeof o == 'function'; ) o = o();
- i = K(e, Array.isArray(o) ? o : [o], Array.isArray(c) ? c : [c]) || i;
- } else e.push(o), (i = !0);
+ s = K(e, Array.isArray(o) ? o : [o], Array.isArray(c) ? c : [c]) || s;
+ } else e.push(o), (s = !0);
else {
const f = String(o);
c && c.nodeType === 3 && c.data === f
@@ -627,31 +627,30 @@ function K(e, t, n, r) {
: e.push(document.createTextNode(f));
}
}
- return i;
+ return s;
}
-function Z(e, t, n = null) {
- for (let r = 0, i = t.length; r < i; r++) e.insertBefore(t[r], n);
+function Q(e, t, n = null) {
+ for (let r = 0, s = t.length; r < s; r++) e.insertBefore(t[r], n);
}
function O(e, t, n, r) {
if (n === void 0) return (e.textContent = '');
- const i = r || document.createTextNode('');
+ const s = r || document.createTextNode('');
if (t.length) {
- let s = !1;
+ let i = !1;
for (let l = t.length - 1; l >= 0; l--) {
const o = t[l];
- if (i !== o) {
+ if (s !== o) {
const c = o.parentNode === e;
- !s && !l ? (c ? e.replaceChild(i, o) : e.insertBefore(i, n)) : c && o.remove();
- } else s = !0;
+ !i && !l ? (c ? e.replaceChild(s, o) : e.insertBefore(s, n)) : c && o.remove();
+ } else i = !0;
}
- } else e.insertBefore(i, n);
- return [i];
+ } else e.insertBefore(s, n);
+ return [s];
}
-var H = ((e) => (
- (e.START_POMODORO = 'START_POMODORO'), (e.START_FOCUS_MODE = 'START_FOCUS_MODE'), e
- ))(H || {}),
- le = ((e) => ((e.PLUGIN_MESSAGE = 'PLUGIN_MESSAGE'), e))(le || {});
-const Oe = [
+var oe = ((e) => (
+ (e.START_POMODORO = 'START_POMODORO'), (e.START_FOCUS_MODE = 'START_FOCUS_MODE'), e
+))(oe || {});
+const Ee = [
{
id: 'overwhelm',
title: 'Overwhelm',
@@ -741,108 +740,108 @@ const Oe = [
],
},
];
-var Ie = k(
+var Oe = _(
`
Understanding Procrastination
Procrastination is an emotion regulation problem, not a time management problem.
The Procrastination Cycle
When we face tasks that trigger uncomfortable emotions, we enter a feedback loop:
Fear of failure
ā
Avoid the task
ā
Temporary relief
ā
Increased anxiety
Breaking the Cycle
The key is to approach procrastination with curiosity and compassion, not judgment. Ask yourself:
What emotions come up when I think about this task?
What specific aspect feels most challenging?
What am I afraid might happen if I start?
Practical Strategies
Start small: What's the tiniest first step you could take?
Time-box: Work for just 10-25 minutes, then take a break
Reframe: Focus on progress over perfection
Self-compassion: Speak to yourself as you would to a good friend
Common Triggers
Procrastination is often triggered by perfectionism, fear of failure, feeling overwhelmed, unclear expectations, or finding the task boring. Identifying your specific trigger is the first step to moving forward.