Skip to content

Commit ef3777d

Browse files
committed
1.0.8
1 parent 81d148d commit ef3777d

File tree

7 files changed

+35
-33
lines changed

7 files changed

+35
-33
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "ai-templater",
33
"name": "AI for Templater",
4-
"version": "1.0.7",
4+
"version": "1.0.8",
55
"minAppVersion": "1.5.11",
66
"description": "AI Extension for the Templater plugin with the OpenAI Client Library.",
77
"author": "TfTHacker",

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "openaisdk",
3-
"version": "1.0.7",
4-
"description": "OpenAI SDK plugin for Obsidian.",
3+
"version": "1.0.8",
4+
"description": "AI for Templater plugin for Obsidian.",
55
"main": "main.js",
66
"scripts": {
77
"dev": "node esbuild.config.mjs",
@@ -17,7 +17,7 @@
1717
"license": "MIT",
1818
"repository": {
1919
"type": "git",
20-
"url": "git://github.com/TfTHacker/openai-sdk-obsidian.git"
20+
"url": "git://github.com/TfTHacker/obsidian-ai-templater"
2121
},
2222
"devDependencies": {
2323
"@html-eslint/eslint-plugin": "^0.24.0",

src/settings/Promotional.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,12 @@
1-
export const promotionalLinks = (containerEl: HTMLElement, settingsTab = true): HTMLElement => {
1+
export const promotionalLinks = (containerEl: HTMLElement): HTMLElement => {
22
const linksDiv = containerEl.createEl('div');
3-
linksDiv.style.float = 'right';
4-
5-
if (!settingsTab) {
6-
linksDiv.style.padding = '10px';
7-
linksDiv.style.paddingLeft = '15px';
8-
linksDiv.style.paddingRight = '15px';
9-
} else {
10-
linksDiv.style.padding = '15px';
11-
linksDiv.style.paddingLeft = '15px';
12-
linksDiv.style.paddingRight = '15px';
13-
linksDiv.style.marginLeft = '15px';
14-
}
15-
3+
linksDiv.classList.add('ait-promotional-links');
164
const twitterSpan = linksDiv.createDiv('coffee');
175
twitterSpan.addClass('ex-twitter-span');
18-
twitterSpan.style.paddingLeft = '10px';
196
const captionText = twitterSpan.createDiv();
207
captionText.innerText = 'Learn more about my work at:';
218
twitterSpan.appendChild(captionText);
229
const twitterLink = twitterSpan.createEl('a', { href: 'https://tfthacker.com' });
2310
twitterLink.innerText = 'https://tfthacker.com';
24-
2511
return linksDiv;
2612
};

src/settings/SettingsTab.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ export class OWlSettingTab extends PluginSettingTab {
9191
await this.plugin.saveData(this.plugin.settings);
9292
});
9393
textEl.inputEl.rows = 6;
94-
if (Platform.isIosApp) textEl.inputEl.style.width = '100%';
95-
else if (Platform.isDesktopApp) {
96-
textEl.inputEl.rows = 6;
97-
}
94+
// if (Platform.isIosApp) textEl.inputEl.style.width = '100%';
95+
// else if (Platform.isDesktopApp) {
96+
// textEl.inputEl.rows = 6;
97+
// }
9898
});
9999

100-
promotionalLinks(containerEl, true);
100+
promotionalLinks(containerEl);
101101
containerEl.createEl('hr');
102102

103103
containerEl.createEl('h1', { text: 'Debugging' });

src/templater/InternalModuleAit.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type AitPlugin from '../main';
66
import { InternalModule } from 'templater-obsidian/src/core/functions/internal_functions/InternalModule';
77
import type { ModuleName } from 'templater-obsidian/src/editor/TpDocumentation';
88
import type { ChatCompletionMessageParam } from 'openai/resources';
9-
import type { TFile } from 'obsidian';
9+
import { TFile } from 'obsidian';
1010
import ActivityIndicator from '../utils/ActivityIndicator';
1111

1212
export class InternalModuleAit extends InternalModule {
@@ -47,10 +47,16 @@ export class InternalModuleAit extends InternalModule {
4747
}
4848

4949
async generate_content_without_properties(): Promise<string> {
50-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- target_file is a TFile
51-
const file = this.config.target_file as TFile;
52-
const fileContents = await this.plugin?.app.vault.read(file);
53-
return fileContents ? fileContents.replace(/^---\n([\s\S]*?)\n---\n/, '') : '';
50+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- target_file is a valid property
51+
if (this.config.target_file instanceof TFile) {
52+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- target_file is a valid property
53+
const file = this.config.target_file;
54+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- target_file is a valid property
55+
const fileContents = await this.plugin?.app.vault.read(file);
56+
return fileContents ? fileContents.replace(/^---\n([\s\S]*?)\n---\n/, '') : '';
57+
} else {
58+
throw new Error('target_file is not a TFile');
59+
}
5460
}
5561

5662
generate_run_chat(): (

styles.css

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,21 @@
1212
width: 100%;
1313
}
1414

15+
/* Promotional Links */
16+
.ait-promotional-links {
17+
float: right;
18+
padding: 15px;
19+
20+
}
21+
1522
/* Spinkit https://github.com/tobiasahlin/SpinKit?tab=readme-ov-file */
1623
.ait-spinner {
1724
width: 20px;
1825
position: absolute;
1926
right: 10px;
2027
}
2128

22-
.ait-spinner > div {
29+
.ait-spinner>div {
2330
width: 20px;
2431
height: 10px;
2532
background-color: var(--background-modifier-border-focus);
@@ -32,12 +39,14 @@
3239
}
3340

3441
@keyframes oil-sk-bouncedelay {
42+
3543
0%,
3644
80%,
3745
100% {
3846
transform: scale(0);
3947
}
48+
4049
40% {
4150
transform: scale(1);
4251
}
43-
}
52+
}

versions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
"1.0.4": "1.5.11",
77
"1.0.5": "1.5.11",
88
"1.0.6": "1.5.11",
9-
"1.0.7": "1.5.11"
9+
"1.0.7": "1.5.11",
10+
"1.0.8": "1.5.11"
1011
}

0 commit comments

Comments
 (0)