obsidian-plugin-config 1.5.12 → 1.6.1

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.
Files changed (43) hide show
  1. package/.vscode/tasks.json +5 -69
  2. package/DONE.md +60 -0
  3. package/FINAL_SUMMARY.md +163 -0
  4. package/README.md +70 -35
  5. package/bin/obsidian-inject.js +1 -1
  6. package/docs/APPLIED_MODIFS.md +104 -0
  7. package/docs/INTERACTIVE_INJECTION.md +137 -0
  8. package/docs/LLM-GUIDE.md +60 -50
  9. package/docs/TECHNICAL_NOTES.md +43 -0
  10. package/docs/implementation_plan.md +127 -0
  11. package/docs/modifs.md +434 -0
  12. package/package.json +3 -29
  13. package/scripts/acp.ts +7 -11
  14. package/scripts/build-npm.ts +78 -75
  15. package/scripts/help.ts +45 -107
  16. package/scripts/inject-core.ts +74 -36
  17. package/scripts/inject-options.ts +139 -0
  18. package/scripts/inject-path.ts +18 -4
  19. package/scripts/inject-prompt.ts +2 -1
  20. package/scripts/update-version-config.ts +2 -5
  21. package/templates/.gitattributes +4 -0
  22. package/templates/.github/workflows/release.yml +1 -1
  23. package/templates/.prettierignore +6 -0
  24. package/templates/.vscode/extensions.json +8 -0
  25. package/templates/.vscode/settings.json +0 -1
  26. package/templates/package.json +3 -2
  27. package/templates/scripts/esbuild.config.ts +16 -21
  28. package/tsconfig.json +2 -8
  29. package/.injection-info.json +0 -5
  30. package/docs/EXPORTS-EXPLAINED.md +0 -164
  31. package/manifest.json +0 -11
  32. package/scripts/esbuild.config.ts +0 -268
  33. package/scripts/sync-template-deps.ts +0 -59
  34. package/scripts/update-exports.js +0 -82
  35. package/src/index.ts +0 -6
  36. package/src/main.ts +0 -117
  37. package/src/modals/GenericConfirmModal.ts +0 -79
  38. package/src/modals/index.ts +0 -7
  39. package/src/tools/index.ts +0 -9
  40. package/src/utils/NoticeHelper.ts +0 -85
  41. package/src/utils/SettingsHelper.ts +0 -170
  42. package/src/utils/index.ts +0 -3
  43. package/versions.json +0 -64
@@ -1,85 +0,0 @@
1
- import { Notice } from 'obsidian';
2
-
3
- /**
4
- * Enhanced Notice helper with different types and durations
5
- */
6
- export class NoticeHelper {
7
- private static readonly DEFAULT_DURATION = 5000;
8
- private static readonly SUCCESS_DURATION = 3000;
9
- private static readonly ERROR_DURATION = 8000;
10
- private static readonly WARNING_DURATION = 6000;
11
-
12
- /**
13
- * Show a success notice with green styling
14
- */
15
- static success(message: string, duration?: number): Notice {
16
- const notice = new Notice(`✅ ${message}`, duration ?? this.SUCCESS_DURATION);
17
- return notice;
18
- }
19
-
20
- /**
21
- * Show an error notice with red styling
22
- */
23
- static error(message: string, duration?: number): Notice {
24
- const notice = new Notice(`❌ ${message}`, duration ?? this.ERROR_DURATION);
25
- return notice;
26
- }
27
-
28
- /**
29
- * Show a warning notice with yellow styling
30
- */
31
- static warning(message: string, duration?: number): Notice {
32
- const notice = new Notice(`⚠️ ${message}`, duration ?? this.WARNING_DURATION);
33
- return notice;
34
- }
35
-
36
- /**
37
- * Show an info notice with blue styling
38
- */
39
- static info(message: string, duration?: number): Notice {
40
- const notice = new Notice(`ℹ️ ${message}`, duration ?? this.DEFAULT_DURATION);
41
- return notice;
42
- }
43
-
44
- /**
45
- * Show a loading notice that can be updated
46
- */
47
- static loading(message: string): Notice {
48
- return new Notice(`⏳ ${message}`, 0); // 0 = permanent until manually hidden
49
- }
50
-
51
- /**
52
- * Update a loading notice to success and auto-hide
53
- */
54
- static updateToSuccess(notice: Notice, message: string): void {
55
- notice.setMessage(`✅ ${message}`);
56
- setTimeout(() => notice.hide(), this.SUCCESS_DURATION);
57
- }
58
-
59
- /**
60
- * Update a loading notice to error and auto-hide
61
- */
62
- static updateToError(notice: Notice, message: string): void {
63
- notice.setMessage(`❌ ${message}`);
64
- setTimeout(() => notice.hide(), this.ERROR_DURATION);
65
- }
66
-
67
- /**
68
- * Show a notice with custom emoji and duration
69
- */
70
- static custom(emoji: string, message: string, duration?: number): Notice {
71
- return new Notice(`${emoji} ${message}`, duration ?? this.DEFAULT_DURATION);
72
- }
73
-
74
- /**
75
- * Show a progress notice for long operations
76
- */
77
- static progress(message: string, current: number, total: number): Notice {
78
- const percentage = Math.round((current / total) * 100);
79
- const progressBar =
80
- '█'.repeat(Math.floor(percentage / 5)) +
81
- '░'.repeat(20 - Math.floor(percentage / 5));
82
-
83
- return new Notice(`🔄 ${message}\n[${progressBar}] ${percentage}%`, 0);
84
- }
85
- }
@@ -1,170 +0,0 @@
1
- import { Setting } from 'obsidian';
2
-
3
- /**
4
- * Helper for creating common setting types with consistent styling
5
- */
6
- export class SettingsHelper {
7
- /**
8
- * Create a text input setting
9
- */
10
- static createTextSetting(
11
- containerEl: HTMLElement,
12
- name: string,
13
- desc: string,
14
- value: string,
15
- onChange: (value: string) => void,
16
- placeholder?: string
17
- ): Setting {
18
- return new Setting(containerEl)
19
- .setName(name)
20
- .setDesc(desc)
21
- .addText((text) =>
22
- text
23
- .setPlaceholder(placeholder || '')
24
- .setValue(value)
25
- .onChange(onChange)
26
- );
27
- }
28
-
29
- /**
30
- * Create a toggle setting
31
- */
32
- static createToggleSetting(
33
- containerEl: HTMLElement,
34
- name: string,
35
- desc: string,
36
- value: boolean,
37
- onChange: (value: boolean) => void
38
- ): Setting {
39
- return new Setting(containerEl)
40
- .setName(name)
41
- .setDesc(desc)
42
- .addToggle((toggle) => toggle.setValue(value).onChange(onChange));
43
- }
44
-
45
- /**
46
- * Create a dropdown setting
47
- */
48
- static createDropdownSetting(
49
- containerEl: HTMLElement,
50
- name: string,
51
- desc: string,
52
- options: Record<string, string>,
53
- value: string,
54
- onChange: (value: string) => void
55
- ): Setting {
56
- return new Setting(containerEl)
57
- .setName(name)
58
- .setDesc(desc)
59
- .addDropdown((dropdown) => {
60
- Object.entries(options).forEach(([key, label]) => {
61
- dropdown.addOption(key, label);
62
- });
63
- dropdown.setValue(value).onChange(onChange);
64
- });
65
- }
66
-
67
- /**
68
- * Create a number input setting
69
- */
70
- static createNumberSetting(
71
- containerEl: HTMLElement,
72
- name: string,
73
- desc: string,
74
- value: number,
75
- onChange: (value: number) => void,
76
- min?: number,
77
- max?: number,
78
- step?: number
79
- ): Setting {
80
- return new Setting(containerEl)
81
- .setName(name)
82
- .setDesc(desc)
83
- .addText((text) => {
84
- text.inputEl.type = 'number';
85
- if (min !== undefined) text.inputEl.min = min.toString();
86
- if (max !== undefined) text.inputEl.max = max.toString();
87
- if (step !== undefined) text.inputEl.step = step.toString();
88
-
89
- text.setValue(value.toString()).onChange((val) => {
90
- const num = parseFloat(val);
91
- if (!isNaN(num)) onChange(num);
92
- });
93
- });
94
- }
95
-
96
- /**
97
- * Create a button setting
98
- */
99
- static createButtonSetting(
100
- containerEl: HTMLElement,
101
- name: string,
102
- desc: string,
103
- buttonText: string,
104
- onClick: () => void
105
- ): Setting {
106
- return new Setting(containerEl)
107
- .setName(name)
108
- .setDesc(desc)
109
- .addButton((button) => button.setButtonText(buttonText).onClick(onClick));
110
- }
111
-
112
- /**
113
- * Create a section header
114
- */
115
- static createHeader(
116
- containerEl: HTMLElement,
117
- title: string,
118
- description?: string
119
- ): void {
120
- const headerEl = containerEl.createEl('h3', { text: title });
121
- headerEl.style.marginTop = '20px';
122
- headerEl.style.marginBottom = '10px';
123
- headerEl.style.borderBottom = '1px solid var(--background-modifier-border)';
124
- headerEl.style.paddingBottom = '5px';
125
-
126
- if (description) {
127
- const descEl = containerEl.createEl('p', { text: description });
128
- descEl.style.marginTop = '0';
129
- descEl.style.marginBottom = '15px';
130
- descEl.style.color = 'var(--text-muted)';
131
- descEl.style.fontSize = '0.9em';
132
- }
133
- }
134
-
135
- /**
136
- * Create a collapsible section
137
- */
138
- static createCollapsibleSection(
139
- containerEl: HTMLElement,
140
- title: string,
141
- isOpen: boolean = false
142
- ): { container: HTMLElement; toggle: () => void } {
143
- const sectionEl = containerEl.createDiv('setting-item');
144
- const headerEl = sectionEl.createDiv('setting-item-info');
145
- const nameEl = headerEl.createDiv('setting-item-name');
146
- nameEl.setText(title);
147
- nameEl.style.cursor = 'pointer';
148
- nameEl.style.userSelect = 'none';
149
-
150
- const contentEl = containerEl.createDiv('collapsible-content');
151
- contentEl.style.display = isOpen ? 'block' : 'none';
152
- contentEl.style.marginLeft = '20px';
153
- contentEl.style.marginTop = '10px';
154
-
155
- const arrow = nameEl.createSpan('collapse-icon');
156
- arrow.setText(isOpen ? '▼' : '▶');
157
- arrow.style.marginRight = '8px';
158
- arrow.style.fontSize = '0.8em';
159
-
160
- const toggle = (): void => {
161
- const isCurrentlyOpen = contentEl.style.display !== 'none';
162
- contentEl.style.display = isCurrentlyOpen ? 'none' : 'block';
163
- arrow.setText(isCurrentlyOpen ? '▶' : '▼');
164
- };
165
-
166
- nameEl.addEventListener('click', toggle);
167
-
168
- return { container: contentEl, toggle };
169
- }
170
- }
@@ -1,3 +0,0 @@
1
- // Centralized utils exports for Obsidian plugins
2
- export { NoticeHelper } from './NoticeHelper.js';
3
- export { SettingsHelper } from './SettingsHelper.js';
package/versions.json DELETED
@@ -1,64 +0,0 @@
1
- {
2
- "1.0.0": "1.8.9",
3
- "1.0.1": "1.8.9",
4
- "1.0.2": "1.8.9",
5
- "1.0.3": "1.8.9",
6
- "1.0.4": "1.8.9",
7
- "1.0.5": "1.8.9",
8
- "1.0.6": "1.8.9",
9
- "1.0.7": "1.8.9",
10
- "1.0.8": "1.8.9",
11
- "1.0.9": "1.8.9",
12
- "1.0.10": "1.8.9",
13
- "1.1.6": "1.8.9",
14
- "1.1.7": "1.8.9",
15
- "1.1.8": "1.8.9",
16
- "1.1.9": "1.8.9",
17
- "1.1.10": "1.8.9",
18
- "1.1.11": "1.8.9",
19
- "1.1.12": "1.8.9",
20
- "1.1.13": "1.8.9",
21
- "1.1.14": "1.8.9",
22
- "1.1.15": "1.8.9",
23
- "1.1.16": "1.8.9",
24
- "1.1.17": "1.8.9",
25
- "1.1.18": "1.8.9",
26
- "1.1.19": "1.8.9",
27
- "1.1.20": "1.8.9",
28
- "1.2.0": "1.8.9",
29
- "1.3.0": "1.8.9",
30
- "1.3.1": "1.8.9",
31
- "1.3.2": "1.8.9",
32
- "1.3.3": "1.8.9",
33
- "1.3.4": "1.8.9",
34
- "1.3.5": "1.8.9",
35
- "1.3.6": "1.8.9",
36
- "1.3.7": "1.8.9",
37
- "1.3.8": "1.8.9",
38
- "1.3.9": "1.8.9",
39
- "1.3.10": "1.8.9",
40
- "1.3.11": "1.8.9",
41
- "1.3.12": "1.8.9",
42
- "1.4.0": "1.8.9",
43
- "1.4.1": "1.8.9",
44
- "1.4.2": "1.8.9",
45
- "1.4.3": "1.8.9",
46
- "1.4.4": "1.8.9",
47
- "1.4.5": "1.8.9",
48
- "1.4.6": "1.8.9",
49
- "1.4.7": "1.8.9",
50
- "1.4.8": "1.8.9",
51
- "1.5.0": "1.8.9",
52
- "1.5.1": "1.8.9",
53
- "1.5.2": "1.8.9",
54
- "1.5.3": "1.8.9",
55
- "1.5.4": "1.8.9",
56
- "1.5.5": "1.8.9",
57
- "1.5.6": "1.8.9",
58
- "1.5.7": "1.8.9",
59
- "1.5.8": "1.8.9",
60
- "1.5.9": "1.8.9",
61
- "1.5.10": "1.8.9",
62
- "1.5.11": "1.8.9",
63
- "1.5.12": "1.8.9"
64
- }