@polyipseity/obsidian-plugin-library 1.25.1 → 1.27.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/assets/locales.d.ts.map +1 -1
- package/dist/index.js +233 -564
- package/dist/index.js.map +4 -4
- package/dist/sources/components/find.d.svelte.ts +21 -0
- package/dist/sources/components/find.svelte +102 -69
- package/dist/sources/components/index.d.ts +2 -1
- package/dist/sources/components/index.d.ts.map +1 -1
- package/dist/sources/documentation.d.ts.map +1 -1
- package/dist/sources/fixers.d.ts.map +1 -1
- package/dist/sources/import.d.ts +1 -2
- package/dist/sources/import.d.ts.map +1 -1
- package/dist/sources/index.d.ts +2 -2
- package/dist/sources/index.d.ts.map +1 -1
- package/dist/sources/modals.d.ts.map +1 -1
- package/dist/sources/obsidian.d.ts.map +1 -1
- package/dist/sources/patch.d.ts.map +1 -1
- package/dist/sources/platform.d.ts +1 -1
- package/dist/sources/platform.d.ts.map +1 -1
- package/dist/sources/private.d.ts +1 -3
- package/dist/sources/private.d.ts.map +1 -1
- package/dist/sources/rules.d.ts.map +1 -1
- package/dist/sources/settings-widgets.d.ts.map +1 -1
- package/dist/sources/settings.d.ts.map +1 -1
- package/dist/sources/source-maps.d.ts.map +1 -1
- package/dist/sources/typeof.d.ts.map +1 -1
- package/dist/sources/types.d.ts.map +1 -1
- package/dist/sources/util.d.ts +4 -7
- package/dist/sources/util.d.ts.map +1 -1
- package/package.json +36 -30
- package/dist/esbuild-compress/index.js +0 -132
- package/dist/esbuild-compress/index.js.map +0 -7
- package/dist/sources/esbuild-compress/index.d.ts +0 -7
- package/dist/sources/esbuild-compress/index.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -62,7 +62,9 @@ var require_lz_string = __commonJS({
|
|
|
62
62
|
return keyStrBase64.charAt(a);
|
|
63
63
|
});
|
|
64
64
|
switch (res.length % 4) {
|
|
65
|
+
// To produce valid Base64
|
|
65
66
|
default:
|
|
67
|
+
// When could this happen ?
|
|
66
68
|
case 0:
|
|
67
69
|
return res;
|
|
68
70
|
case 1:
|
|
@@ -1206,13 +1208,6 @@ var init_translation49 = __esm({
|
|
|
1206
1208
|
}
|
|
1207
1209
|
});
|
|
1208
1210
|
|
|
1209
|
-
// sources/util.ts
|
|
1210
|
-
import {
|
|
1211
|
-
check_outros as $checkOutros,
|
|
1212
|
-
group_outros as $groupOutros,
|
|
1213
|
-
transition_out as $transitionOut
|
|
1214
|
-
} from "svelte/internal";
|
|
1215
|
-
|
|
1216
1211
|
// sources/types.ts
|
|
1217
1212
|
import SemVer from "semver/classes/semver.js";
|
|
1218
1213
|
var NULL_SEM_VER_STRING = semVerString("0.0.0");
|
|
@@ -1514,10 +1509,10 @@ async function copyOnWriteAsync(obj, mutator) {
|
|
|
1514
1509
|
await mutator(ret);
|
|
1515
1510
|
return simplifyType(deepFreeze(ret));
|
|
1516
1511
|
}
|
|
1517
|
-
function createChildElement(
|
|
1512
|
+
function createChildElement(element, type, callback = (_element) => {
|
|
1518
1513
|
}, options) {
|
|
1519
|
-
const ret =
|
|
1520
|
-
|
|
1514
|
+
const ret = element.ownerDocument.createElement(type, options);
|
|
1515
|
+
element.append(ret);
|
|
1521
1516
|
callback(ret);
|
|
1522
1517
|
return ret;
|
|
1523
1518
|
}
|
|
@@ -1541,23 +1536,6 @@ function deepFreeze0(value, freezing) {
|
|
|
1541
1536
|
}
|
|
1542
1537
|
return Object.freeze(value);
|
|
1543
1538
|
}
|
|
1544
|
-
function destroyWithOutro(self0) {
|
|
1545
|
-
const { $$: { fragment } } = self0;
|
|
1546
|
-
if (fragment !== false && fragment) {
|
|
1547
|
-
try {
|
|
1548
|
-
$groupOutros();
|
|
1549
|
-
$transitionOut(fragment, 0, 0, () => {
|
|
1550
|
-
self0.$destroy();
|
|
1551
|
-
});
|
|
1552
|
-
$checkOutros();
|
|
1553
|
-
} catch (error) {
|
|
1554
|
-
self.console.error(error);
|
|
1555
|
-
self0.$destroy();
|
|
1556
|
-
}
|
|
1557
|
-
} else {
|
|
1558
|
-
self0.$destroy();
|
|
1559
|
-
}
|
|
1560
|
-
}
|
|
1561
1539
|
function escapeJavaScriptString(value) {
|
|
1562
1540
|
return `\`${value.replace(/(?<char>`|\\|\$)/ug, "\\$<char>")}\``;
|
|
1563
1541
|
}
|
|
@@ -1597,10 +1575,13 @@ function typedOwnKeys(self0) {
|
|
|
1597
1575
|
return Reflect.ownKeys(self0);
|
|
1598
1576
|
}
|
|
1599
1577
|
function typedKeys() {
|
|
1600
|
-
return (obj) =>
|
|
1578
|
+
return (obj) => (
|
|
1579
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
1580
|
+
deepFreeze(Object.keys(obj))
|
|
1581
|
+
);
|
|
1601
1582
|
}
|
|
1602
|
-
function inSet(
|
|
1603
|
-
return contravariant(
|
|
1583
|
+
function inSet(set2, obj) {
|
|
1584
|
+
return contravariant(set2).includes(obj);
|
|
1604
1585
|
}
|
|
1605
1586
|
function insertAt(self0, index, ...items) {
|
|
1606
1587
|
self0.splice(index, 0, ...items);
|
|
@@ -1626,7 +1607,7 @@ function isHomogenousArray(types, value) {
|
|
|
1626
1607
|
if (!Array.isArray(value)) {
|
|
1627
1608
|
return false;
|
|
1628
1609
|
}
|
|
1629
|
-
return value.every((
|
|
1610
|
+
return value.every((element) => genericTypeofGuardE(types, element));
|
|
1630
1611
|
}
|
|
1631
1612
|
function isNonNil(value) {
|
|
1632
1613
|
return !isNil(value);
|
|
@@ -1639,11 +1620,11 @@ function lazyInit(initializer) {
|
|
|
1639
1620
|
};
|
|
1640
1621
|
}
|
|
1641
1622
|
function lazyProxy(initializer) {
|
|
1642
|
-
const lazy = lazyInit(initializer), functions = /* @__PURE__ */ new Map(),
|
|
1623
|
+
const lazy = lazyInit(initializer), functions = /* @__PURE__ */ new Map(), proxy2 = new Proxy(lazy, {
|
|
1643
1624
|
apply(target, thisArg, argArray) {
|
|
1644
1625
|
const target0 = target();
|
|
1645
1626
|
if (typeof target0 !== "function") {
|
|
1646
|
-
throw new TypeError(
|
|
1627
|
+
throw new TypeError(toJSONOrString(target0));
|
|
1647
1628
|
}
|
|
1648
1629
|
return Reflect.apply(
|
|
1649
1630
|
target0,
|
|
@@ -1654,7 +1635,7 @@ function lazyProxy(initializer) {
|
|
|
1654
1635
|
construct(target, argArray, newTarget) {
|
|
1655
1636
|
const target0 = target();
|
|
1656
1637
|
if (typeof target0 !== "function") {
|
|
1657
|
-
throw new TypeError(
|
|
1638
|
+
throw new TypeError(toJSONOrString(target0));
|
|
1658
1639
|
}
|
|
1659
1640
|
const ret = Reflect.construct(
|
|
1660
1641
|
target0,
|
|
@@ -1702,7 +1683,7 @@ function lazyProxy(initializer) {
|
|
|
1702
1683
|
}
|
|
1703
1684
|
return Reflect.apply(
|
|
1704
1685
|
ret0,
|
|
1705
|
-
this ===
|
|
1686
|
+
this === proxy2 ? target() : this,
|
|
1706
1687
|
args
|
|
1707
1688
|
);
|
|
1708
1689
|
}
|
|
@@ -1755,7 +1736,7 @@ function lazyProxy(initializer) {
|
|
|
1755
1736
|
return Reflect.setPrototypeOf(target(), proto);
|
|
1756
1737
|
}
|
|
1757
1738
|
});
|
|
1758
|
-
return
|
|
1739
|
+
return proxy2;
|
|
1759
1740
|
}
|
|
1760
1741
|
function logFormat(options, ...args) {
|
|
1761
1742
|
if (isEmpty(args)) {
|
|
@@ -1841,18 +1822,18 @@ function multireplace(self0, replacements) {
|
|
|
1841
1822
|
(match) => replacements.get(match) ?? match
|
|
1842
1823
|
);
|
|
1843
1824
|
}
|
|
1844
|
-
function onResize(
|
|
1845
|
-
const ret = new (activeSelf(
|
|
1825
|
+
function onResize(element, callback) {
|
|
1826
|
+
const ret = new (activeSelf(element)).ResizeObserver((ents) => {
|
|
1846
1827
|
const ent = ents.at(-1);
|
|
1847
1828
|
if (ent) {
|
|
1848
1829
|
callback(ent);
|
|
1849
1830
|
}
|
|
1850
1831
|
});
|
|
1851
|
-
ret.observe(
|
|
1832
|
+
ret.observe(element);
|
|
1852
1833
|
return ret;
|
|
1853
1834
|
}
|
|
1854
|
-
function onVisible(
|
|
1855
|
-
const ret = new (activeSelf(
|
|
1835
|
+
function onVisible(element, callback, transient = false) {
|
|
1836
|
+
const ret = new (activeSelf(element)).IntersectionObserver((ents) => {
|
|
1856
1837
|
for (const ent of transient ? ents.reverse() : [ents.at(-1) ?? { isIntersecting: false }]) {
|
|
1857
1838
|
if (ent.isIntersecting) {
|
|
1858
1839
|
callback(ent);
|
|
@@ -1860,7 +1841,7 @@ function onVisible(element2, callback, transient = false) {
|
|
|
1860
1841
|
}
|
|
1861
1842
|
}
|
|
1862
1843
|
});
|
|
1863
|
-
ret.observe(
|
|
1844
|
+
ret.observe(element);
|
|
1864
1845
|
return ret;
|
|
1865
1846
|
}
|
|
1866
1847
|
function openExternal(self0, url) {
|
|
@@ -1907,6 +1888,14 @@ function startCase(str, locales) {
|
|
|
1907
1888
|
function stringToBase64(string) {
|
|
1908
1889
|
return bytesToBase64(new TextEncoder().encode(string));
|
|
1909
1890
|
}
|
|
1891
|
+
function toJSONOrString(value, replacer, space = JSON_STRINGIFY_SPACE) {
|
|
1892
|
+
try {
|
|
1893
|
+
return JSON.stringify(value, replacer, space);
|
|
1894
|
+
} catch (error) {
|
|
1895
|
+
/* @__PURE__ */ self.console.debug(error);
|
|
1896
|
+
}
|
|
1897
|
+
return String(value);
|
|
1898
|
+
}
|
|
1910
1899
|
function activeSelf(reference) {
|
|
1911
1900
|
if (reference) {
|
|
1912
1901
|
if ("ownerDocument" in reference) {
|
|
@@ -1953,10 +1942,11 @@ function mergeResources(...resources) {
|
|
|
1953
1942
|
for (const [lang, locale2] of Object.entries(res)) {
|
|
1954
1943
|
const ret0 = ret[lang] ??= {};
|
|
1955
1944
|
for (const [ns, resource] of Object.entries(locale2)) {
|
|
1956
|
-
|
|
1945
|
+
const data = [];
|
|
1946
|
+
(ret0[ns] ??= Object.assign(
|
|
1957
1947
|
async () => merge(...await Promise.all(data.map((datum) => datum()))),
|
|
1958
1948
|
{ data }
|
|
1959
|
-
))
|
|
1949
|
+
)).data.push(resource);
|
|
1960
1950
|
}
|
|
1961
1951
|
}
|
|
1962
1952
|
}
|
|
@@ -2140,372 +2130,74 @@ var LibraryLocales;
|
|
|
2140
2130
|
})(LibraryLocales || (LibraryLocales = {}));
|
|
2141
2131
|
|
|
2142
2132
|
// sources/components/find.svelte
|
|
2143
|
-
import
|
|
2144
|
-
|
|
2145
|
-
action_destroyer,
|
|
2146
|
-
add_render_callback,
|
|
2147
|
-
append,
|
|
2148
|
-
append_styles,
|
|
2149
|
-
attr,
|
|
2150
|
-
binding_callbacks,
|
|
2151
|
-
create_bidirectional_transition,
|
|
2152
|
-
detach,
|
|
2153
|
-
element,
|
|
2154
|
-
init,
|
|
2155
|
-
insert,
|
|
2156
|
-
is_function,
|
|
2157
|
-
listen,
|
|
2158
|
-
null_to_empty,
|
|
2159
|
-
prevent_default,
|
|
2160
|
-
run_all,
|
|
2161
|
-
safe_not_equal,
|
|
2162
|
-
set_data,
|
|
2163
|
-
set_input_value,
|
|
2164
|
-
space,
|
|
2165
|
-
stop_propagation,
|
|
2166
|
-
text
|
|
2167
|
-
} from "svelte/internal";
|
|
2168
|
-
import { slide } from "svelte/transition";
|
|
2169
|
-
import { setIcon } from "obsidian";
|
|
2170
|
-
import { isEmpty as isEmpty2 } from "lodash-es";
|
|
2133
|
+
import "svelte/internal/disclose-version";
|
|
2134
|
+
import * as $ from "svelte/internal/client";
|
|
2171
2135
|
import { t as i18nt } from "i18next";
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
}
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
let dispose;
|
|
2215
|
-
return {
|
|
2216
|
-
c() {
|
|
2217
|
-
div4 = element("div");
|
|
2218
|
-
div3 = element("div");
|
|
2219
|
-
div0 = element("div");
|
|
2220
|
-
button0 = element("button");
|
|
2221
|
-
t0 = space();
|
|
2222
|
-
button1 = element("button");
|
|
2223
|
-
t1 = space();
|
|
2224
|
-
button2 = element("button");
|
|
2225
|
-
t2 = space();
|
|
2226
|
-
input = element("input");
|
|
2227
|
-
t3 = space();
|
|
2228
|
-
div2 = element("div");
|
|
2229
|
-
button3 = element("button");
|
|
2230
|
-
t4 = space();
|
|
2231
|
-
button4 = element("button");
|
|
2232
|
-
t5 = space();
|
|
2233
|
-
div1 = element("div");
|
|
2234
|
-
t6 = text(
|
|
2235
|
-
/*results*/
|
|
2236
|
-
ctx[4]
|
|
2237
|
-
);
|
|
2238
|
-
t7 = space();
|
|
2239
|
-
button5 = element("button");
|
|
2240
|
-
attr(button0, "class", button0_class_value = null_to_empty(`document-search-button${/*params*/
|
|
2241
|
-
ctx[0].caseSensitive ? " mod-cta" : ""}`) + " _polyipseity_obsidian-plugin-library-svelte-find");
|
|
2242
|
-
attr(button0, "aria-label", button0_aria_label_value = /*i18n*/
|
|
2243
|
-
ctx[1]("components.find.case-sensitive"));
|
|
2244
|
-
attr(button1, "class", button1_class_value = null_to_empty(`document-search-button${/*params*/
|
|
2245
|
-
ctx[0].wholeWord ? " mod-cta" : ""}`) + " _polyipseity_obsidian-plugin-library-svelte-find");
|
|
2246
|
-
attr(button1, "aria-label", button1_aria_label_value = /*i18n*/
|
|
2247
|
-
ctx[1]("components.find.whole-word"));
|
|
2248
|
-
attr(button2, "class", button2_class_value = null_to_empty(`document-search-button${/*params*/
|
|
2249
|
-
ctx[0].regex ? " mod-cta" : ""}`) + " _polyipseity_obsidian-plugin-library-svelte-find");
|
|
2250
|
-
attr(button2, "aria-label", button2_aria_label_value = /*i18n*/
|
|
2251
|
-
ctx[1]("components.find.regex"));
|
|
2252
|
-
attr(div0, "class", "document-search-buttons");
|
|
2253
|
-
attr(input, "class", "document-search-input");
|
|
2254
|
-
attr(input, "type", "text");
|
|
2255
|
-
attr(input, "placeholder", input_placeholder_value = /*i18n*/
|
|
2256
|
-
ctx[1]("components.find.input-placeholder"));
|
|
2257
|
-
attr(button3, "class", "document-search-button");
|
|
2258
|
-
attr(button3, "aria-label", button3_aria_label_value = /*i18n*/
|
|
2259
|
-
ctx[1]("components.find.previous"));
|
|
2260
|
-
attr(button4, "class", "document-search-button");
|
|
2261
|
-
attr(button4, "aria-label", button4_aria_label_value = /*i18n*/
|
|
2262
|
-
ctx[1]("components.find.next"));
|
|
2263
|
-
attr(div1, "class", "document-search-results");
|
|
2264
|
-
attr(button5, "class", "document-search-close-button");
|
|
2265
|
-
attr(button5, "aria-label", button5_aria_label_value = /*i18n*/
|
|
2266
|
-
ctx[1]("components.find.close"));
|
|
2267
|
-
attr(div2, "class", "document-search-buttons");
|
|
2268
|
-
attr(div3, "class", "document-search _polyipseity_obsidian-plugin-library-svelte-find");
|
|
2269
|
-
attr(div4, "class", "document-search-container");
|
|
2270
|
-
},
|
|
2271
|
-
m(target, anchor) {
|
|
2272
|
-
insert(target, div4, anchor);
|
|
2273
|
-
append(div4, div3);
|
|
2274
|
-
append(div3, div0);
|
|
2275
|
-
append(div0, button0);
|
|
2276
|
-
append(div0, t0);
|
|
2277
|
-
append(div0, button1);
|
|
2278
|
-
append(div0, t1);
|
|
2279
|
-
append(div0, button2);
|
|
2280
|
-
append(div3, t2);
|
|
2281
|
-
append(div3, input);
|
|
2282
|
-
set_input_value(
|
|
2283
|
-
input,
|
|
2284
|
-
/*params*/
|
|
2285
|
-
ctx[0].findText
|
|
2286
|
-
);
|
|
2287
|
-
ctx[13](input);
|
|
2288
|
-
append(div3, t3);
|
|
2289
|
-
append(div3, div2);
|
|
2290
|
-
append(div2, button3);
|
|
2291
|
-
append(div2, t4);
|
|
2292
|
-
append(div2, button4);
|
|
2293
|
-
append(div2, t5);
|
|
2294
|
-
append(div2, div1);
|
|
2295
|
-
append(div1, t6);
|
|
2296
|
-
append(div2, t7);
|
|
2297
|
-
append(div2, button5);
|
|
2298
|
-
current = true;
|
|
2299
|
-
if (!mounted) {
|
|
2300
|
-
dispose = [
|
|
2301
|
-
listen(button0, "click", stop_propagation(prevent_default(
|
|
2302
|
-
/*click_handler*/
|
|
2303
|
-
ctx[9]
|
|
2304
|
-
))),
|
|
2305
|
-
action_destroyer(setIcon_action = setIcon.call(
|
|
2306
|
-
null,
|
|
2307
|
-
button0,
|
|
2308
|
-
/*i18n*/
|
|
2309
|
-
ctx[1]("asset:components.find.case-sensitive-icon")
|
|
2310
|
-
)),
|
|
2311
|
-
listen(button1, "click", stop_propagation(prevent_default(
|
|
2312
|
-
/*click_handler_1*/
|
|
2313
|
-
ctx[10]
|
|
2314
|
-
))),
|
|
2315
|
-
action_destroyer(setIcon_action_1 = setIcon.call(
|
|
2316
|
-
null,
|
|
2317
|
-
button1,
|
|
2318
|
-
/*i18n*/
|
|
2319
|
-
ctx[1]("asset:components.find.whole-word-icon")
|
|
2320
|
-
)),
|
|
2321
|
-
listen(button2, "click", stop_propagation(prevent_default(
|
|
2322
|
-
/*click_handler_2*/
|
|
2323
|
-
ctx[11]
|
|
2324
|
-
))),
|
|
2325
|
-
action_destroyer(setIcon_action_2 = setIcon.call(
|
|
2326
|
-
null,
|
|
2327
|
-
button2,
|
|
2328
|
-
/*i18n*/
|
|
2329
|
-
ctx[1]("asset:components.find.regex-icon")
|
|
2330
|
-
)),
|
|
2331
|
-
listen(
|
|
2332
|
-
input,
|
|
2333
|
-
"input",
|
|
2334
|
-
/*input_input_handler*/
|
|
2335
|
-
ctx[12]
|
|
2336
|
-
),
|
|
2337
|
-
listen(button3, "click", stop_propagation(prevent_default(
|
|
2338
|
-
/*click_handler_3*/
|
|
2339
|
-
ctx[14]
|
|
2340
|
-
))),
|
|
2341
|
-
action_destroyer(setIcon_action_3 = setIcon.call(
|
|
2342
|
-
null,
|
|
2343
|
-
button3,
|
|
2344
|
-
/*i18n*/
|
|
2345
|
-
ctx[1]("asset:components.find.previous-icon")
|
|
2346
|
-
)),
|
|
2347
|
-
listen(button4, "click", stop_propagation(prevent_default(
|
|
2348
|
-
/*click_handler_4*/
|
|
2349
|
-
ctx[15]
|
|
2350
|
-
))),
|
|
2351
|
-
action_destroyer(setIcon_action_4 = setIcon.call(
|
|
2352
|
-
null,
|
|
2353
|
-
button4,
|
|
2354
|
-
/*i18n*/
|
|
2355
|
-
ctx[1]("asset:components.find.next-icon")
|
|
2356
|
-
)),
|
|
2357
|
-
listen(button5, "click", stop_propagation(prevent_default(function() {
|
|
2358
|
-
if (is_function(
|
|
2359
|
-
/*onClose*/
|
|
2360
|
-
ctx[2]
|
|
2361
|
-
)) ctx[2].apply(this, arguments);
|
|
2362
|
-
}))),
|
|
2363
|
-
listen(
|
|
2364
|
-
div4,
|
|
2365
|
-
"keydown",
|
|
2366
|
-
/*keydown_handler*/
|
|
2367
|
-
ctx[16]
|
|
2368
|
-
)
|
|
2369
|
-
];
|
|
2370
|
-
mounted = true;
|
|
2371
|
-
}
|
|
2372
|
-
},
|
|
2373
|
-
p(new_ctx, [dirty]) {
|
|
2374
|
-
ctx = new_ctx;
|
|
2375
|
-
if (!current || dirty & /*params*/
|
|
2376
|
-
1 && button0_class_value !== (button0_class_value = null_to_empty(`document-search-button${/*params*/
|
|
2377
|
-
ctx[0].caseSensitive ? " mod-cta" : ""}`) + " _polyipseity_obsidian-plugin-library-svelte-find")) {
|
|
2378
|
-
attr(button0, "class", button0_class_value);
|
|
2379
|
-
}
|
|
2380
|
-
if (!current || dirty & /*i18n*/
|
|
2381
|
-
2 && button0_aria_label_value !== (button0_aria_label_value = /*i18n*/
|
|
2382
|
-
ctx[1]("components.find.case-sensitive"))) {
|
|
2383
|
-
attr(button0, "aria-label", button0_aria_label_value);
|
|
2384
|
-
}
|
|
2385
|
-
if (setIcon_action && is_function(setIcon_action.update) && dirty & /*i18n*/
|
|
2386
|
-
2) setIcon_action.update.call(
|
|
2387
|
-
null,
|
|
2388
|
-
/*i18n*/
|
|
2389
|
-
ctx[1]("asset:components.find.case-sensitive-icon")
|
|
2390
|
-
);
|
|
2391
|
-
if (!current || dirty & /*params*/
|
|
2392
|
-
1 && button1_class_value !== (button1_class_value = null_to_empty(`document-search-button${/*params*/
|
|
2393
|
-
ctx[0].wholeWord ? " mod-cta" : ""}`) + " _polyipseity_obsidian-plugin-library-svelte-find")) {
|
|
2394
|
-
attr(button1, "class", button1_class_value);
|
|
2395
|
-
}
|
|
2396
|
-
if (!current || dirty & /*i18n*/
|
|
2397
|
-
2 && button1_aria_label_value !== (button1_aria_label_value = /*i18n*/
|
|
2398
|
-
ctx[1]("components.find.whole-word"))) {
|
|
2399
|
-
attr(button1, "aria-label", button1_aria_label_value);
|
|
2400
|
-
}
|
|
2401
|
-
if (setIcon_action_1 && is_function(setIcon_action_1.update) && dirty & /*i18n*/
|
|
2402
|
-
2) setIcon_action_1.update.call(
|
|
2403
|
-
null,
|
|
2404
|
-
/*i18n*/
|
|
2405
|
-
ctx[1]("asset:components.find.whole-word-icon")
|
|
2406
|
-
);
|
|
2407
|
-
if (!current || dirty & /*params*/
|
|
2408
|
-
1 && button2_class_value !== (button2_class_value = null_to_empty(`document-search-button${/*params*/
|
|
2409
|
-
ctx[0].regex ? " mod-cta" : ""}`) + " _polyipseity_obsidian-plugin-library-svelte-find")) {
|
|
2410
|
-
attr(button2, "class", button2_class_value);
|
|
2411
|
-
}
|
|
2412
|
-
if (!current || dirty & /*i18n*/
|
|
2413
|
-
2 && button2_aria_label_value !== (button2_aria_label_value = /*i18n*/
|
|
2414
|
-
ctx[1]("components.find.regex"))) {
|
|
2415
|
-
attr(button2, "aria-label", button2_aria_label_value);
|
|
2416
|
-
}
|
|
2417
|
-
if (setIcon_action_2 && is_function(setIcon_action_2.update) && dirty & /*i18n*/
|
|
2418
|
-
2) setIcon_action_2.update.call(
|
|
2419
|
-
null,
|
|
2420
|
-
/*i18n*/
|
|
2421
|
-
ctx[1]("asset:components.find.regex-icon")
|
|
2422
|
-
);
|
|
2423
|
-
if (!current || dirty & /*i18n*/
|
|
2424
|
-
2 && input_placeholder_value !== (input_placeholder_value = /*i18n*/
|
|
2425
|
-
ctx[1]("components.find.input-placeholder"))) {
|
|
2426
|
-
attr(input, "placeholder", input_placeholder_value);
|
|
2427
|
-
}
|
|
2428
|
-
if (dirty & /*params*/
|
|
2429
|
-
1 && input.value !== /*params*/
|
|
2430
|
-
ctx[0].findText) {
|
|
2431
|
-
set_input_value(
|
|
2432
|
-
input,
|
|
2433
|
-
/*params*/
|
|
2434
|
-
ctx[0].findText
|
|
2435
|
-
);
|
|
2436
|
-
}
|
|
2437
|
-
if (!current || dirty & /*i18n*/
|
|
2438
|
-
2 && button3_aria_label_value !== (button3_aria_label_value = /*i18n*/
|
|
2439
|
-
ctx[1]("components.find.previous"))) {
|
|
2440
|
-
attr(button3, "aria-label", button3_aria_label_value);
|
|
2441
|
-
}
|
|
2442
|
-
if (setIcon_action_3 && is_function(setIcon_action_3.update) && dirty & /*i18n*/
|
|
2443
|
-
2) setIcon_action_3.update.call(
|
|
2444
|
-
null,
|
|
2445
|
-
/*i18n*/
|
|
2446
|
-
ctx[1]("asset:components.find.previous-icon")
|
|
2447
|
-
);
|
|
2448
|
-
if (!current || dirty & /*i18n*/
|
|
2449
|
-
2 && button4_aria_label_value !== (button4_aria_label_value = /*i18n*/
|
|
2450
|
-
ctx[1]("components.find.next"))) {
|
|
2451
|
-
attr(button4, "aria-label", button4_aria_label_value);
|
|
2452
|
-
}
|
|
2453
|
-
if (setIcon_action_4 && is_function(setIcon_action_4.update) && dirty & /*i18n*/
|
|
2454
|
-
2) setIcon_action_4.update.call(
|
|
2455
|
-
null,
|
|
2456
|
-
/*i18n*/
|
|
2457
|
-
ctx[1]("asset:components.find.next-icon")
|
|
2458
|
-
);
|
|
2459
|
-
if (!current || dirty & /*results*/
|
|
2460
|
-
16) set_data(
|
|
2461
|
-
t6,
|
|
2462
|
-
/*results*/
|
|
2463
|
-
ctx[4]
|
|
2464
|
-
);
|
|
2465
|
-
if (!current || dirty & /*i18n*/
|
|
2466
|
-
2 && button5_aria_label_value !== (button5_aria_label_value = /*i18n*/
|
|
2467
|
-
ctx[1]("components.find.close"))) {
|
|
2468
|
-
attr(button5, "aria-label", button5_aria_label_value);
|
|
2469
|
-
}
|
|
2470
|
-
},
|
|
2471
|
-
i(local) {
|
|
2472
|
-
if (current) return;
|
|
2473
|
-
add_render_callback(() => {
|
|
2474
|
-
if (!current) return;
|
|
2475
|
-
if (!div4_transition) div4_transition = create_bidirectional_transition(div4, slide, {}, true);
|
|
2476
|
-
div4_transition.run(1);
|
|
2477
|
-
});
|
|
2478
|
-
current = true;
|
|
2479
|
-
},
|
|
2480
|
-
o(local) {
|
|
2481
|
-
if (!div4_transition) div4_transition = create_bidirectional_transition(div4, slide, {}, false);
|
|
2482
|
-
div4_transition.run(0);
|
|
2483
|
-
current = false;
|
|
2484
|
-
},
|
|
2485
|
-
d(detaching) {
|
|
2486
|
-
if (detaching) detach(div4);
|
|
2487
|
-
ctx[13](null);
|
|
2488
|
-
if (detaching && div4_transition) div4_transition.end();
|
|
2489
|
-
mounted = false;
|
|
2490
|
-
run_all(dispose);
|
|
2491
|
-
}
|
|
2492
|
-
};
|
|
2493
|
-
}
|
|
2494
|
-
function instance($$self, $$props, $$invalidate) {
|
|
2495
|
-
let { i18n = i18nt } = $$props;
|
|
2496
|
-
let { params = {
|
|
2136
|
+
import { isEmpty as isEmpty2 } from "lodash-es";
|
|
2137
|
+
import { setIcon } from "obsidian";
|
|
2138
|
+
import { slide } from "svelte/transition";
|
|
2139
|
+
var on_click = (event, stateParams) => {
|
|
2140
|
+
stateParams.caseSensitive = !stateParams.caseSensitive;
|
|
2141
|
+
consumeEvent(event);
|
|
2142
|
+
};
|
|
2143
|
+
var on_click_1 = (event, stateParams) => {
|
|
2144
|
+
stateParams.wholeWord = !stateParams.wholeWord;
|
|
2145
|
+
consumeEvent(event);
|
|
2146
|
+
};
|
|
2147
|
+
var on_click_2 = (event, stateParams) => {
|
|
2148
|
+
stateParams.regex = !stateParams.regex;
|
|
2149
|
+
consumeEvent(event);
|
|
2150
|
+
};
|
|
2151
|
+
var on_keydown = (event, onClose) => {
|
|
2152
|
+
if (event.key === "Escape" && isEmpty2(getKeyModifiers(event))) {
|
|
2153
|
+
onClose()();
|
|
2154
|
+
consumeEvent(event);
|
|
2155
|
+
}
|
|
2156
|
+
};
|
|
2157
|
+
var on_click_3 = (event, onFind, stateParams) => {
|
|
2158
|
+
onFind()("previous", stateParams);
|
|
2159
|
+
consumeEvent(event);
|
|
2160
|
+
};
|
|
2161
|
+
var on_click_4 = (event, onFind, stateParams) => {
|
|
2162
|
+
onFind()("next", stateParams);
|
|
2163
|
+
consumeEvent(event);
|
|
2164
|
+
};
|
|
2165
|
+
var on_click_5 = (event, onClose) => {
|
|
2166
|
+
onClose()();
|
|
2167
|
+
consumeEvent(event);
|
|
2168
|
+
};
|
|
2169
|
+
var root = $.template(`<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>`);
|
|
2170
|
+
var $$css = {
|
|
2171
|
+
hash: "_polyipseity_obsidian-plugin-library-svelte-find",
|
|
2172
|
+
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);}"
|
|
2173
|
+
};
|
|
2174
|
+
function Find($$anchor, $$props) {
|
|
2175
|
+
$.push($$props, true);
|
|
2176
|
+
$.append_styles($$anchor, $$css);
|
|
2177
|
+
const i18n = $.prop($$props, "i18n", 3, i18nt), params = $.prop($$props, "params", 19, () => ({
|
|
2497
2178
|
caseSensitive: false,
|
|
2498
2179
|
findText: "",
|
|
2499
2180
|
regex: false,
|
|
2500
2181
|
wholeWord: false
|
|
2501
|
-
}
|
|
2502
|
-
|
|
2503
|
-
}
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2182
|
+
})), onClose = $.prop($$props, "onClose", 3, () => {
|
|
2183
|
+
}), onFind = $.prop($$props, "onFind", 3, (_direction, _params) => {
|
|
2184
|
+
}), onParamsChanged = $.prop($$props, "onParamsChanged", 3, (_params) => {
|
|
2185
|
+
}), results = $.prop($$props, "results", 3, "");
|
|
2186
|
+
let stateI18n = $.state(i18n());
|
|
2187
|
+
const stateParams = $.proxy(cloneAsWritable(params()));
|
|
2188
|
+
let stateResults = $.state(results());
|
|
2189
|
+
$.user_effect(() => {
|
|
2190
|
+
onParamsChanged()(stateParams);
|
|
2191
|
+
});
|
|
2192
|
+
function setI18n(i18n0) {
|
|
2193
|
+
$.set(stateI18n, i18n0);
|
|
2194
|
+
}
|
|
2195
|
+
function getParamsRef() {
|
|
2196
|
+
return stateParams;
|
|
2197
|
+
}
|
|
2198
|
+
function setResults(results0) {
|
|
2199
|
+
$.set(stateResults, results0);
|
|
2200
|
+
}
|
|
2509
2201
|
let inputElement = null;
|
|
2510
2202
|
function focus() {
|
|
2511
2203
|
inputElement?.focus();
|
|
@@ -2513,101 +2205,74 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
2513
2205
|
function blur() {
|
|
2514
2206
|
inputElement?.blur();
|
|
2515
2207
|
}
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2208
|
+
var div = root();
|
|
2209
|
+
var div_1 = $.child(div);
|
|
2210
|
+
var div_2 = $.child(div_1);
|
|
2211
|
+
var button = $.child(div_2);
|
|
2212
|
+
button.__click = [on_click, stateParams];
|
|
2213
|
+
$.action(button, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => $.get(stateI18n)("asset:components.find.case-sensitive-icon"));
|
|
2214
|
+
var button_1 = $.sibling(button, 2);
|
|
2215
|
+
button_1.__click = [on_click_1, stateParams];
|
|
2216
|
+
$.action(button_1, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => $.get(stateI18n)("asset:components.find.whole-word-icon"));
|
|
2217
|
+
var button_2 = $.sibling(button_1, 2);
|
|
2218
|
+
button_2.__click = [on_click_2, stateParams];
|
|
2219
|
+
$.action(button_2, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => $.get(stateI18n)("asset:components.find.regex-icon"));
|
|
2220
|
+
$.reset(div_2);
|
|
2221
|
+
var input = $.sibling(div_2, 2);
|
|
2222
|
+
$.remove_input_defaults(input);
|
|
2223
|
+
input.__keydown = [on_keydown, onClose];
|
|
2224
|
+
$.bind_this(input, ($$value) => inputElement = $$value, () => inputElement);
|
|
2225
|
+
var div_3 = $.sibling(input, 2);
|
|
2226
|
+
var button_3 = $.child(div_3);
|
|
2227
|
+
button_3.__click = [on_click_3, onFind, stateParams];
|
|
2228
|
+
$.action(button_3, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => $.get(stateI18n)("asset:components.find.previous-icon"));
|
|
2229
|
+
var button_4 = $.sibling(button_3, 2);
|
|
2230
|
+
button_4.__click = [on_click_4, onFind, stateParams];
|
|
2231
|
+
$.action(button_4, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => $.get(stateI18n)("asset:components.find.next-icon"));
|
|
2232
|
+
var div_4 = $.sibling(button_4, 2);
|
|
2233
|
+
var text = $.child(div_4, true);
|
|
2234
|
+
$.reset(div_4);
|
|
2235
|
+
var button_5 = $.sibling(div_4, 2);
|
|
2236
|
+
button_5.__click = [on_click_5, onClose];
|
|
2237
|
+
$.reset(div_3);
|
|
2238
|
+
$.reset(div_1);
|
|
2239
|
+
$.reset(div);
|
|
2240
|
+
$.template_effect(
|
|
2241
|
+
($0, $1, $2, $3, $4, $5, $6) => {
|
|
2242
|
+
$.set_class(button, 1, `document-search-button${stateParams.caseSensitive ? " mod-cta" : ""}`, "_polyipseity_obsidian-plugin-library-svelte-find");
|
|
2243
|
+
$.set_attribute(button, "aria-label", $0);
|
|
2244
|
+
$.set_class(button_1, 1, `document-search-button${stateParams.wholeWord ? " mod-cta" : ""}`, "_polyipseity_obsidian-plugin-library-svelte-find");
|
|
2245
|
+
$.set_attribute(button_1, "aria-label", $1);
|
|
2246
|
+
$.set_class(button_2, 1, `document-search-button${stateParams.regex ? " mod-cta" : ""}`, "_polyipseity_obsidian-plugin-library-svelte-find");
|
|
2247
|
+
$.set_attribute(button_2, "aria-label", $2);
|
|
2248
|
+
$.set_attribute(input, "placeholder", $3);
|
|
2249
|
+
$.set_attribute(button_3, "aria-label", $4);
|
|
2250
|
+
$.set_attribute(button_4, "aria-label", $5);
|
|
2251
|
+
$.set_text(text, $.get(stateResults));
|
|
2252
|
+
$.set_attribute(button_5, "aria-label", $6);
|
|
2253
|
+
},
|
|
2254
|
+
[
|
|
2255
|
+
() => $.get(stateI18n)("components.find.case-sensitive"),
|
|
2256
|
+
() => $.get(stateI18n)("components.find.whole-word"),
|
|
2257
|
+
() => $.get(stateI18n)("components.find.regex"),
|
|
2258
|
+
() => $.get(stateI18n)("components.find.input-placeholder"),
|
|
2259
|
+
() => $.get(stateI18n)("components.find.previous"),
|
|
2260
|
+
() => $.get(stateI18n)("components.find.next"),
|
|
2261
|
+
() => $.get(stateI18n)("components.find.close")
|
|
2262
|
+
]
|
|
2263
|
+
);
|
|
2264
|
+
$.bind_value(input, () => stateParams.findText, ($$value) => stateParams.findText = $$value);
|
|
2265
|
+
$.transition(3, div, () => slide);
|
|
2266
|
+
$.append($$anchor, div);
|
|
2267
|
+
return $.pop({
|
|
2268
|
+
setI18n,
|
|
2269
|
+
getParamsRef,
|
|
2270
|
+
setResults,
|
|
2569
2271
|
focus,
|
|
2570
|
-
blur
|
|
2571
|
-
|
|
2572
|
-
click_handler_1,
|
|
2573
|
-
click_handler_2,
|
|
2574
|
-
input_input_handler,
|
|
2575
|
-
input_binding,
|
|
2576
|
-
click_handler_3,
|
|
2577
|
-
click_handler_4,
|
|
2578
|
-
keydown_handler
|
|
2579
|
-
];
|
|
2272
|
+
blur
|
|
2273
|
+
});
|
|
2580
2274
|
}
|
|
2581
|
-
|
|
2582
|
-
constructor(options) {
|
|
2583
|
-
super();
|
|
2584
|
-
init(
|
|
2585
|
-
this,
|
|
2586
|
-
options,
|
|
2587
|
-
instance,
|
|
2588
|
-
create_fragment,
|
|
2589
|
-
safe_not_equal,
|
|
2590
|
-
{
|
|
2591
|
-
i18n: 1,
|
|
2592
|
-
params: 0,
|
|
2593
|
-
onClose: 2,
|
|
2594
|
-
onFind: 3,
|
|
2595
|
-
onParamsChanged: 6,
|
|
2596
|
-
results: 4,
|
|
2597
|
-
focus: 7,
|
|
2598
|
-
blur: 8
|
|
2599
|
-
},
|
|
2600
|
-
add_css
|
|
2601
|
-
);
|
|
2602
|
-
}
|
|
2603
|
-
get focus() {
|
|
2604
|
-
return this.$$.ctx[7];
|
|
2605
|
-
}
|
|
2606
|
-
get blur() {
|
|
2607
|
-
return this.$$.ctx[8];
|
|
2608
|
-
}
|
|
2609
|
-
};
|
|
2610
|
-
var find_default = Find;
|
|
2275
|
+
$.delegate(["click", "keydown"]);
|
|
2611
2276
|
|
|
2612
2277
|
// sources/components/find.ts
|
|
2613
2278
|
var find_exports = {};
|
|
@@ -2643,9 +2308,9 @@ function fixArray(defaults, from, key, types) {
|
|
|
2643
2308
|
const default1 = default0;
|
|
2644
2309
|
return default1.map(primitiveOfE);
|
|
2645
2310
|
}
|
|
2646
|
-
function fixInSet(defaults, from, key,
|
|
2311
|
+
function fixInSet(defaults, from, key, set2) {
|
|
2647
2312
|
const val = from[key];
|
|
2648
|
-
return inSet(
|
|
2313
|
+
return inSet(set2, val) ? val : defaults[key];
|
|
2649
2314
|
}
|
|
2650
2315
|
|
|
2651
2316
|
// sources/documentation.ts
|
|
@@ -2714,6 +2379,7 @@ var LambdaComponent = class extends Component {
|
|
|
2714
2379
|
};
|
|
2715
2380
|
var ResourceComponent = class _ResourceComponent extends Component {
|
|
2716
2381
|
static sentinel = Symbol(this.name);
|
|
2382
|
+
// `unknown` to make the class covariant.
|
|
2717
2383
|
#loader = promisePromise();
|
|
2718
2384
|
#value = _ResourceComponent.sentinel;
|
|
2719
2385
|
get onLoaded() {
|
|
@@ -2780,10 +2446,10 @@ var UpdatableUI = class {
|
|
|
2780
2446
|
throw error;
|
|
2781
2447
|
}
|
|
2782
2448
|
}
|
|
2783
|
-
newSetting(
|
|
2449
|
+
newSetting(element, configure) {
|
|
2784
2450
|
let recording = true;
|
|
2785
2451
|
return this.new(() => {
|
|
2786
|
-
const setting = new Setting(
|
|
2452
|
+
const setting = new Setting(element), patch = (proto) => {
|
|
2787
2453
|
const components = [];
|
|
2788
2454
|
let index = 0;
|
|
2789
2455
|
return function fn(cb) {
|
|
@@ -2841,6 +2507,7 @@ var UpdatableUI = class {
|
|
|
2841
2507
|
addDropdown: patch,
|
|
2842
2508
|
addExtraButton: patch,
|
|
2843
2509
|
addMomentFormat: patch,
|
|
2510
|
+
addProgressBar: patch,
|
|
2844
2511
|
addSearch: patch,
|
|
2845
2512
|
addSlider: patch,
|
|
2846
2513
|
addText: patch,
|
|
@@ -2884,13 +2551,13 @@ var UpdatableUI = class {
|
|
|
2884
2551
|
clear(this.#updaters);
|
|
2885
2552
|
}
|
|
2886
2553
|
};
|
|
2887
|
-
function statusUI(ui,
|
|
2888
|
-
ui.new(constant(
|
|
2889
|
-
|
|
2554
|
+
function statusUI(ui, element) {
|
|
2555
|
+
ui.new(constant(element), noop2, () => {
|
|
2556
|
+
element.textContent = null;
|
|
2890
2557
|
});
|
|
2891
2558
|
return deepFreeze({
|
|
2892
2559
|
report(status) {
|
|
2893
|
-
|
|
2560
|
+
element.textContent = status === void 0 ? null : toJSONOrString(status);
|
|
2894
2561
|
}
|
|
2895
2562
|
});
|
|
2896
2563
|
}
|
|
@@ -2953,11 +2620,11 @@ function addRibbonIcon(context, id, icon, title, callback) {
|
|
|
2953
2620
|
}
|
|
2954
2621
|
);
|
|
2955
2622
|
}
|
|
2956
|
-
async function awaitCSS(
|
|
2957
|
-
const { classList, style, style: { display } } =
|
|
2623
|
+
async function awaitCSS(element) {
|
|
2624
|
+
const { classList, style, style: { display } } = element;
|
|
2958
2625
|
style.display = "none";
|
|
2959
2626
|
return new Promise((resolve, reject) => {
|
|
2960
|
-
const obsr = onVisible(
|
|
2627
|
+
const obsr = onVisible(element, () => {
|
|
2961
2628
|
try {
|
|
2962
2629
|
style.display = display;
|
|
2963
2630
|
classList.remove(awaitCSS.CLASS);
|
|
@@ -2979,7 +2646,7 @@ function cleanFrontmatterCache(cache) {
|
|
|
2979
2646
|
return deepFreeze({});
|
|
2980
2647
|
}
|
|
2981
2648
|
const ret = cloneAsWritable(cache);
|
|
2982
|
-
delete ret
|
|
2649
|
+
delete ret["position"];
|
|
2983
2650
|
return deepFreeze(ret);
|
|
2984
2651
|
}
|
|
2985
2652
|
function commandNamer(cmdNamer, pluginNamer, defaultPluginName, format) {
|
|
@@ -3040,8 +2707,8 @@ ${error.name}: ${error.message}`,
|
|
|
3040
2707
|
activeSelf(noticeEl).console.error(`${message()}
|
|
3041
2708
|
`, error);
|
|
3042
2709
|
}
|
|
3043
|
-
function readStateCollabratively(implType,
|
|
3044
|
-
return launderUnchecked(
|
|
2710
|
+
function readStateCollabratively(implType, state2) {
|
|
2711
|
+
return launderUnchecked(state2)[implType];
|
|
3045
2712
|
}
|
|
3046
2713
|
function recordViewStateHistory(context, result) {
|
|
3047
2714
|
revealPrivate(context, [result], (result0) => {
|
|
@@ -3083,8 +2750,8 @@ function updateView(context, view) {
|
|
|
3083
2750
|
}
|
|
3084
2751
|
}
|
|
3085
2752
|
}
|
|
3086
|
-
function useSettings(
|
|
3087
|
-
const container = createChildElement(
|
|
2753
|
+
function useSettings(element) {
|
|
2754
|
+
const container = createChildElement(element, "div", (ele) => {
|
|
3088
2755
|
ele.classList.add(DOMClasses.VERTICAL_TAB_CONTENT_CONTAINER);
|
|
3089
2756
|
});
|
|
3090
2757
|
return Object.freeze({
|
|
@@ -3096,15 +2763,15 @@ function useSettings(element2) {
|
|
|
3096
2763
|
}
|
|
3097
2764
|
});
|
|
3098
2765
|
}
|
|
3099
|
-
function useSubsettings(
|
|
3100
|
-
const ret = createChildElement(
|
|
3101
|
-
if (
|
|
2766
|
+
function useSubsettings(element) {
|
|
2767
|
+
const ret = createChildElement(element, "div");
|
|
2768
|
+
if (element.firstChild) {
|
|
3102
2769
|
createChildElement(ret, "div");
|
|
3103
2770
|
}
|
|
3104
2771
|
return ret;
|
|
3105
2772
|
}
|
|
3106
|
-
function writeStateCollabratively(
|
|
3107
|
-
return Object.assign(launderUnchecked(
|
|
2773
|
+
function writeStateCollabratively(state2, implType, implState) {
|
|
2774
|
+
return Object.assign(launderUnchecked(state2), { [implType]: implState });
|
|
3108
2775
|
}
|
|
3109
2776
|
|
|
3110
2777
|
// sources/documentation.ts
|
|
@@ -3116,8 +2783,8 @@ var DocumentationMarkdownView = class _DocumentationMarkdownView extends ItemVie
|
|
|
3116
2783
|
const { contentEl } = this;
|
|
3117
2784
|
this.navigation = true;
|
|
3118
2785
|
this.element = createChildElement(
|
|
3119
|
-
createChildElement(contentEl, "div", (
|
|
3120
|
-
|
|
2786
|
+
createChildElement(contentEl, "div", (element) => {
|
|
2787
|
+
element.classList.add(
|
|
3121
2788
|
DOMClasses.ALLOW_FOLD_HEADINGS,
|
|
3122
2789
|
DOMClasses.ALLOW_FOLD_LISTS,
|
|
3123
2790
|
DOMClasses.IS_READABLE_LINE_WIDTH,
|
|
@@ -3128,8 +2795,8 @@ var DocumentationMarkdownView = class _DocumentationMarkdownView extends ItemVie
|
|
|
3128
2795
|
);
|
|
3129
2796
|
}),
|
|
3130
2797
|
"div",
|
|
3131
|
-
(
|
|
3132
|
-
|
|
2798
|
+
(element) => {
|
|
2799
|
+
element.classList.add(
|
|
3133
2800
|
DOMClasses.MARKDOWN_PREVIEW_SECTION,
|
|
3134
2801
|
DOMClasses.MARKDOWN_PREVIEW_SIZER
|
|
3135
2802
|
);
|
|
@@ -3165,18 +2832,18 @@ var DocumentationMarkdownView = class _DocumentationMarkdownView extends ItemVie
|
|
|
3165
2832
|
} = this;
|
|
3166
2833
|
return key === null ? super.getIcon() : String(i18n.t(key));
|
|
3167
2834
|
}
|
|
3168
|
-
async setState(
|
|
3169
|
-
const { context: plugin, element
|
|
2835
|
+
async setState(state2, result) {
|
|
2836
|
+
const { context: plugin, element } = this, ownState = readStateCollabratively(
|
|
3170
2837
|
_DocumentationMarkdownView.type.namespaced(plugin),
|
|
3171
|
-
|
|
2838
|
+
state2
|
|
3172
2839
|
), { value, valid } = _DocumentationMarkdownView.State.fix(ownState);
|
|
3173
2840
|
if (!valid) {
|
|
3174
2841
|
printMalformedData(plugin, ownState, value);
|
|
3175
2842
|
}
|
|
3176
|
-
await super.setState(
|
|
2843
|
+
await super.setState(state2, result);
|
|
3177
2844
|
const { data } = value;
|
|
3178
2845
|
this.state = value;
|
|
3179
|
-
await MarkdownRenderer.
|
|
2846
|
+
await MarkdownRenderer.render(this.app, data, element, "", this);
|
|
3180
2847
|
recordViewStateHistory(plugin, result);
|
|
3181
2848
|
}
|
|
3182
2849
|
getState() {
|
|
@@ -3198,7 +2865,7 @@ var Registered0 = class {
|
|
|
3198
2865
|
constructor(context) {
|
|
3199
2866
|
this.context = context;
|
|
3200
2867
|
}
|
|
3201
|
-
async open(active,
|
|
2868
|
+
async open(active, state2) {
|
|
3202
2869
|
const { context, context: { app: { workspace } } } = this;
|
|
3203
2870
|
return new Promise((resolve) => {
|
|
3204
2871
|
workspace.onLayoutReady(() => {
|
|
@@ -3209,7 +2876,7 @@ var Registered0 = class {
|
|
|
3209
2876
|
/* @__PURE__ */ new Map([
|
|
3210
2877
|
[
|
|
3211
2878
|
DocumentationMarkdownView.type,
|
|
3212
|
-
|
|
2879
|
+
state2
|
|
3213
2880
|
]
|
|
3214
2881
|
])
|
|
3215
2882
|
),
|
|
@@ -3240,12 +2907,14 @@ var Registered0 = class {
|
|
|
3240
2907
|
const unc = launderUnchecked(self0);
|
|
3241
2908
|
return markFixed(self0, {
|
|
3242
2909
|
data: fixTyped(State2.DEFAULT, unc, "data", ["string"]),
|
|
2910
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
3243
2911
|
displayTextI18nKey: fixTyped(
|
|
3244
2912
|
State2.DEFAULT,
|
|
3245
2913
|
unc,
|
|
3246
2914
|
"displayTextI18nKey",
|
|
3247
2915
|
["string", "null"]
|
|
3248
2916
|
),
|
|
2917
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
3249
2918
|
iconI18nKey: fixTyped(
|
|
3250
2919
|
State2.DEFAULT,
|
|
3251
2920
|
unc,
|
|
@@ -3270,16 +2939,16 @@ async function createI18n(resources, formatters = {}, options) {
|
|
|
3270
2939
|
const ret = createInstance({
|
|
3271
2940
|
cleanCode: true,
|
|
3272
2941
|
initImmediate: true,
|
|
3273
|
-
missingInterpolationHandler(
|
|
2942
|
+
missingInterpolationHandler(text, value) {
|
|
3274
2943
|
if (missingInterpolationHandlerReentrant) {
|
|
3275
|
-
self.console.warn(value,
|
|
2944
|
+
self.console.warn(value, text);
|
|
3276
2945
|
} else {
|
|
3277
2946
|
missingInterpolationHandlerReentrant = true;
|
|
3278
2947
|
try {
|
|
3279
2948
|
self.console.warn(ret.t("errors.missing-interpolation", {
|
|
3280
2949
|
interpolation: { escapeValue: false },
|
|
3281
2950
|
name: value[1],
|
|
3282
|
-
text
|
|
2951
|
+
text,
|
|
3283
2952
|
value: value[0]
|
|
3284
2953
|
}));
|
|
3285
2954
|
} finally {
|
|
@@ -3374,9 +3043,9 @@ var LanguageManager = class _LanguageManager extends ResourceComponent {
|
|
|
3374
3043
|
import { addIcon as addIcon0, removeIcon } from "obsidian";
|
|
3375
3044
|
import { createElement } from "lucide";
|
|
3376
3045
|
function addIcon(id, content) {
|
|
3377
|
-
const
|
|
3378
|
-
|
|
3379
|
-
const { content: { firstElementChild: svg } } =
|
|
3046
|
+
const template2 = self.document.createElement("template");
|
|
3047
|
+
template2.innerHTML = content;
|
|
3048
|
+
const { content: { firstElementChild: svg } } = template2;
|
|
3380
3049
|
if (!svg) {
|
|
3381
3050
|
throw new Error(content);
|
|
3382
3051
|
}
|
|
@@ -3433,11 +3102,11 @@ import { constant as constant2, noop as noop3 } from "lodash-es";
|
|
|
3433
3102
|
|
|
3434
3103
|
// sources/settings-widgets.ts
|
|
3435
3104
|
function closeSetting(container) {
|
|
3436
|
-
let
|
|
3437
|
-
while (
|
|
3438
|
-
|
|
3105
|
+
let element = container;
|
|
3106
|
+
while (element && !element.classList.contains(DOMClasses.MODAL)) {
|
|
3107
|
+
element = element.parentElement;
|
|
3439
3108
|
}
|
|
3440
|
-
const close =
|
|
3109
|
+
const close = element?.querySelector(`.${DOMClasses.MODAL_CLOSE_BUTTON}`);
|
|
3441
3110
|
if (instanceOf(close, HTMLElement)) {
|
|
3442
3111
|
close.click();
|
|
3443
3112
|
}
|
|
@@ -3515,7 +3184,7 @@ function resetButton(icon, tooltip, resetter, callback, { pre, post } = {}) {
|
|
|
3515
3184
|
}
|
|
3516
3185
|
};
|
|
3517
3186
|
}
|
|
3518
|
-
function dropdownSelect(unselected, selections, callback,
|
|
3187
|
+
function dropdownSelect(unselected, selections, callback, action2 = {}) {
|
|
3519
3188
|
return linkSetting(
|
|
3520
3189
|
() => NaN.toString(),
|
|
3521
3190
|
async (value, component) => {
|
|
@@ -3527,10 +3196,10 @@ function dropdownSelect(unselected, selections, callback, action = {}) {
|
|
|
3527
3196
|
},
|
|
3528
3197
|
unexpected,
|
|
3529
3198
|
{
|
|
3530
|
-
...
|
|
3199
|
+
...action2,
|
|
3531
3200
|
pre(component) {
|
|
3532
3201
|
component.addOption(NaN.toString(), unselected).addOptions(Object.fromEntries(selections.map((selection, index) => [index, selection.name])));
|
|
3533
|
-
const { pre } =
|
|
3202
|
+
const { pre } = action2;
|
|
3534
3203
|
if (pre) {
|
|
3535
3204
|
pre(component);
|
|
3536
3205
|
}
|
|
@@ -3540,11 +3209,11 @@ function dropdownSelect(unselected, selections, callback, action = {}) {
|
|
|
3540
3209
|
}
|
|
3541
3210
|
|
|
3542
3211
|
// sources/modals.ts
|
|
3543
|
-
function makeModalDynamicWidth(ui,
|
|
3544
|
-
const { width } =
|
|
3545
|
-
|
|
3212
|
+
function makeModalDynamicWidth(ui, element) {
|
|
3213
|
+
const { width } = element.style;
|
|
3214
|
+
element.style.width = "unset";
|
|
3546
3215
|
ui.finally(() => {
|
|
3547
|
-
|
|
3216
|
+
element.style.width = width;
|
|
3548
3217
|
});
|
|
3549
3218
|
}
|
|
3550
3219
|
var ListModal = class _ListModal extends Modal {
|
|
@@ -3589,7 +3258,7 @@ var ListModal = class _ListModal extends Modal {
|
|
|
3589
3258
|
return (setting, editable, getter, setter, input = (setting0, callback) => {
|
|
3590
3259
|
setting0.addTextArea(callback);
|
|
3591
3260
|
}) => {
|
|
3592
|
-
input(setting, (
|
|
3261
|
+
input(setting, (text) => text.setValue(transformer.forth(getter())).setDisabled(!editable).onChange((value) => setter((_0, index, data) => {
|
|
3593
3262
|
data[index] = transformer.back(value);
|
|
3594
3263
|
})));
|
|
3595
3264
|
};
|
|
@@ -3703,11 +3372,11 @@ var ListModal = class _ListModal extends Modal {
|
|
|
3703
3372
|
ui.update();
|
|
3704
3373
|
await cb;
|
|
3705
3374
|
}
|
|
3706
|
-
setupListSubUI(ui,
|
|
3375
|
+
setupListSubUI(ui, element) {
|
|
3707
3376
|
const { context, data } = this, editables = this.#editables, namer = this.#namer, descriptor = this.#descriptor, { language } = context, { value: i18n } = language;
|
|
3708
3377
|
ui.destroy();
|
|
3709
3378
|
for (const [index] of data.entries()) {
|
|
3710
|
-
ui.newSetting(
|
|
3379
|
+
ui.newSetting(element, (setting) => {
|
|
3711
3380
|
const { valid, value: item } = bracket(data, index);
|
|
3712
3381
|
if (!valid) {
|
|
3713
3382
|
throw new Error(index.toString());
|
|
@@ -3831,10 +3500,10 @@ var EditDataModal = class _EditDataModal extends Modal {
|
|
|
3831
3500
|
this.modalUI.destroy();
|
|
3832
3501
|
this.ui.destroy();
|
|
3833
3502
|
}
|
|
3834
|
-
draw(ui,
|
|
3503
|
+
draw(ui, element, errorEl) {
|
|
3835
3504
|
const { context: { language: { value: i18n } }, fixer, protodata } = this, els = this.#elements;
|
|
3836
3505
|
if (els.includes("export")) {
|
|
3837
|
-
ui.newSetting(
|
|
3506
|
+
ui.newSetting(element, (setting) => {
|
|
3838
3507
|
setting.setName(i18n.t("components.edit-data.export")).addButton((button) => {
|
|
3839
3508
|
const { buttonEl } = button;
|
|
3840
3509
|
button.setIcon(i18n.t("asset:components.edit-data.export-to-clipboard-icon")).setTooltip(i18n.t("components.edit-data.export-to-clipboard")).onClick(async () => {
|
|
@@ -3849,7 +3518,7 @@ var EditDataModal = class _EditDataModal extends Modal {
|
|
|
3849
3518
|
});
|
|
3850
3519
|
}
|
|
3851
3520
|
if (els.includes("import")) {
|
|
3852
|
-
ui.newSetting(
|
|
3521
|
+
ui.newSetting(element, (setting) => {
|
|
3853
3522
|
setting.setName(i18n.t("components.edit-data.import")).addButton((button) => {
|
|
3854
3523
|
const { buttonEl } = button;
|
|
3855
3524
|
button.setIcon(i18n.t("asset:components.edit-data.import-from-clipboard-icon")).setTooltip(i18n.t("components.edit-data.import-from-clipboard")).onClick(async () => {
|
|
@@ -3873,7 +3542,7 @@ var EditDataModal = class _EditDataModal extends Modal {
|
|
|
3873
3542
|
});
|
|
3874
3543
|
}
|
|
3875
3544
|
if (els.includes("data")) {
|
|
3876
|
-
ui.newSetting(
|
|
3545
|
+
ui.newSetting(element, (setting) => {
|
|
3877
3546
|
const { settingEl } = setting;
|
|
3878
3547
|
setting.setName(i18n.t("components.edit-data.data")).addTextArea(linkSetting(
|
|
3879
3548
|
() => this.#dataText,
|
|
@@ -3906,9 +3575,9 @@ var EditDataModal = class _EditDataModal extends Modal {
|
|
|
3906
3575
|
});
|
|
3907
3576
|
}
|
|
3908
3577
|
}
|
|
3909
|
-
async postMutate(
|
|
3578
|
+
async postMutate(reset2 = true) {
|
|
3910
3579
|
const { data, modalUI, ui } = this, cb = this.#callback(simplifyType(cloneAsWritable(data)));
|
|
3911
|
-
if (
|
|
3580
|
+
if (reset2) {
|
|
3912
3581
|
this.#resetDataText();
|
|
3913
3582
|
}
|
|
3914
3583
|
modalUI.update();
|
|
@@ -4253,12 +3922,12 @@ var StorageSettingsManager = class _StorageSettingsManager extends AbstractSetti
|
|
|
4253
3922
|
if (key === null) {
|
|
4254
3923
|
return { [_StorageSettingsManager.FAILED]: true };
|
|
4255
3924
|
}
|
|
4256
|
-
const
|
|
4257
|
-
if (
|
|
3925
|
+
const text = this.storage.getItem(key);
|
|
3926
|
+
if (text === null) {
|
|
4258
3927
|
return null;
|
|
4259
3928
|
}
|
|
4260
3929
|
try {
|
|
4261
|
-
const ret = JSON.parse(
|
|
3930
|
+
const ret = JSON.parse(text);
|
|
4262
3931
|
return ret;
|
|
4263
3932
|
} catch (error) {
|
|
4264
3933
|
/* @__PURE__ */ self.console.debug(error);
|
|
@@ -4588,10 +4257,10 @@ var AdvancedSettingTab = class extends PluginSettingTab {
|
|
|
4588
4257
|
onUnload() {
|
|
4589
4258
|
this.ui.destroy();
|
|
4590
4259
|
}
|
|
4591
|
-
newSectionWidget(
|
|
4260
|
+
newSectionWidget(text, heading = 2) {
|
|
4592
4261
|
const { containerEl, ui } = this;
|
|
4593
4262
|
ui.new(() => createChildElement(containerEl, `h${heading}`), (ele) => {
|
|
4594
|
-
const text0 =
|
|
4263
|
+
const text0 = text();
|
|
4595
4264
|
ele.replaceChildren(typeof text0 === "string" ? createDocumentFragment(ele.ownerDocument, (frag2) => {
|
|
4596
4265
|
frag2.textContent = text0;
|
|
4597
4266
|
}) : text0);
|
|
@@ -4617,7 +4286,7 @@ var AdvancedSettingTab = class extends PluginSettingTab {
|
|
|
4617
4286
|
containerEl,
|
|
4618
4287
|
ui,
|
|
4619
4288
|
context: { settings, language: { value: i18n } }
|
|
4620
|
-
} = this, langs = deepFreeze(["", ...languages.filter(
|
|
4289
|
+
} = this, langs = deepFreeze(["", ...languages.filter(Boolean)]);
|
|
4621
4290
|
ui.newSetting(containerEl, (setting) => {
|
|
4622
4291
|
setting.setName(i18n.t("settings.language")).setDesc(i18n.t("settings.language-description")).addDropdown(linkSetting(
|
|
4623
4292
|
() => settings.value.language,
|
|
@@ -4988,7 +4657,7 @@ export {
|
|
|
4988
4657
|
EditDataModal,
|
|
4989
4658
|
EventEmitterLite,
|
|
4990
4659
|
FileExtensions,
|
|
4991
|
-
|
|
4660
|
+
Find as FindComponent,
|
|
4992
4661
|
find_exports as FindComponent$,
|
|
4993
4662
|
Functions,
|
|
4994
4663
|
JSON_STRINGIFY_SPACE,
|
|
@@ -5055,7 +4724,6 @@ export {
|
|
|
5055
4724
|
createI18n,
|
|
5056
4725
|
deepFreeze,
|
|
5057
4726
|
deopaque,
|
|
5058
|
-
destroyWithOutro,
|
|
5059
4727
|
dropdownSelect,
|
|
5060
4728
|
dynamicRequire,
|
|
5061
4729
|
dynamicRequireLazy,
|
|
@@ -5128,6 +4796,7 @@ export {
|
|
|
5128
4796
|
stringToBase64,
|
|
5129
4797
|
swap,
|
|
5130
4798
|
syncLocale,
|
|
4799
|
+
toJSONOrString,
|
|
5131
4800
|
typedIn,
|
|
5132
4801
|
typedKeys,
|
|
5133
4802
|
typedOwnKeys,
|