@appsemble/preact 0.20.11 → 0.20.14
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 +7 -10
- package/jest.config.js +3 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
#  Appsemble Preact SDK
|
|
2
2
|
|
|
3
3
|
> Build your own blocks using Preact
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@appsemble/preact)
|
|
6
|
-
[](https://gitlab.com/appsemble/appsemble/-/releases/0.20.14)
|
|
7
|
+
[](https://codecov.io/gl/appsemble/appsemble)
|
|
8
8
|
[](https://prettier.io)
|
|
9
9
|
|
|
10
10
|
## Installation
|
|
@@ -27,9 +27,8 @@ called when the block is done rendering. Actions won’t be finalized for any bl
|
|
|
27
27
|
until all blocks are ready.
|
|
28
28
|
|
|
29
29
|
```tsx
|
|
30
|
-
import { useEffect } from 'preact/hooks';
|
|
31
|
-
|
|
32
30
|
import { bootstrap } from '@appsemble/preact';
|
|
31
|
+
import { useEffect } from 'preact/hooks';
|
|
33
32
|
|
|
34
33
|
bootstrap(({ actions }) => {
|
|
35
34
|
useEffect(() => {
|
|
@@ -53,9 +52,8 @@ Get the block context. This is available for components that are rendered within
|
|
|
53
52
|
component rendered by [`bootstrap`](#bootstrap)
|
|
54
53
|
|
|
55
54
|
```tsx
|
|
56
|
-
import { VNode } from 'preact';
|
|
57
|
-
|
|
58
55
|
import { useBlock } from '@appsemble/preact';
|
|
56
|
+
import { VNode } from 'preact';
|
|
59
57
|
|
|
60
58
|
export function MyButton(): VNode {
|
|
61
59
|
const { actions } = useBlock();
|
|
@@ -73,9 +71,8 @@ export function MyButton(): VNode {
|
|
|
73
71
|
This helper component renders a translated message ID.
|
|
74
72
|
|
|
75
73
|
```tsx
|
|
76
|
-
import { VNode } from 'preact';
|
|
77
|
-
|
|
78
74
|
import { FormattedMessage } from '@appsemble/preact';
|
|
75
|
+
import { VNode } from 'preact';
|
|
79
76
|
|
|
80
77
|
interface MyButtonProps {
|
|
81
78
|
name: string;
|
|
@@ -92,5 +89,5 @@ export function MyButton({ name }: MyButtonProps): VNode {
|
|
|
92
89
|
|
|
93
90
|
## License
|
|
94
91
|
|
|
95
|
-
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.
|
|
92
|
+
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.20.14/LICENSE.md) ©
|
|
96
93
|
[Appsemble](https://appsemble.com)
|
package/jest.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appsemble/preact",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.14",
|
|
4
4
|
"description": "Build your own blocks using Preact",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"license": "LGPL-3.0-only",
|
|
25
25
|
"author": "Appsemble <info@appsemble.com> (https://appsemble.com)",
|
|
26
26
|
"sideEffects": false,
|
|
27
|
+
"type": "module",
|
|
27
28
|
"files": [
|
|
28
29
|
"**/*.d.ts",
|
|
29
30
|
"**/*.js",
|
|
@@ -31,10 +32,10 @@
|
|
|
31
32
|
],
|
|
32
33
|
"scripts": {
|
|
33
34
|
"prepack": "tsc --noEmit false",
|
|
34
|
-
"test": "jest"
|
|
35
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules jest"
|
|
35
36
|
},
|
|
36
37
|
"peerDependencies": {
|
|
37
|
-
"@appsemble/sdk": "0.20.
|
|
38
|
+
"@appsemble/sdk": "0.20.14",
|
|
38
39
|
"preact": "^10"
|
|
39
40
|
}
|
|
40
41
|
}
|