Compare commits
No commits in common. "main" and "1.0.0" have entirely different histories.
8 changed files with 78 additions and 98 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "obsidian-habitica-integration",
|
"id": "obsidian-habitica-integration",
|
||||||
"name": "Habitica Sync",
|
"name": "Habitica Sync",
|
||||||
"version": "1.0.2",
|
"version": "1.0.0",
|
||||||
"minAppVersion": "0.9.12",
|
"minAppVersion": "0.9.12",
|
||||||
"description": "This plugin helps integrate Habitica user tasks and stats into Obsidian",
|
"description": "This plugin helps integrate Habitica user tasks and stats into Obsidian",
|
||||||
"author": "Leoh and Ran",
|
"author": "Leoh and Ran",
|
||||||
|
|
|
||||||
69
package.json
69
package.json
|
|
@ -4,48 +4,47 @@
|
||||||
"description": "This plugin allows for Habitica integration into Obsidian",
|
"description": "This plugin allows for Habitica integration into Obsidian",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "rollup --config rollup.config.mjs -w",
|
"dev": "rollup --config rollup.config.js -w",
|
||||||
"build": "rollup --config rollup.config.mjs --environment BUILD:production",
|
"build": "rollup --config rollup.config.js --environment BUILD:production",
|
||||||
"dev2": "obsidian-plugin dev src/main.ts"
|
"dev2": "obsidian-plugin dev src/main.ts"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "Leonard and Ran",
|
"author": "Leonard and Ran",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-commonjs": "^25.0.7",
|
"@rollup/plugin-commonjs": "^18.0.0",
|
||||||
"@rollup/plugin-json": "^6.1.0",
|
"@rollup/plugin-json": "^4.1.0",
|
||||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
"@rollup/plugin-node-resolve": "^11.2.1",
|
||||||
"@rollup/plugin-typescript": "^11.1.6",
|
"@rollup/plugin-typescript": "^8.2.1",
|
||||||
"@types/markdown-it": "^13.0.7",
|
"@types/markdown-it": "^12.2.3",
|
||||||
"@types/markdown-it-emoji": "^2.0.4",
|
"@types/markdown-it-emoji": "^2.0.2",
|
||||||
"@types/node": "^20.11.0",
|
"@types/node": "^14.14.37",
|
||||||
"@types/node-emoji": "^1.8.2",
|
"@types/node-emoji": "^1.8.1",
|
||||||
"@types/react": "^18.2.47",
|
"@types/react": "^17.0.27",
|
||||||
"@types/react-dom": "^18.2.18",
|
"@types/react-dom": "^17.0.9",
|
||||||
"@types/react-tabs": "^5.0.4",
|
"@types/react-tabs": "^2.3.3",
|
||||||
"@types/twemoji": "^13.1.1",
|
"@types/twemoji": "^12.1.2",
|
||||||
"css-loader": "^6.9.0",
|
"css-loader": "^6.4.0",
|
||||||
"mini-css-extract-plugin": "^2.7.7",
|
"extract-text-webpack-plugin": "^2.1.2",
|
||||||
"obsidian": "^1.4.11",
|
"obsidian": "^0.12.0",
|
||||||
"obsidian-plugin-cli": "^0.0.5",
|
"obsidian-plugin-cli": "^0.4.3",
|
||||||
"rollup": "^4.9.4",
|
"rollup": "^2.32.1",
|
||||||
"style-loader": "^3.3.4",
|
"style-loader": "^3.3.0",
|
||||||
"tslib": "^2.6.2",
|
"tslib": "^2.2.0",
|
||||||
"typescript": "^5.3.3",
|
"typescript": "^4.2.4"
|
||||||
"webpack": "^5.89.0"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"markdown-it": "^14.0.0",
|
"markdown-it": "^12.3.2",
|
||||||
"markdown-it-emoji": "^2.0.2",
|
"markdown-it-emoji": "^2.0.0",
|
||||||
"moment": "^2.30.1",
|
"moment": "^2.29.1",
|
||||||
"node": "^21.2.0",
|
"node": "^16.10.0",
|
||||||
"node-emoji": "^2.1.3",
|
"node-emoji": "^1.11.0",
|
||||||
"node-fetch": "^3.3.2",
|
"node-fetch": "^3.0.0",
|
||||||
"react": "^18.2.0",
|
"react": "^17.0.2",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^17.0.2",
|
||||||
"react-emoji-render": "^2.0.1",
|
"react-emoji-render": "^1.2.4",
|
||||||
"react-markdown": "^9.0.1",
|
"react-markdown": "^7.1.0",
|
||||||
"react-tabs": "^6.0.2",
|
"react-tabs": "^3.2.2",
|
||||||
"twemoji": "^14.0.2"
|
"twemoji": "^13.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,32 +1,32 @@
|
||||||
import typescript from '@rollup/plugin-typescript';
|
import typescript from '@rollup/plugin-typescript';
|
||||||
import {nodeResolve} from '@rollup/plugin-node-resolve';
|
import {nodeResolve} from '@rollup/plugin-node-resolve';
|
||||||
import commonjs from '@rollup/plugin-commonjs';
|
import commonjs from '@rollup/plugin-commonjs';
|
||||||
import json from '@rollup/plugin-json';
|
import json from '@rollup/plugin-json';
|
||||||
|
|
||||||
const isProd = (process.env.BUILD === 'production');
|
const isProd = (process.env.BUILD === 'production');
|
||||||
|
|
||||||
const banner =
|
const banner =
|
||||||
`/*
|
`/*
|
||||||
THIS IS A GENERATED/BUNDLED FILE BY ROLLUP
|
THIS IS A GENERATED/BUNDLED FILE BY ROLLUP
|
||||||
if you want to view the source visit the plugins github repository
|
if you want to view the source visit the plugins github repository
|
||||||
*/
|
*/
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
input: 'src/main.ts',
|
input: 'src/main.ts',
|
||||||
output: {
|
output: {
|
||||||
dir: '.',
|
dir: '.',
|
||||||
sourcemap: 'inline',
|
sourcemap: 'inline',
|
||||||
sourcemapExcludeSources: isProd,
|
sourcemapExcludeSources: isProd,
|
||||||
format: 'cjs',
|
format: 'cjs',
|
||||||
exports: 'default',
|
exports: 'default',
|
||||||
banner,
|
banner,
|
||||||
},
|
},
|
||||||
external: ['obsidian'],
|
external: ['obsidian'],
|
||||||
plugins: [
|
plugins: [
|
||||||
typescript(),
|
typescript(),
|
||||||
nodeResolve({browser: true}),
|
nodeResolve({browser: true}),
|
||||||
commonjs(),
|
commonjs(),
|
||||||
json(),
|
json(),
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
10
src/main.ts
10
src/main.ts
|
|
@ -39,7 +39,7 @@ export default class HabiticaSync extends Plugin {
|
||||||
this.activateView();
|
this.activateView();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
async loadSettings() {
|
async loadSettings() {
|
||||||
this.settings = Object.assign(DEFAULT_SETTINGS, await this.loadData())
|
this.settings = Object.assign(DEFAULT_SETTINGS, await this.loadData())
|
||||||
|
|
@ -50,22 +50,22 @@ export default class HabiticaSync extends Plugin {
|
||||||
|
|
||||||
async onunload() {
|
async onunload() {
|
||||||
await this.view.onClose();
|
await this.view.onClose();
|
||||||
|
|
||||||
this.app.workspace
|
this.app.workspace
|
||||||
.getLeavesOfType(VIEW_TYPE)
|
.getLeavesOfType(VIEW_TYPE)
|
||||||
.forEach((leaf) => leaf.detach());
|
.forEach((leaf) => leaf.detach());
|
||||||
}
|
}
|
||||||
async activateView() {
|
async activateView() {
|
||||||
this.app.workspace.detachLeavesOfType(VIEW_TYPE);
|
this.app.workspace.detachLeavesOfType(VIEW_TYPE);
|
||||||
|
|
||||||
await this.app.workspace.getRightLeaf(false).setViewState({
|
await this.app.workspace.getRightLeaf(false).setViewState({
|
||||||
type: VIEW_TYPE,
|
type: VIEW_TYPE,
|
||||||
active: true,
|
active: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
this.app.workspace.revealLeaf(
|
this.app.workspace.revealLeaf(
|
||||||
this.app.workspace.getLeavesOfType(VIEW_TYPE)[0]
|
this.app.workspace.getLeavesOfType(VIEW_TYPE)[0]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,30 +62,12 @@ export default function Index(props: any){
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const allDailies = props.dailys.map((daily: any) => {
|
|
||||||
// if(daily.completed)
|
|
||||||
// return <DailyItem key={daily.id} id={daily.id} daily_text={daily.text} daily_notes={daily.notes} onChange={props.onChange} completed={daily.completed}/>
|
|
||||||
let daily_notes = '';
|
|
||||||
let daily_subtasks = '';
|
|
||||||
if (props.settings.showTaskDescription) {
|
|
||||||
daily_notes = daily.notes;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (props.settings.showSubTasks) {
|
|
||||||
daily_subtasks = daily.checklist;
|
|
||||||
}
|
|
||||||
return <DailyItem key={daily.id} id={daily.id} daily_text={daily.text}
|
|
||||||
daily_notes={daily_notes} daily_subtasks={daily_subtasks}
|
|
||||||
onChange={props.onChange} completed={daily.completed} onChangeChecklistItem={props.onChangeChecklistItem}/>
|
|
||||||
})
|
|
||||||
|
|
||||||
const display = <div id="classDisplay">
|
const display = <div id="classDisplay">
|
||||||
<Tabs>
|
<Tabs>
|
||||||
<TabList>
|
<TabList>
|
||||||
<Tab>Active</Tab>
|
<Tab>Active</Tab>
|
||||||
<Tab>Completed</Tab>
|
<Tab>Completed</Tab>
|
||||||
<Tab>Not Due</Tab>
|
<Tab>Not Due</Tab>
|
||||||
<Tab>All</Tab>
|
|
||||||
</TabList>
|
</TabList>
|
||||||
<TabPanel>
|
<TabPanel>
|
||||||
<ul>{incompleteDailies}</ul>
|
<ul>{incompleteDailies}</ul>
|
||||||
|
|
@ -96,9 +78,6 @@ export default function Index(props: any){
|
||||||
<TabPanel>
|
<TabPanel>
|
||||||
<ul>{notDueDailies}</ul>
|
<ul>{notDueDailies}</ul>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel>
|
|
||||||
<ul>{allDailies}</ul>
|
|
||||||
</TabPanel>
|
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
return(display);
|
return(display);
|
||||||
|
|
|
||||||
|
|
@ -36,10 +36,10 @@ export default function Index(props: any){
|
||||||
<Tab>Completed</Tab>
|
<Tab>Completed</Tab>
|
||||||
</TabList>
|
</TabList>
|
||||||
<TabPanel>
|
<TabPanel>
|
||||||
<ul className="todolist-indent">{incompleteTodos}</ul>
|
<ul>{incompleteTodos}</ul>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel>
|
<TabPanel>
|
||||||
<ul className="todolist-indent">{completedTodos}</ul>
|
<ul>{completedTodos}</ul>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
@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@1,300&display=swap');
|
||||||
@import url('https://fonts.googleapis.com/css2?family=Open Sans:ital,wght@0,400;1,100&family=Roboto&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 {
|
.add-task-input {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
@ -41,7 +45,6 @@
|
||||||
font-family: Roboto, sans-serif;
|
font-family: Roboto, sans-serif;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
padding-left: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.description {
|
.description {
|
||||||
|
|
@ -320,4 +323,4 @@ button {
|
||||||
.description>ul {
|
.description>ul {
|
||||||
list-style-type: disc;
|
list-style-type: disc;
|
||||||
margin-left: 10% !important;
|
margin-left: 10% !important;
|
||||||
}
|
}
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"importHelpers": true,
|
"importHelpers": true,
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"esModuleInterop": true,
|
|
||||||
"lib": [
|
"lib": [
|
||||||
"dom",
|
"dom",
|
||||||
"es5",
|
"es5",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue