obsidian-dev-utils 73.0.0 → 74.1.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/dev/main.js +202 -194
  3. package/dist/lib/cjs/function.cjs +9 -1
  4. package/dist/lib/cjs/function.d.cts +10 -0
  5. package/dist/lib/cjs/library.cjs +1 -1
  6. package/dist/lib/cjs/obsidian/command-handlers/abstract-file-command-handler.cjs +3 -7
  7. package/dist/lib/cjs/obsidian/command-handlers/abstract-file-command-handler.d.cts +1 -3
  8. package/dist/lib/cjs/obsidian/command-handlers/command-handler.cjs +15 -4
  9. package/dist/lib/cjs/obsidian/command-handlers/command-handler.d.cts +9 -3
  10. package/dist/lib/cjs/obsidian/command-handlers/editor-command-handler.cjs +3 -8
  11. package/dist/lib/cjs/obsidian/command-handlers/editor-command-handler.d.cts +1 -3
  12. package/dist/lib/cjs/obsidian/components/index.cjs +1 -4
  13. package/dist/lib/cjs/obsidian/components/index.d.cts +0 -1
  14. package/dist/lib/cjs/obsidian/components/monkey-around-component.cjs +5 -2
  15. package/dist/lib/cjs/obsidian/components/monkey-around-component.d.cts +41 -9
  16. package/dist/lib/cjs/obsidian/components/rename-delete-handler-component.cjs +118 -99
  17. package/dist/lib/cjs/obsidian/components/rename-delete-handler-component.d.cts +0 -1
  18. package/dist/lib/cjs/obsidian/constructors/getDomEventsHandlersConstructor.cjs +21 -17
  19. package/dist/lib/cjs/obsidian/i18n/i18n.cjs +2 -7
  20. package/dist/lib/cjs/obsidian/i18n/i18n.d.cts +4 -0
  21. package/dist/lib/cjs/obsidian/markdown.cjs +24 -15
  22. package/dist/lib/cjs/obsidian/plugin/plugin.cjs +15 -20
  23. package/dist/lib/cjs/obsidian/plugin/plugin.d.cts +10 -14
  24. package/dist/lib/esm/function.d.mts +10 -0
  25. package/dist/lib/esm/function.mjs +8 -1
  26. package/dist/lib/esm/library.mjs +1 -1
  27. package/dist/lib/esm/obsidian/command-handlers/abstract-file-command-handler.d.mts +1 -3
  28. package/dist/lib/esm/obsidian/command-handlers/abstract-file-command-handler.mjs +3 -7
  29. package/dist/lib/esm/obsidian/command-handlers/command-handler.d.mts +9 -3
  30. package/dist/lib/esm/obsidian/command-handlers/command-handler.mjs +16 -5
  31. package/dist/lib/esm/obsidian/command-handlers/editor-command-handler.d.mts +1 -3
  32. package/dist/lib/esm/obsidian/command-handlers/editor-command-handler.mjs +3 -8
  33. package/dist/lib/esm/obsidian/components/index.d.mts +0 -1
  34. package/dist/lib/esm/obsidian/components/index.mjs +1 -3
  35. package/dist/lib/esm/obsidian/components/monkey-around-component.d.mts +41 -9
  36. package/dist/lib/esm/obsidian/components/monkey-around-component.mjs +5 -2
  37. package/dist/lib/esm/obsidian/components/rename-delete-handler-component.d.mts +0 -1
  38. package/dist/lib/esm/obsidian/components/rename-delete-handler-component.mjs +118 -99
  39. package/dist/lib/esm/obsidian/constructors/getDomEventsHandlersConstructor.mjs +21 -17
  40. package/dist/lib/esm/obsidian/i18n/i18n.d.mts +4 -0
  41. package/dist/lib/esm/obsidian/i18n/i18n.mjs +2 -7
  42. package/dist/lib/esm/obsidian/markdown.mjs +24 -15
  43. package/dist/lib/esm/obsidian/plugin/plugin.d.mts +10 -14
  44. package/dist/lib/esm/obsidian/plugin/plugin.mjs +15 -20
  45. package/package.json +6 -6
  46. package/dist/lib/cjs/obsidian/components/i18n-component.cjs +0 -156
  47. package/dist/lib/cjs/obsidian/components/i18n-component.d.cts +0 -24
  48. package/dist/lib/esm/obsidian/components/i18n-component.d.mts +0 -24
  49. package/dist/lib/esm/obsidian/components/i18n-component.mjs +0 -48
  50. package/obsidian/Components/i18n-component/package.json +0 -6
@@ -1,156 +0,0 @@
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 initCjs() {
7
- // eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
8
- const globalThisRecord = globalThis;
9
- globalThisRecord['__name'] ??= name;
10
- const originalRequire = require;
11
- if (originalRequire && !originalRequire.__isPatched) {
12
- // eslint-disable-next-line no-global-assign, no-implicit-globals -- We need to patch the `require()` function.
13
- require = Object.assign(
14
- (id) => requirePatched(id),
15
- originalRequire,
16
- {
17
- __isPatched: true
18
- }
19
- );
20
- }
21
-
22
- const newFuncs = {
23
- __extractDefault() {
24
- return extractDefault;
25
- },
26
- process() {
27
- const browserProcess = {
28
- browser: true,
29
- cwd() {
30
- return '/';
31
- },
32
- env: {},
33
- platform: 'android'
34
- };
35
- return browserProcess;
36
- }
37
- };
38
-
39
- for (const key of Object.keys(newFuncs)) {
40
- globalThisRecord[key] ??= newFuncs[key]?.();
41
- }
42
-
43
- function name(obj) {
44
- return obj;
45
- }
46
-
47
- function extractDefault(module) {
48
- return module && module.__esModule && 'default' in module ? module.default : module;
49
- }
50
-
51
- const OBSIDIAN_BUILT_IN_MODULE_NAMES = [
52
- 'obsidian',
53
- '@codemirror/autocomplete',
54
- '@codemirror/collab',
55
- '@codemirror/commands',
56
- '@codemirror/language',
57
- '@codemirror/lint',
58
- '@codemirror/search',
59
- '@codemirror/state',
60
- '@codemirror/text',
61
- '@codemirror/view',
62
- '@lezer/common',
63
- '@lezer/lr',
64
- '@lezer/highlight'];
65
-
66
-
67
- const DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES = [
68
- '@codemirror/closebrackets',
69
- '@codemirror/comment',
70
- '@codemirror/fold',
71
- '@codemirror/gutter',
72
- '@codemirror/highlight',
73
- '@codemirror/history',
74
- '@codemirror/matchbrackets',
75
- '@codemirror/panel',
76
- '@codemirror/rangeset',
77
- '@codemirror/rectangular-selection',
78
- '@codemirror/stream-parser',
79
- '@codemirror/tooltip'];
80
-
81
-
82
- function requirePatched(id) {
83
- if (OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id) || DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id)) {
84
- return originalRequire?.(id);
85
- }
86
-
87
- // eslint-disable-next-line @typescript-eslint/no-deprecated, obsidianmd/no-global-this -- Need access to app. Actively use globalThis.
88
- if (globalThis.app.isMobile) {
89
- if (id === 'process' || id === 'node:process') {
90
- // eslint-disable-next-line no-console -- Valid usage.
91
- console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Fake process object is returned instead.`);
92
- // eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
93
- return globalThis.process;
94
- }
95
- } else {
96
- const module = originalRequire?.(id);
97
- if (module) {
98
- return extractDefault(module);
99
- }
100
- }
101
-
102
- // eslint-disable-next-line no-console -- Valid usage.
103
- console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Empty object is returned instead.`);
104
- return {};
105
- }
106
- })();
107
-
108
- "use strict";
109
- var __defProp = Object.defineProperty;
110
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
111
- var __getOwnPropNames = Object.getOwnPropertyNames;
112
- var __hasOwnProp = Object.prototype.hasOwnProperty;
113
- var __export = (target, all) => {
114
- for (var name in all)
115
- __defProp(target, name, { get: all[name], enumerable: true });
116
- };
117
- var __copyProps = (to, from, except, desc) => {
118
- if (from && typeof from === "object" || typeof from === "function") {
119
- for (let key of __getOwnPropNames(from))
120
- if (!__hasOwnProp.call(to, key) && key !== except)
121
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
122
- }
123
- return to;
124
- };
125
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
126
- var i18n_component_exports = {};
127
- __export(i18n_component_exports, {
128
- I18nComponent: () => I18nComponent
129
- });
130
- module.exports = __toCommonJS(i18n_component_exports);
131
- var import_i18n = require('../i18n/i18n.cjs');
132
- var import_translations_map = require('../i18n/locales/translations-map.cjs');
133
- var import_component_ex = require('./component-ex.cjs');
134
- class I18nComponent extends import_component_ex.ComponentEx {
135
- /**
136
- * Creates a new i18n component.
137
- *
138
- * @param translationsMap - The translations map. Defaults to the built-in translations.
139
- */
140
- constructor(translationsMap = import_translations_map.defaultTranslationsMap) {
141
- super();
142
- this.translationsMap = translationsMap;
143
- }
144
- translationsMap;
145
- /**
146
- * Initializes i18n.
147
- */
148
- async onloadAsync() {
149
- await (0, import_i18n.initI18N)(this.translationsMap);
150
- }
151
- }
152
- // Annotate the CommonJS export names for ESM import in node:
153
- 0 && (module.exports = {
154
- I18nComponent
155
- });
156
- //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL2NvbXBvbmVudHMvaTE4bi1jb21wb25lbnQudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGZpbGVcbiAqXG4gKiBDb21wb25lbnQgdGhhdCBpbml0aWFsaXplcyBpMThuIHRyYW5zbGF0aW9ucy5cbiAqL1xuXG5pbXBvcnQgdHlwZSB7IFRyYW5zbGF0aW9uc01hcCB9IGZyb20gJy4uL2kxOG4vaTE4bi50cyc7XG5cbmltcG9ydCB7IGluaXRJMThOIH0gZnJvbSAnLi4vaTE4bi9pMThuLnRzJztcbmltcG9ydCB7IGRlZmF1bHRUcmFuc2xhdGlvbnNNYXAgfSBmcm9tICcuLi9pMThuL2xvY2FsZXMvdHJhbnNsYXRpb25zLW1hcC50cyc7XG5pbXBvcnQgeyBDb21wb25lbnRFeCB9IGZyb20gJy4vY29tcG9uZW50LWV4LnRzJztcblxuLyoqXG4gKiBJbml0aWFsaXplcyB0aGUgaTE4biBtb2R1bGUgd2l0aCB0aGUgcHJvdmlkZWQgdHJhbnNsYXRpb25zIG1hcC5cbiAqL1xuZXhwb3J0IGNsYXNzIEkxOG5Db21wb25lbnQgZXh0ZW5kcyBDb21wb25lbnRFeCB7XG4gIC8qKlxuICAgKiBDcmVhdGVzIGEgbmV3IGkxOG4gY29tcG9uZW50LlxuICAgKlxuICAgKiBAcGFy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CiAgIm5hbWVzIjogW10KfQo=
@@ -1,24 +0,0 @@
1
- /// <reference path="../../library.d.cts" />
2
- /**
3
- * @file
4
- *
5
- * Component that initializes i18n translations.
6
- */
7
- import type { TranslationsMap } from '../i18n/i18n.cjs';
8
- import { ComponentEx } from './component-ex.cjs';
9
- /**
10
- * Initializes the i18n module with the provided translations map.
11
- */
12
- export declare class I18nComponent extends ComponentEx {
13
- private readonly translationsMap;
14
- /**
15
- * Creates a new i18n component.
16
- *
17
- * @param translationsMap - The translations map. Defaults to the built-in translations.
18
- */
19
- constructor(translationsMap?: TranslationsMap);
20
- /**
21
- * Initializes i18n.
22
- */
23
- onloadAsync(): Promise<void>;
24
- }
@@ -1,24 +0,0 @@
1
- /// <reference path="../../library.d.mts" />
2
- /**
3
- * @file
4
- *
5
- * Component that initializes i18n translations.
6
- */
7
- import type { TranslationsMap } from '../i18n/i18n.mjs';
8
- import { ComponentEx } from './component-ex.mjs';
9
- /**
10
- * Initializes the i18n module with the provided translations map.
11
- */
12
- export declare class I18nComponent extends ComponentEx {
13
- private readonly translationsMap;
14
- /**
15
- * Creates a new i18n component.
16
- *
17
- * @param translationsMap - The translations map. Defaults to the built-in translations.
18
- */
19
- constructor(translationsMap?: TranslationsMap);
20
- /**
21
- * Initializes i18n.
22
- */
23
- onloadAsync(): Promise<void>;
24
- }
@@ -1,48 +0,0 @@
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 initEsm() {
7
- // eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
8
- if (globalThis.process) {
9
- return;
10
- }
11
-
12
- const browserProcess = {
13
- browser: true,
14
- cwd() {
15
- return '/';
16
- },
17
- env: {},
18
- platform: 'android'
19
- };
20
- // eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
21
- globalThis.process = browserProcess;
22
- })();
23
-
24
- import { initI18N } from "../i18n/i18n.mjs";
25
- import { defaultTranslationsMap } from "../i18n/locales/translations-map.mjs";
26
- import { ComponentEx } from "./component-ex.mjs";
27
- class I18nComponent extends ComponentEx {
28
- /**
29
- * Creates a new i18n component.
30
- *
31
- * @param translationsMap - The translations map. Defaults to the built-in translations.
32
- */
33
- constructor(translationsMap = defaultTranslationsMap) {
34
- super();
35
- this.translationsMap = translationsMap;
36
- }
37
- translationsMap;
38
- /**
39
- * Initializes i18n.
40
- */
41
- async onloadAsync() {
42
- await initI18N(this.translationsMap);
43
- }
44
- }
45
- export {
46
- I18nComponent
47
- };
48
- //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL2NvbXBvbmVudHMvaTE4bi1jb21wb25lbnQudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGZpbGVcbiAqXG4gKiBDb21wb25lbnQgdGhhdCBpbml0aWFsaXplcyBpMThuIHRyYW5zbGF0aW9ucy5cbiAqL1xuXG5pbXBvcnQgdHlwZSB7IFRyYW5zbGF0aW9uc01hcCB9IGZyb20gJy4uL2kxOG4vaTE4bi50cyc7XG5cbmltcG9ydCB7IGluaXRJMThOIH0gZnJvbSAnLi4vaTE4bi9pMThuLnRzJztcbmltcG9ydCB7IGRlZmF1bHRUcmFuc2xhdGlvbnNNYXAgfSBmcm9tICcuLi9pMThuL2xvY2FsZXMvdHJhbnNsYXRpb25zLW1hcC50cyc7XG5pbXBvcnQgeyBDb21wb25lbnRFeCB9IGZyb20gJy4vY29tcG9uZW50LWV4LnRzJztcblxuLyoqXG4gKiBJbml0aWFsaXplcyB0aGUgaTE4biBtb2R1bGUgd2l0aCB0aGUgcHJvdmlkZWQgdHJhbnNsYXRpb25zIG1hcC5cbiAqL1xuZXhwb3J0IGNsYXNzIEkxOG5Db21wb25lbnQgZXh0ZW5kcyBDb21wb25lbnRFeCB7XG4gIC8qKlxuICAgKiBDcmVhdGVzIGEgbmV3IGkxOG4gY29tcG9uZW50LlxuICAgKlxuICAgKiBAcGFyYW0gdHJhbnNsYXRpb25zTWFwIC0gVGhlIHRyYW5zbGF0aW9ucyBtYXAuIERlZmF1bHRzIHRvIHRoZSBidWlsdC1pbiB0cmFuc2xhdGlvbnMuXG4gICAqL1xuICBwdWJsaWMgY29uc3RydWN0b3IocHJpdmF0ZSByZWFkb25seSB0cmFuc2xhdGlvbnNNYXA6IFRyYW5zbGF0aW9uc01hcCA9IGRlZmF1bHRUcmFuc2xhdGlvbnNNYXApIHtcbiAgICBzdXBlcigpO1xuICB9XG5cbiAgLyoqXG4gICAqIEluaXRpYWxpemVzIGkxOG4uXG4gICAqL1xuICBwdWJsaWMgb3ZlcnJpZGUgYXN5bmMgb25sb2FkQXN5bmMoKTogUHJvbWlzZTx2b2lkPiB7XG4gICAgYXdhaXQgaW5pdEkxOE4odGhpcy50cmFuc2xhdGlvbnNNYXApO1xuICB9XG59XG4iXSwKICAibWFwcGluZ3MiOiAiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQVFBLFNBQVMsZ0JBQWdCO0FBQ3pCLFNBQVMsOEJBQThCO0FBQ3ZDLFNBQVMsbUJBQW1CO0FBS3JCLE1BQU0sc0JBQXNCLFlBQVk7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUEsRUFNdEMsWUFBNkIsa0JBQW1DLHdCQUF3QjtBQUM3RixVQUFNO0FBRDRCO0FBQUEsRUFFcEM7QUFBQSxFQUZvQztBQUFBO0FBQUE7QUFBQTtBQUFBLEVBT3BDLE1BQXNCLGNBQTZCO0FBQ2pELFVBQU0sU0FBUyxLQUFLLGVBQWU7QUFBQSxFQUNyQztBQUNGOyIsCiAgIm5hbWVzIjogW10KfQo=
@@ -1,6 +0,0 @@
1
- {
2
- "main": "../../../dist/lib/cjs/obsidian/components/i18n-component.cjs",
3
- "module": "../../../dist/lib/esm/obsidian/components/i18n-component.mjs",
4
- "type": "module",
5
- "types": "../../../dist/lib/cjs/obsidian/components/i18n-component.d.cts"
6
- }