@sveltia/ui 0.27.6 → 0.27.8
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.
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
* @typedef {object} Props
|
|
12
12
|
* @property {any[]} items Item list.
|
|
13
13
|
* @property {string} itemKey Item key used for the `each` loop.
|
|
14
|
-
* @property {number} [itemChunkSize] Number of items to be loaded at once.
|
|
15
|
-
* @property {Snippet<[any]>} renderItem Snippet to render each item.
|
|
14
|
+
* @property {number} [itemChunkSize] Number of items to be loaded at once. Defaults to 25.
|
|
15
|
+
* @property {Snippet<[any, number]>} renderItem Snippet to render each item. The snippet receives
|
|
16
|
+
* the item and its index as parameters.
|
|
16
17
|
*/
|
|
17
18
|
|
|
18
19
|
/** @type {Props} */
|
|
@@ -50,8 +51,8 @@
|
|
|
50
51
|
});
|
|
51
52
|
</script>
|
|
52
53
|
|
|
53
|
-
{#each items.slice(0, loadedItemSize) as item (item[itemKey])}
|
|
54
|
-
{@render renderItem(item)}
|
|
54
|
+
{#each items.slice(0, loadedItemSize) as item, index (item[itemKey] ?? index)}
|
|
55
|
+
{@render renderItem(item, index)}
|
|
55
56
|
{/each}
|
|
56
57
|
|
|
57
58
|
{#if loading}
|
|
@@ -17,13 +17,14 @@ declare const InfiniteScroll: import("svelte").Component<{
|
|
|
17
17
|
*/
|
|
18
18
|
itemKey: string;
|
|
19
19
|
/**
|
|
20
|
-
* Number of items to be loaded at once.
|
|
20
|
+
* Number of items to be loaded at once. Defaults to 25.
|
|
21
21
|
*/
|
|
22
22
|
itemChunkSize?: number | undefined;
|
|
23
23
|
/**
|
|
24
|
-
* Snippet to render each item.
|
|
24
|
+
* Snippet to render each item. The snippet receives
|
|
25
|
+
* the item and its index as parameters.
|
|
25
26
|
*/
|
|
26
|
-
renderItem: Snippet<[any]>;
|
|
27
|
+
renderItem: Snippet<[any, number]>;
|
|
27
28
|
}, {}, "">;
|
|
28
29
|
type Props = {
|
|
29
30
|
/**
|
|
@@ -35,12 +36,13 @@ type Props = {
|
|
|
35
36
|
*/
|
|
36
37
|
itemKey: string;
|
|
37
38
|
/**
|
|
38
|
-
* Number of items to be loaded at once.
|
|
39
|
+
* Number of items to be loaded at once. Defaults to 25.
|
|
39
40
|
*/
|
|
40
41
|
itemChunkSize?: number | undefined;
|
|
41
42
|
/**
|
|
42
|
-
* Snippet to render each item.
|
|
43
|
+
* Snippet to render each item. The snippet receives
|
|
44
|
+
* the item and its index as parameters.
|
|
43
45
|
*/
|
|
44
|
-
renderItem: Snippet<[any]>;
|
|
46
|
+
renderItem: Snippet<[any, number]>;
|
|
45
47
|
};
|
|
46
48
|
import type { Snippet } from 'svelte';
|
|
@@ -413,14 +413,9 @@ export const convertMarkdownToLexical = async (editor, value) => {
|
|
|
413
413
|
* @param {LexicalEditor} editor Editor instance.
|
|
414
414
|
* @returns {Promise<void>} Nothing.
|
|
415
415
|
*/
|
|
416
|
-
export const focusEditor = async (editor) =>
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
return new Promise((resolve) => {
|
|
421
|
-
editor.focus(async () => {
|
|
422
|
-
await sleep(100);
|
|
416
|
+
export const focusEditor = async (editor) =>
|
|
417
|
+
new Promise((resolve) => {
|
|
418
|
+
editor.focus(() => {
|
|
423
419
|
resolve(undefined);
|
|
424
420
|
});
|
|
425
421
|
});
|
|
426
|
-
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltia/ui",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -48,30 +48,30 @@
|
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@sveltejs/adapter-auto": "^6.0.1",
|
|
51
|
-
"@sveltejs/kit": "^2.
|
|
51
|
+
"@sveltejs/kit": "^2.27.0",
|
|
52
52
|
"@sveltejs/package": "^2.4.0",
|
|
53
53
|
"@sveltejs/vite-plugin-svelte": "6.1.0",
|
|
54
|
-
"cspell": "^9.
|
|
54
|
+
"cspell": "^9.2.0",
|
|
55
55
|
"eslint": "^8.57.1",
|
|
56
56
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
57
|
-
"eslint-config-prettier": "^10.1.
|
|
57
|
+
"eslint-config-prettier": "^10.1.8",
|
|
58
58
|
"eslint-plugin-import": "^2.32.0",
|
|
59
|
-
"eslint-plugin-jsdoc": "^
|
|
59
|
+
"eslint-plugin-jsdoc": "^52.0.2",
|
|
60
60
|
"eslint-plugin-svelte": "^2.46.1",
|
|
61
61
|
"postcss": "^8.5.6",
|
|
62
62
|
"postcss-html": "^1.8.0",
|
|
63
63
|
"prettier": "^3.6.2",
|
|
64
64
|
"prettier-plugin-svelte": "^3.4.0",
|
|
65
65
|
"sass": "^1.89.2",
|
|
66
|
-
"stylelint": "^16.
|
|
66
|
+
"stylelint": "^16.23.0",
|
|
67
67
|
"stylelint-config-recommended-scss": "^15.0.1",
|
|
68
68
|
"stylelint-scss": "^6.12.1",
|
|
69
|
-
"svelte": "5.
|
|
70
|
-
"svelte-check": "^4.
|
|
69
|
+
"svelte": "5.37.3",
|
|
70
|
+
"svelte-check": "^4.3.1",
|
|
71
71
|
"svelte-i18n": "^4.0.1",
|
|
72
72
|
"svelte-preprocess": "^6.0.3",
|
|
73
73
|
"tslib": "^2.8.1",
|
|
74
|
-
"vite": "^7.0.
|
|
74
|
+
"vite": "^7.0.6",
|
|
75
75
|
"vitest": "^3.2.4"
|
|
76
76
|
},
|
|
77
77
|
"exports": {
|