obsidian-dev-utils 101.5.0 → 101.7.0
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/CHANGELOG.md +12 -0
- package/dist/integration-test-plugin/main.js +2612 -1815
- package/dist/lib/cjs/__merged.cjs +29 -1
- package/dist/lib/cjs/__merged.d.cts +5 -1
- package/dist/lib/cjs/generated-during-build.cjs +1 -1
- package/dist/lib/cjs/obsidian/components/component-ex.cjs +14 -1
- package/dist/lib/cjs/obsidian/components/component-ex.d.cts +11 -0
- package/dist/lib/cjs/obsidian/components/index.cjs +7 -1
- package/dist/lib/cjs/obsidian/components/index.d.cts +2 -0
- package/dist/lib/cjs/obsidian/components/monkey-around-component.cjs +1 -1
- package/dist/lib/cjs/obsidian/components/plugin-gate-component.cjs +520 -0
- package/dist/lib/cjs/obsidian/components/plugin-gate-component.d.cts +299 -0
- package/dist/lib/cjs/obsidian/components/plugin-suggestion-component.cjs +17 -38
- package/dist/lib/cjs/obsidian/components/plugin-suggestion-component.d.cts +25 -18
- package/dist/lib/cjs/obsidian/components/rename-delete-handler-component.cjs +7 -2
- package/dist/lib/cjs/obsidian/components/settings-migration-component.cjs +232 -0
- package/dist/lib/cjs/obsidian/components/settings-migration-component.d.cts +120 -0
- package/dist/lib/cjs/obsidian/css-class.cjs +3 -1
- package/dist/lib/cjs/obsidian/css-class.d.cts +9 -0
- package/dist/lib/cjs/obsidian/html-element.cjs +27 -3
- package/dist/lib/cjs/obsidian/html-element.d.cts +36 -0
- package/dist/lib/cjs/obsidian/i18n/locales/en.cjs +15 -1
- package/dist/lib/cjs/obsidian/i18n/locales/en.d.cts +14 -0
- package/dist/lib/cjs/obsidian/i18n/locales/translations-map.d.cts +14 -0
- package/dist/lib/cjs/obsidian/mobile-trusted-input.cjs +1 -1
- package/dist/lib/cjs/obsidian/mobile-trusted-input.d.cts +5 -3
- package/dist/lib/cjs/obsidian/plugin/index.cjs +12 -3
- package/dist/lib/cjs/obsidian/plugin/index.d.cts +3 -0
- package/dist/lib/cjs/obsidian/plugin/plugin-api.cjs +2 -2
- package/dist/lib/cjs/obsidian/plugin/plugin-api.d.cts +34 -15
- package/dist/lib/cjs/obsidian/plugin/plugin-install-state.cjs +208 -0
- package/dist/lib/cjs/obsidian/plugin/plugin-install-state.d.cts +113 -0
- package/dist/lib/cjs/obsidian/plugin/plugin-lifecycle-events.cjs +161 -0
- package/dist/lib/cjs/obsidian/plugin/plugin-lifecycle-events.d.cts +119 -0
- package/dist/lib/cjs/obsidian/plugin/plugin.cjs +241 -21
- package/dist/lib/cjs/obsidian/plugin/plugin.d.cts +133 -4
- package/dist/lib/cjs/obsidian/plugin/settings-migration-api.cjs +141 -0
- package/dist/lib/cjs/obsidian/plugin/settings-migration-api.d.cts +91 -0
- package/dist/lib/esm/__merged.d.mts +5 -1
- package/dist/lib/esm/__merged.mjs +32 -2
- package/dist/lib/esm/generated-during-build.mjs +1 -1
- package/dist/lib/esm/obsidian/components/component-ex.d.mts +11 -0
- package/dist/lib/esm/obsidian/components/component-ex.mjs +14 -1
- package/dist/lib/esm/obsidian/components/index.d.mts +2 -0
- package/dist/lib/esm/obsidian/components/index.mjs +5 -1
- package/dist/lib/esm/obsidian/components/monkey-around-component.mjs +1 -1
- package/dist/lib/esm/obsidian/components/plugin-gate-component.d.mts +299 -0
- package/dist/lib/esm/obsidian/components/plugin-gate-component.mjs +428 -0
- package/dist/lib/esm/obsidian/components/plugin-suggestion-component.d.mts +25 -18
- package/dist/lib/esm/obsidian/components/plugin-suggestion-component.mjs +21 -41
- package/dist/lib/esm/obsidian/components/rename-delete-handler-component.mjs +7 -2
- package/dist/lib/esm/obsidian/components/settings-migration-component.d.mts +120 -0
- package/dist/lib/esm/obsidian/components/settings-migration-component.mjs +127 -0
- package/dist/lib/esm/obsidian/css-class.d.mts +9 -0
- package/dist/lib/esm/obsidian/css-class.mjs +3 -1
- package/dist/lib/esm/obsidian/html-element.d.mts +36 -0
- package/dist/lib/esm/obsidian/html-element.mjs +24 -2
- package/dist/lib/esm/obsidian/i18n/locales/en.d.mts +14 -0
- package/dist/lib/esm/obsidian/i18n/locales/en.mjs +15 -1
- package/dist/lib/esm/obsidian/i18n/locales/translations-map.d.mts +14 -0
- package/dist/lib/esm/obsidian/mobile-trusted-input.d.mts +5 -3
- package/dist/lib/esm/obsidian/mobile-trusted-input.mjs +1 -1
- package/dist/lib/esm/obsidian/plugin/index.d.mts +3 -0
- package/dist/lib/esm/obsidian/plugin/index.mjs +8 -2
- package/dist/lib/esm/obsidian/plugin/plugin-api.d.mts +34 -15
- package/dist/lib/esm/obsidian/plugin/plugin-api.mjs +2 -2
- package/dist/lib/esm/obsidian/plugin/plugin-install-state.d.mts +113 -0
- package/dist/lib/esm/obsidian/plugin/plugin-install-state.mjs +106 -0
- package/dist/lib/esm/obsidian/plugin/plugin-lifecycle-events.d.mts +119 -0
- package/dist/lib/esm/obsidian/plugin/plugin-lifecycle-events.mjs +54 -0
- package/dist/lib/esm/obsidian/plugin/plugin.d.mts +133 -4
- package/dist/lib/esm/obsidian/plugin/plugin.mjs +245 -21
- package/dist/lib/esm/obsidian/plugin/settings-migration-api.d.mts +91 -0
- package/dist/lib/esm/obsidian/plugin/settings-migration-api.mjs +44 -0
- package/obsidian/components/plugin-gate-component/package.json +6 -0
- package/obsidian/components/settings-migration-component/package.json +6 -0
- package/obsidian/plugin/plugin-install-state/package.json +6 -0
- package/obsidian/plugin/plugin-lifecycle-events/package.json +6 -0
- package/obsidian/plugin/settings-migration-api/package.json +6 -0
- package/package.json +15 -15
|
@@ -9,13 +9,16 @@
|
|
|
9
9
|
import type { Component, IconName } from 'obsidian' with { 'resolution-mode': 'import' };
|
|
10
10
|
import type { Promisable } from 'type-fest' with { 'resolution-mode': 'import' };
|
|
11
11
|
import { Plugin } from 'obsidian';
|
|
12
|
+
import type { PluginConflict, PluginDependency } from '../components/plugin-gate-component.cjs';
|
|
12
13
|
import type { TranslationsMap } from '../i18n/i18n.cjs';
|
|
14
|
+
import type { PluginApiDeclaration } from './plugin-api.cjs';
|
|
13
15
|
import type { PluginEventMap, PluginEventSource } from './plugin-event-source.cjs';
|
|
14
16
|
import { CommandHandlerComponent } from '../command-handlers/command-handler-component.cjs';
|
|
15
17
|
import { AbortSignalComponent } from '../components/abort-signal-component.cjs';
|
|
16
18
|
import { AsyncErrorHandlerComponent } from '../components/async-error-handler-component.cjs';
|
|
17
19
|
import { ConsoleDebugComponent } from '../components/console-debug-component.cjs';
|
|
18
20
|
import { PluginContextComponent } from '../components/plugin-context-component.cjs';
|
|
21
|
+
import { PluginGateComponent } from '../components/plugin-gate-component.cjs';
|
|
19
22
|
import { PluginNoticeComponent } from '../components/plugin-notice-component.cjs';
|
|
20
23
|
import { PluginSettingsComponentBase } from '../components/plugin-settings-component.cjs';
|
|
21
24
|
import { ResourceLockComponent } from '../resource-lock.cjs';
|
|
@@ -90,6 +93,22 @@ export declare abstract class PluginBase extends PluginBase_base implements Plug
|
|
|
90
93
|
* @param value - Plugin context component.
|
|
91
94
|
*/
|
|
92
95
|
protected set pluginContextComponent(value: PluginContextComponent);
|
|
96
|
+
/**
|
|
97
|
+
* Gets the gate holding the plugin's feature surface up or down.
|
|
98
|
+
*
|
|
99
|
+
* Reach for it from a settings tab to render the overlap banner for a
|
|
100
|
+
* {@link obsidian/components/plugin-gate-component!PluginConflictSeverity.Warn} conflict — the one
|
|
101
|
+
* banner the library cannot place itself, because a running plugin builds its own settings tab.
|
|
102
|
+
*
|
|
103
|
+
* @returns The plugin gate component.
|
|
104
|
+
*/
|
|
105
|
+
protected get pluginGateComponent(): PluginGateComponent;
|
|
106
|
+
/**
|
|
107
|
+
* Sets the plugin gate component.
|
|
108
|
+
*
|
|
109
|
+
* @param value - The plugin gate component.
|
|
110
|
+
*/
|
|
111
|
+
protected set pluginGateComponent(value: PluginGateComponent);
|
|
93
112
|
/**
|
|
94
113
|
* Gets plugin notice component.
|
|
95
114
|
*
|
|
@@ -128,13 +147,22 @@ export declare abstract class PluginBase extends PluginBase_base implements Plug
|
|
|
128
147
|
*/
|
|
129
148
|
protected set resourceLockComponent(value: ResourceLockComponent);
|
|
130
149
|
private readonly components;
|
|
131
|
-
private
|
|
150
|
+
private gatedWrapperComponent;
|
|
151
|
+
private lifecycleEventPayload;
|
|
152
|
+
private readonly universalWrapperComponent;
|
|
132
153
|
/**
|
|
133
154
|
* Adds a child component.
|
|
134
155
|
*
|
|
135
|
-
* The child is added to
|
|
136
|
-
* before
|
|
137
|
-
* children-first, and is usable by the time this method returns.
|
|
156
|
+
* The child is added to the internal wrapper holding the subclass's own surface, which {@link onload}
|
|
157
|
+
* creates and loads before calling {@link onloadImpl}. So a child added during {@link onloadImpl} is
|
|
158
|
+
* loaded immediately, children-first, and is usable by the time this method returns.
|
|
159
|
+
*
|
|
160
|
+
* That wrapper is torn down and rebuilt whenever the gate closes and opens again — a dependency declared
|
|
161
|
+
* by {@link getPluginDependencies} going away and coming back, or a conflict declared by
|
|
162
|
+
* {@link getPluginConflicts} appearing and being resolved — so a child added here lives exactly as long
|
|
163
|
+
* as the plugin's feature surface does. Adding one while the surface is down is still legitimate — it is
|
|
164
|
+
* queued and loaded when the surface next comes up, the way {@link ComponentEx.addChild} already queues
|
|
165
|
+
* a child added to a not-yet-loaded component.
|
|
138
166
|
*
|
|
139
167
|
* @typeParam TComponent - The type of component to add.
|
|
140
168
|
* @param component - The component instance to add.
|
|
@@ -157,6 +185,15 @@ export declare abstract class PluginBase extends PluginBase_base implements Plug
|
|
|
157
185
|
* Do NOT override this method. Override {@link onloadImpl} instead.
|
|
158
186
|
*/
|
|
159
187
|
onload(): Promise<void>;
|
|
188
|
+
/**
|
|
189
|
+
* Called when the plugin is unloaded.
|
|
190
|
+
*
|
|
191
|
+
* Announces the departure on `app.workspace` so anything depending on this plugin learns of it at the
|
|
192
|
+
* moment it happens, rather than discovering it later through behavior that quietly stopped.
|
|
193
|
+
*
|
|
194
|
+
* Do NOT override this method; put teardown on a component instead, which unloads with the plugin.
|
|
195
|
+
*/
|
|
196
|
+
onunload(): void;
|
|
160
197
|
/**
|
|
161
198
|
* Removes a child component.
|
|
162
199
|
*
|
|
@@ -184,6 +221,62 @@ export declare abstract class PluginBase extends PluginBase_base implements Plug
|
|
|
184
221
|
* @returns The icon, or `''` for no icon.
|
|
185
222
|
*/
|
|
186
223
|
protected getNotebookNavigatorMenuSubmenuIcon(): IconName;
|
|
224
|
+
/**
|
|
225
|
+
* Provides the APIs this plugin exposes to other plugins.
|
|
226
|
+
*
|
|
227
|
+
* Override in subclass to publish one. The default publishes none. Called after {@link onloadImpl}, so a
|
|
228
|
+
* declaration may reference anything it created; the returned declarations are published through
|
|
229
|
+
* `publishPluginApi` and revoked when the plugin's feature surface unloads.
|
|
230
|
+
*
|
|
231
|
+
* Returning a LIST rather than a single API is deliberate: the registry supports several contract
|
|
232
|
+
* versions published side by side, which is how a provider ships a breaking `2.0.0` without stranding
|
|
233
|
+
* consumers still pinned to `^1`.
|
|
234
|
+
*
|
|
235
|
+
* Every declaration here is published BEFORE the `obsidian-dev-utils:plugin-loaded` broadcast, which is
|
|
236
|
+
* what lets a listener call these APIs the moment it hears that event.
|
|
237
|
+
*
|
|
238
|
+
* @returns The API declarations.
|
|
239
|
+
*/
|
|
240
|
+
protected getPluginApis(): PluginApiDeclaration[];
|
|
241
|
+
/**
|
|
242
|
+
* Provides the plugins this one refuses, or warns about, running beside.
|
|
243
|
+
*
|
|
244
|
+
* Override in subclass to declare an overlap. The default declares none.
|
|
245
|
+
*
|
|
246
|
+
* A `Block` conflict is the mirror image of a dependency: while a conflicting plugin is enabled at a
|
|
247
|
+
* conflicting version, {@link onloadImpl} does not run at all and the plugin registers nothing. Declare
|
|
248
|
+
* it when both plugins acting on the same operation damages the vault — there is no reliable way to win
|
|
249
|
+
* that race, because whichever plugin loaded first keeps a hand on the wheel, so refusing deterministically
|
|
250
|
+
* beats competing unpredictably. A `Warn` conflict declares an overlap that is merely annoying, such as a
|
|
251
|
+
* duplicated command: both plugins keep running and the user is told.
|
|
252
|
+
*
|
|
253
|
+
* Unlike a dependency, a conflicting plugin need not publish anything — it is detected by reading its
|
|
254
|
+
* installed version, which is the only thing about another plugin that reads the same regardless of load
|
|
255
|
+
* order.
|
|
256
|
+
*
|
|
257
|
+
* @returns The declared conflicts.
|
|
258
|
+
*/
|
|
259
|
+
protected getPluginConflicts(): PluginConflict[];
|
|
260
|
+
/**
|
|
261
|
+
* Provides the plugins this one cannot work without.
|
|
262
|
+
*
|
|
263
|
+
* Override in subclass to declare a mandatory dependency. The default declares none, and such a plugin
|
|
264
|
+
* loads exactly as it always has.
|
|
265
|
+
*
|
|
266
|
+
* A declared dependency is MANDATORY, unlike the offer `PluginSuggestionComponent` makes: while one is
|
|
267
|
+
* missing, disabled, or too old, {@link onloadImpl} does not run at all and the plugin registers nothing
|
|
268
|
+
* — no commands, no handlers, no patches. It stays enabled in Obsidian's list rather than disabling
|
|
269
|
+
* itself, because the enabled set is the user's to change, and it explains itself through a notice and a
|
|
270
|
+
* settings banner that installs the missing plugin in one click. The load completes the moment the
|
|
271
|
+
* dependency arrives, with no restart.
|
|
272
|
+
*
|
|
273
|
+
* A dependency must publish an API through `publishPluginApi`, which is what makes its presence,
|
|
274
|
+
* absence, version and departure all observable through one mechanism. A plugin with nothing to expose
|
|
275
|
+
* can publish an empty API purely so it can be depended upon.
|
|
276
|
+
*
|
|
277
|
+
* @returns The declared dependencies.
|
|
278
|
+
*/
|
|
279
|
+
protected getPluginDependencies(): PluginDependency[];
|
|
187
280
|
/**
|
|
188
281
|
* Called during {@link onload} to wire plugin-specific child components.
|
|
189
282
|
*
|
|
@@ -204,7 +297,43 @@ export declare abstract class PluginBase extends PluginBase_base implements Plug
|
|
|
204
297
|
* @param key - The key of the component to store.
|
|
205
298
|
* @param value - The component to store.
|
|
206
299
|
*/
|
|
300
|
+
/**
|
|
301
|
+
* Adds a component to the universal tier, which outlives any dependency.
|
|
302
|
+
*
|
|
303
|
+
* Private on purpose: only this class decides what is universal. A subclass adding one of its own goes
|
|
304
|
+
* through {@link addChild} and lands in the gated tier, where it belongs.
|
|
305
|
+
*
|
|
306
|
+
* @typeParam TComponent - The type of component to add.
|
|
307
|
+
* @param component - The component instance to add.
|
|
308
|
+
* @returns The added component.
|
|
309
|
+
*/
|
|
310
|
+
private addUniversalChild;
|
|
311
|
+
/**
|
|
312
|
+
* Announces on `app.workspace` that this plugin is loaded and its APIs are callable.
|
|
313
|
+
*/
|
|
314
|
+
private broadcastLoaded;
|
|
315
|
+
/**
|
|
316
|
+
* Announces on `app.workspace` that this plugin's surface has gone away.
|
|
317
|
+
*
|
|
318
|
+
* Silent unless a loaded broadcast is outstanding, so the two events stay paired: a plugin that never
|
|
319
|
+
* got past its dependency gate never announced itself, and must not announce a departure either.
|
|
320
|
+
*/
|
|
321
|
+
private broadcastUnloaded;
|
|
322
|
+
/**
|
|
323
|
+
* Builds and loads the subclass's feature surface, then publishes its APIs and announces itself.
|
|
324
|
+
*
|
|
325
|
+
* NOT idempotent, deliberately. `PluginGateComponent` owns the up/down state machine and calls
|
|
326
|
+
* this only on a real transition; a second guard here would be a second copy of that state, which is the
|
|
327
|
+
* kind of duplicate that drifts.
|
|
328
|
+
*
|
|
329
|
+
* @returns A {@link Promise} that resolves once the surface is loaded and the broadcast has been made.
|
|
330
|
+
*/
|
|
331
|
+
private loadFeatureSurface;
|
|
207
332
|
private setComponent;
|
|
333
|
+
/**
|
|
334
|
+
* Tears the subclass's feature surface down, leaving the universal components running.
|
|
335
|
+
*/
|
|
336
|
+
private unloadFeatureSurface;
|
|
208
337
|
}
|
|
209
338
|
/**
|
|
210
339
|
* Reloads the specified plugin by disabling and then re-enabling it.
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/*
|
|
2
|
+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
3
|
+
if you want to view the source, please visit the github repository of this plugin
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
(function () {
|
|
7
|
+
function ensureBrowserProcess() {
|
|
8
|
+
const browserProcess = {
|
|
9
|
+
browser: true,
|
|
10
|
+
cwd() {
|
|
11
|
+
return '/';
|
|
12
|
+
},
|
|
13
|
+
env: {},
|
|
14
|
+
platform: 'android'
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// eslint-disable-next-line obsidianmd/no-global-this, unicorn/no-unnecessary-global-this -- Must stay `globalThis`-qualified: in the emitted banner a bare `process` is a free identifier, so reading it where the host has none throws a ReferenceError instead of yielding `undefined`. That is the very case this function exists to handle.
|
|
18
|
+
const existingProcess = globalThis.process;
|
|
19
|
+
|
|
20
|
+
if (!existingProcess) {
|
|
21
|
+
// eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
|
|
22
|
+
globalThis.process = browserProcess;
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (existingProcess.versions?.node) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const existingProcessRecord = existingProcess;
|
|
31
|
+
|
|
32
|
+
for (const [key, value] of Object.entries(browserProcess)) {
|
|
33
|
+
existingProcessRecord[key] ??= value;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
existingProcessRecord['browser'] = true;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function keepName($unknown) {
|
|
40
|
+
return $unknown;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
(function initCjs() {
|
|
44
|
+
// eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
|
|
45
|
+
const globalThisRecord = globalThis;
|
|
46
|
+
globalThisRecord['__name'] ??= keepName;
|
|
47
|
+
const originalRequire = require;
|
|
48
|
+
if (originalRequire && !originalRequire.__isPatched) {
|
|
49
|
+
// eslint-disable-next-line no-global-assign, no-implicit-globals -- We need to patch the `require()` function.
|
|
50
|
+
require = Object.assign(
|
|
51
|
+
(id) => requirePatched(id),
|
|
52
|
+
originalRequire,
|
|
53
|
+
{
|
|
54
|
+
__isPatched: true
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
globalThisRecord['__extractDefault'] ??= extractDefault;
|
|
60
|
+
|
|
61
|
+
ensureBrowserProcess();
|
|
62
|
+
|
|
63
|
+
function extractDefault(module) {
|
|
64
|
+
return module && module.__esModule && 'default' in module ? module.default : module;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const OBSIDIAN_BUILT_IN_MODULE_NAMES = new Set([
|
|
68
|
+
'@codemirror/autocomplete',
|
|
69
|
+
'@codemirror/collab',
|
|
70
|
+
'@codemirror/commands',
|
|
71
|
+
'@codemirror/language',
|
|
72
|
+
'@codemirror/lint',
|
|
73
|
+
'@codemirror/search',
|
|
74
|
+
'@codemirror/state',
|
|
75
|
+
'@codemirror/text',
|
|
76
|
+
'@codemirror/view',
|
|
77
|
+
'@lezer/common',
|
|
78
|
+
'@lezer/highlight',
|
|
79
|
+
'@lezer/lr',
|
|
80
|
+
'obsidian']
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
const DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES = new Set([
|
|
84
|
+
'@codemirror/closebrackets',
|
|
85
|
+
'@codemirror/comment',
|
|
86
|
+
'@codemirror/fold',
|
|
87
|
+
'@codemirror/gutter',
|
|
88
|
+
'@codemirror/highlight',
|
|
89
|
+
'@codemirror/history',
|
|
90
|
+
'@codemirror/matchbrackets',
|
|
91
|
+
'@codemirror/panel',
|
|
92
|
+
'@codemirror/rangeset',
|
|
93
|
+
'@codemirror/rectangular-selection',
|
|
94
|
+
'@codemirror/stream-parser',
|
|
95
|
+
'@codemirror/tooltip']
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
function requirePatched(id) {
|
|
99
|
+
if (OBSIDIAN_BUILT_IN_MODULE_NAMES.has(id) || DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES.has(id)) {
|
|
100
|
+
return originalRequire?.(id);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated, obsidianmd/no-global-this -- Need access to app. Actively use globalThis.
|
|
104
|
+
if (globalThis.app.isMobile) {
|
|
105
|
+
if (id === 'process' || id === 'node:process') {
|
|
106
|
+
// eslint-disable-next-line no-console -- Valid usage.
|
|
107
|
+
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Fake process object is returned instead.`);
|
|
108
|
+
|
|
109
|
+
return process;
|
|
110
|
+
}
|
|
111
|
+
} else {
|
|
112
|
+
const module = originalRequire?.(id);
|
|
113
|
+
if (module) {
|
|
114
|
+
return extractDefault(module);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// eslint-disable-next-line no-console -- Valid usage.
|
|
119
|
+
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Empty object is returned instead.`);
|
|
120
|
+
return {};
|
|
121
|
+
}
|
|
122
|
+
})();
|
|
123
|
+
})();
|
|
124
|
+
|
|
125
|
+
"use strict";
|
|
126
|
+
var __defProp = Object.defineProperty;
|
|
127
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
128
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
129
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
130
|
+
var __copyProps = (to, from, except, desc) => {
|
|
131
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
132
|
+
for (let key of __getOwnPropNames(from))
|
|
133
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
134
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
135
|
+
}
|
|
136
|
+
return to;
|
|
137
|
+
};
|
|
138
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
139
|
+
var settings_migration_api_exports = {};
|
|
140
|
+
module.exports = __toCommonJS(settings_migration_api_exports);
|
|
141
|
+
//# sourceMappingURL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MgLSBUaGUgcHJvcG9zYWwuXG4gICAqIEByZXR1cm5zIFdoYXQgdGhlIHVzZXIgYXBwcm92ZWQuXG4gICAqL1xuICBtaWdyYXRlU2V0dGluZ3MocGFyYW1zOiBNaWdyYXRlU2V0dGluZ3NQYXJhbXM8VE1pZ3JhdGFibGVTZXR0aW5ncz4pOiBQcm9taXNlPE1pZ3JhdGVTZXR0aW5nc1Jlc3VsdD47XG59XG4iXSwKICAibWFwcGluZ3MiOiAiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTtBQUFBOyIsCiAgIm5hbWVzIjogW10KfQo=
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/// <reference path="../../library.d.cts" />
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
*
|
|
5
|
+
* The generic half of a settings HANDOVER contract: one plugin offers another the settings it used to own,
|
|
6
|
+
* and the plugin that owns them now decides what to do with the offer.
|
|
7
|
+
*
|
|
8
|
+
* The shape below is deliberately the *envelope* and nothing else. A handover has three parts, and only one
|
|
9
|
+
* of them is generic:
|
|
10
|
+
*
|
|
11
|
+
* - The **envelope** — a `migrateSettings` call, who is proposing, and whether the user applied it. Identical
|
|
12
|
+
* for every pair of plugins, so it lives here.
|
|
13
|
+
* - The **payload** — which settings are being proposed. Entirely the pair's own business, so it stays a type
|
|
14
|
+
* parameter and is never named here.
|
|
15
|
+
* - The **provider's identity** — its plugin id and display name. Also the pair's own business, and not
|
|
16
|
+
* something this library has any standing to own.
|
|
17
|
+
*
|
|
18
|
+
* Why it is declared rather than imported. A provider is typically an Obsidian *plugin* repo, not an npm
|
|
19
|
+
* package, so a consumer has nothing to depend on and hand-writes its own copy of the contract. Five copies
|
|
20
|
+
* of one contract with no compiler link between them means drift is SILENT — every copy still compiles and
|
|
21
|
+
* the handover fails at runtime instead. Declaring the envelope here gives both ends one declaration to
|
|
22
|
+
* compile against; `watchPluginApi` still negotiates the version at runtime, because the two ends ship
|
|
23
|
+
* independently and always will.
|
|
24
|
+
*
|
|
25
|
+
* The provider publishes it:
|
|
26
|
+
*
|
|
27
|
+
* ```ts
|
|
28
|
+
* publishPluginApi<SettingsMigrationApi<MyMigratableSettings>>({
|
|
29
|
+
* api: this.settingsMigrationApi,
|
|
30
|
+
* apiVersion: '1.0.0',
|
|
31
|
+
* contract: { migrateSettings: {} },
|
|
32
|
+
* plugin: this
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* The consumer reaches it through {@link obsidian/components/settings-migration-component!SettingsMigrationComponent},
|
|
37
|
+
* which owns the whole offer-and-retire dance.
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* Parameters for {@link SettingsMigrationApi.migrateSettings}.
|
|
41
|
+
*
|
|
42
|
+
* @typeParam TMigratableSettings - The settings the proposing plugin may hand over.
|
|
43
|
+
*/
|
|
44
|
+
export interface MigrateSettingsParams<TMigratableSettings extends object> {
|
|
45
|
+
/**
|
|
46
|
+
* The values the proposing plugin offers.
|
|
47
|
+
*
|
|
48
|
+
* Conventionally every member is optional, so a plugin proposes only what it actually held and a value the
|
|
49
|
+
* provider already owns is never overwritten by a default nobody chose. That convention belongs to the pair,
|
|
50
|
+
* though — this type imposes only the envelope.
|
|
51
|
+
*/
|
|
52
|
+
readonly proposedSettings: TMigratableSettings;
|
|
53
|
+
/**
|
|
54
|
+
* The `manifest.id` of the plugin making the proposal, so the provider's dialog can say whose settings
|
|
55
|
+
* these are.
|
|
56
|
+
*/
|
|
57
|
+
readonly sourcePluginId: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The outcome of {@link SettingsMigrationApi.migrateSettings}.
|
|
61
|
+
*/
|
|
62
|
+
export interface MigrateSettingsResult {
|
|
63
|
+
/**
|
|
64
|
+
* Whether the user approved the migration.
|
|
65
|
+
*
|
|
66
|
+
* `false` means they cancelled and nothing was written, so the proposing plugin must NOT record the
|
|
67
|
+
* migration as done — a cancel is not an answer, and the offer has to come back.
|
|
68
|
+
*/
|
|
69
|
+
readonly isApplied: boolean;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The API a plugin publishes when it is willing to receive settings another plugin used to own.
|
|
73
|
+
*
|
|
74
|
+
* @typeParam TMigratableSettings - The settings this provider accepts.
|
|
75
|
+
*
|
|
76
|
+
* @remarks
|
|
77
|
+
* The provider owns the settings, so it owns the dialog: a proposing plugin never writes into another
|
|
78
|
+
* plugin's `data.json`. It proposes, and the user approves, edits or declines.
|
|
79
|
+
*/
|
|
80
|
+
export interface SettingsMigrationApi<TMigratableSettings extends object> {
|
|
81
|
+
/**
|
|
82
|
+
* Offers the user a set of settings values another plugin proposes, and applies what they approve.
|
|
83
|
+
*
|
|
84
|
+
* Resolves only once the dialog is closed, so the caller learns whether the migration actually happened and
|
|
85
|
+
* can retire — or withhold — its own pending values on that answer.
|
|
86
|
+
*
|
|
87
|
+
* @param params - The proposal.
|
|
88
|
+
* @returns What the user approved.
|
|
89
|
+
*/
|
|
90
|
+
migrateSettings(params: MigrateSettingsParams<TMigratableSettings>): Promise<MigrateSettingsResult>;
|
|
91
|
+
}
|
|
@@ -57,6 +57,7 @@ export { MenuEventRegistrarComponent } from './obsidian/components/menu-event-re
|
|
|
57
57
|
export { around, hasPatchToken, MonkeyAroundComponent } from './obsidian/components/monkey-around-component.mjs';
|
|
58
58
|
export { NotebookNavigatorMenuEventRegistrarComponent } from './obsidian/components/notebook-navigator-menu-event-registrar-component.mjs';
|
|
59
59
|
export { PluginContextComponent } from './obsidian/components/plugin-context-component.mjs';
|
|
60
|
+
export { PluginConflictSeverity, PluginGateComponent } from './obsidian/components/plugin-gate-component.mjs';
|
|
60
61
|
export { PluginNoticeComponent, PluginNoticeMode } from './obsidian/components/plugin-notice-component.mjs';
|
|
61
62
|
export { PluginSettingsComponentBase } from './obsidian/components/plugin-settings-component.mjs';
|
|
62
63
|
export { PluginSettingsTabComponent } from './obsidian/components/plugin-settings-tab-component.mjs';
|
|
@@ -65,6 +66,7 @@ export { PointerPositionComponent } from './obsidian/components/pointer-position
|
|
|
65
66
|
export { RegistryComponent } from './obsidian/components/registry-component.mjs';
|
|
66
67
|
export { EmptyFolderBehavior, RenameDeleteHandlerComponent } from './obsidian/components/rename-delete-handler-component.mjs';
|
|
67
68
|
export { NOT_EMPTY_DIRECTORY_ERROR_CODE, RmdirGuardComponent } from './obsidian/components/rmdir-guard-component.mjs';
|
|
69
|
+
export { SettingsMigrationComponent } from './obsidian/components/settings-migration-component.mjs';
|
|
68
70
|
export { SyntaxHighlightingComponent } from './obsidian/components/syntax-highlighting-component.mjs';
|
|
69
71
|
export { getDomEventsHandlersConstructor } from './obsidian/constructors/get-dom-events-handlers-constructor.mjs';
|
|
70
72
|
export { CssClass } from './obsidian/css-class.mjs';
|
|
@@ -86,7 +88,7 @@ export { FOLDER_NOTES_PLUGIN_ID, FolderNoteLocation, resolveFolderNote, resolveF
|
|
|
86
88
|
export { isFrontmatterLinkCacheWithOffsets, toFrontmatterLinkCacheWithOffsets } from './obsidian/frontmatter-link-cache-with-offsets.mjs';
|
|
87
89
|
export { parseFrontmatter, removeEmptyFrontmatterValues, setFrontmatter } from './obsidian/frontmatter.mjs';
|
|
88
90
|
export { PluginHoverLinkSourceRegistrar } from './obsidian/hover-link-source-registrar.mjs';
|
|
89
|
-
export { appendCodeBlock, applySpellcheckMode } from './obsidian/html-element.mjs';
|
|
91
|
+
export { appendCodeBlock, applySpellcheckMode, asCodeBlock, createFragmentWithCodeBlocks } from './obsidian/html-element.mjs';
|
|
90
92
|
export { DEFAULT_NS, initI18N, t } from './obsidian/i18n/i18n.mjs';
|
|
91
93
|
export { en } from './obsidian/i18n/locales/en.mjs';
|
|
92
94
|
export { DEFAULT_LANGUAGE, defaultTranslationsMap } from './obsidian/i18n/locales/translations-map.mjs';
|
|
@@ -121,6 +123,8 @@ export { ObsidianPluginRepoPaths } from './obsidian/plugin/obsidian-plugin-repo-
|
|
|
121
123
|
export { PluginApiPayloadKind, PluginApiRevokedError, PluginApiUnavailabilityReason, PluginApiUnavailableError, PluginApiValidationError, publishPluginApi, watchPluginApi } from './obsidian/plugin/plugin-api.mjs';
|
|
122
124
|
export { addPluginCssClasses, initDebugController, initPluginContext } from './obsidian/plugin/plugin-context.mjs';
|
|
123
125
|
export { PluginEventSourceImpl } from './obsidian/plugin/plugin-event-source.mjs';
|
|
126
|
+
export { getInstalledPluginState, getInstalledPluginVersion, installAndEnablePlugin, InstalledPluginState } from './obsidian/plugin/plugin-install-state.mjs';
|
|
127
|
+
export { PLUGIN_LOADED_EVENT_NAME, PLUGIN_UNLOADED_EVENT_NAME, triggerPluginLifecycleEvent } from './obsidian/plugin/plugin-lifecycle-events.mjs';
|
|
124
128
|
export { PluginSettingsTabBase, SAVE_TO_FILE_CONTEXT } from './obsidian/plugin/plugin-settings-tab.mjs';
|
|
125
129
|
export { PluginBase, reloadPlugin, showErrorAndDisablePlugin } from './obsidian/plugin/plugin.mjs';
|
|
126
130
|
export { editFieldsInPopover } from './obsidian/popovers/field-popover.mjs';
|