nanosplash 3.0.0 → 3.0.2
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/.github/workflows/ci.yml +50 -44
- package/.github/workflows/vitepress.yml +69 -0
- package/.prettierignore +1 -0
- package/.prettierrc +10 -10
- package/LICENSE +21 -0
- package/README.md +14 -41
- package/bun.lockb +0 -0
- package/coverage/DomUtilities.ts.html +568 -0
- package/coverage/Service.ts.html +718 -0
- package/coverage/Splash.ts.html +448 -0
- package/coverage/SplashQueue.ts.html +232 -0
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/clover.xml +560 -0
- package/coverage/coverage-final.json +5 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +161 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +196 -0
- package/dist/cjs/ns.cjs +2 -0
- package/dist/es/ns.js +342 -0
- package/dist/iife/ns.iife.js +2 -0
- package/docs/.vitepress/config.ts +75 -0
- package/docs/.vitepress/theme/css/style.css +157 -0
- package/docs/.vitepress/theme/index.ts +16 -0
- package/docs/.vitepress/theme/vue/Card.vue +31 -0
- package/docs/.vitepress/theme/vue/CardGrid.vue +17 -0
- package/docs/.vitepress/theme/vue/Exe.vue +86 -0
- package/docs/.vitepress/theme/vue/PlayGround.vue +50 -0
- package/docs/api/doc/hide.md +69 -0
- package/docs/api/doc/show.md +47 -0
- package/docs/api/start/features.md +17 -0
- package/docs/api/start/install.md +53 -0
- package/docs/api/start/playground.md +11 -0
- package/docs/api/start/usage.md +25 -0
- package/docs/index.md +30 -0
- package/package.json +86 -66
- package/src/style/ns.sass +95 -0
- package/src/ts/core/DomUtilities.ts +161 -0
- package/src/ts/core/Service.ts +211 -0
- package/src/ts/core/{Nanosplash/interfaces/NanosplashAPI.ts → ServiceInterface.ts} +18 -10
- package/src/ts/core/Splash.ts +121 -0
- package/src/ts/core/SplashInterface.ts +46 -0
- package/src/ts/core/SplashQueue.ts +49 -0
- package/src/ts/main.ts +9 -0
- package/src/ts/types/Types.ts +3 -0
- package/src/ts/types/global.d.ts +14 -0
- package/src/vite-env.d.ts +0 -8
- package/tests/DomUtilities.spec.ts +117 -0
- package/tests/Guid.spec.ts +5 -5
- package/tests/Service.spec.ts +198 -0
- package/tests/Splash.spec.ts +64 -0
- package/tests/TestUtilities.ts +48 -0
- package/tsconfig.json +21 -20
- package/vite.config.ts +14 -22
- package/dist/main.css +0 -1
- package/dist/ns.cjs.js +0 -1
- package/dist/ns.es.js +0 -330
- package/dist/ns.iife.js +0 -2
- package/index.html +0 -52
- package/src/main.ts +0 -8
- package/src/sass/ns.sass +0 -86
- package/src/ts/core/Nanosplash/Nanosplash.ts +0 -97
- package/src/ts/core/Nanosplash/interfaces/NanosplashInterface.ts +0 -42
- package/src/ts/core/Nanosplash/repositories/NanosplashRepository.ts +0 -178
- package/src/ts/core/Nanosplash/services/NanosplashService.ts +0 -222
- package/src/ts/types/Alias.d.ts +0 -1
- package/src/ts/types/Nanosplash.d.ts +0 -18
- package/src/ts/types/NanosplashService.d.ts +0 -1
- package/src/ts/util/Guid.ts +0 -13
- package/src/ts/util/Stack.ts +0 -73
- package/tests/Nanosplash.spec.ts +0 -64
- package/tests/NanosplashRepository.spec.ts +0 -91
- package/tests/NanosplashService.spec.ts +0 -119
- package/tests/Stack.spec.ts +0 -56
package/.github/workflows/ci.yml
CHANGED
|
@@ -1,48 +1,54 @@
|
|
|
1
|
-
name:
|
|
1
|
+
name: Main Github Actions Workflow
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- production
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- production
|
|
10
10
|
|
|
11
11
|
jobs:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
12
|
+
build-and-test:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout
|
|
17
|
+
uses: actions/checkout@v3
|
|
18
|
+
|
|
19
|
+
- name: Install Bun
|
|
20
|
+
uses: oven-sh/setup-bun@v1
|
|
21
|
+
|
|
22
|
+
- name: Setup Node.js
|
|
23
|
+
uses: actions/setup-node@v3
|
|
24
|
+
with:
|
|
25
|
+
node-version: 20
|
|
26
|
+
|
|
27
|
+
- name: Set up Git and update production branch
|
|
28
|
+
run: |
|
|
29
|
+
git config --global user.name "GitHub Actions"
|
|
30
|
+
git config --global user.email "actions@github.com"
|
|
31
|
+
git checkout production
|
|
32
|
+
git fetch
|
|
33
|
+
git pull --no-rebase
|
|
34
|
+
|
|
35
|
+
- name: Setup Pages
|
|
36
|
+
uses: actions/configure-pages@v3
|
|
37
|
+
|
|
38
|
+
- name: Install dependencies
|
|
39
|
+
run: bun install
|
|
40
|
+
|
|
41
|
+
- name: Build (Vite)
|
|
42
|
+
run: bun run build
|
|
43
|
+
|
|
44
|
+
- name: Test (Vitest)
|
|
45
|
+
run: bun run test
|
|
46
|
+
|
|
47
|
+
- name: Generate Code Coverage (Vitest)
|
|
48
|
+
run: bun run coverage
|
|
49
|
+
|
|
50
|
+
- name: Commit and push changes
|
|
51
|
+
run: |
|
|
52
|
+
git add .
|
|
53
|
+
git commit --allow-empty -m "Build, test, and coverage report"
|
|
54
|
+
git push
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Sample workflow for building and deploying a VitePress site to GitHub Pages
|
|
2
|
+
#
|
|
3
|
+
name: Deploy VitePress site to Pages
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
|
|
7
|
+
# using the `master` branch as the default branch.
|
|
8
|
+
push:
|
|
9
|
+
branches: [production]
|
|
10
|
+
pull_request:
|
|
11
|
+
branches: [production]
|
|
12
|
+
|
|
13
|
+
# Allows you to run this workflow manually from the Actions tab
|
|
14
|
+
workflow_dispatch:
|
|
15
|
+
|
|
16
|
+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
|
17
|
+
permissions:
|
|
18
|
+
contents: read
|
|
19
|
+
pages: write
|
|
20
|
+
id-token: write
|
|
21
|
+
|
|
22
|
+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
|
23
|
+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
|
24
|
+
concurrency:
|
|
25
|
+
group: pages
|
|
26
|
+
cancel-in-progress: false
|
|
27
|
+
|
|
28
|
+
jobs:
|
|
29
|
+
# Build job
|
|
30
|
+
build:
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
steps:
|
|
33
|
+
- name: Checkout
|
|
34
|
+
uses: actions/checkout@v3
|
|
35
|
+
with:
|
|
36
|
+
fetch-depth: 0 # Not needed if lastUpdated is not enabled
|
|
37
|
+
# - uses: pnpm/action-setup@v2 # Uncomment this if you're using pnpm
|
|
38
|
+
- name: Install Bun
|
|
39
|
+
uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
|
|
40
|
+
- name: Setup Node
|
|
41
|
+
uses: actions/setup-node@v3
|
|
42
|
+
with:
|
|
43
|
+
node-version: 20
|
|
44
|
+
cache: yarn
|
|
45
|
+
- name: Setup Pages
|
|
46
|
+
uses: actions/configure-pages@v3
|
|
47
|
+
- name: Install dependencies
|
|
48
|
+
run: yarn install
|
|
49
|
+
- name: Build with VitePress
|
|
50
|
+
run: |
|
|
51
|
+
bun run docs:build
|
|
52
|
+
touch docs/.vitepress/dist/.nojekyll
|
|
53
|
+
- name: Upload artifact
|
|
54
|
+
uses: actions/upload-pages-artifact@v2
|
|
55
|
+
with:
|
|
56
|
+
path: docs/.vitepress/dist
|
|
57
|
+
|
|
58
|
+
# Deployment job
|
|
59
|
+
deploy:
|
|
60
|
+
environment:
|
|
61
|
+
name: github-pages
|
|
62
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
63
|
+
needs: build
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
name: Deploy
|
|
66
|
+
steps:
|
|
67
|
+
- name: Deploy to GitHub Pages
|
|
68
|
+
id: deployment
|
|
69
|
+
uses: actions/deploy-pages@v2
|
package/.prettierignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*.sass
|
package/.prettierrc
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
"tabWidth": 4,
|
|
3
|
+
"useTabs": true,
|
|
4
|
+
"singleQuote": true,
|
|
5
|
+
"bracketSpacing": true,
|
|
6
|
+
"jsxSingleQuote": true,
|
|
7
|
+
"endOfLine": "lf",
|
|
8
|
+
"trailingComma": "es5",
|
|
9
|
+
"arrowParens": "avoid",
|
|
10
|
+
"semi": false,
|
|
11
|
+
"printWidth": 80
|
|
12
12
|
}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Isak Hauge
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,57 +1,30 @@
|
|
|
1
1
|
# Nanosplash
|
|
2
2
|
|
|
3
|
-
###
|
|
3
|
+
### The tiny loading screen for web artisans
|
|
4
4
|
|
|
5
5
|
<br>
|
|
6
6
|
|
|
7
|
-
[](https://github.com/isakhauge/nanosplash/actions/workflows/ci.yml)
|
|
7
|
+
[](https://github.com/isakhauge/nanosplash/actions/workflows/ci.yml)  [](./coverage/index.html) [](https://github.com/ellerbrock/typescript-badges/) [](https://github.com/isakhauge/nanosplash/commits/production)
|
|
8
8
|
|
|
9
9
|
<br>
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
> 📣 **New in 3.0.2**
|
|
12
|
+
>
|
|
13
|
+
> - CSS is included inside the ES and CJS bundles 🎉
|
|
14
|
+
> - The `ns.hide` method will now delete splash screens in a FIFO sequence.
|
|
12
15
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
```html
|
|
16
|
-
<script src="https://unpkg.com/nanosplash/dist/ns.iife.js">
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Display loading screen
|
|
20
|
-
|
|
21
|
-
Display spinning wheel only.
|
|
22
|
-
|
|
23
|
-
```js
|
|
24
|
-
ns.show()
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Display with text.
|
|
28
|
-
|
|
29
|
-
```js
|
|
30
|
-
ns.show('Loading assets')
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Display inside another element.
|
|
34
|
-
|
|
35
|
-
```js
|
|
36
|
-
ns.showInside('Loading table', '#my-table')
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Hide loading screen
|
|
40
|
-
|
|
41
|
-
Hide the last loading screen (LIFO).
|
|
16
|
+
## Usage
|
|
42
17
|
|
|
43
18
|
```js
|
|
19
|
+
// Fullscreen splash screen
|
|
20
|
+
ns.show('Loading')
|
|
44
21
|
ns.hide()
|
|
45
|
-
```
|
|
46
22
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
ns.hideInside('#my-table')
|
|
23
|
+
// Splash screen inside a DOM element
|
|
24
|
+
ns.showInside('#my-div', 'Loading')
|
|
25
|
+
ns.hide()
|
|
51
26
|
```
|
|
52
27
|
|
|
53
|
-
|
|
28
|
+
## Documentation
|
|
54
29
|
|
|
55
|
-
|
|
56
|
-
ns.hideAll()
|
|
57
|
-
```
|
|
30
|
+
[isakhauge.github.io/nanosplash/](https://isakhauge.github.io/nanosplash/)
|
package/bun.lockb
ADDED
|
Binary file
|