joplin-plugin-checkboxes-sum-calculator 0.0.0-stage β 1.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 giicha
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,101 @@
|
|
|
1
|
-
# Temporary Holding Version
|
|
2
1
|
|
|
3
|
-
|
|
2
|
+
<div align="center">
|
|
3
|
+
<h1>Joplin Checkbox Sum Calculator Plugin</h1>
|
|
4
|
+
<p>
|
|
5
|
+
<i>This is a plugin for <a href="https://github.com/laurent22/joplin">Joplin</a>. Refer to <a href="https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/toc/">joplin toc</a>.</i>
|
|
6
|
+
</p>
|
|
7
|
+
<p>
|
|
8
|
+
<img src="https://img.shields.io/github/issues/giicha/joplin-checkboxes-sum-calculator-plugin" />
|
|
9
|
+
<img src="https://img.shields.io/github/license/giicha/joplin-checkboxes-sum-calculator-plugin" />
|
|
10
|
+
<img src="https://img.shields.io/npm/v/joplin-plugin-checkboxes-sum-calculator?label=version" />
|
|
11
|
+
<img src="https://img.shields.io/github/downloads/giicha/joplin-checkboxes-sum-calculator-plugin/total?label=github%20downloads" />
|
|
12
|
+
<img src="https://img.shields.io/npm/dt/joplin-plugin-checkboxes-sum-calculator?label=npm%20downloads" />
|
|
13
|
+
</p>
|
|
14
|
+
<hr>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
Sidebar utility for Joplin that automatically scans your active note for **Markdown checklists** and **HTML tables containing checkboxes**, summing up all numerical values in real-time. It splits metrics intelligently into Checked, Unchecked (Remaining), and Grand Total counters, providing detailed breakdowns.
|
|
18
|
+
|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
The **Joplin Checkbox Sum Calculator** dynamically bridges text-editing with structured numerical workflows. Whenever you open or edit a note, the plugin sequentially tracks down your list tasks or table cells, runs an inline string parser to extract integers and decimals, handles localization formatting (supporting both dots `.` and commas `,` for decimals), and aggregates values cleanly inside your UI side pane.
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
## Use Cases & Examples
|
|
26
|
+
|
|
27
|
+
Here are 5 practical ways to automate your workflows using the **Checkbox Sum Calculator**:
|
|
28
|
+
|
|
29
|
+
* π **Smart Shopping Lists & Budget Estimators:** Build dynamic tables for your upcoming purchases. Bold text parameters like screen sizes (`**4K**`) or version tags (`**v12**`) to bypass calculation, and check items to instantly calculate the total cost of your active cart.
|
|
30
|
+
* π₯¦ **Daily Calorie & Macro Tracker:** Keep a food journal directly in your notes. Use decimal values (e.g., `1.5` servings or `0,5` packs) to precisely count calories, protein, or carbs as you check off what you eat throughout the day.
|
|
31
|
+
* π» **Freelance Billing & Time Tracking:** List completed tasks with hours spent (e.g., `4.5` hours). Toggle checkboxes as tasks get approved to see the cumulative billable hours or invoice totals in real-time.
|
|
32
|
+
* π **Savings Progress & Debt Paydown:** Set financial milestones (e.g., *Save from October bonus β 500*). Check off milestones as you deposit money, letting the sidebar track your exact total savings progress.
|
|
33
|
+
* π» **Hiking Gear Weight Planner:** Track every gram before a big trip. List your equipment with individual weights (`0.3` kg or `450` g). As you physically pack items into your backpack and check them, the panel updates the current total weight of your gear.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## Examples & Rules
|
|
37
|
+
|
|
38
|
+
The calculator follows strict processing protocols based on structural markdown and layout formats to ensure calculations remain robust and predictable:
|
|
39
|
+
|
|
40
|
+
### 1. Standard Markdown Checklists
|
|
41
|
+
* **Counted Values:** Ordinary whole or fractional numbers contained anywhere along a standard bullet list line (e.g., `- [x] Oats β 225.5 kcal`) are parsed completely.
|
|
42
|
+
* **Checked vs. Unchecked:** Checked tasks (`- [x]`) map directly into the **Checked** sum bucket. Empty checklist items (`- [ ]`) map directly to **Unchecked (Remaining)**.
|
|
43
|
+
|
|
44
|
+
### 2. Advanced HTML Tables
|
|
45
|
+
Tables apply an automated structural analysis matrix tailored for tabular accounting:
|
|
46
|
+
* **Single Checkbox Row Profile:** If a row contains **exactly one** checkbox (either filled or empty), the state of that single checkbox dictates the mathematical fate of the entire row. If marked checked, *all* regular numeric cell tokens across the entire horizontal row add up into **Checked**.
|
|
47
|
+
* **Multi-Checkbox Row Profile:** If a row contains **more than one** distinct checkbox cell, the plugin flips into a hyper-granular **cell-by-cell matrix layout mode**. Numbers are summed into **Checked** strictly within cells where the checkbox is marked active. Cells holding unselected checkboxes, text strings, or no checkboxes at all flow into **Unchecked**.
|
|
48
|
+
|
|
49
|
+
### 3. Smart Bold Number Isolation Rule
|
|
50
|
+
* If any number is formatted inside **bold text** (`**number**` or `__number__`) or placed inside a bold cell (`<b>`, `<strong>`), the engine marks it as a system metadata bypass token.
|
|
51
|
+
* It highlights the value in **yellow** inside the list views and **completely excludes it from all calculations**. This allows you to list sizes, years, model iterations, or dimensions (e.g., `MacBook Pro **15-inch** β 650`) without breaking your monetary or calorie math.
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## Installation
|
|
55
|
+
|
|
56
|
+
### Method 1: Directly via the Joplin App (Recommended)
|
|
57
|
+
1. Launch **Joplin** on your desktop.
|
|
58
|
+
2. Navigate to your global configuration window: `Tools` > `Options` (or `Joplin` > `Preferences` on macOS).
|
|
59
|
+
3. Select the **Plugins** segment tab from the sidebar interface.
|
|
60
|
+
4. Type **`Checkbox Sum`** directly inside the search inputs field bar.
|
|
61
|
+
5. Click **Install**, then gently restart the Joplin application bootstrap to activate the panel layout.
|
|
62
|
+
|
|
63
|
+
### Method 2: Manual JPL Installation via Local Repository Releases
|
|
64
|
+
1. Navigate to the release dashboard on the official **GitHub Repository**.
|
|
65
|
+
2. Download the latest compiled production binary file archive bundle: **`joplin-plugin-checkbox-sum.jpl`** from the assets tab.
|
|
66
|
+
3. Open Joplin's `Tools` > `Options` > `Plugins` panel menu.
|
|
67
|
+
4. Click the gear icon tool dropdown overlay located near the top and choose **"Install from file"**.
|
|
68
|
+
5. Select the downloaded `.jpl` binary, import it, and restart Joplin.
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
## Getting Started
|
|
72
|
+
|
|
73
|
+
Once initialized, using the plugin is immediate and seamlessly embedded inside your native layout flows:
|
|
74
|
+
|
|
75
|
+
1. Look up at your primary top toolbar cluster. Click the newly added **Square Checklist Plus (`+` inside a box)** toggle button.
|
|
76
|
+
2. The calculator's native sidebar view pane will instantly anchor onto the right side edge layout.
|
|
77
|
+
3. Open any note containing checklists or financial spreadsheets. The plugin immediately flushes real-time metrics onto your screen:
|
|
78
|
+
* **Checked Sum:** Large aesthetic display reflecting completed values.
|
|
79
|
+
* **Details List:** A chronological text mirror highlighting matching lines, coloring items in **green** (counted) or **yellow** (ignored bold tokens).
|
|
80
|
+
* **Analytics Summary Matrix:** A flat statistical breakdown detailing your exact *Checked*, *Unchecked (Remaining)*, and *Total* calculations.
|
|
81
|
+
4. **Infinite Height Support:** If your logs grow long (e.g., tracking a full year of savings or an intensive grocery receipt spreadsheet), the pane features an integrated vertical scroll container (`overflow-y: auto`) ensuring smooth scrolling access without breaking your UI.
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
## License
|
|
85
|
+
|
|
86
|
+
This repository is distributed under the terms of the **MIT License**. You are free to copy, modify, distribute, or use this extension setup commercially, provided the original author credits remain intact. See the `LICENSE` file for details.
|
|
87
|
+
|
|
88
|
+
<div align="center">
|
|
89
|
+
|
|
90
|
+
## Support the Project
|
|
91
|
+
|
|
92
|
+
If this plugin saves you time and helps you keep track of your calculations, consider supporting its further development! Any contribution is highly appreciated.
|
|
93
|
+
|
|
94
|
+
π΅ **USDT (TRC-20):** `TS1x5AR87CipqAqF3bb7sqePBKqRLFEc4Q`
|
|
95
|
+
|
|
96
|
+
πͺ **Bitcoin (BTC):** `bc1qpamcvn5le907jkt5zhhd4c2r783489nts72m8m`
|
|
97
|
+
|
|
98
|
+
π **Ethereum (ETH):** `0x354dc4b9cEC4fC05021Cd26734B8cc839390e5af`
|
|
99
|
+
|
|
100
|
+
</div>
|
|
101
|
+
|
package/README.md.bak
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
|
|
2
|
+
<div align="center">
|
|
3
|
+
<h1>Joplin Checkbox Sum Calculator Plugin</h1>
|
|
4
|
+
<p>
|
|
5
|
+
<i>This is a plugin for <a href="https://github.com/laurent22/joplin">Joplin</a>. Refer to <a href="https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/toc/">joplin toc</a>.</i>
|
|
6
|
+
</p>
|
|
7
|
+
<p>
|
|
8
|
+
<img src="https://img.shields.io/github/issues/giicha/joplin-checkboxes-sum-calculator-plugin" />
|
|
9
|
+
<img src="https://img.shields.io/github/license/giicha/joplin-checkboxes-sum-calculator-plugin" />
|
|
10
|
+
<img src="https://img.shields.io/npm/v/joplin-plugin-checkbox-sum-giicha?label=version" />
|
|
11
|
+
<img src="https://img.shields.io/github/downloads/giicha/joplin-checkboxes-sum-calculator-plugin/total?label=github%20downloads" />
|
|
12
|
+
<img src="https://img.shields.io/npm/dt/joplin-plugin-checkbox-sum-giicha?label=npm%20downloads" />
|
|
13
|
+
</p>
|
|
14
|
+
<hr>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
Sidebar utility for Joplin that automatically scans your active note for **Markdown checklists** and **HTML tables containing checkboxes**, summing up all numerical values in real-time. It splits metrics intelligently into Checked, Unchecked (Remaining), and Grand Total counters, providing detailed breakdowns.
|
|
18
|
+
|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
The **Joplin Checkbox Sum Calculator** dynamically bridges text-editing with structured numerical workflows. Whenever you open or edit a note, the plugin sequentially tracks down your list tasks or table cells, runs an inline string parser to extract integers and decimals, handles localization formatting (supporting both dots `.` and commas `,` for decimals), and aggregates values cleanly inside your UI side pane.
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
## Use Cases & Examples
|
|
26
|
+
|
|
27
|
+
Here are 5 practical ways to automate your workflows using the **Checkbox Sum Calculator**:
|
|
28
|
+
|
|
29
|
+
* π **Smart Shopping Lists & Budget Estimators:** Build dynamic tables for your upcoming purchases. Bold text parameters like screen sizes (`**4K**`) or version tags (`**v12**`) to bypass calculation, and check items to instantly calculate the total cost of your active cart.
|
|
30
|
+
* π₯¦ **Daily Calorie & Macro Tracker:** Keep a food journal directly in your notes. Use decimal values (e.g., `1.5` servings or `0,5` packs) to precisely count calories, protein, or carbs as you check off what you eat throughout the day.
|
|
31
|
+
* π» **Freelance Billing & Time Tracking:** List completed tasks with hours spent (e.g., `4.5` hours). Toggle checkboxes as tasks get approved to see the cumulative billable hours or invoice totals in real-time.
|
|
32
|
+
* π **Savings Progress & Debt Paydown:** Set financial milestones (e.g., *Save from October bonus β 500*). Check off milestones as you deposit money, letting the sidebar track your exact total savings progress.
|
|
33
|
+
* π» **Hiking Gear Weight Planner:** Track every gram before a big trip. List your equipment with individual weights (`0.3` kg or `450` g). As you physically pack items into your backpack and check them, the panel updates the current total weight of your gear.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## Examples & Rules
|
|
37
|
+
|
|
38
|
+
The calculator follows strict processing protocols based on structural markdown and layout formats to ensure calculations remain robust and predictable:
|
|
39
|
+
|
|
40
|
+
### 1. Standard Markdown Checklists
|
|
41
|
+
* **Counted Values:** Ordinary whole or fractional numbers contained anywhere along a standard bullet list line (e.g., `- [x] Oats β 225.5 kcal`) are parsed completely.
|
|
42
|
+
* **Checked vs. Unchecked:** Checked tasks (`- [x]`) map directly into the **Checked** sum bucket. Empty checklist items (`- [ ]`) map directly to **Unchecked (Remaining)**.
|
|
43
|
+
|
|
44
|
+
### 2. Advanced HTML Tables
|
|
45
|
+
Tables apply an automated structural analysis matrix tailored for tabular accounting:
|
|
46
|
+
* **Single Checkbox Row Profile:** If a row contains **exactly one** checkbox (either filled or empty), the state of that single checkbox dictates the mathematical fate of the entire row. If marked checked, *all* regular numeric cell tokens across the entire horizontal row add up into **Checked**.
|
|
47
|
+
* **Multi-Checkbox Row Profile:** If a row contains **more than one** distinct checkbox cell, the plugin flips into a hyper-granular **cell-by-cell matrix layout mode**. Numbers are summed into **Checked** strictly within cells where the checkbox is marked active. Cells holding unselected checkboxes, text strings, or no checkboxes at all flow into **Unchecked**.
|
|
48
|
+
|
|
49
|
+
### 3. Smart Bold Number Isolation Rule
|
|
50
|
+
* If any number is formatted inside **bold text** (`**number**` or `__number__`) or placed inside a bold cell (`<b>`, `<strong>`), the engine marks it as a system metadata bypass token.
|
|
51
|
+
* It highlights the value in **yellow** inside the list views and **completely excludes it from all calculations**. This allows you to list sizes, years, model iterations, or dimensions (e.g., `MacBook Pro **15-inch** β 650`) without breaking your monetary or calorie math.
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## Installation
|
|
55
|
+
|
|
56
|
+
### Method 1: Directly via the Joplin App (Recommended)
|
|
57
|
+
1. Launch **Joplin** on your desktop.
|
|
58
|
+
2. Navigate to your global configuration window: `Tools` > `Options` (or `Joplin` > `Preferences` on macOS).
|
|
59
|
+
3. Select the **Plugins** segment tab from the sidebar interface.
|
|
60
|
+
4. Type **`Checkbox Sum`** directly inside the search inputs field bar.
|
|
61
|
+
5. Click **Install**, then gently restart the Joplin application bootstrap to activate the panel layout.
|
|
62
|
+
|
|
63
|
+
### Method 2: Manual JPL Installation via Local Repository Releases
|
|
64
|
+
1. Navigate to the release dashboard on the official **GitHub Repository**.
|
|
65
|
+
2. Download the latest compiled production binary file archive bundle: **`joplin-plugin-checkbox-sum.jpl`** from the assets tab.
|
|
66
|
+
3. Open Joplin's `Tools` > `Options` > `Plugins` panel menu.
|
|
67
|
+
4. Click the gear icon tool dropdown overlay located near the top and choose **"Install from file"**.
|
|
68
|
+
5. Select the downloaded `.jpl` binary, import it, and restart Joplin.
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
## Getting Started
|
|
72
|
+
|
|
73
|
+
Once initialized, using the plugin is immediate and seamlessly embedded inside your native layout flows:
|
|
74
|
+
|
|
75
|
+
1. Look up at your primary top toolbar cluster. Click the newly added **Square Checklist Plus (`+` inside a box)** toggle button.
|
|
76
|
+
2. The calculator's native sidebar view pane will instantly anchor onto the right side edge layout.
|
|
77
|
+
3. Open any note containing checklists or financial spreadsheets. The plugin immediately flushes real-time metrics onto your screen:
|
|
78
|
+
* **Checked Sum:** Large aesthetic display reflecting completed values.
|
|
79
|
+
* **Details List:** A chronological text mirror highlighting matching lines, coloring items in **green** (counted) or **yellow** (ignored bold tokens).
|
|
80
|
+
* **Analytics Summary Matrix:** A flat statistical breakdown detailing your exact *Checked*, *Unchecked (Remaining)*, and *Total* calculations.
|
|
81
|
+
4. **Infinite Height Support:** If your logs grow long (e.g., tracking a full year of savings or an intensive grocery receipt spreadsheet), the pane features an integrated vertical scroll container (`overflow-y: auto`) ensuring smooth scrolling access without breaking your UI.
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
## License
|
|
85
|
+
|
|
86
|
+
This repository is distributed under the terms of the **MIT License**. You are free to copy, modify, distribute, or use this extension setup commercially, provided the original author credits remain intact. See the `LICENSE` file for details.
|
|
87
|
+
|
|
88
|
+
<div align="center">
|
|
89
|
+
|
|
90
|
+
## Support the Project
|
|
91
|
+
|
|
92
|
+
If this plugin saves you time and helps you keep track of your calculations, consider supporting its further development! Any contribution is highly appreciated.
|
|
93
|
+
|
|
94
|
+
π΅ **USDT (TRC-20):** `TS1x5AR87CipqAqF3bb7sqePBKqRLFEc4Q`
|
|
95
|
+
|
|
96
|
+
πͺ **Bitcoin (BTC):** `bc1qpamcvn5le907jkt5zhhd4c2r783489nts72m8m`
|
|
97
|
+
|
|
98
|
+
π **Ethereum (ETH):** `0x354dc4b9cEC4fC05021Cd26734B8cc839390e5af`
|
|
99
|
+
|
|
100
|
+
</div>
|
|
101
|
+
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var t={998(t,e){e.default=joplin},156(t,e,o){var n=this&&this.__awaiter||function(t,e,o,n){return new(o||(o=Promise))(function(r,i){function l(t){try{a(n.next(t))}catch(t){i(t)}}function s(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof o?e:new o(function(t){t(e)})).then(l,s)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const r=o(998);r.default.plugins.register({onStart:function(){return n(this,void 0,void 0,function*(){const t=r.default.views.panels,e=yield t.create("checkbox_sum_panel");let o=!0;function i(t){return t?t.replace(/<\/?[^>]+(>|\$)/g,"").replace(/ /gi,"").replace(/\s+/g," ").trim():""}function l(){return n(this,void 0,void 0,function*(){const o=yield r.default.workspace.selectedNote();if(!o||!o.body)return void(yield t.setHtml(e,'<div style="padding: 10px; font-family: sans-serif;"><h3>Checked Sum:</h3><h1 style="color: #2da44e; font-size: 36px; margin: 0;"><b>0</b></h1></div>'));let n=0,l=0;const s=/\d+(?:[\.,]\d+)?/g;let a=[];const d=o.body,c=[],p=/<tr[^>]*>([\s\(\S\)]*?)<\/tr>/gi;let f;for(;null!==(f=p.exec(d));)c.push({index:f.index,type:"html",content:f});const b=/^\s*-\s+\[([ xX])\]([^\n\r]*)/gm;let u;for(;null!==(u=b.exec(d));)c.push({index:u.index,type:"md",content:u});c.sort((t,e)=>t.index-e.index);for(const t of c)if("html"===t.type){const e=t.content[0],o=/<td[^>]*>([\s\(\S\)]*?)<\/td>/gi;let r;const d=[];for(;null!==(r=o.exec(e));)d.push(r[0]);o.lastIndex=0;let c=0,p=!1;for(const t of d)(/class="[^"]*(?:checked|checkbox|joplin-checklist)[^"]*"/i.test(t)||/<li[^>]*>/i.test(t))&&(c++,/class="[^"]*checked[^"]*"/i.test(t)&&(p=!0));if(c>0){let t=[],d=0,f=0,b=!1;for(;null!==(r=o.exec(e));){const e=r[0],o=i(e);if(o.length>0){const n=/class="[^"]*checked[^"]*"/i.test(e);let r=o;if(/<b[^>]*>.*?<\/b>|<strong[^>]*>.*?<\/strong>|font-weight:\s*bold/gi.test(e))r=o.replace(s,t=>`<mark style="background-color: #fff2a3; color: #5d4037; padding: 0 2px; border-radius: 2px;">${t}</mark>`);else{const t=o.match(s);if(c<=1){if(p){if(b=!0,r=o.replace(s,t=>`<mark style="background-color: #d1f5d3; color: #1b5e20; padding: 0 2px; border-radius: 2px; font-weight: bold;">${t}</mark>`),t)for(const e of t)d+=parseFloat(e.replace(",","."))}else if(r=o.replace(s,t=>`<mark style="background-color: #f0f0f0; color: #666; padding: 0 2px; border-radius: 2px;">${t}</mark>`),t)for(const e of t)f+=parseFloat(e.replace(",","."))}else if(n){if(b=!0,r=o.replace(s,t=>`<mark style="background-color: #d1f5d3; color: #1b5e20; padding: 0 2px; border-radius: 2px; font-weight: bold;">${t}</mark>`),t)for(const e of t)d+=parseFloat(e.replace(",","."))}else if(r=o.replace(s,t=>`<mark style="background-color: #f0f0f0; color: #666; padding: 0 2px; border-radius: 2px;">${t}</mark>`),t)for(const e of t)f+=parseFloat(e.replace(",","."))}t.push(r)}}if(n+=d,l+=f,b&&d>0){const e=Number(d.toFixed(2));a.push(`<b>${e}</b> (${t.join(" - ")})`)}}}else{const e="x"===t.content[1].trim().toLowerCase(),o=t.content[2];if(o&&o.trim().length>0){let t=0,r=o.trim().replace(/\*\*([\s\(\S\)]*?)\*\*/g,(t,e)=>`<b>${e.replace(s,t=>`<mark class="sum-ignored" style="background-color: #fff2a3; color: #5d4037; padding: 0 2px; border-radius: 2px; font-weight: bold;">${t}</mark>`)}</b>`).replace(/__([\s\(\S\)]*?)__/g,(t,e)=>`<b>${e.replace(s,t=>`<mark class="sum-ignored" style="background-color: #fff2a3; color: #5d4037; padding: 0 2px; border-radius: 2px; font-weight: bold;">${t}</mark>`)}</b>`),i=r;i=i.replace(/<mark class=["']sum-ignored["'][^>]*>.*?<\/mark>/gi,"");const d=i.match(s);if(d)for(const e of d){const o=parseFloat(e.replace(",","."));isNaN(o)||(t+=o)}const c=r.split(/(<mark[^>]*>.*?<\/mark>|<b>.*?<\/b>)/g);let p=[];for(const t of c)if(t.startsWith("<mark")||t.startsWith("<b>"))p.push(t);else{let o=t;o=e?t.replace(s,t=>`<mark style="background-color: #d1f5d3; color: #1b5e20; padding: 0 2px; border-radius: 2px; font-weight: bold;">${t}</mark>`):t.replace(s,t=>`<mark style="background-color: #f0f0f0; color: #666; padding: 0 2px; border-radius: 2px;">${t}</mark>`),p.push(o)}let f=p.join("");f=f.replace(/<\/?b[^>]*>/gi,"");const b=Number(t.toFixed(2));e?(n+=Number(t),a.push(`<b>${b}</b> (${f})`)):l+=Number(t)}}let g="";if(a.length>0){g='<h4 style="margin-top: 20px; margin-bottom: 5px; color: #666; border-top: 1px solid #ddd; padding-top: 10px;">Details:</h4>',g+='<ul style="padding-left: 20px; margin: 0; font-size: 14px; color: #333; line-height: 1.4;">';for(const t of a)g+=`<li style="margin-bottom: 4px;">${t}</li>`;g+="</ul>"}const h=Number(n.toFixed(2)),m=`\n\t\t\t\t<div style="margin-top: 15px; padding-top: 10px; border-top: 1px dashed #bbb; font-size: 13px; color: #444; line-height: 1.6;">\n\t\t\t\t\t<div style="display: flex; justify-content: space-between; margin-bottom: 2px;">\n\t\t\t\t\t\t<span>Π‘hecked:</span>\n\t\t\t\t\t\t<span style="color: #2da44e; font-weight: bold;">${h}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: flex; justify-content: space-between; margin-bottom: 4px;">\n\t\t\t\t\t\t<span>Unchecked (Remaining):</span>\n\t\t\t\t\t\t<span style="color: #c93b3b; font-weight: bold;">${Number(l.toFixed(2))}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: flex; justify-content: space-between; color: #000; margin-top: 4px; padding: 2px 0;">\n\t\t\t\t\t\t<span>Total:</span>\n\t\t\t\t\t\t<span>${Number((n+l).toFixed(2))}</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t`;yield t.setHtml(e,`\n\t\t\t\t<div style="padding: 10px; font-family: sans-serif; box-sizing: border-box; height: 100vh; overflow-y: auto;">\n\t\t\t\t\t<h3 style="margin-bottom: 5px; color: #555;">Checked Sum:</h3>\n\t\t\t\t\t<h1 style="color: #2da44e; font-size: 36px; margin: 0;"><b>${h}</b></h1>\n\t\t\t\t\t${g}\n\t\t\t\t\t${m}\n\t\t\t\t\t<p style="font-size: 11px; color: #888; margin-top: 20px; border-top: 1px dashed #ccc; padding-top: 8px; line-height: 1.4; padding-bottom: 20px;">\n\t\t\t\t\t\t<i>Notice: All numbers in the row are added up (e.g., model IDs or serial numbers), except those formatted in <b>bold</b>. Counted numbers are highlighted in <span style="background-color: #d1f5d3; color: #1b5e20; padding: 0 2px; border-radius: 2px; font-weight: bold;">green</span>. Ignored numbers are highlighted in <span style="background-color: #fff2a3; color: #5d4037; padding: 0 2px; border-radius: 2px; font-weight: bold;">yellow</span>.</i>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t`)})}yield t.setHtml(e,'<div style="padding: 10px; font-family: sans-serif;"><h3>Checked Sum:</h3><h1 style="color: #2da44e; font-size: 36px; margin: 0;"><b>0</b></h1></div>'),yield t.show(e),yield r.default.commands.register({name:"toggleCheckboxSumPanel",label:"Toggle Checkbox Sum Panel",iconName:"fas fa-plus-square",execute:()=>n(this,void 0,void 0,function*(){o=!o,o?(yield t.show(e),l()):yield t.hide(e)})}),yield r.default.views.toolbarButtons.create("toggleCheckboxSumPanelButton","toggleCheckboxSumPanel","noteToolbar"),yield r.default.workspace.onNoteChange(()=>{o&&l()}),yield r.default.workspace.onNoteSelectionChange(()=>{o&&l()}),l()})}})}};const e={};!function o(n){const r=e[n];if(void 0!==r)return r.exports;const i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,o),i.exports}(156)})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "joplin-plugin-checkboxes-sum-calculator",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.26",
|
|
4
|
+
"description": "Plugin for Joplin that summing up all numbers in strings, rows or cells with checked checkboxes.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"joplin-plugin"
|
|
8
|
+
],
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"name": "joplin-plugin-checkboxes-sum-calculator",
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"dist": "webpack --env joplin-plugin-config=buildMain && webpack --env joplin-plugin-config=buildExtraScripts && webpack --env joplin-plugin-config=createArchive",
|
|
15
|
+
"prepare": "npm run dist",
|
|
16
|
+
"updateVersion": "webpack --env joplin-plugin-config=updateVersion",
|
|
17
|
+
"update": "npm install -g generator-joplin && yo joplin --node-package-manager npm --update --force"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/giicha/joplin-checkboxes-sum-calculator-plugin"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"files": [
|
|
25
|
+
"publish"
|
|
26
|
+
],
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/node": "^18.7.13",
|
|
29
|
+
"chalk": "^4.1.0",
|
|
30
|
+
"copy-webpack-plugin": "^14.0.0",
|
|
31
|
+
"fs-extra": "^10.1.0",
|
|
32
|
+
"glob": "^8.0.3",
|
|
33
|
+
"tar": "^7.5.21",
|
|
34
|
+
"ts-loader": "^9.3.1",
|
|
35
|
+
"typescript": "^4.8.2",
|
|
36
|
+
"webpack": "^5.74.0",
|
|
37
|
+
"webpack-cli": "^4.10.0"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": 1,
|
|
3
|
+
"id": "com.giicha.joplin-checkboxes-sum-calculator-pluginn",
|
|
4
|
+
"app_min_version": "3.7",
|
|
5
|
+
"version": "1.0.26",
|
|
6
|
+
"name": "Checkbox Sum Calculator",
|
|
7
|
+
"description": "Summing up all numbers in strings, rows or cells with checked checkboxes.",
|
|
8
|
+
"author": "giicha",
|
|
9
|
+
"homepage_url": "https://github.com/giicha/joplin-checkboxes-sum-calculator-plugin",
|
|
10
|
+
"repository_url": "https://github.com/giicha/joplin-checkboxes-sum-calculator-plugin",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"joplin-plugin",
|
|
13
|
+
"checkbox",
|
|
14
|
+
"sum",
|
|
15
|
+
"calculator",
|
|
16
|
+
"checklist",
|
|
17
|
+
"budget"
|
|
18
|
+
],
|
|
19
|
+
"categories": [
|
|
20
|
+
"productivity"
|
|
21
|
+
],
|
|
22
|
+
"screenshots": [
|
|
23
|
+
{
|
|
24
|
+
"src": "images/ExA_1-0-11_s.png",
|
|
25
|
+
"label": "Calculate example"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"icons": {
|
|
29
|
+
"16": "images/CSC-16.png",
|
|
30
|
+
"24": "images/CSC-24.png",
|
|
31
|
+
"32": "images/CSC-32.png",
|
|
32
|
+
"48": "images/CSC-48.png",
|
|
33
|
+
"64": "images/CSC-64.png",
|
|
34
|
+
"128": "images/CSC-128.png",
|
|
35
|
+
"256": "images/CSC-256.png"
|
|
36
|
+
},
|
|
37
|
+
"promo_tile": {
|
|
38
|
+
"src": "images/CSC_Promo.png",
|
|
39
|
+
"label": "Checkbox Sum Calculator"
|
|
40
|
+
},
|
|
41
|
+
"_publish_hash": "sha256:d686840ba189e9187aff2726a8780935bf6603759af01525c0d044937667f8d6",
|
|
42
|
+
"_publish_commit": "master:3a95e7b3bf71705a2c376364b25333b9f7c6efa8"
|
|
43
|
+
}
|