@polyipseity/obsidian-plugin-library 1.25.0 → 1.26.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 +223 -568
- package/dist/index.js.map +4 -4
- package/dist/sources/@types/obsidian.d.ts.map +1 -1
- package/dist/sources/components/find.svelte +36 -38
- package/dist/sources/components/index.d.ts +1 -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 -29
- 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");
|
|
@@ -1500,9 +1495,9 @@ function cloneAsFrozen(obj, cloner = structuredClone) {
|
|
|
1500
1495
|
function cloneAsWritable(obj, cloner = structuredClone) {
|
|
1501
1496
|
return cloner(obj);
|
|
1502
1497
|
}
|
|
1503
|
-
function consumeEvent(
|
|
1504
|
-
|
|
1505
|
-
|
|
1498
|
+
function consumeEvent(event2) {
|
|
1499
|
+
event2.preventDefault();
|
|
1500
|
+
event2.stopPropagation();
|
|
1506
1501
|
}
|
|
1507
1502
|
function copyOnWrite(obj, mutator) {
|
|
1508
1503
|
const ret = simplifyType(cloneAsWritable(obj));
|
|
@@ -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
|
}
|
|
@@ -1571,18 +1549,18 @@ function extname(path) {
|
|
|
1571
1549
|
const base = basename(path), idx = base.lastIndexOf(".");
|
|
1572
1550
|
return idx === -1 ? "" : base.slice(idx);
|
|
1573
1551
|
}
|
|
1574
|
-
function getKeyModifiers(
|
|
1552
|
+
function getKeyModifiers(event2) {
|
|
1575
1553
|
const ret = [];
|
|
1576
|
-
if (
|
|
1554
|
+
if (event2.altKey) {
|
|
1577
1555
|
ret.push("Alt");
|
|
1578
1556
|
}
|
|
1579
|
-
if (
|
|
1557
|
+
if (event2.ctrlKey) {
|
|
1580
1558
|
ret.push("Ctrl");
|
|
1581
1559
|
}
|
|
1582
|
-
if (
|
|
1560
|
+
if (event2.metaKey) {
|
|
1583
1561
|
ret.push("Meta");
|
|
1584
1562
|
}
|
|
1585
|
-
if (
|
|
1563
|
+
if (event2.shiftKey) {
|
|
1586
1564
|
ret.push("Shift");
|
|
1587
1565
|
}
|
|
1588
1566
|
return deepFreeze(ret);
|
|
@@ -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);
|
|
@@ -1643,7 +1624,7 @@ function lazyProxy(initializer) {
|
|
|
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,
|
|
@@ -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,478 +2130,139 @@ var LibraryLocales;
|
|
|
2140
2130
|
})(LibraryLocales || (LibraryLocales = {}));
|
|
2141
2131
|
|
|
2142
2132
|
// sources/components/find.svelte
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
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
|
+
var find_exports = {};
|
|
2134
|
+
__export(find_exports, {
|
|
2135
|
+
default: () => Find
|
|
2136
|
+
});
|
|
2137
|
+
import "svelte/internal/disclose-version";
|
|
2138
|
+
import "svelte/internal/flags/legacy";
|
|
2139
|
+
import * as $ from "svelte/internal/client";
|
|
2171
2140
|
import { t as i18nt } from "i18next";
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
}
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
let
|
|
2184
|
-
let
|
|
2185
|
-
let button1_class_value;
|
|
2186
|
-
let button1_aria_label_value;
|
|
2187
|
-
let setIcon_action_1;
|
|
2188
|
-
let t1;
|
|
2189
|
-
let button2;
|
|
2190
|
-
let button2_class_value;
|
|
2191
|
-
let button2_aria_label_value;
|
|
2192
|
-
let setIcon_action_2;
|
|
2193
|
-
let t2;
|
|
2194
|
-
let input;
|
|
2195
|
-
let input_placeholder_value;
|
|
2196
|
-
let t3;
|
|
2197
|
-
let div2;
|
|
2198
|
-
let button3;
|
|
2199
|
-
let button3_aria_label_value;
|
|
2200
|
-
let setIcon_action_3;
|
|
2201
|
-
let t4;
|
|
2202
|
-
let button4;
|
|
2203
|
-
let button4_aria_label_value;
|
|
2204
|
-
let setIcon_action_4;
|
|
2205
|
-
let t5;
|
|
2206
|
-
let div1;
|
|
2207
|
-
let t6;
|
|
2208
|
-
let t7;
|
|
2209
|
-
let button5;
|
|
2210
|
-
let button5_aria_label_value;
|
|
2211
|
-
let div4_transition;
|
|
2212
|
-
let current;
|
|
2213
|
-
let mounted;
|
|
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 = {
|
|
2141
|
+
import { isEmpty as isEmpty2 } from "lodash-es";
|
|
2142
|
+
import { setIcon } from "obsidian";
|
|
2143
|
+
import { slide } from "svelte/transition";
|
|
2144
|
+
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>`);
|
|
2145
|
+
var $$css = {
|
|
2146
|
+
hash: "_polyipseity_obsidian-plugin-library-svelte-find",
|
|
2147
|
+
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);}"
|
|
2148
|
+
};
|
|
2149
|
+
function Find($$anchor, $$props) {
|
|
2150
|
+
$.push($$props, false);
|
|
2151
|
+
$.append_styles($$anchor, $$css);
|
|
2152
|
+
let i18n = $.prop($$props, "i18n", 8, i18nt);
|
|
2153
|
+
let params = $.prop($$props, "params", 28, () => ({
|
|
2497
2154
|
caseSensitive: false,
|
|
2498
2155
|
findText: "",
|
|
2499
2156
|
regex: false,
|
|
2500
2157
|
wholeWord: false
|
|
2501
|
-
}
|
|
2502
|
-
let
|
|
2503
|
-
}
|
|
2504
|
-
let
|
|
2505
|
-
}
|
|
2506
|
-
let
|
|
2507
|
-
}
|
|
2508
|
-
let
|
|
2509
|
-
let inputElement = null;
|
|
2158
|
+
}));
|
|
2159
|
+
let onClose = $.prop($$props, "onClose", 8, () => {
|
|
2160
|
+
});
|
|
2161
|
+
let onFind = $.prop($$props, "onFind", 8, (_direction, _params) => {
|
|
2162
|
+
});
|
|
2163
|
+
let onParamsChanged = $.prop($$props, "onParamsChanged", 8, (_params) => {
|
|
2164
|
+
});
|
|
2165
|
+
let results = $.prop($$props, "results", 8, "");
|
|
2166
|
+
let inputElement = $.mutable_source(null);
|
|
2510
2167
|
function focus() {
|
|
2511
|
-
inputElement?.focus();
|
|
2168
|
+
$.get(inputElement)?.focus();
|
|
2512
2169
|
}
|
|
2513
2170
|
function blur() {
|
|
2514
|
-
inputElement?.blur();
|
|
2515
|
-
}
|
|
2516
|
-
const click_handler = () => {
|
|
2517
|
-
$$invalidate(0, params.caseSensitive = !params.caseSensitive, params);
|
|
2518
|
-
};
|
|
2519
|
-
const click_handler_1 = () => {
|
|
2520
|
-
$$invalidate(0, params.wholeWord = !params.wholeWord, params);
|
|
2521
|
-
};
|
|
2522
|
-
const click_handler_2 = () => {
|
|
2523
|
-
$$invalidate(0, params.regex = !params.regex, params);
|
|
2524
|
-
};
|
|
2525
|
-
function input_input_handler() {
|
|
2526
|
-
params.findText = this.value;
|
|
2527
|
-
$$invalidate(0, params);
|
|
2528
|
-
}
|
|
2529
|
-
function input_binding($$value) {
|
|
2530
|
-
binding_callbacks[$$value ? "unshift" : "push"](() => {
|
|
2531
|
-
inputElement = $$value;
|
|
2532
|
-
$$invalidate(5, inputElement);
|
|
2533
|
-
});
|
|
2171
|
+
$.get(inputElement)?.blur();
|
|
2534
2172
|
}
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
onFind("next", params);
|
|
2540
|
-
};
|
|
2541
|
-
const keydown_handler = (event) => {
|
|
2542
|
-
if (event.key === "Escape" && isEmpty2(getKeyModifiers(event))) {
|
|
2543
|
-
onClose();
|
|
2544
|
-
consumeEvent(event);
|
|
2173
|
+
$.legacy_pre_effect(
|
|
2174
|
+
() => ($.deep_read_state(onParamsChanged()), $.deep_read_state(params())),
|
|
2175
|
+
() => {
|
|
2176
|
+
onParamsChanged()(params());
|
|
2545
2177
|
}
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2178
|
+
);
|
|
2179
|
+
$.legacy_pre_effect_reset();
|
|
2180
|
+
$.init();
|
|
2181
|
+
var div = root();
|
|
2182
|
+
var div_1 = $.child(div);
|
|
2183
|
+
var div_2 = $.child(div_1);
|
|
2184
|
+
var button = $.child(div_2);
|
|
2185
|
+
$.effect(() => $.event("click", button, $.preventDefault($.stopPropagation(() => {
|
|
2186
|
+
params(params().caseSensitive = !params().caseSensitive, true);
|
|
2187
|
+
}))));
|
|
2188
|
+
$.action(button, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18n()("asset:components.find.case-sensitive-icon"));
|
|
2189
|
+
var button_1 = $.sibling(button, 2);
|
|
2190
|
+
$.effect(() => $.event("click", button_1, $.preventDefault($.stopPropagation(() => {
|
|
2191
|
+
params(params().wholeWord = !params().wholeWord, true);
|
|
2192
|
+
}))));
|
|
2193
|
+
$.action(button_1, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18n()("asset:components.find.whole-word-icon"));
|
|
2194
|
+
var button_2 = $.sibling(button_1, 2);
|
|
2195
|
+
$.effect(() => $.event("click", button_2, $.preventDefault($.stopPropagation(() => {
|
|
2196
|
+
params(params().regex = !params().regex, true);
|
|
2197
|
+
}))));
|
|
2198
|
+
$.action(button_2, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18n()("asset:components.find.regex-icon"));
|
|
2199
|
+
$.reset(div_2);
|
|
2200
|
+
var input = $.sibling(div_2, 2);
|
|
2201
|
+
$.remove_input_defaults(input);
|
|
2202
|
+
$.bind_this(input, ($$value) => $.set(inputElement, $$value), () => $.get(inputElement));
|
|
2203
|
+
var div_3 = $.sibling(input, 2);
|
|
2204
|
+
var button_3 = $.child(div_3);
|
|
2205
|
+
$.effect(() => $.event("click", button_3, $.preventDefault($.stopPropagation(() => {
|
|
2206
|
+
onFind()("previous", params());
|
|
2207
|
+
}))));
|
|
2208
|
+
$.action(button_3, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18n()("asset:components.find.previous-icon"));
|
|
2209
|
+
var button_4 = $.sibling(button_3, 2);
|
|
2210
|
+
$.effect(() => $.event("click", button_4, $.preventDefault($.stopPropagation(() => {
|
|
2211
|
+
onFind()("next", params());
|
|
2212
|
+
}))));
|
|
2213
|
+
$.action(button_4, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18n()("asset:components.find.next-icon"));
|
|
2214
|
+
var div_4 = $.sibling(button_4, 2);
|
|
2215
|
+
var text = $.child(div_4, true);
|
|
2216
|
+
$.reset(div_4);
|
|
2217
|
+
var button_5 = $.sibling(div_4, 2);
|
|
2218
|
+
$.reset(div_3);
|
|
2219
|
+
$.reset(div_1);
|
|
2220
|
+
$.reset(div);
|
|
2221
|
+
$.template_effect(
|
|
2222
|
+
($0, $1, $2, $3, $4, $5, $6) => {
|
|
2223
|
+
$.set_class(button, 1, `document-search-button${params().caseSensitive ? " mod-cta" : ""}`, "_polyipseity_obsidian-plugin-library-svelte-find");
|
|
2224
|
+
$.set_attribute(button, "aria-label", $0);
|
|
2225
|
+
$.set_class(button_1, 1, `document-search-button${params().wholeWord ? " mod-cta" : ""}`, "_polyipseity_obsidian-plugin-library-svelte-find");
|
|
2226
|
+
$.set_attribute(button_1, "aria-label", $1);
|
|
2227
|
+
$.set_class(button_2, 1, `document-search-button${params().regex ? " mod-cta" : ""}`, "_polyipseity_obsidian-plugin-library-svelte-find");
|
|
2228
|
+
$.set_attribute(button_2, "aria-label", $2);
|
|
2229
|
+
$.set_attribute(input, "placeholder", $3);
|
|
2230
|
+
$.set_attribute(button_3, "aria-label", $4);
|
|
2231
|
+
$.set_attribute(button_4, "aria-label", $5);
|
|
2232
|
+
$.set_text(text, results());
|
|
2233
|
+
$.set_attribute(button_5, "aria-label", $6);
|
|
2234
|
+
},
|
|
2235
|
+
[
|
|
2236
|
+
() => i18n()("components.find.case-sensitive"),
|
|
2237
|
+
() => i18n()("components.find.whole-word"),
|
|
2238
|
+
() => i18n()("components.find.regex"),
|
|
2239
|
+
() => i18n()("components.find.input-placeholder"),
|
|
2240
|
+
() => i18n()("components.find.previous"),
|
|
2241
|
+
() => i18n()("components.find.next"),
|
|
2242
|
+
() => i18n()("components.find.close")
|
|
2243
|
+
],
|
|
2244
|
+
$.derived_safe_equal
|
|
2245
|
+
);
|
|
2246
|
+
$.bind_value(input, () => params().findText, ($$value) => params(params().findText = $$value, true));
|
|
2247
|
+
$.event("keydown", input, (event2) => {
|
|
2248
|
+
if (event2.key === "Escape" && isEmpty2(getKeyModifiers(event2))) {
|
|
2249
|
+
onClose()();
|
|
2250
|
+
consumeEvent(event2);
|
|
2559
2251
|
}
|
|
2560
|
-
};
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
focus,
|
|
2570
|
-
blur,
|
|
2571
|
-
click_handler,
|
|
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
|
-
];
|
|
2252
|
+
});
|
|
2253
|
+
$.event("click", button_5, $.preventDefault($.stopPropagation(function(...$$args) {
|
|
2254
|
+
onClose()?.apply(this, $$args);
|
|
2255
|
+
})));
|
|
2256
|
+
$.transition(3, div, () => slide);
|
|
2257
|
+
$.append($$anchor, div);
|
|
2258
|
+
$.bind_prop($$props, "focus", focus);
|
|
2259
|
+
$.bind_prop($$props, "blur", blur);
|
|
2260
|
+
return $.pop({ focus, blur });
|
|
2580
2261
|
}
|
|
2581
|
-
var Find = class extends SvelteComponent {
|
|
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;
|
|
2611
2262
|
|
|
2612
2263
|
// sources/components/find.ts
|
|
2613
|
-
var
|
|
2614
|
-
__export(
|
|
2264
|
+
var find_exports2 = {};
|
|
2265
|
+
__export(find_exports2, {
|
|
2615
2266
|
DIRECTIONS: () => DIRECTIONS
|
|
2616
2267
|
});
|
|
2617
2268
|
var DIRECTIONS = deepFreeze(["next", "previous"]);
|
|
@@ -2643,9 +2294,9 @@ function fixArray(defaults, from, key, types) {
|
|
|
2643
2294
|
const default1 = default0;
|
|
2644
2295
|
return default1.map(primitiveOfE);
|
|
2645
2296
|
}
|
|
2646
|
-
function fixInSet(defaults, from, key,
|
|
2297
|
+
function fixInSet(defaults, from, key, set2) {
|
|
2647
2298
|
const val = from[key];
|
|
2648
|
-
return inSet(
|
|
2299
|
+
return inSet(set2, val) ? val : defaults[key];
|
|
2649
2300
|
}
|
|
2650
2301
|
|
|
2651
2302
|
// sources/documentation.ts
|
|
@@ -2714,6 +2365,7 @@ var LambdaComponent = class extends Component {
|
|
|
2714
2365
|
};
|
|
2715
2366
|
var ResourceComponent = class _ResourceComponent extends Component {
|
|
2716
2367
|
static sentinel = Symbol(this.name);
|
|
2368
|
+
// `unknown` to make the class covariant.
|
|
2717
2369
|
#loader = promisePromise();
|
|
2718
2370
|
#value = _ResourceComponent.sentinel;
|
|
2719
2371
|
get onLoaded() {
|
|
@@ -2780,10 +2432,10 @@ var UpdatableUI = class {
|
|
|
2780
2432
|
throw error;
|
|
2781
2433
|
}
|
|
2782
2434
|
}
|
|
2783
|
-
newSetting(
|
|
2435
|
+
newSetting(element, configure) {
|
|
2784
2436
|
let recording = true;
|
|
2785
2437
|
return this.new(() => {
|
|
2786
|
-
const setting = new Setting(
|
|
2438
|
+
const setting = new Setting(element), patch = (proto) => {
|
|
2787
2439
|
const components = [];
|
|
2788
2440
|
let index = 0;
|
|
2789
2441
|
return function fn(cb) {
|
|
@@ -2841,6 +2493,7 @@ var UpdatableUI = class {
|
|
|
2841
2493
|
addDropdown: patch,
|
|
2842
2494
|
addExtraButton: patch,
|
|
2843
2495
|
addMomentFormat: patch,
|
|
2496
|
+
addProgressBar: patch,
|
|
2844
2497
|
addSearch: patch,
|
|
2845
2498
|
addSlider: patch,
|
|
2846
2499
|
addText: patch,
|
|
@@ -2884,13 +2537,13 @@ var UpdatableUI = class {
|
|
|
2884
2537
|
clear(this.#updaters);
|
|
2885
2538
|
}
|
|
2886
2539
|
};
|
|
2887
|
-
function statusUI(ui,
|
|
2888
|
-
ui.new(constant(
|
|
2889
|
-
|
|
2540
|
+
function statusUI(ui, element) {
|
|
2541
|
+
ui.new(constant(element), noop2, () => {
|
|
2542
|
+
element.textContent = null;
|
|
2890
2543
|
});
|
|
2891
2544
|
return deepFreeze({
|
|
2892
2545
|
report(status) {
|
|
2893
|
-
|
|
2546
|
+
element.textContent = status === void 0 ? null : toJSONOrString(status);
|
|
2894
2547
|
}
|
|
2895
2548
|
});
|
|
2896
2549
|
}
|
|
@@ -2953,11 +2606,11 @@ function addRibbonIcon(context, id, icon, title, callback) {
|
|
|
2953
2606
|
}
|
|
2954
2607
|
);
|
|
2955
2608
|
}
|
|
2956
|
-
async function awaitCSS(
|
|
2957
|
-
const { classList, style, style: { display } } =
|
|
2609
|
+
async function awaitCSS(element) {
|
|
2610
|
+
const { classList, style, style: { display } } = element;
|
|
2958
2611
|
style.display = "none";
|
|
2959
2612
|
return new Promise((resolve, reject) => {
|
|
2960
|
-
const obsr = onVisible(
|
|
2613
|
+
const obsr = onVisible(element, () => {
|
|
2961
2614
|
try {
|
|
2962
2615
|
style.display = display;
|
|
2963
2616
|
classList.remove(awaitCSS.CLASS);
|
|
@@ -2979,7 +2632,7 @@ function cleanFrontmatterCache(cache) {
|
|
|
2979
2632
|
return deepFreeze({});
|
|
2980
2633
|
}
|
|
2981
2634
|
const ret = cloneAsWritable(cache);
|
|
2982
|
-
delete ret
|
|
2635
|
+
delete ret["position"];
|
|
2983
2636
|
return deepFreeze(ret);
|
|
2984
2637
|
}
|
|
2985
2638
|
function commandNamer(cmdNamer, pluginNamer, defaultPluginName, format) {
|
|
@@ -3083,8 +2736,8 @@ function updateView(context, view) {
|
|
|
3083
2736
|
}
|
|
3084
2737
|
}
|
|
3085
2738
|
}
|
|
3086
|
-
function useSettings(
|
|
3087
|
-
const container = createChildElement(
|
|
2739
|
+
function useSettings(element) {
|
|
2740
|
+
const container = createChildElement(element, "div", (ele) => {
|
|
3088
2741
|
ele.classList.add(DOMClasses.VERTICAL_TAB_CONTENT_CONTAINER);
|
|
3089
2742
|
});
|
|
3090
2743
|
return Object.freeze({
|
|
@@ -3096,9 +2749,9 @@ function useSettings(element2) {
|
|
|
3096
2749
|
}
|
|
3097
2750
|
});
|
|
3098
2751
|
}
|
|
3099
|
-
function useSubsettings(
|
|
3100
|
-
const ret = createChildElement(
|
|
3101
|
-
if (
|
|
2752
|
+
function useSubsettings(element) {
|
|
2753
|
+
const ret = createChildElement(element, "div");
|
|
2754
|
+
if (element.firstChild) {
|
|
3102
2755
|
createChildElement(ret, "div");
|
|
3103
2756
|
}
|
|
3104
2757
|
return ret;
|
|
@@ -3116,8 +2769,8 @@ var DocumentationMarkdownView = class _DocumentationMarkdownView extends ItemVie
|
|
|
3116
2769
|
const { contentEl } = this;
|
|
3117
2770
|
this.navigation = true;
|
|
3118
2771
|
this.element = createChildElement(
|
|
3119
|
-
createChildElement(contentEl, "div", (
|
|
3120
|
-
|
|
2772
|
+
createChildElement(contentEl, "div", (element) => {
|
|
2773
|
+
element.classList.add(
|
|
3121
2774
|
DOMClasses.ALLOW_FOLD_HEADINGS,
|
|
3122
2775
|
DOMClasses.ALLOW_FOLD_LISTS,
|
|
3123
2776
|
DOMClasses.IS_READABLE_LINE_WIDTH,
|
|
@@ -3128,8 +2781,8 @@ var DocumentationMarkdownView = class _DocumentationMarkdownView extends ItemVie
|
|
|
3128
2781
|
);
|
|
3129
2782
|
}),
|
|
3130
2783
|
"div",
|
|
3131
|
-
(
|
|
3132
|
-
|
|
2784
|
+
(element) => {
|
|
2785
|
+
element.classList.add(
|
|
3133
2786
|
DOMClasses.MARKDOWN_PREVIEW_SECTION,
|
|
3134
2787
|
DOMClasses.MARKDOWN_PREVIEW_SIZER
|
|
3135
2788
|
);
|
|
@@ -3166,7 +2819,7 @@ var DocumentationMarkdownView = class _DocumentationMarkdownView extends ItemVie
|
|
|
3166
2819
|
return key === null ? super.getIcon() : String(i18n.t(key));
|
|
3167
2820
|
}
|
|
3168
2821
|
async setState(state, result) {
|
|
3169
|
-
const { context: plugin, element
|
|
2822
|
+
const { context: plugin, element } = this, ownState = readStateCollabratively(
|
|
3170
2823
|
_DocumentationMarkdownView.type.namespaced(plugin),
|
|
3171
2824
|
state
|
|
3172
2825
|
), { value, valid } = _DocumentationMarkdownView.State.fix(ownState);
|
|
@@ -3176,7 +2829,7 @@ var DocumentationMarkdownView = class _DocumentationMarkdownView extends ItemVie
|
|
|
3176
2829
|
await super.setState(state, result);
|
|
3177
2830
|
const { data } = value;
|
|
3178
2831
|
this.state = value;
|
|
3179
|
-
await MarkdownRenderer.
|
|
2832
|
+
await MarkdownRenderer.render(this.app, data, element, "", this);
|
|
3180
2833
|
recordViewStateHistory(plugin, result);
|
|
3181
2834
|
}
|
|
3182
2835
|
getState() {
|
|
@@ -3240,12 +2893,14 @@ var Registered0 = class {
|
|
|
3240
2893
|
const unc = launderUnchecked(self0);
|
|
3241
2894
|
return markFixed(self0, {
|
|
3242
2895
|
data: fixTyped(State2.DEFAULT, unc, "data", ["string"]),
|
|
2896
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
3243
2897
|
displayTextI18nKey: fixTyped(
|
|
3244
2898
|
State2.DEFAULT,
|
|
3245
2899
|
unc,
|
|
3246
2900
|
"displayTextI18nKey",
|
|
3247
2901
|
["string", "null"]
|
|
3248
2902
|
),
|
|
2903
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
3249
2904
|
iconI18nKey: fixTyped(
|
|
3250
2905
|
State2.DEFAULT,
|
|
3251
2906
|
unc,
|
|
@@ -3270,16 +2925,16 @@ async function createI18n(resources, formatters = {}, options) {
|
|
|
3270
2925
|
const ret = createInstance({
|
|
3271
2926
|
cleanCode: true,
|
|
3272
2927
|
initImmediate: true,
|
|
3273
|
-
missingInterpolationHandler(
|
|
2928
|
+
missingInterpolationHandler(text, value) {
|
|
3274
2929
|
if (missingInterpolationHandlerReentrant) {
|
|
3275
|
-
self.console.warn(value,
|
|
2930
|
+
self.console.warn(value, text);
|
|
3276
2931
|
} else {
|
|
3277
2932
|
missingInterpolationHandlerReentrant = true;
|
|
3278
2933
|
try {
|
|
3279
2934
|
self.console.warn(ret.t("errors.missing-interpolation", {
|
|
3280
2935
|
interpolation: { escapeValue: false },
|
|
3281
2936
|
name: value[1],
|
|
3282
|
-
text
|
|
2937
|
+
text,
|
|
3283
2938
|
value: value[0]
|
|
3284
2939
|
}));
|
|
3285
2940
|
} finally {
|
|
@@ -3374,9 +3029,9 @@ var LanguageManager = class _LanguageManager extends ResourceComponent {
|
|
|
3374
3029
|
import { addIcon as addIcon0, removeIcon } from "obsidian";
|
|
3375
3030
|
import { createElement } from "lucide";
|
|
3376
3031
|
function addIcon(id, content) {
|
|
3377
|
-
const
|
|
3378
|
-
|
|
3379
|
-
const { content: { firstElementChild: svg } } =
|
|
3032
|
+
const template2 = self.document.createElement("template");
|
|
3033
|
+
template2.innerHTML = content;
|
|
3034
|
+
const { content: { firstElementChild: svg } } = template2;
|
|
3380
3035
|
if (!svg) {
|
|
3381
3036
|
throw new Error(content);
|
|
3382
3037
|
}
|
|
@@ -3433,11 +3088,11 @@ import { constant as constant2, noop as noop3 } from "lodash-es";
|
|
|
3433
3088
|
|
|
3434
3089
|
// sources/settings-widgets.ts
|
|
3435
3090
|
function closeSetting(container) {
|
|
3436
|
-
let
|
|
3437
|
-
while (
|
|
3438
|
-
|
|
3091
|
+
let element = container;
|
|
3092
|
+
while (element && !element.classList.contains(DOMClasses.MODAL)) {
|
|
3093
|
+
element = element.parentElement;
|
|
3439
3094
|
}
|
|
3440
|
-
const close =
|
|
3095
|
+
const close = element?.querySelector(`.${DOMClasses.MODAL_CLOSE_BUTTON}`);
|
|
3441
3096
|
if (instanceOf(close, HTMLElement)) {
|
|
3442
3097
|
close.click();
|
|
3443
3098
|
}
|
|
@@ -3515,7 +3170,7 @@ function resetButton(icon, tooltip, resetter, callback, { pre, post } = {}) {
|
|
|
3515
3170
|
}
|
|
3516
3171
|
};
|
|
3517
3172
|
}
|
|
3518
|
-
function dropdownSelect(unselected, selections, callback,
|
|
3173
|
+
function dropdownSelect(unselected, selections, callback, action2 = {}) {
|
|
3519
3174
|
return linkSetting(
|
|
3520
3175
|
() => NaN.toString(),
|
|
3521
3176
|
async (value, component) => {
|
|
@@ -3527,10 +3182,10 @@ function dropdownSelect(unselected, selections, callback, action = {}) {
|
|
|
3527
3182
|
},
|
|
3528
3183
|
unexpected,
|
|
3529
3184
|
{
|
|
3530
|
-
...
|
|
3185
|
+
...action2,
|
|
3531
3186
|
pre(component) {
|
|
3532
3187
|
component.addOption(NaN.toString(), unselected).addOptions(Object.fromEntries(selections.map((selection, index) => [index, selection.name])));
|
|
3533
|
-
const { pre } =
|
|
3188
|
+
const { pre } = action2;
|
|
3534
3189
|
if (pre) {
|
|
3535
3190
|
pre(component);
|
|
3536
3191
|
}
|
|
@@ -3540,11 +3195,11 @@ function dropdownSelect(unselected, selections, callback, action = {}) {
|
|
|
3540
3195
|
}
|
|
3541
3196
|
|
|
3542
3197
|
// sources/modals.ts
|
|
3543
|
-
function makeModalDynamicWidth(ui,
|
|
3544
|
-
const { width } =
|
|
3545
|
-
|
|
3198
|
+
function makeModalDynamicWidth(ui, element) {
|
|
3199
|
+
const { width } = element.style;
|
|
3200
|
+
element.style.width = "unset";
|
|
3546
3201
|
ui.finally(() => {
|
|
3547
|
-
|
|
3202
|
+
element.style.width = width;
|
|
3548
3203
|
});
|
|
3549
3204
|
}
|
|
3550
3205
|
var ListModal = class _ListModal extends Modal {
|
|
@@ -3589,7 +3244,7 @@ var ListModal = class _ListModal extends Modal {
|
|
|
3589
3244
|
return (setting, editable, getter, setter, input = (setting0, callback) => {
|
|
3590
3245
|
setting0.addTextArea(callback);
|
|
3591
3246
|
}) => {
|
|
3592
|
-
input(setting, (
|
|
3247
|
+
input(setting, (text) => text.setValue(transformer.forth(getter())).setDisabled(!editable).onChange((value) => setter((_0, index, data) => {
|
|
3593
3248
|
data[index] = transformer.back(value);
|
|
3594
3249
|
})));
|
|
3595
3250
|
};
|
|
@@ -3703,11 +3358,11 @@ var ListModal = class _ListModal extends Modal {
|
|
|
3703
3358
|
ui.update();
|
|
3704
3359
|
await cb;
|
|
3705
3360
|
}
|
|
3706
|
-
setupListSubUI(ui,
|
|
3361
|
+
setupListSubUI(ui, element) {
|
|
3707
3362
|
const { context, data } = this, editables = this.#editables, namer = this.#namer, descriptor = this.#descriptor, { language } = context, { value: i18n } = language;
|
|
3708
3363
|
ui.destroy();
|
|
3709
3364
|
for (const [index] of data.entries()) {
|
|
3710
|
-
ui.newSetting(
|
|
3365
|
+
ui.newSetting(element, (setting) => {
|
|
3711
3366
|
const { valid, value: item } = bracket(data, index);
|
|
3712
3367
|
if (!valid) {
|
|
3713
3368
|
throw new Error(index.toString());
|
|
@@ -3831,10 +3486,10 @@ var EditDataModal = class _EditDataModal extends Modal {
|
|
|
3831
3486
|
this.modalUI.destroy();
|
|
3832
3487
|
this.ui.destroy();
|
|
3833
3488
|
}
|
|
3834
|
-
draw(ui,
|
|
3489
|
+
draw(ui, element, errorEl) {
|
|
3835
3490
|
const { context: { language: { value: i18n } }, fixer, protodata } = this, els = this.#elements;
|
|
3836
3491
|
if (els.includes("export")) {
|
|
3837
|
-
ui.newSetting(
|
|
3492
|
+
ui.newSetting(element, (setting) => {
|
|
3838
3493
|
setting.setName(i18n.t("components.edit-data.export")).addButton((button) => {
|
|
3839
3494
|
const { buttonEl } = button;
|
|
3840
3495
|
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 +3504,7 @@ var EditDataModal = class _EditDataModal extends Modal {
|
|
|
3849
3504
|
});
|
|
3850
3505
|
}
|
|
3851
3506
|
if (els.includes("import")) {
|
|
3852
|
-
ui.newSetting(
|
|
3507
|
+
ui.newSetting(element, (setting) => {
|
|
3853
3508
|
setting.setName(i18n.t("components.edit-data.import")).addButton((button) => {
|
|
3854
3509
|
const { buttonEl } = button;
|
|
3855
3510
|
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 +3528,7 @@ var EditDataModal = class _EditDataModal extends Modal {
|
|
|
3873
3528
|
});
|
|
3874
3529
|
}
|
|
3875
3530
|
if (els.includes("data")) {
|
|
3876
|
-
ui.newSetting(
|
|
3531
|
+
ui.newSetting(element, (setting) => {
|
|
3877
3532
|
const { settingEl } = setting;
|
|
3878
3533
|
setting.setName(i18n.t("components.edit-data.data")).addTextArea(linkSetting(
|
|
3879
3534
|
() => this.#dataText,
|
|
@@ -3906,9 +3561,9 @@ var EditDataModal = class _EditDataModal extends Modal {
|
|
|
3906
3561
|
});
|
|
3907
3562
|
}
|
|
3908
3563
|
}
|
|
3909
|
-
async postMutate(
|
|
3564
|
+
async postMutate(reset2 = true) {
|
|
3910
3565
|
const { data, modalUI, ui } = this, cb = this.#callback(simplifyType(cloneAsWritable(data)));
|
|
3911
|
-
if (
|
|
3566
|
+
if (reset2) {
|
|
3912
3567
|
this.#resetDataText();
|
|
3913
3568
|
}
|
|
3914
3569
|
modalUI.update();
|
|
@@ -3989,18 +3644,18 @@ var DialogModal = class extends Modal {
|
|
|
3989
3644
|
}
|
|
3990
3645
|
confirmButton = button;
|
|
3991
3646
|
}).addButton((button) => button.setIcon(i18n.t("asset:components.dialog.cancel-icon")).setTooltip(i18n.t("components.dialog.cancel")).onClick(async () => this.cancel(this.#close)));
|
|
3992
|
-
}).new(() => scope.register([], "enter", async (
|
|
3647
|
+
}).new(() => scope.register([], "enter", async (event2) => {
|
|
3993
3648
|
if (preconfirmed) {
|
|
3994
3649
|
await this.confirm(this.#close);
|
|
3995
3650
|
} else {
|
|
3996
|
-
activeSelf(
|
|
3651
|
+
activeSelf(event2).setTimeout(() => {
|
|
3997
3652
|
preconfirmed = false;
|
|
3998
3653
|
confirmButton?.removeCta().setWarning();
|
|
3999
3654
|
}, doubleConfirmTimeout * SI_PREFIX_SCALE);
|
|
4000
3655
|
preconfirmed = true;
|
|
4001
3656
|
confirmButton?.setCta().buttonEl.classList.remove(DOMClasses.MOD_WARNING);
|
|
4002
3657
|
}
|
|
4003
|
-
consumeEvent(
|
|
3658
|
+
consumeEvent(event2);
|
|
4004
3659
|
}), null, (ele) => {
|
|
4005
3660
|
scope.unregister(ele);
|
|
4006
3661
|
});
|
|
@@ -4253,12 +3908,12 @@ var StorageSettingsManager = class _StorageSettingsManager extends AbstractSetti
|
|
|
4253
3908
|
if (key === null) {
|
|
4254
3909
|
return { [_StorageSettingsManager.FAILED]: true };
|
|
4255
3910
|
}
|
|
4256
|
-
const
|
|
4257
|
-
if (
|
|
3911
|
+
const text = this.storage.getItem(key);
|
|
3912
|
+
if (text === null) {
|
|
4258
3913
|
return null;
|
|
4259
3914
|
}
|
|
4260
3915
|
try {
|
|
4261
|
-
const ret = JSON.parse(
|
|
3916
|
+
const ret = JSON.parse(text);
|
|
4262
3917
|
return ret;
|
|
4263
3918
|
} catch (error) {
|
|
4264
3919
|
/* @__PURE__ */ self.console.debug(error);
|
|
@@ -4588,10 +4243,10 @@ var AdvancedSettingTab = class extends PluginSettingTab {
|
|
|
4588
4243
|
onUnload() {
|
|
4589
4244
|
this.ui.destroy();
|
|
4590
4245
|
}
|
|
4591
|
-
newSectionWidget(
|
|
4246
|
+
newSectionWidget(text, heading = 2) {
|
|
4592
4247
|
const { containerEl, ui } = this;
|
|
4593
4248
|
ui.new(() => createChildElement(containerEl, `h${heading}`), (ele) => {
|
|
4594
|
-
const text0 =
|
|
4249
|
+
const text0 = text();
|
|
4595
4250
|
ele.replaceChildren(typeof text0 === "string" ? createDocumentFragment(ele.ownerDocument, (frag2) => {
|
|
4596
4251
|
frag2.textContent = text0;
|
|
4597
4252
|
}) : text0);
|
|
@@ -4617,7 +4272,7 @@ var AdvancedSettingTab = class extends PluginSettingTab {
|
|
|
4617
4272
|
containerEl,
|
|
4618
4273
|
ui,
|
|
4619
4274
|
context: { settings, language: { value: i18n } }
|
|
4620
|
-
} = this, langs = deepFreeze(["", ...languages.filter(
|
|
4275
|
+
} = this, langs = deepFreeze(["", ...languages.filter(Boolean)]);
|
|
4621
4276
|
ui.newSetting(containerEl, (setting) => {
|
|
4622
4277
|
setting.setName(i18n.t("settings.language")).setDesc(i18n.t("settings.language-description")).addDropdown(linkSetting(
|
|
4623
4278
|
() => settings.value.language,
|
|
@@ -4988,8 +4643,8 @@ export {
|
|
|
4988
4643
|
EditDataModal,
|
|
4989
4644
|
EventEmitterLite,
|
|
4990
4645
|
FileExtensions,
|
|
4991
|
-
|
|
4992
|
-
|
|
4646
|
+
find_exports as FindComponent,
|
|
4647
|
+
find_exports2 as FindComponent$,
|
|
4993
4648
|
Functions,
|
|
4994
4649
|
JSON_STRINGIFY_SPACE,
|
|
4995
4650
|
LambdaComponent,
|
|
@@ -5055,7 +4710,6 @@ export {
|
|
|
5055
4710
|
createI18n,
|
|
5056
4711
|
deepFreeze,
|
|
5057
4712
|
deopaque,
|
|
5058
|
-
destroyWithOutro,
|
|
5059
4713
|
dropdownSelect,
|
|
5060
4714
|
dynamicRequire,
|
|
5061
4715
|
dynamicRequireLazy,
|
|
@@ -5128,6 +4782,7 @@ export {
|
|
|
5128
4782
|
stringToBase64,
|
|
5129
4783
|
swap,
|
|
5130
4784
|
syncLocale,
|
|
4785
|
+
toJSONOrString,
|
|
5131
4786
|
typedIn,
|
|
5132
4787
|
typedKeys,
|
|
5133
4788
|
typedOwnKeys,
|