@polyipseity/obsidian-plugin-library 1.35.0 → 1.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +86 -62
- package/dist/inject/index.js +0 -1
- package/dist/scripts/sync-locale-keys.d.mts +2 -0
- package/dist/scripts/sync-locale-keys.d.mts.map +1 -0
- package/dist/src/components/find.d.svelte.ts +49 -19
- package/dist/src/components/find.svelte +57 -29
- package/dist/src/components/index.d.ts +2 -3
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/svelte.svelte.d.ts +15 -0
- package/dist/src/svelte.svelte.d.ts.map +1 -0
- package/dist/style.css +0 -1
- package/package.json +4 -4
- package/dist/index.js.map +0 -7
- package/dist/inject/index.js.map +0 -7
- package/dist/src/components/find.d.ts +0 -9
- package/dist/src/components/find.d.ts.map +0 -1
- package/dist/style.css.map +0 -7
package/dist/index.js
CHANGED
|
@@ -1644,7 +1644,7 @@ function lazyInit(initializer) {
|
|
|
1644
1644
|
};
|
|
1645
1645
|
}
|
|
1646
1646
|
function lazyProxy(initializer) {
|
|
1647
|
-
const lazy = lazyInit(initializer), functions = /* @__PURE__ */ new Map(),
|
|
1647
|
+
const lazy = lazyInit(initializer), functions = /* @__PURE__ */ new Map(), proxy3 = new Proxy(lazy, {
|
|
1648
1648
|
apply(target, thisArg, argArray) {
|
|
1649
1649
|
const target0 = target();
|
|
1650
1650
|
if (typeof target0 !== "function") {
|
|
@@ -1707,7 +1707,7 @@ function lazyProxy(initializer) {
|
|
|
1707
1707
|
}
|
|
1708
1708
|
return Reflect.apply(
|
|
1709
1709
|
ret0,
|
|
1710
|
-
this ===
|
|
1710
|
+
this === proxy3 ? target() : this,
|
|
1711
1711
|
args
|
|
1712
1712
|
);
|
|
1713
1713
|
}
|
|
@@ -1764,7 +1764,7 @@ function lazyProxy(initializer) {
|
|
|
1764
1764
|
return Reflect.setPrototypeOf(target(), proto);
|
|
1765
1765
|
}
|
|
1766
1766
|
});
|
|
1767
|
-
return
|
|
1767
|
+
return proxy3;
|
|
1768
1768
|
}
|
|
1769
1769
|
function logFormat(options, ...args) {
|
|
1770
1770
|
if (isEmpty(args)) {
|
|
@@ -2163,13 +2163,19 @@ var LibraryLocales;
|
|
|
2163
2163
|
})(LibraryLocales || (LibraryLocales = {}));
|
|
2164
2164
|
|
|
2165
2165
|
// src/components/find.svelte
|
|
2166
|
+
var find_exports = {};
|
|
2167
|
+
__export(find_exports, {
|
|
2168
|
+
DIRECTIONS: () => DIRECTIONS,
|
|
2169
|
+
default: () => Find
|
|
2170
|
+
});
|
|
2166
2171
|
import "svelte/internal/disclose-version";
|
|
2167
|
-
import {
|
|
2172
|
+
import { default as i18next } from "i18next";
|
|
2168
2173
|
import { isEmpty as isEmpty2, noop as noop2 } from "lodash-es";
|
|
2169
2174
|
import { onMount } from "svelte";
|
|
2170
2175
|
import { setIcon } from "obsidian";
|
|
2171
2176
|
import { slide } from "svelte/transition";
|
|
2172
2177
|
import * as $ from "svelte/internal/client";
|
|
2178
|
+
var DIRECTIONS = ["next", "previous"];
|
|
2173
2179
|
var root = $.from_html(`<div class="document-search-container" role="search"><div class="document-search _polyipseity_obsidian-plugin-library-svelte-find"><div class="document-search-buttons"><button type="button"></button> <button type="button"></button> <button type="button"></button></div> <input class="document-search-input" type="text" role="searchbox"/> <div class="document-search-buttons"><button type="button" class="document-search-button"></button> <button type="button" class="document-search-button"></button> <div class="document-search-results" aria-live="polite"> </div> <button type="button" class="document-search-close-button"></button></div></div></div>`);
|
|
2174
2180
|
var $$css = {
|
|
2175
2181
|
hash: "_polyipseity_obsidian-plugin-library-svelte-find",
|
|
@@ -2178,7 +2184,7 @@ var $$css = {
|
|
|
2178
2184
|
function Find($$anchor, $$props) {
|
|
2179
2185
|
$.push($$props, true);
|
|
2180
2186
|
$.append_styles($$anchor, $$css);
|
|
2181
|
-
const
|
|
2187
|
+
const i18nt = $.prop($$props, "i18nt", 19, () => i18next.t.bind(i18next)), params = $.prop($$props, "params", 31, () => $.proxy({
|
|
2182
2188
|
caseSensitive: false,
|
|
2183
2189
|
findText: "",
|
|
2184
2190
|
regex: false,
|
|
@@ -2202,70 +2208,36 @@ function Find($$anchor, $$props) {
|
|
|
2202
2208
|
var div_1 = $.child(div);
|
|
2203
2209
|
var div_2 = $.child(div_1);
|
|
2204
2210
|
var button = $.child(div_2);
|
|
2205
|
-
button
|
|
2206
|
-
params(params().caseSensitive = !params().caseSensitive, true);
|
|
2207
|
-
consumeEvent(event);
|
|
2208
|
-
};
|
|
2209
|
-
$.action(button, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18n()("asset:components.find.case-sensitive-icon"));
|
|
2211
|
+
$.action(button, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18nt()("asset:components.find.case-sensitive-icon"));
|
|
2210
2212
|
var button_1 = $.sibling(button, 2);
|
|
2211
|
-
button_1
|
|
2212
|
-
params(params().wholeWord = !params().wholeWord, true);
|
|
2213
|
-
consumeEvent(event);
|
|
2214
|
-
};
|
|
2215
|
-
$.action(button_1, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18n()("asset:components.find.whole-word-icon"));
|
|
2213
|
+
$.action(button_1, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18nt()("asset:components.find.whole-word-icon"));
|
|
2216
2214
|
var button_2 = $.sibling(button_1, 2);
|
|
2217
|
-
button_2
|
|
2218
|
-
params(params().regex = !params().regex, true);
|
|
2219
|
-
consumeEvent(event);
|
|
2220
|
-
};
|
|
2221
|
-
$.action(button_2, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18n()("asset:components.find.regex-icon"));
|
|
2215
|
+
$.action(button_2, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18nt()("asset:components.find.regex-icon"));
|
|
2222
2216
|
$.reset(div_2);
|
|
2223
2217
|
var input = $.sibling(div_2, 2);
|
|
2224
2218
|
$.remove_input_defaults(input);
|
|
2225
|
-
input.__keydown = (event) => {
|
|
2226
|
-
if (event.key === "Escape" && isEmpty2(getKeyModifiers(event))) {
|
|
2227
|
-
onClose()();
|
|
2228
|
-
consumeEvent(event);
|
|
2229
|
-
}
|
|
2230
|
-
if (event.key === "Enter" && isEmpty2(getKeyModifiers(event))) {
|
|
2231
|
-
onFind()("next", params());
|
|
2232
|
-
consumeEvent(event);
|
|
2233
|
-
}
|
|
2234
|
-
};
|
|
2235
2219
|
$.bind_this(input, ($$value) => inputElement = $$value, () => inputElement);
|
|
2236
2220
|
var div_3 = $.sibling(input, 2);
|
|
2237
2221
|
var button_3 = $.child(div_3);
|
|
2238
|
-
button_3
|
|
2239
|
-
onFind()("previous", params());
|
|
2240
|
-
consumeEvent(event);
|
|
2241
|
-
};
|
|
2242
|
-
$.action(button_3, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18n()("asset:components.find.previous-icon"));
|
|
2222
|
+
$.action(button_3, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18nt()("asset:components.find.previous-icon"));
|
|
2243
2223
|
var button_4 = $.sibling(button_3, 2);
|
|
2244
|
-
button_4
|
|
2245
|
-
onFind()("next", params());
|
|
2246
|
-
consumeEvent(event);
|
|
2247
|
-
};
|
|
2248
|
-
$.action(button_4, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18n()("asset:components.find.next-icon"));
|
|
2224
|
+
$.action(button_4, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18nt()("asset:components.find.next-icon"));
|
|
2249
2225
|
var div_4 = $.sibling(button_4, 2);
|
|
2250
2226
|
var text = $.child(div_4, true);
|
|
2251
2227
|
$.reset(div_4);
|
|
2252
2228
|
var button_5 = $.sibling(div_4, 2);
|
|
2253
|
-
button_5
|
|
2254
|
-
onClose()();
|
|
2255
|
-
consumeEvent(event);
|
|
2256
|
-
};
|
|
2257
|
-
$.action(button_5, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18n()("asset:components.find.close-icon"));
|
|
2229
|
+
$.action(button_5, ($$node, $$action_arg) => setIcon?.($$node, $$action_arg), () => i18nt()("asset:components.find.close-icon"));
|
|
2258
2230
|
$.reset(div_3);
|
|
2259
2231
|
$.reset(div_1);
|
|
2260
2232
|
$.reset(div);
|
|
2261
2233
|
$.template_effect(
|
|
2262
|
-
($0, $1, $
|
|
2234
|
+
($0, $1, $22, $3, $4, $5, $6) => {
|
|
2263
2235
|
$.set_class(button, 1, `document-search-button${params().caseSensitive ? " mod-cta" : ""}`, "_polyipseity_obsidian-plugin-library-svelte-find");
|
|
2264
2236
|
$.set_attribute(button, "aria-label", $0);
|
|
2265
2237
|
$.set_class(button_1, 1, `document-search-button${params().wholeWord ? " mod-cta" : ""}`, "_polyipseity_obsidian-plugin-library-svelte-find");
|
|
2266
2238
|
$.set_attribute(button_1, "aria-label", $1);
|
|
2267
2239
|
$.set_class(button_2, 1, `document-search-button${params().regex ? " mod-cta" : ""}`, "_polyipseity_obsidian-plugin-library-svelte-find");
|
|
2268
|
-
$.set_attribute(button_2, "aria-label", $
|
|
2240
|
+
$.set_attribute(button_2, "aria-label", $22);
|
|
2269
2241
|
$.set_attribute(input, "placeholder", $3);
|
|
2270
2242
|
$.set_attribute(button_3, "aria-label", $4);
|
|
2271
2243
|
$.set_attribute(button_4, "aria-label", $5);
|
|
@@ -2273,29 +2245,56 @@ function Find($$anchor, $$props) {
|
|
|
2273
2245
|
$.set_attribute(button_5, "aria-label", $6);
|
|
2274
2246
|
},
|
|
2275
2247
|
[
|
|
2276
|
-
() =>
|
|
2277
|
-
() =>
|
|
2278
|
-
() =>
|
|
2279
|
-
() =>
|
|
2280
|
-
() =>
|
|
2281
|
-
() =>
|
|
2282
|
-
() =>
|
|
2248
|
+
() => i18nt()("components.find.case-sensitive"),
|
|
2249
|
+
() => i18nt()("components.find.whole-word"),
|
|
2250
|
+
() => i18nt()("components.find.regex"),
|
|
2251
|
+
() => i18nt()("components.find.input-placeholder"),
|
|
2252
|
+
() => i18nt()("components.find.previous"),
|
|
2253
|
+
() => i18nt()("components.find.next"),
|
|
2254
|
+
() => i18nt()("components.find.close")
|
|
2283
2255
|
]
|
|
2284
2256
|
);
|
|
2257
|
+
$.delegated("click", button, (event) => {
|
|
2258
|
+
params(params().caseSensitive = !params().caseSensitive, true);
|
|
2259
|
+
consumeEvent(event);
|
|
2260
|
+
});
|
|
2261
|
+
$.delegated("click", button_1, (event) => {
|
|
2262
|
+
params(params().wholeWord = !params().wholeWord, true);
|
|
2263
|
+
consumeEvent(event);
|
|
2264
|
+
});
|
|
2265
|
+
$.delegated("click", button_2, (event) => {
|
|
2266
|
+
params(params().regex = !params().regex, true);
|
|
2267
|
+
consumeEvent(event);
|
|
2268
|
+
});
|
|
2269
|
+
$.delegated("keydown", input, (event) => {
|
|
2270
|
+
if (event.key === "Escape" && isEmpty2(getKeyModifiers(event))) {
|
|
2271
|
+
onClose()();
|
|
2272
|
+
consumeEvent(event);
|
|
2273
|
+
}
|
|
2274
|
+
if (event.key === "Enter" && isEmpty2(getKeyModifiers(event))) {
|
|
2275
|
+
onFind()("next", params());
|
|
2276
|
+
consumeEvent(event);
|
|
2277
|
+
}
|
|
2278
|
+
});
|
|
2285
2279
|
$.bind_value(input, () => params().findText, ($$value) => params(params().findText = $$value, true));
|
|
2280
|
+
$.delegated("click", button_3, (event) => {
|
|
2281
|
+
onFind()("previous", params());
|
|
2282
|
+
consumeEvent(event);
|
|
2283
|
+
});
|
|
2284
|
+
$.delegated("click", button_4, (event) => {
|
|
2285
|
+
onFind()("next", params());
|
|
2286
|
+
consumeEvent(event);
|
|
2287
|
+
});
|
|
2288
|
+
$.delegated("click", button_5, (event) => {
|
|
2289
|
+
onClose()();
|
|
2290
|
+
consumeEvent(event);
|
|
2291
|
+
});
|
|
2286
2292
|
$.transition(3, div, () => slide);
|
|
2287
2293
|
$.append($$anchor, div);
|
|
2288
2294
|
return $.pop($$exports);
|
|
2289
2295
|
}
|
|
2290
2296
|
$.delegate(["click", "keydown"]);
|
|
2291
2297
|
|
|
2292
|
-
// src/components/find.ts
|
|
2293
|
-
var find_exports = {};
|
|
2294
|
-
__export(find_exports, {
|
|
2295
|
-
DIRECTIONS: () => DIRECTIONS
|
|
2296
|
-
});
|
|
2297
|
-
var DIRECTIONS = deepFreeze(["next", "previous"]);
|
|
2298
|
-
|
|
2299
2298
|
// src/fixers.ts
|
|
2300
2299
|
import deepEqual from "deep-equal";
|
|
2301
2300
|
function markFixed(unchecked, fixed) {
|
|
@@ -5103,6 +5102,31 @@ var StatusBarHider = class _StatusBarHider extends Component2 {
|
|
|
5103
5102
|
});
|
|
5104
5103
|
}
|
|
5105
5104
|
};
|
|
5105
|
+
|
|
5106
|
+
// src/svelte.svelte.ts
|
|
5107
|
+
import * as $2 from "svelte/internal/client";
|
|
5108
|
+
function svelteState(props) {
|
|
5109
|
+
if (arguments.length === 0) {
|
|
5110
|
+
class InternalRead {
|
|
5111
|
+
val;
|
|
5112
|
+
constructor() {
|
|
5113
|
+
const val = void 0;
|
|
5114
|
+
this.val = val;
|
|
5115
|
+
}
|
|
5116
|
+
}
|
|
5117
|
+
return new InternalRead().val;
|
|
5118
|
+
} else {
|
|
5119
|
+
const value = props;
|
|
5120
|
+
class InternalWrite {
|
|
5121
|
+
val;
|
|
5122
|
+
constructor(v) {
|
|
5123
|
+
const val = $2.proxy(v);
|
|
5124
|
+
this.val = val;
|
|
5125
|
+
}
|
|
5126
|
+
}
|
|
5127
|
+
return new InternalWrite(value).val;
|
|
5128
|
+
}
|
|
5129
|
+
}
|
|
5106
5130
|
export {
|
|
5107
5131
|
ALWAYS_REGEX,
|
|
5108
5132
|
ALWAYS_REGEX_G,
|
|
@@ -5254,6 +5278,7 @@ export {
|
|
|
5254
5278
|
startCase,
|
|
5255
5279
|
statusUI,
|
|
5256
5280
|
stringToBase64,
|
|
5281
|
+
svelteState,
|
|
5257
5282
|
swap,
|
|
5258
5283
|
syncLocale,
|
|
5259
5284
|
toJSONOrString,
|
|
@@ -5269,4 +5294,3 @@ export {
|
|
|
5269
5294
|
writeStateCollaboratively
|
|
5270
5295
|
};
|
|
5271
5296
|
// repository: https://github.com/polyipseity/obsidian-plugin-library
|
|
5272
|
-
//# sourceMappingURL=index.js.map
|
package/dist/inject/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-locale-keys.d.mts","sourceRoot":"","sources":["../../scripts/sync-locale-keys.mjs"],"names":[],"mappings":"AAgJA,kDAyBC"}
|
|
@@ -1,23 +1,53 @@
|
|
|
1
|
-
|
|
1
|
+
// This declaration file provides TypeScript typings for the `find.svelte` component.
|
|
2
|
+
// Svelte's compiler generates its own `.d.ts` files when building the library, but
|
|
3
|
+
// during development we still need explicit types so that `import type { ... } from
|
|
4
|
+
// "./find.svelte"` works in the workspace. Keeping a separate `.d.svelte.ts`
|
|
5
|
+
// file avoids having to preprocess the `.svelte` file just for the type checker.
|
|
6
|
+
|
|
2
7
|
import type { Component } from "svelte";
|
|
8
|
+
import type { i18n } from "i18next";
|
|
3
9
|
import type { DeepWritable } from "ts-essentials";
|
|
4
|
-
import type { t as i18nt } from "i18next";
|
|
5
10
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
export const DIRECTIONS = ["next", "previous"] as const;
|
|
12
|
+
export type Direction = (typeof DIRECTIONS)[number];
|
|
13
|
+
|
|
14
|
+
export interface Params {
|
|
15
|
+
readonly caseSensitive: boolean;
|
|
16
|
+
readonly findText: string;
|
|
17
|
+
readonly regex: boolean;
|
|
18
|
+
readonly wholeWord: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface Props {
|
|
22
|
+
/**
|
|
23
|
+
* Remember to bind `i18nt` if you want to use it in the component's markup.
|
|
24
|
+
* This is because the component expects a function that is already bound to
|
|
25
|
+
* the i18next instance, so it can be called directly without needing to reference
|
|
26
|
+
* the instance. By default, `i18nt` is set to `i18next.t.bind(i18next)`,
|
|
27
|
+
* so if you don't provide your own it will still work as expected.
|
|
28
|
+
*
|
|
29
|
+
* However, if you want to use a custom translation function or a different
|
|
30
|
+
* i18next instance, you can pass it in as a prop and bind it in your markup.
|
|
31
|
+
*/
|
|
32
|
+
readonly i18nt?: i18n["t"];
|
|
33
|
+
params?: DeepWritable<Params>;
|
|
34
|
+
readonly results?: string;
|
|
35
|
+
readonly onClose?: () => unknown;
|
|
36
|
+
readonly onFind?: (direction: Direction, params: Params) => unknown;
|
|
37
|
+
readonly onParamsChanged?: (params: Params) => unknown;
|
|
38
|
+
readonly initialFocus?: boolean;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface Exports {
|
|
42
|
+
readonly focus: () => void;
|
|
43
|
+
readonly blur: () => void;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type Bindings = "params";
|
|
47
|
+
|
|
48
|
+
// the default export is the component itself. during normal builds the
|
|
49
|
+
// compiler generates a class, so our declaration mirrors that by extending the
|
|
50
|
+
// generic `Component` type. this makes the value newable and mergeable with a
|
|
51
|
+
// namespace below.
|
|
52
|
+
declare class FindComponent extends Component<Props, Exports, Bindings> {}
|
|
23
53
|
export default FindComponent;
|
|
@@ -1,20 +1,56 @@
|
|
|
1
1
|
<svelte:options />
|
|
2
2
|
|
|
3
|
-
<script
|
|
4
|
-
|
|
5
|
-
import {
|
|
3
|
+
<script lang="ts" module>
|
|
4
|
+
// exported types and constants for library consumers
|
|
5
|
+
import { type i18n, default as i18next } from "i18next";
|
|
6
6
|
import type { DeepWritable } from "ts-essentials";
|
|
7
|
-
import {
|
|
7
|
+
import { consumeEvent, getKeyModifiers } from "../utils.js";
|
|
8
8
|
import { isEmpty, noop } from "lodash-es";
|
|
9
9
|
import { onMount } from "svelte";
|
|
10
10
|
import { setIcon } from "obsidian";
|
|
11
11
|
import { slide } from "svelte/transition";
|
|
12
|
+
|
|
13
|
+
export const DIRECTIONS = ["next", "previous"] as const;
|
|
14
|
+
export type Direction = (typeof DIRECTIONS)[number];
|
|
15
|
+
|
|
16
|
+
export interface Params {
|
|
17
|
+
readonly caseSensitive: boolean;
|
|
18
|
+
readonly findText: string;
|
|
19
|
+
readonly regex: boolean;
|
|
20
|
+
readonly wholeWord: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface Props {
|
|
24
|
+
/**
|
|
25
|
+
* Remember to bind `i18nt` if you want to use it in the component's markup.
|
|
26
|
+
* This is because the component expects a function that is already bound to
|
|
27
|
+
* the i18next instance, so it can be called directly without needing to reference
|
|
28
|
+
* the instance. By default, `i18nt` is set to `i18next.t.bind(i18next)`,
|
|
29
|
+
* so if you don't provide your own it will still work as expected.
|
|
30
|
+
*
|
|
31
|
+
* However, if you want to use a custom translation function or a different
|
|
32
|
+
* i18next instance, you can pass it in as a prop and bind it in your markup.
|
|
33
|
+
*/
|
|
34
|
+
readonly i18nt?: i18n["t"];
|
|
35
|
+
params?: DeepWritable<Params>;
|
|
36
|
+
readonly results?: string;
|
|
37
|
+
readonly onClose?: () => unknown;
|
|
38
|
+
readonly onFind?: (direction: Direction, params: Params) => unknown;
|
|
39
|
+
readonly onParamsChanged?: (params: Params) => unknown;
|
|
40
|
+
readonly initialFocus?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface Exports {
|
|
44
|
+
readonly focus: () => void;
|
|
45
|
+
readonly blur: () => void;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type Bindings = "params";
|
|
12
49
|
</script>
|
|
13
50
|
|
|
14
|
-
<script lang="
|
|
51
|
+
<script lang="ts">
|
|
15
52
|
const {
|
|
16
|
-
|
|
17
|
-
// `params` is bindable
|
|
53
|
+
i18nt = i18next.t.bind(i18next),
|
|
18
54
|
params = $bindable({
|
|
19
55
|
caseSensitive: false,
|
|
20
56
|
findText: "",
|
|
@@ -26,15 +62,7 @@
|
|
|
26
62
|
onFind = noop,
|
|
27
63
|
onParamsChanged = noop,
|
|
28
64
|
initialFocus = false,
|
|
29
|
-
}:
|
|
30
|
-
readonly i18n?: typeof i18nt;
|
|
31
|
-
params?: DeepWritable<Params>;
|
|
32
|
-
readonly results?: string;
|
|
33
|
-
readonly onClose?: () => unknown;
|
|
34
|
-
readonly onFind?: (direction: Direction, params: Params) => unknown;
|
|
35
|
-
readonly onParamsChanged?: (params: Params) => unknown;
|
|
36
|
-
readonly initialFocus?: boolean;
|
|
37
|
-
} = $props();
|
|
65
|
+
}: Props = $props();
|
|
38
66
|
|
|
39
67
|
$effect(() => {
|
|
40
68
|
onParamsChanged(params);
|
|
@@ -62,38 +90,38 @@
|
|
|
62
90
|
class={`document-search-button${
|
|
63
91
|
params.caseSensitive ? " mod-cta" : ""
|
|
64
92
|
}`}
|
|
65
|
-
aria-label={
|
|
93
|
+
aria-label={i18nt("components.find.case-sensitive")}
|
|
66
94
|
onclick={(event) => {
|
|
67
95
|
params.caseSensitive = !params.caseSensitive;
|
|
68
96
|
consumeEvent(event);
|
|
69
97
|
}}
|
|
70
|
-
use:setIcon={
|
|
98
|
+
use:setIcon={i18nt("asset:components.find.case-sensitive-icon")}
|
|
71
99
|
></button>
|
|
72
100
|
<button
|
|
73
101
|
type="button"
|
|
74
102
|
class={`document-search-button${params.wholeWord ? " mod-cta" : ""}`}
|
|
75
|
-
aria-label={
|
|
103
|
+
aria-label={i18nt("components.find.whole-word")}
|
|
76
104
|
onclick={(event) => {
|
|
77
105
|
params.wholeWord = !params.wholeWord;
|
|
78
106
|
consumeEvent(event);
|
|
79
107
|
}}
|
|
80
|
-
use:setIcon={
|
|
108
|
+
use:setIcon={i18nt("asset:components.find.whole-word-icon")}
|
|
81
109
|
></button>
|
|
82
110
|
<button
|
|
83
111
|
type="button"
|
|
84
112
|
class={`document-search-button${params.regex ? " mod-cta" : ""}`}
|
|
85
|
-
aria-label={
|
|
113
|
+
aria-label={i18nt("components.find.regex")}
|
|
86
114
|
onclick={(event) => {
|
|
87
115
|
params.regex = !params.regex;
|
|
88
116
|
consumeEvent(event);
|
|
89
117
|
}}
|
|
90
|
-
use:setIcon={
|
|
118
|
+
use:setIcon={i18nt("asset:components.find.regex-icon")}
|
|
91
119
|
></button>
|
|
92
120
|
</div>
|
|
93
121
|
<input
|
|
94
122
|
class="document-search-input"
|
|
95
123
|
type="text"
|
|
96
|
-
placeholder={
|
|
124
|
+
placeholder={i18nt("components.find.input-placeholder")}
|
|
97
125
|
role="searchbox"
|
|
98
126
|
bind:value={params.findText}
|
|
99
127
|
bind:this={inputElement}
|
|
@@ -112,33 +140,33 @@
|
|
|
112
140
|
<button
|
|
113
141
|
type="button"
|
|
114
142
|
class="document-search-button"
|
|
115
|
-
aria-label={
|
|
143
|
+
aria-label={i18nt("components.find.previous")}
|
|
116
144
|
onclick={(event) => {
|
|
117
145
|
onFind("previous", params);
|
|
118
146
|
consumeEvent(event);
|
|
119
147
|
}}
|
|
120
|
-
use:setIcon={
|
|
148
|
+
use:setIcon={i18nt("asset:components.find.previous-icon")}
|
|
121
149
|
></button>
|
|
122
150
|
<button
|
|
123
151
|
type="button"
|
|
124
152
|
class="document-search-button"
|
|
125
|
-
aria-label={
|
|
153
|
+
aria-label={i18nt("components.find.next")}
|
|
126
154
|
onclick={(event) => {
|
|
127
155
|
onFind("next", params);
|
|
128
156
|
consumeEvent(event);
|
|
129
157
|
}}
|
|
130
|
-
use:setIcon={
|
|
158
|
+
use:setIcon={i18nt("asset:components.find.next-icon")}
|
|
131
159
|
></button>
|
|
132
160
|
<div class="document-search-results" aria-live="polite">{results}</div>
|
|
133
161
|
<button
|
|
134
162
|
type="button"
|
|
135
163
|
class="document-search-close-button"
|
|
136
|
-
aria-label={
|
|
164
|
+
aria-label={i18nt("components.find.close")}
|
|
137
165
|
onclick={(event) => {
|
|
138
166
|
onClose();
|
|
139
167
|
consumeEvent(event);
|
|
140
168
|
}}
|
|
141
|
-
use:setIcon={
|
|
169
|
+
use:setIcon={i18nt("asset:components.find.close-icon")}
|
|
142
170
|
></button>
|
|
143
171
|
</div>
|
|
144
172
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,cAAc,MAAM,eAAe,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export * from "./settings-widgets.js";
|
|
|
21
21
|
export * from "./settings.js";
|
|
22
22
|
export * from "./source-maps.js";
|
|
23
23
|
export * from "./status-bar.js";
|
|
24
|
+
export * from "./svelte.svelte.js";
|
|
24
25
|
export * from "./typeof.js";
|
|
25
26
|
export * from "./types.js";
|
|
26
27
|
export * from "./utils.js";
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,mBAAmB,qBAAqB,CAAC;AACzC,mBAAmB,sBAAsB,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,mBAAmB,qBAAqB,CAAC;AACzC,mBAAmB,sBAAsB,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Write a value to the underlying `$state` store and return whatever the
|
|
3
|
+
* `$state` call returns (it may or may not be the same value).
|
|
4
|
+
*
|
|
5
|
+
* @param props - value to set
|
|
6
|
+
* @returns the result of invoking `$state(props)`
|
|
7
|
+
*/
|
|
8
|
+
export declare function svelteState<T>(props: T): T;
|
|
9
|
+
/**
|
|
10
|
+
* Read the current value from the `$state` store.
|
|
11
|
+
*
|
|
12
|
+
* @returns the stored value, or `undefined` if none has been set yet
|
|
13
|
+
*/
|
|
14
|
+
export declare function svelteState<T>(): T | undefined;
|
|
15
|
+
//# sourceMappingURL=svelte.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svelte.svelte.d.ts","sourceRoot":"","sources":["../../src/svelte.svelte.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;AAE5C;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC"}
|
package/dist/style.css
CHANGED
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"i18next-resources-to-backend": "^1.2.1",
|
|
19
19
|
"import-meta-resolve": "^4.1.0",
|
|
20
20
|
"lodash-es": "^4.17.21",
|
|
21
|
-
"lucide": "^0.
|
|
21
|
+
"lucide": "^0.575.0",
|
|
22
22
|
"lz-string": "^1.5.0",
|
|
23
23
|
"moment": "^2.30.1",
|
|
24
24
|
"monkey-around": "^3.0.0",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@commitlint/cli": "^20.4.1",
|
|
38
38
|
"@commitlint/config-conventional": "^20.4.1",
|
|
39
39
|
"@eslint/compat": "^2.0.2",
|
|
40
|
-
"@eslint/js": "^
|
|
40
|
+
"@eslint/js": "^10.0.1",
|
|
41
41
|
"@polyipseity/obsidian": "~1.4.11",
|
|
42
42
|
"@types/async-lock": "^1.4.2",
|
|
43
43
|
"@types/browser-util-inspect": "^0.2.4",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"esbuild-plugin-globals": "^0.2.0",
|
|
58
58
|
"esbuild-plugin-text-replace": "^1.3.0",
|
|
59
59
|
"esbuild-svelte": "^0.9.3",
|
|
60
|
-
"eslint": "^
|
|
60
|
+
"eslint": "^10.0.2",
|
|
61
61
|
"eslint-plugin-svelte": "^3.11.0",
|
|
62
62
|
"globals": "^17.2.0",
|
|
63
63
|
"happy-dom": "^20.6.1",
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"style": "dist/style.css",
|
|
144
144
|
"type": "module",
|
|
145
145
|
"types": "dist/src/index.d.ts",
|
|
146
|
-
"version": "1.
|
|
146
|
+
"version": "1.36.0",
|
|
147
147
|
"workspaces": [
|
|
148
148
|
"."
|
|
149
149
|
],
|