@sesamy/sesamy-components 1.11.2 → 2.1.0
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/README.md +6 -8
- package/dist/lib/sesamy-components.es.js +2481 -2447
- package/dist/lib/sesamy-components.umd.js +11 -11
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -40,13 +40,13 @@ The demo application is provided for development and testing of your components,
|
|
|
40
40
|
|
|
41
41
|
If you prefer, you can import the built web components from the `dist/` folder instead, by editing `demo/src/App.svelte` and replacing the `import '../../lib';` statement with `import '../../../dist/lib';` if you have the `bundleComponents` option enabled, or individually import your components with `import import '../../dist/MyComponent.wc.js';` otherwise.
|
|
42
42
|
|
|
43
|
-
You'll also have to make sure to run the `
|
|
43
|
+
You'll also have to make sure to run the `yarn build` script to generate the `dist/lib/` folder first.
|
|
44
44
|
|
|
45
45
|
## Building the library
|
|
46
46
|
|
|
47
|
-
The command `
|
|
47
|
+
The command `yarn build` will create the web components library in the `dist/lib/` folder. It creates both an ES module (`dist/lib/<your-lib>.js`) suitable for bundler (non-minified), a minified ES module (`dist/lib/<your-lib>.min.js`) and a regular UMD script (`dist/lib/<your-lib>.umd.js`).
|
|
48
48
|
|
|
49
|
-
The build is automatically called when executing `
|
|
49
|
+
The build is automatically called when executing `yarn publish` to distribute your library, thanks to the `prepublishOnly` script entry in `package.json`.
|
|
50
50
|
|
|
51
51
|
## Notes and limitations
|
|
52
52
|
|
|
@@ -58,7 +58,7 @@ Any props accepted by your web component are automatically transformed to elemen
|
|
|
58
58
|
|
|
59
59
|
```html
|
|
60
60
|
<script>
|
|
61
|
-
export let myvalue =
|
|
61
|
+
export let myvalue = 'Default';
|
|
62
62
|
</script>
|
|
63
63
|
```
|
|
64
64
|
|
|
@@ -74,16 +74,14 @@ Here's an example:
|
|
|
74
74
|
// MyComponent.wc.svelte
|
|
75
75
|
<svelte:options tag="my-component" />
|
|
76
76
|
<script>
|
|
77
|
-
import { get_current_component } from
|
|
77
|
+
import { get_current_component } from 'svelte/internal';
|
|
78
78
|
const component = get_current_component();
|
|
79
79
|
|
|
80
80
|
// example function for dispatching events
|
|
81
81
|
const dispatchEvent = (name, detail) =>
|
|
82
82
|
component.dispatchEvent(new CustomEvent(name, { detail }));
|
|
83
83
|
</script>
|
|
84
|
-
<button onclick={()
|
|
85
|
-
Click to dispatch event
|
|
86
|
-
</button>
|
|
84
|
+
<button onclick="{()" ="">dispatchEvent("test", "Hello!")}> Click to dispatch event</button>
|
|
87
85
|
```
|
|
88
86
|
|
|
89
87
|
## Create a new component
|