From 7f3f84dc36734129b59a85efe5cec27aaff16be6 Mon Sep 17 00:00:00 2001 From: cokejoke Date: Thu, 9 Mar 2023 07:43:54 +0100 Subject: [PATCH 1/4] :sparkles: Add missing props noResults, noMore, error & a new one errorButton --- src/InfiniteLoading.svelte | 13 +++++++++---- types/index.d.ts | 11 ++++++++--- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/InfiniteLoading.svelte b/src/InfiniteLoading.svelte index a43e958..332fd7a 100644 --- a/src/InfiniteLoading.svelte +++ b/src/InfiniteLoading.svelte @@ -161,6 +161,11 @@ export let forceUseInfiniteWrapper = false; export let identifier = +new Date(); + export let noResults = 'No results :('; + export let noMore = 'No more data :)'; + export let error = 'Oops, something went wrong :('; + export let errorButton = 'Retry'; + let isFirstLoad = true; // save the current loading whether it is the first loading let status = STATUS.READY; let mounted = false; @@ -334,7 +339,7 @@ {#if showNoResults}
- No results :( + {noResults}
{/if} @@ -342,7 +347,7 @@ {#if showNoMore}
- No more data :) + {noMore}
{/if} @@ -350,10 +355,10 @@ {#if showError}
- Oops, something went wrong :( + {error}
diff --git a/types/index.d.ts b/types/index.d.ts index f842802..39062a9 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -66,18 +66,23 @@ export interface InfiniteLoadingSlots { * This message will be displayed when there is no data, which means that we have called the InfiniteEvent.details.complete * method, before ever calling the InfiniteEvent.details.loaded method. */ - noResults: {}; + noResults: string; /** * This message will be displayed when there is no more data, which means we have called the InfiniteEvent.details.loaded * method at least once before calling the InfiniteEvent.details.complete method. */ - noMore: {}; + noMore: string; /** * This message will be displayed when loading has failed, which means that we have called the InfiniteEvent.details.error method. */ - error: { attemptLoad: () => void }; + error: string; + + /** + * This is a Part of the error message. It will change the button text, wich means that we have called the InfiniteEvent.details.error method. + */ + errorButton: string; /** * This slot will be displayed when loading data, you can also use your own spinner here. From 957699e37e357813ddbbd9356139e49ce6fba845 Mon Sep 17 00:00:00 2001 From: cokejoke Date: Thu, 9 Mar 2023 07:47:08 +0100 Subject: [PATCH 2/4] :sparkles: Add comment --- src/InfiniteLoading.svelte | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/InfiniteLoading.svelte b/src/InfiniteLoading.svelte index 332fd7a..8bbc710 100644 --- a/src/InfiniteLoading.svelte +++ b/src/InfiniteLoading.svelte @@ -161,6 +161,9 @@ export let forceUseInfiniteWrapper = false; export let identifier = +new Date(); + /** + * Slot props + */ export let noResults = 'No results :('; export let noMore = 'No more data :)'; export let error = 'Oops, something went wrong :('; From 939184730daae371dfc3c9f8c42c08c641f54889 Mon Sep 17 00:00:00 2001 From: cokejoke Date: Thu, 9 Mar 2023 08:37:02 +0100 Subject: [PATCH 3/4] :zap: Updated workflow --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 242b780..5c4d6e5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,6 +53,6 @@ jobs: - name: Publish 🚀 if: steps.check.outputs.changed == 'true' - run: npm publish + run: npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file From ed85fbfe558973ae24e06b6056f658126eced5e0 Mon Sep 17 00:00:00 2001 From: cokejoke Date: Thu, 9 Mar 2023 08:38:53 +0100 Subject: [PATCH 4/4] 1.3.9 --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 673c067..3adc265 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "svelte-infinite-loading", - "version": "1.3.8", + "name": "@cokejoke/svelte-infinite-loading", + "version": "1.3.9", "description": "An infinite scroll component for Svelte apps", "svelte": "src/index.js", "main": "dist/svelte-infinite-loading.js", @@ -41,17 +41,17 @@ "svelte-components" ], "author": { - "name": "Skayo", + "name": "cokejoke", "email": "contact@skayo.dev", "url": "https://skayo.dev" }, "license": "MIT", "repository": { "type": "git", - "url": "git+https://github.com/Skayo/svelte-infinite-loading.git" + "url": "git+https://github.com/cokejoke/svelte-infinite-loading.git" }, "bugs": { - "url": "https://github.com/Skayo/svelte-infinite-loading/issues" + "url": "https://github.com/cokejoke/svelte-infinite-loading/issues" }, - "homepage": "https://github.com/Skayo/svelte-infinite-loading" + "homepage": "https://github.com/cokejoke/svelte-infinite-loading" }