@polyipseity/obsidian-plugin-library 1.33.1 → 1.35.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/dist/index.js +90 -86
- package/dist/index.js.map +4 -4
- package/dist/src/components/find.d.svelte.ts +10 -11
- package/dist/src/components/find.svelte +48 -54
- package/dist/src/i18n.d.ts +1 -1
- package/dist/src/i18n.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/private.d.ts.map +1 -1
- package/dist/src/rules.d.ts +1 -1
- package/dist/src/rules.d.ts.map +1 -1
- package/dist/src/source-maps.d.ts.map +1 -1
- package/dist/src/status-bar.d.ts +1 -0
- package/dist/src/status-bar.d.ts.map +1 -1
- package/dist/src/{util.d.ts → utils.d.ts} +1 -1
- package/dist/src/utils.d.ts.map +1 -0
- package/package.json +11 -9
- package/dist/src/util.d.ts.map +0 -1
- package/dist/tests/assets/locales.spec.d.ts +0 -2
- package/dist/tests/assets/locales.spec.d.ts.map +0 -1
- package/dist/tests/helpers.d.ts +0 -14
- package/dist/tests/helpers.d.ts.map +0 -1
- package/dist/tests/scripts/build.test.d.mts +0 -2
- package/dist/tests/scripts/build.test.d.mts.map +0 -1
- package/dist/tests/scripts/utils.spec.d.mts +0 -2
- package/dist/tests/scripts/utils.spec.d.mts.map +0 -1
- package/dist/tests/setup.d.ts +0 -2
- package/dist/tests/setup.d.ts.map +0 -1
- package/dist/tests/tests/helpers.spec.d.ts +0 -2
- package/dist/tests/tests/helpers.spec.d.ts.map +0 -1
- package/dist/tests/vi-practices.spec.d.ts +0 -2
- package/dist/tests/vi-practices.spec.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1235,7 +1235,7 @@ function opaqueOrDefault(type, value, defaultValue) {
|
|
|
1235
1235
|
}
|
|
1236
1236
|
function codePoint(value) {
|
|
1237
1237
|
const cp = value.codePointAt(0);
|
|
1238
|
-
if (cp === void 0 || String.
|
|
1238
|
+
if (cp === void 0 || String.fromCodePoint(cp) !== value) {
|
|
1239
1239
|
throw new TypeError(value);
|
|
1240
1240
|
}
|
|
1241
1241
|
return value;
|
|
@@ -1319,7 +1319,7 @@ function primitiveOfE(value) {
|
|
|
1319
1319
|
return value;
|
|
1320
1320
|
}
|
|
1321
1321
|
|
|
1322
|
-
// src/
|
|
1322
|
+
// src/utils.ts
|
|
1323
1323
|
import {
|
|
1324
1324
|
escapeRegExp,
|
|
1325
1325
|
identity,
|
|
@@ -1344,7 +1344,7 @@ var InternalDOMClasses;
|
|
|
1344
1344
|
InternalDOMClasses2.ICON = `${NAMESPACE}:icon`;
|
|
1345
1345
|
})(InternalDOMClasses || (InternalDOMClasses = {}));
|
|
1346
1346
|
|
|
1347
|
-
// src/
|
|
1347
|
+
// src/utils.ts
|
|
1348
1348
|
var EventEmitterLite = class _EventEmitterLite {
|
|
1349
1349
|
constructor() {
|
|
1350
1350
|
this.lock = new AsyncLock({ maxPending: MAX_LOCK_PENDING });
|
|
@@ -1421,7 +1421,9 @@ function alternativeRegExp(strs) {
|
|
|
1421
1421
|
);
|
|
1422
1422
|
}
|
|
1423
1423
|
function anyToError(obj) {
|
|
1424
|
-
|
|
1424
|
+
if (obj instanceof Error) return obj;
|
|
1425
|
+
if (typeof obj === "object") return new Error(toJSONOrString(obj));
|
|
1426
|
+
return new Error(String(obj));
|
|
1425
1427
|
}
|
|
1426
1428
|
function aroundIdentityFactory() {
|
|
1427
1429
|
return (proto) => function fn(...args) {
|
|
@@ -1572,7 +1574,7 @@ function escapeQuerySelectorAttribute(value) {
|
|
|
1572
1574
|
}
|
|
1573
1575
|
function extname(path) {
|
|
1574
1576
|
const base = basename(path), idx = base.lastIndexOf(".");
|
|
1575
|
-
return idx
|
|
1577
|
+
return idx <= 0 ? "" : base.slice(idx);
|
|
1576
1578
|
}
|
|
1577
1579
|
function getKeyModifiers(event) {
|
|
1578
1580
|
const ret = [];
|
|
@@ -1602,8 +1604,8 @@ function typedOwnKeys(self0) {
|
|
|
1602
1604
|
function typedKeys() {
|
|
1603
1605
|
return (obj) => deepFreeze(Object.keys(obj));
|
|
1604
1606
|
}
|
|
1605
|
-
function inSet(
|
|
1606
|
-
return contravariant(
|
|
1607
|
+
function inSet(set, obj) {
|
|
1608
|
+
return contravariant(set).includes(obj);
|
|
1607
1609
|
}
|
|
1608
1610
|
function insertAt(self0, index, ...items) {
|
|
1609
1611
|
self0.splice(index, 0, ...items);
|
|
@@ -1898,6 +1900,7 @@ function remove(self0, item) {
|
|
|
1898
1900
|
return removeAt(self0, self0.indexOf(item));
|
|
1899
1901
|
}
|
|
1900
1902
|
function removeAt(self0, index) {
|
|
1903
|
+
if (index < 0 || index >= self0.length) return void 0;
|
|
1901
1904
|
return self0.splice(index, 1)[0];
|
|
1902
1905
|
}
|
|
1903
1906
|
function replaceAllRegex(string) {
|
|
@@ -2162,12 +2165,12 @@ var LibraryLocales;
|
|
|
2162
2165
|
// src/components/find.svelte
|
|
2163
2166
|
import "svelte/internal/disclose-version";
|
|
2164
2167
|
import { t as i18nt } from "i18next";
|
|
2165
|
-
import { isEmpty as isEmpty2 } from "lodash-es";
|
|
2168
|
+
import { isEmpty as isEmpty2, noop as noop2 } from "lodash-es";
|
|
2166
2169
|
import { onMount } from "svelte";
|
|
2167
2170
|
import { setIcon } from "obsidian";
|
|
2168
2171
|
import { slide } from "svelte/transition";
|
|
2169
2172
|
import * as $ from "svelte/internal/client";
|
|
2170
|
-
var root = $.from_html(`<div class="document-search-container" role="search"><div class="document-search _polyipseity_obsidian-plugin-library-svelte-find"><div class="document-search-buttons"><button></button> <button></button> <button></button></div> <input class="document-search-input" type="text" role="searchbox"/> <div class="document-search-buttons"><button class="document-search-button"></button> <button class="document-search-button"></button> <div class="document-search-results"> </div> <button class="document-search-close-button"></button></div></div></div>`);
|
|
2173
|
+
var root = $.from_html(`<div class="document-search-container" role="search"><div class="document-search _polyipseity_obsidian-plugin-library-svelte-find"><div class="document-search-buttons"><button type="button"></button> <button type="button"></button> <button type="button"></button></div> <input class="document-search-input" type="text" role="searchbox"/> <div class="document-search-buttons"><button type="button" class="document-search-button"></button> <button type="button" class="document-search-button"></button> <div class="document-search-results" aria-live="polite"> </div> <button type="button" class="document-search-close-button"></button></div></div></div>`);
|
|
2171
2174
|
var $$css = {
|
|
2172
2175
|
hash: "_polyipseity_obsidian-plugin-library-svelte-find",
|
|
2173
2176
|
code: ".document-search._polyipseity_obsidian-plugin-library-svelte-find {flex-wrap:wrap;}.is-mobile .document-search._polyipseity_obsidian-plugin-library-svelte-find .document-search-button.mod-cta:where(._polyipseity_obsidian-plugin-library-svelte-find) {background-color:var(--interactive-accent);color:var(--text-on-accent);}"
|
|
@@ -2175,30 +2178,15 @@ var $$css = {
|
|
|
2175
2178
|
function Find($$anchor, $$props) {
|
|
2176
2179
|
$.push($$props, true);
|
|
2177
2180
|
$.append_styles($$anchor, $$css);
|
|
2178
|
-
const i18n = $.prop($$props, "i18n", 3, i18nt), params = $.prop($$props, "params",
|
|
2181
|
+
const i18n = $.prop($$props, "i18n", 3, i18nt), params = $.prop($$props, "params", 31, () => $.proxy({
|
|
2179
2182
|
caseSensitive: false,
|
|
2180
2183
|
findText: "",
|
|
2181
2184
|
regex: false,
|
|
2182
2185
|
wholeWord: false
|
|
2183
|
-
})), onClose = $.prop($$props, "onClose", 3, ()
|
|
2184
|
-
}), onFind = $.prop($$props, "onFind", 3, (_direction, _params) => {
|
|
2185
|
-
}), onParamsChanged = $.prop($$props, "onParamsChanged", 3, (_params) => {
|
|
2186
|
-
}), results = $.prop($$props, "results", 3, ""), focused = $.prop($$props, "focused", 3, false);
|
|
2187
|
-
let stateI18n = $.state(i18n());
|
|
2188
|
-
const stateParams = $.proxy(cloneAsWritable(params()));
|
|
2189
|
-
let stateResults = $.state(results());
|
|
2186
|
+
})), results = $.prop($$props, "results", 3, ""), onClose = $.prop($$props, "onClose", 3, noop2), onFind = $.prop($$props, "onFind", 3, noop2), onParamsChanged = $.prop($$props, "onParamsChanged", 3, noop2), initialFocus = $.prop($$props, "initialFocus", 3, false);
|
|
2190
2187
|
$.user_effect(() => {
|
|
2191
|
-
onParamsChanged()(
|
|
2188
|
+
onParamsChanged()(params());
|
|
2192
2189
|
});
|
|
2193
|
-
function setI18n(i18n0) {
|
|
2194
|
-
$.set(stateI18n, i18n0);
|
|
2195
|
-
}
|
|
2196
|
-
function getParamsRef() {
|
|
2197
|
-
return stateParams;
|
|
2198
|
-
}
|
|
2199
|
-
function setResults(results0) {
|
|
2200
|
-
$.set(stateResults, results0);
|
|
2201
|
-
}
|
|
2202
2190
|
let inputElement = null;
|
|
2203
2191
|
function focus() {
|
|
2204
2192
|
inputElement === null || inputElement === void 0 ? void 0 : inputElement.focus();
|
|
@@ -2206,31 +2194,31 @@ function Find($$anchor, $$props) {
|
|
|
2206
2194
|
function blur() {
|
|
2207
2195
|
inputElement === null || inputElement === void 0 ? void 0 : inputElement.blur();
|
|
2208
2196
|
}
|
|
2209
|
-
if (
|
|
2197
|
+
if (initialFocus()) {
|
|
2210
2198
|
onMount(focus);
|
|
2211
2199
|
}
|
|
2212
|
-
var $$exports = {
|
|
2200
|
+
var $$exports = { focus, blur };
|
|
2213
2201
|
var div = root();
|
|
2214
2202
|
var div_1 = $.child(div);
|
|
2215
2203
|
var div_2 = $.child(div_1);
|
|
2216
2204
|
var button = $.child(div_2);
|
|
2217
2205
|
button.__click = (event) => {
|
|
2218
|
-
|
|
2206
|
+
params(params().caseSensitive = !params().caseSensitive, true);
|
|
2219
2207
|
consumeEvent(event);
|
|
2220
2208
|
};
|
|
2221
|
-
$.action(button, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () =>
|
|
2209
|
+
$.action(button, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18n()("asset:components.find.case-sensitive-icon"));
|
|
2222
2210
|
var button_1 = $.sibling(button, 2);
|
|
2223
2211
|
button_1.__click = (event) => {
|
|
2224
|
-
|
|
2212
|
+
params(params().wholeWord = !params().wholeWord, true);
|
|
2225
2213
|
consumeEvent(event);
|
|
2226
2214
|
};
|
|
2227
|
-
$.action(button_1, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () =>
|
|
2215
|
+
$.action(button_1, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18n()("asset:components.find.whole-word-icon"));
|
|
2228
2216
|
var button_2 = $.sibling(button_1, 2);
|
|
2229
2217
|
button_2.__click = (event) => {
|
|
2230
|
-
|
|
2218
|
+
params(params().regex = !params().regex, true);
|
|
2231
2219
|
consumeEvent(event);
|
|
2232
2220
|
};
|
|
2233
|
-
$.action(button_2, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () =>
|
|
2221
|
+
$.action(button_2, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18n()("asset:components.find.regex-icon"));
|
|
2234
2222
|
$.reset(div_2);
|
|
2235
2223
|
var input = $.sibling(div_2, 2);
|
|
2236
2224
|
$.remove_input_defaults(input);
|
|
@@ -2239,21 +2227,25 @@ function Find($$anchor, $$props) {
|
|
|
2239
2227
|
onClose()();
|
|
2240
2228
|
consumeEvent(event);
|
|
2241
2229
|
}
|
|
2230
|
+
if (event.key === "Enter" && isEmpty2(getKeyModifiers(event))) {
|
|
2231
|
+
onFind()("next", params());
|
|
2232
|
+
consumeEvent(event);
|
|
2233
|
+
}
|
|
2242
2234
|
};
|
|
2243
2235
|
$.bind_this(input, ($$value) => inputElement = $$value, () => inputElement);
|
|
2244
2236
|
var div_3 = $.sibling(input, 2);
|
|
2245
2237
|
var button_3 = $.child(div_3);
|
|
2246
2238
|
button_3.__click = (event) => {
|
|
2247
|
-
onFind()("previous",
|
|
2239
|
+
onFind()("previous", params());
|
|
2248
2240
|
consumeEvent(event);
|
|
2249
2241
|
};
|
|
2250
|
-
$.action(button_3, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () =>
|
|
2242
|
+
$.action(button_3, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18n()("asset:components.find.previous-icon"));
|
|
2251
2243
|
var button_4 = $.sibling(button_3, 2);
|
|
2252
2244
|
button_4.__click = (event) => {
|
|
2253
|
-
onFind()("next",
|
|
2245
|
+
onFind()("next", params());
|
|
2254
2246
|
consumeEvent(event);
|
|
2255
2247
|
};
|
|
2256
|
-
$.action(button_4, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () =>
|
|
2248
|
+
$.action(button_4, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18n()("asset:components.find.next-icon"));
|
|
2257
2249
|
var div_4 = $.sibling(button_4, 2);
|
|
2258
2250
|
var text = $.child(div_4, true);
|
|
2259
2251
|
$.reset(div_4);
|
|
@@ -2262,35 +2254,35 @@ function Find($$anchor, $$props) {
|
|
|
2262
2254
|
onClose()();
|
|
2263
2255
|
consumeEvent(event);
|
|
2264
2256
|
};
|
|
2265
|
-
$.action(button_5, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () =>
|
|
2257
|
+
$.action(button_5, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18n()("asset:components.find.close-icon"));
|
|
2266
2258
|
$.reset(div_3);
|
|
2267
2259
|
$.reset(div_1);
|
|
2268
2260
|
$.reset(div);
|
|
2269
2261
|
$.template_effect(
|
|
2270
2262
|
($0, $1, $2, $3, $4, $5, $6) => {
|
|
2271
|
-
$.set_class(button, 1, `document-search-button${
|
|
2263
|
+
$.set_class(button, 1, `document-search-button${params().caseSensitive ? " mod-cta" : ""}`, "_polyipseity_obsidian-plugin-library-svelte-find");
|
|
2272
2264
|
$.set_attribute(button, "aria-label", $0);
|
|
2273
|
-
$.set_class(button_1, 1, `document-search-button${
|
|
2265
|
+
$.set_class(button_1, 1, `document-search-button${params().wholeWord ? " mod-cta" : ""}`, "_polyipseity_obsidian-plugin-library-svelte-find");
|
|
2274
2266
|
$.set_attribute(button_1, "aria-label", $1);
|
|
2275
|
-
$.set_class(button_2, 1, `document-search-button${
|
|
2267
|
+
$.set_class(button_2, 1, `document-search-button${params().regex ? " mod-cta" : ""}`, "_polyipseity_obsidian-plugin-library-svelte-find");
|
|
2276
2268
|
$.set_attribute(button_2, "aria-label", $2);
|
|
2277
2269
|
$.set_attribute(input, "placeholder", $3);
|
|
2278
2270
|
$.set_attribute(button_3, "aria-label", $4);
|
|
2279
2271
|
$.set_attribute(button_4, "aria-label", $5);
|
|
2280
|
-
$.set_text(text,
|
|
2272
|
+
$.set_text(text, results());
|
|
2281
2273
|
$.set_attribute(button_5, "aria-label", $6);
|
|
2282
2274
|
},
|
|
2283
2275
|
[
|
|
2284
|
-
() =>
|
|
2285
|
-
() =>
|
|
2286
|
-
() =>
|
|
2287
|
-
() =>
|
|
2288
|
-
() =>
|
|
2289
|
-
() =>
|
|
2290
|
-
() =>
|
|
2276
|
+
() => i18n()("components.find.case-sensitive"),
|
|
2277
|
+
() => i18n()("components.find.whole-word"),
|
|
2278
|
+
() => i18n()("components.find.regex"),
|
|
2279
|
+
() => i18n()("components.find.input-placeholder"),
|
|
2280
|
+
() => i18n()("components.find.previous"),
|
|
2281
|
+
() => i18n()("components.find.next"),
|
|
2282
|
+
() => i18n()("components.find.close")
|
|
2291
2283
|
]
|
|
2292
2284
|
);
|
|
2293
|
-
$.bind_value(input, () =>
|
|
2285
|
+
$.bind_value(input, () => params().findText, ($$value) => params(params().findText = $$value, true));
|
|
2294
2286
|
$.transition(3, div, () => slide);
|
|
2295
2287
|
$.append($$anchor, div);
|
|
2296
2288
|
return $.pop($$exports);
|
|
@@ -2322,20 +2314,20 @@ function fixTyped(defaults, from, key, types) {
|
|
|
2322
2314
|
return genericTypeofGuardE(types, val) ? val : primitiveOfE(defaults[key]);
|
|
2323
2315
|
}
|
|
2324
2316
|
function fixArray(defaults, from, key, types) {
|
|
2325
|
-
const val = from[key];
|
|
2326
|
-
if (isHomogenousArray(types, val)) {
|
|
2327
|
-
return val;
|
|
2328
|
-
}
|
|
2329
2317
|
const default0 = defaults[key];
|
|
2330
2318
|
if (!Array.isArray(default0)) {
|
|
2331
2319
|
throw new TypeError(String(default0));
|
|
2332
2320
|
}
|
|
2321
|
+
const val = from[key];
|
|
2322
|
+
if (isHomogenousArray(types, val)) {
|
|
2323
|
+
return val;
|
|
2324
|
+
}
|
|
2333
2325
|
const default1 = default0;
|
|
2334
2326
|
return default1.map(primitiveOfE);
|
|
2335
2327
|
}
|
|
2336
|
-
function fixInSet(defaults, from, key,
|
|
2328
|
+
function fixInSet(defaults, from, key, set) {
|
|
2337
2329
|
const val = from[key];
|
|
2338
|
-
return inSet(
|
|
2330
|
+
return inSet(set, val) ? val : defaults[key];
|
|
2339
2331
|
}
|
|
2340
2332
|
|
|
2341
2333
|
// src/documentation.ts
|
|
@@ -2356,7 +2348,7 @@ import {
|
|
|
2356
2348
|
ValueComponent
|
|
2357
2349
|
} from "obsidian";
|
|
2358
2350
|
import { Directory, Encoding, Filesystem } from "@capacitor/filesystem";
|
|
2359
|
-
import { cloneDeep, constant, noop as
|
|
2351
|
+
import { cloneDeep, constant, noop as noop3 } from "lodash-es";
|
|
2360
2352
|
|
|
2361
2353
|
// src/private.ts
|
|
2362
2354
|
function revealPrivate(context, args, func, fallback) {
|
|
@@ -2365,6 +2357,7 @@ function revealPrivate(context, args, func, fallback) {
|
|
|
2365
2357
|
...args
|
|
2366
2358
|
);
|
|
2367
2359
|
} catch (error) {
|
|
2360
|
+
/* @__PURE__ */ self.console.debug(error);
|
|
2368
2361
|
self.console.warn(
|
|
2369
2362
|
context.language.value.t("errors.private-API-changed"),
|
|
2370
2363
|
error
|
|
@@ -2378,6 +2371,7 @@ async function revealPrivateAsync(context, args, func, fallback) {
|
|
|
2378
2371
|
...args
|
|
2379
2372
|
);
|
|
2380
2373
|
} catch (error) {
|
|
2374
|
+
/* @__PURE__ */ self.console.debug(error);
|
|
2381
2375
|
self.console.warn(
|
|
2382
2376
|
context.language.value.t("errors.private-API-changed"),
|
|
2383
2377
|
error
|
|
@@ -2509,7 +2503,7 @@ var UpdatableUI = class {
|
|
|
2509
2503
|
try {
|
|
2510
2504
|
if ("onChange" in comp && typeof comp.onChange === "function") {
|
|
2511
2505
|
try {
|
|
2512
|
-
comp.onChange(
|
|
2506
|
+
comp.onChange(noop3);
|
|
2513
2507
|
} catch (error) {
|
|
2514
2508
|
activeSelf(settingEl).console.error(error);
|
|
2515
2509
|
}
|
|
@@ -2595,7 +2589,7 @@ var UpdatableUI = class {
|
|
|
2595
2589
|
}
|
|
2596
2590
|
};
|
|
2597
2591
|
function statusUI(ui, element) {
|
|
2598
|
-
ui.new(constant(element),
|
|
2592
|
+
ui.new(constant(element), noop3, () => {
|
|
2599
2593
|
element.textContent = null;
|
|
2600
2594
|
});
|
|
2601
2595
|
return deepFreeze({
|
|
@@ -2770,8 +2764,8 @@ ${error.name}: ${error.message}`,
|
|
|
2770
2764
|
activeSelf(noticeEl).console.error(`${message()}
|
|
2771
2765
|
`, error);
|
|
2772
2766
|
}
|
|
2773
|
-
function readStateCollaboratively(implType,
|
|
2774
|
-
return launderUnchecked(
|
|
2767
|
+
function readStateCollaboratively(implType, state) {
|
|
2768
|
+
return launderUnchecked(state)[implType];
|
|
2775
2769
|
}
|
|
2776
2770
|
function recordViewStateHistory(context, result) {
|
|
2777
2771
|
revealPrivate(
|
|
@@ -2780,7 +2774,7 @@ function recordViewStateHistory(context, result) {
|
|
|
2780
2774
|
(result0) => {
|
|
2781
2775
|
result0.history = true;
|
|
2782
2776
|
},
|
|
2783
|
-
|
|
2777
|
+
noop3
|
|
2784
2778
|
);
|
|
2785
2779
|
}
|
|
2786
2780
|
async function saveFileAs(context, adapter, data) {
|
|
@@ -2816,7 +2810,7 @@ function updateView(context, view) {
|
|
|
2816
2810
|
leaf.updateHeader();
|
|
2817
2811
|
workspace.requestUpdateLayout();
|
|
2818
2812
|
},
|
|
2819
|
-
|
|
2813
|
+
noop3
|
|
2820
2814
|
);
|
|
2821
2815
|
if ("titleEl" in view) {
|
|
2822
2816
|
const { titleEl } = view;
|
|
@@ -2845,8 +2839,8 @@ function useSubsettings(element) {
|
|
|
2845
2839
|
}
|
|
2846
2840
|
return ret;
|
|
2847
2841
|
}
|
|
2848
|
-
function writeStateCollaboratively(
|
|
2849
|
-
return Object.assign(launderUnchecked(
|
|
2842
|
+
function writeStateCollaboratively(state, implType, implState) {
|
|
2843
|
+
return Object.assign(launderUnchecked(state), { [implType]: implState });
|
|
2850
2844
|
}
|
|
2851
2845
|
|
|
2852
2846
|
// src/documentation.ts
|
|
@@ -2941,15 +2935,15 @@ var DocumentationMarkdownView = class _DocumentationMarkdownView extends ItemVie
|
|
|
2941
2935
|
} = this;
|
|
2942
2936
|
return key === null ? super.getIcon() : i18n.t(key);
|
|
2943
2937
|
}
|
|
2944
|
-
async setState(
|
|
2938
|
+
async setState(state, result) {
|
|
2945
2939
|
const { context, element } = this, ownState = readStateCollaboratively(
|
|
2946
2940
|
_DocumentationMarkdownView.type.namespaced(context),
|
|
2947
|
-
|
|
2941
|
+
state
|
|
2948
2942
|
), { value, valid } = _DocumentationMarkdownView.State.fix(ownState);
|
|
2949
2943
|
if (!valid) {
|
|
2950
2944
|
printMalformedData(context, ownState, value);
|
|
2951
2945
|
}
|
|
2952
|
-
await super.setState(
|
|
2946
|
+
await super.setState(state, result);
|
|
2953
2947
|
const { data } = value;
|
|
2954
2948
|
this.state = value;
|
|
2955
2949
|
await MarkdownRenderer.render(this.app, data, element, "", this);
|
|
@@ -2981,7 +2975,7 @@ var Registered0 = class {
|
|
|
2981
2975
|
constructor(context) {
|
|
2982
2976
|
this.context = context;
|
|
2983
2977
|
}
|
|
2984
|
-
async open(active,
|
|
2978
|
+
async open(active, state) {
|
|
2985
2979
|
const {
|
|
2986
2980
|
context,
|
|
2987
2981
|
context: {
|
|
@@ -2998,7 +2992,7 @@ var Registered0 = class {
|
|
|
2998
2992
|
/* @__PURE__ */ new Map([
|
|
2999
2993
|
[
|
|
3000
2994
|
DocumentationMarkdownView.type,
|
|
3001
|
-
|
|
2995
|
+
state
|
|
3002
2996
|
]
|
|
3003
2997
|
])
|
|
3004
2998
|
),
|
|
@@ -3231,7 +3225,7 @@ function importable(...args) {
|
|
|
3231
3225
|
}
|
|
3232
3226
|
|
|
3233
3227
|
// src/keys.ts
|
|
3234
|
-
import { constant as constant2, noop as
|
|
3228
|
+
import { constant as constant2, noop as noop4 } from "lodash-es";
|
|
3235
3229
|
import { around as around2 } from "monkey-around";
|
|
3236
3230
|
function newHotkeyListener(context, ids) {
|
|
3237
3231
|
const {
|
|
@@ -3292,7 +3286,7 @@ function newHotkeyListener(context, ids) {
|
|
|
3292
3286
|
this0.baked = false;
|
|
3293
3287
|
}
|
|
3294
3288
|
},
|
|
3295
|
-
|
|
3289
|
+
noop4
|
|
3296
3290
|
);
|
|
3297
3291
|
next.apply(this, args);
|
|
3298
3292
|
};
|
|
@@ -3317,11 +3311,11 @@ function newHotkeyListener(context, ids) {
|
|
|
3317
3311
|
}
|
|
3318
3312
|
return true;
|
|
3319
3313
|
},
|
|
3320
|
-
|
|
3314
|
+
noop4
|
|
3321
3315
|
);
|
|
3322
3316
|
};
|
|
3323
3317
|
},
|
|
3324
|
-
constant2(
|
|
3318
|
+
constant2(noop4)
|
|
3325
3319
|
);
|
|
3326
3320
|
}
|
|
3327
3321
|
|
|
@@ -3329,7 +3323,7 @@ function newHotkeyListener(context, ids) {
|
|
|
3329
3323
|
import {
|
|
3330
3324
|
Modal
|
|
3331
3325
|
} from "obsidian";
|
|
3332
|
-
import { constant as constant3, noop as
|
|
3326
|
+
import { constant as constant3, noop as noop5 } from "lodash-es";
|
|
3333
3327
|
|
|
3334
3328
|
// src/settings-widgets.ts
|
|
3335
3329
|
function closeSetting(container) {
|
|
@@ -3484,7 +3478,7 @@ var ListModal = class _ListModal extends Modal {
|
|
|
3484
3478
|
this.placeholder = placeholder;
|
|
3485
3479
|
this.modalUI = new UpdatableUI();
|
|
3486
3480
|
this.ui = new UpdatableUI();
|
|
3487
|
-
this.#setupListSubUI =
|
|
3481
|
+
this.#setupListSubUI = noop5;
|
|
3488
3482
|
this.data = [...data];
|
|
3489
3483
|
this.#inputter = inputter;
|
|
3490
3484
|
this.#callback = options?.callback ?? (() => {
|
|
@@ -3935,7 +3929,7 @@ var DialogModal = class extends Modal {
|
|
|
3935
3929
|
});
|
|
3936
3930
|
this.#title = options?.title;
|
|
3937
3931
|
this.#description = options?.description;
|
|
3938
|
-
this.#draw = options?.draw ??
|
|
3932
|
+
this.#draw = options?.draw ?? noop5;
|
|
3939
3933
|
}
|
|
3940
3934
|
#cancel;
|
|
3941
3935
|
#confirm;
|
|
@@ -4040,7 +4034,7 @@ var DialogModal = class extends Modal {
|
|
|
4040
4034
|
};
|
|
4041
4035
|
|
|
4042
4036
|
// src/patch.ts
|
|
4043
|
-
import { constant as constant4, noop as
|
|
4037
|
+
import { constant as constant4, noop as noop6 } from "lodash-es";
|
|
4044
4038
|
import { around as around3 } from "monkey-around";
|
|
4045
4039
|
async function patchPlugin(context, id, patcher) {
|
|
4046
4040
|
return revealPrivateAsync(
|
|
@@ -4098,7 +4092,7 @@ async function patchPlugin(context, id, patcher) {
|
|
|
4098
4092
|
throw error;
|
|
4099
4093
|
}
|
|
4100
4094
|
},
|
|
4101
|
-
constant4(
|
|
4095
|
+
constant4(noop6)
|
|
4102
4096
|
);
|
|
4103
4097
|
}
|
|
4104
4098
|
function patchWindows(workspace, patcher) {
|
|
@@ -4550,8 +4544,10 @@ var Rules;
|
|
|
4550
4544
|
if (type === "error") {
|
|
4551
4545
|
continue;
|
|
4552
4546
|
}
|
|
4553
|
-
if (type ===
|
|
4554
|
-
ret =
|
|
4547
|
+
if (type === "+" && value.test(str)) {
|
|
4548
|
+
ret = true;
|
|
4549
|
+
} else if (type === "-" && value.test(str)) {
|
|
4550
|
+
ret = false;
|
|
4555
4551
|
}
|
|
4556
4552
|
}
|
|
4557
4553
|
return ret;
|
|
@@ -4967,13 +4963,17 @@ import { fromObject, fromSource } from "convert-source-map";
|
|
|
4967
4963
|
import { isEmpty as isEmpty5 } from "lodash-es";
|
|
4968
4964
|
function attachFunctionSourceMap(...args) {
|
|
4969
4965
|
const [, script] = args;
|
|
4966
|
+
const comment = fromObject(
|
|
4967
|
+
generateFunctionSourceMap(...args).toJSON()
|
|
4968
|
+
).toComment();
|
|
4970
4969
|
return `${script}
|
|
4971
|
-
${
|
|
4970
|
+
${comment}`;
|
|
4972
4971
|
}
|
|
4973
4972
|
function attachSourceMap(...args) {
|
|
4974
4973
|
const [script] = args;
|
|
4974
|
+
const comment = fromObject(generateSourceMap(...args).toJSON()).toComment();
|
|
4975
4975
|
return `${script}
|
|
4976
|
-
${
|
|
4976
|
+
${comment}`;
|
|
4977
4977
|
}
|
|
4978
4978
|
var FUNCTION_CONSTRUCTOR_OFFSETS = /* @__PURE__ */ new WeakMap();
|
|
4979
4979
|
function generateFunctionSourceMap(ctor, script, options) {
|
|
@@ -4992,11 +4992,12 @@ function generateFunctionSourceMap(ctor, script, options) {
|
|
|
4992
4992
|
return generateSourceMap(script, { ...options, offset });
|
|
4993
4993
|
}
|
|
4994
4994
|
function generateSourceMap(script, options) {
|
|
4995
|
-
const
|
|
4995
|
+
const offset = options?.offset ?? { column: 0, line: 1 }, genOpts = { skipValidation: true };
|
|
4996
4996
|
assignExact(genOpts, "file", options?.file);
|
|
4997
4997
|
assignExact(genOpts, "sourceRoot", options?.sourceRoot);
|
|
4998
4998
|
let subSourceMap = null;
|
|
4999
4999
|
try {
|
|
5000
|
+
const subSourceMap0 = fromSource(script);
|
|
5000
5001
|
if (subSourceMap0) {
|
|
5001
5002
|
subSourceMap = new TraceMap(subSourceMap0.toJSON());
|
|
5002
5003
|
}
|
|
@@ -5071,6 +5072,9 @@ var StatusBarHider = class _StatusBarHider extends Component2 {
|
|
|
5071
5072
|
this.class = InternalDOMClasses.HIDE_STATUS_BAR;
|
|
5072
5073
|
}
|
|
5073
5074
|
#hiders = [];
|
|
5075
|
+
get _hiders() {
|
|
5076
|
+
return this.#hiders;
|
|
5077
|
+
}
|
|
5074
5078
|
onload() {
|
|
5075
5079
|
super.onload();
|
|
5076
5080
|
this.register(() => {
|