@builder.io/sdk-qwik 0.0.34 → 0.0.35
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 +35 -1
- package/package.json +1 -8
- package/lib/index.qwik.cjs +0 -2979
- package/lib/index.qwik.mjs +0 -2951
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ Add Qwik SDK code to a particular route (such as `src/routes/index.tsx`)
|
|
|
32
32
|
```typscript
|
|
33
33
|
import { component$, Resource, useResource$ } from "@builder.io/qwik";
|
|
34
34
|
import { useLocation } from "@builder.io/qwik-city";
|
|
35
|
-
import { getContent, RenderContent, getBuilderSearchParams } from "@builder.io/sdk-qwik";
|
|
35
|
+
import { getContent, RenderContent, RegisteredComponent, getBuilderSearchParams } from "@builder.io/sdk-qwik";
|
|
36
36
|
|
|
37
37
|
export const BUILDER_PUBLIC_API_KEY = "YOUR_API_KEY_GOES_HERE"; // ggignore
|
|
38
38
|
export default component$(() => {
|
|
@@ -57,11 +57,45 @@ export default component$(() => {
|
|
|
57
57
|
model="page"
|
|
58
58
|
content={content}
|
|
59
59
|
apiKey={BUILDER_PUBLIC_API_KEY}
|
|
60
|
+
// Optional: pass in a custom component registry
|
|
61
|
+
// customComponents={CUSTOM_COMPONENTS}
|
|
60
62
|
/>
|
|
61
63
|
)}
|
|
62
64
|
/>
|
|
63
65
|
);
|
|
64
66
|
});
|
|
67
|
+
|
|
68
|
+
// OPTIONAL: need to add custom components to your Qwik app
|
|
69
|
+
|
|
70
|
+
export const MyFunComponent = component$((props: { text: string }) => {
|
|
71
|
+
const state = useStore({
|
|
72
|
+
count: 0,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<div>
|
|
77
|
+
<h3>{props.text.toUpperCase()}</h3>
|
|
78
|
+
<p>{state.count}</p>
|
|
79
|
+
<button onClick$={() => state.count++}>Click me</button>
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
85
|
+
{
|
|
86
|
+
component: MyFunComponent,
|
|
87
|
+
name: 'MyFunComponent',
|
|
88
|
+
builtIn: true,
|
|
89
|
+
inputs: [
|
|
90
|
+
{
|
|
91
|
+
name: 'text',
|
|
92
|
+
type: 'string',
|
|
93
|
+
defaultValue: 'Hello world',
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
];
|
|
98
|
+
|
|
65
99
|
```
|
|
66
100
|
|
|
67
101
|
## Mitosis
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/sdk-qwik",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35",
|
|
4
4
|
"description": "Builder.io Qwik SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.qwik.cjs",
|
|
@@ -19,13 +19,6 @@
|
|
|
19
19
|
"release:patch": "yarn run build && npm version patch --no-git-tag-version && npm publish --access public",
|
|
20
20
|
"release:dev": "yarn run build && npm version prerelease --no-git-tag-version && npm publish --tag latest --access public"
|
|
21
21
|
},
|
|
22
|
-
"files": [
|
|
23
|
-
"README.md",
|
|
24
|
-
"package.json",
|
|
25
|
-
"types-hacks.d.ts",
|
|
26
|
-
"types",
|
|
27
|
-
"lib"
|
|
28
|
-
],
|
|
29
22
|
"devDependencies": {
|
|
30
23
|
"@types/node": "latest",
|
|
31
24
|
"typescript": "^4",
|