@tsparticles/stencil 4.0.5
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/LICENSE +21 -0
- package/README.md +73 -0
- package/dist/cjs/Container-DFed5jPA.js +3556 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/index-BY5-j3YK.js +1143 -0
- package/dist/cjs/index-Dwz1YgEM.js +1229 -0
- package/dist/cjs/index.cjs.js +9 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/stencil-particles.cjs.entry.js +76 -0
- package/dist/cjs/tsparticlesstencil.cjs.js +25 -0
- package/dist/collection/collection-manifest.json +13 -0
- package/dist/collection/components/stencil-particles/stencil-particles.js +144 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/initParticlesEngine.js +38 -0
- package/dist/esm/Container-Di-pVL5B.js +3554 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/index-BzK79uqU.js +1223 -0
- package/dist/esm/index-CPcFDf6d.js +1052 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/stencil-particles.entry.js +74 -0
- package/dist/esm/tsparticlesstencil.js +21 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/tsparticlesstencil/index.esm.js +1 -0
- package/dist/tsparticlesstencil/p-2a10755a.entry.js +1 -0
- package/dist/tsparticlesstencil/p-BzK79uqU.js +2 -0
- package/dist/tsparticlesstencil/p-C6McIuSD.js +1 -0
- package/dist/tsparticlesstencil/p-DQuL1Twl.js +1 -0
- package/dist/tsparticlesstencil/p-x9G6hxBi.js +1 -0
- package/dist/tsparticlesstencil/tsparticlesstencil.esm.js +1 -0
- package/dist/types/components/stencil-particles/stencil-particles.d.ts +16 -0
- package/dist/types/components.d.ts +52 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/initParticlesEngine.d.ts +5 -0
- package/dist/types/stencil-public-runtime.d.ts +1860 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +64 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Matteo Bruni
|
|
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
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
[](https://particles.js.org)
|
|
2
|
+
|
|
3
|
+
# @tsparticles/stencil
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@tsparticles/stencil) [](https://www.npmjs.com/package/@tsparticles/stencil) [](https://github.com/sponsors/matteobruni)
|
|
6
|
+
|
|
7
|
+
Official [tsParticles](https://github.com/tsparticles/tsparticles) Stencil wrapper.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```shell
|
|
12
|
+
npm install @tsparticles/stencil @tsparticles/engine
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
or
|
|
16
|
+
|
|
17
|
+
```shell
|
|
18
|
+
yarn add @tsparticles/stencil @tsparticles/engine
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
If you need prebuilt features, install one loader package too, for example `@tsparticles/slim`.
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
Register Stencil custom elements once:
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { defineCustomElements } from "@tsparticles/stencil/loader";
|
|
29
|
+
|
|
30
|
+
defineCustomElements();
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Use the component in your app and initialize features with the `init` callback:
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
import { h } from "@stencil/core";
|
|
37
|
+
import { loadSlim } from "@tsparticles/slim";
|
|
38
|
+
|
|
39
|
+
export const Background = () => (
|
|
40
|
+
<stencil-particles
|
|
41
|
+
container-id="tsparticles"
|
|
42
|
+
init={async engine => {
|
|
43
|
+
await loadSlim(engine);
|
|
44
|
+
}}
|
|
45
|
+
options={{
|
|
46
|
+
fullScreen: { enable: false },
|
|
47
|
+
particles: {
|
|
48
|
+
move: { enable: true },
|
|
49
|
+
number: { value: 80 }
|
|
50
|
+
}
|
|
51
|
+
}}
|
|
52
|
+
></stencil-particles>
|
|
53
|
+
);
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
You can also load options from URL:
|
|
57
|
+
|
|
58
|
+
```html
|
|
59
|
+
|
|
60
|
+
<stencil-particles container-id="tsparticles" url="/assets/default.json"></stencil-particles>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Props
|
|
64
|
+
|
|
65
|
+
- `container-id`: container id used by `tsParticles.load`
|
|
66
|
+
- `options`: inline particles options (`ISourceOptions`)
|
|
67
|
+
- `url`: path/url to a JSON options file
|
|
68
|
+
- `init`: async callback used to register plugins on the same engine instance used by the component
|
|
69
|
+
|
|
70
|
+
## Monorepo references
|
|
71
|
+
|
|
72
|
+
- Package folder: <https://github.com/tsparticles/tsparticles/tree/main/wrappers/stencil>
|
|
73
|
+
- Demo app: <https://github.com/tsparticles/tsparticles/tree/main/demo/stencil>
|