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 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" } diff --git a/src/InfiniteLoading.svelte b/src/InfiniteLoading.svelte index a43e958..8bbc710 100644 --- a/src/InfiniteLoading.svelte +++ b/src/InfiniteLoading.svelte @@ -161,6 +161,14 @@ 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 :('; + 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 +342,7 @@ {#if showNoResults}
- No results :( + {noResults}
{/if} @@ -342,7 +350,7 @@ {#if showNoMore}
- No more data :) + {noMore}
{/if} @@ -350,10 +358,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.