diff --git a/manifest.json b/manifest.json index 96c0557..2ae5bfe 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-habitica-integration", "name": "Habitica Sync", - "version": "1.0.1", + "version": "1.0.2", "minAppVersion": "0.9.12", "description": "This plugin helps integrate Habitica user tasks and stats into Obsidian", "author": "Leoh and Ran", diff --git a/package.json b/package.json index 80f9f65..37371e6 100644 --- a/package.json +++ b/package.json @@ -4,47 +4,48 @@ "description": "This plugin allows for Habitica integration into Obsidian", "main": "main.js", "scripts": { - "dev": "rollup --config rollup.config.js -w", - "build": "rollup --config rollup.config.js --environment BUILD:production", + "dev": "rollup --config rollup.config.mjs -w", + "build": "rollup --config rollup.config.mjs --environment BUILD:production", "dev2": "obsidian-plugin dev src/main.ts" }, "keywords": [], "author": "Leonard and Ran", "license": "MIT", "devDependencies": { - "@rollup/plugin-commonjs": "^18.0.0", - "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-node-resolve": "^11.2.1", - "@rollup/plugin-typescript": "^8.2.1", - "@types/markdown-it": "^12.2.3", - "@types/markdown-it-emoji": "^2.0.2", - "@types/node": "^14.14.37", - "@types/node-emoji": "^1.8.1", - "@types/react": "^17.0.27", - "@types/react-dom": "^17.0.9", - "@types/react-tabs": "^2.3.3", - "@types/twemoji": "^12.1.2", - "css-loader": "^6.4.0", - "extract-text-webpack-plugin": "^2.1.2", - "obsidian": "^0.12.0", - "obsidian-plugin-cli": "^0.4.3", - "rollup": "^2.32.1", - "style-loader": "^3.3.0", - "tslib": "^2.2.0", - "typescript": "^4.2.4" + "@rollup/plugin-commonjs": "^25.0.7", + "@rollup/plugin-json": "^6.1.0", + "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-typescript": "^11.1.6", + "@types/markdown-it": "^13.0.7", + "@types/markdown-it-emoji": "^2.0.4", + "@types/node": "^20.11.0", + "@types/node-emoji": "^1.8.2", + "@types/react": "^18.2.47", + "@types/react-dom": "^18.2.18", + "@types/react-tabs": "^5.0.4", + "@types/twemoji": "^13.1.1", + "css-loader": "^6.9.0", + "mini-css-extract-plugin": "^2.7.7", + "obsidian": "^1.4.11", + "obsidian-plugin-cli": "^0.0.5", + "rollup": "^4.9.4", + "style-loader": "^3.3.4", + "tslib": "^2.6.2", + "typescript": "^5.3.3", + "webpack": "^5.89.0" }, "dependencies": { - "markdown-it": "^12.3.2", - "markdown-it-emoji": "^2.0.0", - "moment": "^2.29.1", - "node": "^16.10.0", - "node-emoji": "^1.11.0", - "node-fetch": "^3.0.0", - "react": "^17.0.2", - "react-dom": "^17.0.2", - "react-emoji-render": "^1.2.4", - "react-markdown": "^7.1.0", - "react-tabs": "^3.2.2", - "twemoji": "^13.1.0" + "markdown-it": "^14.0.0", + "markdown-it-emoji": "^2.0.2", + "moment": "^2.30.1", + "node": "^21.2.0", + "node-emoji": "^2.1.3", + "node-fetch": "^3.3.2", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-emoji-render": "^2.0.1", + "react-markdown": "^9.0.1", + "react-tabs": "^6.0.2", + "twemoji": "^14.0.2" } } diff --git a/rollup.config.js b/rollup.config.mjs similarity index 95% rename from rollup.config.js rename to rollup.config.mjs index 6da9767..1551460 100644 --- a/rollup.config.js +++ b/rollup.config.mjs @@ -1,32 +1,32 @@ -import typescript from '@rollup/plugin-typescript'; -import {nodeResolve} from '@rollup/plugin-node-resolve'; -import commonjs from '@rollup/plugin-commonjs'; -import json from '@rollup/plugin-json'; - -const isProd = (process.env.BUILD === 'production'); - -const banner = -`/* -THIS IS A GENERATED/BUNDLED FILE BY ROLLUP -if you want to view the source visit the plugins github repository -*/ -`; - -export default { - input: 'src/main.ts', - output: { - dir: '.', - sourcemap: 'inline', - sourcemapExcludeSources: isProd, - format: 'cjs', - exports: 'default', - banner, - }, - external: ['obsidian'], - plugins: [ - typescript(), - nodeResolve({browser: true}), - commonjs(), - json(), - ] +import typescript from '@rollup/plugin-typescript'; +import {nodeResolve} from '@rollup/plugin-node-resolve'; +import commonjs from '@rollup/plugin-commonjs'; +import json from '@rollup/plugin-json'; + +const isProd = (process.env.BUILD === 'production'); + +const banner = +`/* +THIS IS A GENERATED/BUNDLED FILE BY ROLLUP +if you want to view the source visit the plugins github repository +*/ +`; + +export default { + input: 'src/main.ts', + output: { + dir: '.', + sourcemap: 'inline', + sourcemapExcludeSources: isProd, + format: 'cjs', + exports: 'default', + banner, + }, + external: ['obsidian'], + plugins: [ + typescript(), + nodeResolve({browser: true}), + commonjs(), + json(), + ] }; \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index 13cae87..b8eaff4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -39,7 +39,7 @@ export default class HabiticaSync extends Plugin { this.activateView(); } }); - + } async loadSettings() { this.settings = Object.assign(DEFAULT_SETTINGS, await this.loadData()) @@ -50,22 +50,22 @@ export default class HabiticaSync extends Plugin { async onunload() { await this.view.onClose(); - + this.app.workspace .getLeavesOfType(VIEW_TYPE) .forEach((leaf) => leaf.detach()); } async activateView() { this.app.workspace.detachLeavesOfType(VIEW_TYPE); - + await this.app.workspace.getRightLeaf(false).setViewState({ type: VIEW_TYPE, active: true, }); - + this.app.workspace.revealLeaf( this.app.workspace.getLeavesOfType(VIEW_TYPE)[0] ); } - + } diff --git a/src/view/Components/Taskview/Dailiesview/index.tsx b/src/view/Components/Taskview/Dailiesview/index.tsx index 9785888..db5944b 100644 --- a/src/view/Components/Taskview/Dailiesview/index.tsx +++ b/src/view/Components/Taskview/Dailiesview/index.tsx @@ -62,12 +62,30 @@ export default function Index(props: any){ } }) + const allDailies = props.dailys.map((daily: any) => { + // if(daily.completed) + // return + let daily_notes = ''; + let daily_subtasks = ''; + if (props.settings.showTaskDescription) { + daily_notes = daily.notes; + } + + if (props.settings.showSubTasks) { + daily_subtasks = daily.checklist; + } + return + }) + const display =
Active Completed Not Due + All
    {incompleteDailies}
@@ -78,6 +96,9 @@ export default function Index(props: any){
    {notDueDailies}
+ +
    {allDailies}
+
return(display); diff --git a/src/view/Components/Taskview/Todoview/index.tsx b/src/view/Components/Taskview/Todoview/index.tsx index a050528..035b52e 100644 --- a/src/view/Components/Taskview/Todoview/index.tsx +++ b/src/view/Components/Taskview/Todoview/index.tsx @@ -36,10 +36,10 @@ export default function Index(props: any){ Completed -
    {incompleteTodos}
+
    {incompleteTodos}
-
    {completedTodos}
+
    {completedTodos}
diff --git a/styles.css b/styles.css index 935ffb9..90c9ec1 100644 --- a/styles.css +++ b/styles.css @@ -1,10 +1,6 @@ @import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@1,300&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Open Sans:ital,wght@0,400;1,100&family=Roboto&display=swap'); -* { - padding: 0; -} - .add-task-input { display: flex; } @@ -45,6 +41,7 @@ font-family: Roboto, sans-serif; font-weight: bold; font-size: 16px; + padding-left: 0; } .description { @@ -54,6 +51,9 @@ .description > ul { list-style-type: none; } +p { + margin: 0; +} .habit-text { text-align: left !important; @@ -320,4 +320,4 @@ button { .description>ul { list-style-type: disc; margin-left: 10% !important; -} \ No newline at end of file +} diff --git a/tsconfig.json b/tsconfig.json index 95b95d2..c6bbfcb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,6 +10,7 @@ "moduleResolution": "node", "importHelpers": true, "allowSyntheticDefaultImports": true, + "esModuleInterop": true, "lib": [ "dom", "es5",