@builder.io/sdk-qwik 0.0.8 → 0.0.9
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 +65 -2
- package/lib/index.qwik.cjs +104 -7
- package/lib/index.qwik.mjs +104 -7
- package/package.json +1 -1
- package/src/blocks/button/button.jsx +197 -0
- package/src/blocks/button/component-info.js +41 -0
- package/src/blocks/columns/columns.jsx +267 -0
- package/src/blocks/columns/component-info.js +242 -0
- package/src/blocks/custom-code/component-info.js +31 -0
- package/src/blocks/custom-code/custom-code.jsx +130 -0
- package/src/blocks/embed/component-info.js +44 -0
- package/src/blocks/embed/embed.jsx +130 -0
- package/src/blocks/embed/helpers.js +9 -0
- package/src/blocks/form/builder-blocks.jsx +86 -0
- package/src/blocks/form/component-info.js +262 -0
- package/src/blocks/form/form.jsx +782 -0
- package/src/blocks/fragment/component-info.js +11 -0
- package/src/blocks/fragment/fragment.jsx +59 -0
- package/src/blocks/image/component-info.js +151 -0
- package/src/blocks/image/image.helpers.js +48 -0
- package/src/blocks/image/image.jsx +554 -0
- package/src/blocks/img/component-info.js +20 -0
- package/src/blocks/img/img.jsx +76 -0
- package/src/blocks/input/component-info.js +74 -0
- package/src/blocks/input/input.jsx +87 -0
- package/src/blocks/raw-text/component-info.js +16 -0
- package/src/blocks/raw-text/raw-text.jsx +53 -0
- package/src/blocks/section/component-info.js +49 -0
- package/src/blocks/section/section.jsx +97 -0
- package/src/blocks/select/component-info.js +59 -0
- package/src/blocks/select/select.jsx +149 -0
- package/src/blocks/submit-button/component-info.js +28 -0
- package/src/blocks/submit-button/submit-button.jsx +87 -0
- package/src/blocks/symbol/component-info.js +43 -0
- package/src/blocks/symbol/symbol.jsx +211 -0
- package/src/blocks/text/component-info.js +24 -0
- package/src/blocks/text/text.jsx +46 -0
- package/src/blocks/textarea/component-info.js +47 -0
- package/src/blocks/textarea/textarea.jsx +65 -0
- package/src/blocks/util.js +7 -0
- package/src/blocks/video/component-info.js +106 -0
- package/src/blocks/video/video.jsx +103 -0
- package/src/components/render-block/block-styles.jsx +174 -0
- package/src/components/render-block/render-block.helpers.js +23 -0
- package/src/components/render-block/render-block.jsx +733 -0
- package/src/components/render-block/render-component.jsx +245 -0
- package/src/components/render-block/render-repeated-block.jsx +104 -0
- package/src/components/render-block/types.js +0 -0
- package/src/components/render-blocks.jsx +387 -0
- package/src/components/render-content/components/render-styles.jsx +126 -0
- package/src/components/render-content/index.js +4 -0
- package/src/components/render-content/render-content.jsx +650 -0
- package/src/components/render-inlined-styles.jsx +141 -0
- package/src/constants/builder-registered-components.js +48 -0
- package/src/constants/device-sizes.js +21 -0
- package/src/constants/target.js +4 -0
- package/src/context/builder.context.js +5 -0
- package/src/functions/camel-to-kebab-case.js +4 -0
- package/src/functions/convert-style-object.js +6 -0
- package/src/functions/evaluate.js +28 -0
- package/src/functions/event-handler-name.js +7 -0
- package/src/functions/get-block-actions.js +23 -0
- package/src/functions/get-block-component-options.js +28 -0
- package/src/functions/get-block-properties.js +29 -0
- package/src/functions/get-block-styles.js +34 -0
- package/src/functions/get-block-tag.js +6 -0
- package/src/functions/get-builder-search-params/fn.test.js +13 -0
- package/src/functions/get-builder-search-params/index.js +33 -0
- package/src/functions/get-content/ab-testing.js +38 -0
- package/src/functions/get-content/fn.test.js +31 -0
- package/src/functions/get-content/index.js +96 -0
- package/src/functions/get-content/types.js +0 -0
- package/src/functions/get-fetch.js +34 -0
- package/src/functions/get-global-this.js +18 -0
- package/src/functions/get-processed-block.js +53 -0
- package/src/functions/get-processed-block.test.js +32 -0
- package/src/functions/if-target.js +15 -0
- package/src/functions/is-browser.js +6 -0
- package/src/functions/is-editing.js +7 -0
- package/src/functions/is-iframe.js +7 -0
- package/src/functions/is-previewing.js +14 -0
- package/src/functions/on-change.js +27 -0
- package/src/functions/on-change.test.js +19 -0
- package/src/functions/register-component.js +72 -0
- package/src/functions/register.js +29 -0
- package/src/functions/sanitize-styles.js +5 -0
- package/src/functions/set-editor-settings.js +15 -0
- package/src/functions/set.js +11 -0
- package/src/functions/set.test.js +16 -0
- package/src/functions/track.js +22 -0
- package/src/functions/transform-block.js +6 -0
- package/src/helpers/css.js +12 -0
- package/src/helpers/flatten.js +34 -0
- package/src/index-helpers/blocks-exports.js +22 -0
- package/src/index-helpers/top-of-file.js +4 -0
- package/src/index.js +10 -0
- package/src/scripts/init-editing.js +79 -0
- package/src/types/builder-block.js +0 -0
- package/src/types/builder-content.js +0 -0
- package/src/types/components.js +0 -0
- package/src/types/deep-partial.js +0 -0
- package/src/types/element.js +0 -0
- package/src/types/targets.js +0 -0
- package/src/types/typescript.js +0 -0
- package/types.d.ts +7 -12
- package/root.json +0 -1176
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
// GENERATED BY MITOSIS
|
|
2
|
+
|
|
3
|
+
import BlockStyles from "./block-styles";
|
|
4
|
+
import RenderBlock from "./render-block";
|
|
5
|
+
import { Fragment, h } from "@builder.io/qwik";
|
|
6
|
+
export const RenderComponent = (props) => {
|
|
7
|
+
return (
|
|
8
|
+
<>
|
|
9
|
+
{props.componentRef ? (
|
|
10
|
+
<props.componentRef {...props.componentOptions}>
|
|
11
|
+
{(props.blockChildren || []).map((child) => {
|
|
12
|
+
return (
|
|
13
|
+
<RenderBlock
|
|
14
|
+
key={"render-block-" + child.id}
|
|
15
|
+
block={child}
|
|
16
|
+
context={props.context}
|
|
17
|
+
></RenderBlock>
|
|
18
|
+
);
|
|
19
|
+
})}
|
|
20
|
+
{(props.blockChildren || []).map((child) => {
|
|
21
|
+
return (
|
|
22
|
+
<BlockStyles
|
|
23
|
+
key={"block-style-" + child.id}
|
|
24
|
+
block={child}
|
|
25
|
+
context={props.context}
|
|
26
|
+
></BlockStyles>
|
|
27
|
+
);
|
|
28
|
+
})}
|
|
29
|
+
</props.componentRef>
|
|
30
|
+
) : null}
|
|
31
|
+
</>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
export default RenderComponent;
|
|
35
|
+
export const COMPONENT = {
|
|
36
|
+
"@type": "@builder.io/mitosis/component",
|
|
37
|
+
imports: [
|
|
38
|
+
{
|
|
39
|
+
imports: {
|
|
40
|
+
BlockStyles: "default",
|
|
41
|
+
},
|
|
42
|
+
path: "./block-styles.lite",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
imports: {
|
|
46
|
+
RenderBlock: "default",
|
|
47
|
+
},
|
|
48
|
+
path: "./render-block.lite",
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
exports: {},
|
|
52
|
+
inputs: [],
|
|
53
|
+
meta: {
|
|
54
|
+
useMetadata: {
|
|
55
|
+
qwik: {
|
|
56
|
+
component: {
|
|
57
|
+
isLight: true,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
refs: {},
|
|
63
|
+
state: {},
|
|
64
|
+
children: [
|
|
65
|
+
{
|
|
66
|
+
"@type": "@builder.io/mitosis/node",
|
|
67
|
+
name: "Show",
|
|
68
|
+
meta: {},
|
|
69
|
+
scope: {},
|
|
70
|
+
properties: {},
|
|
71
|
+
bindings: {
|
|
72
|
+
when: {
|
|
73
|
+
code: "props.componentRef",
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
children: [
|
|
77
|
+
{
|
|
78
|
+
"@type": "@builder.io/mitosis/node",
|
|
79
|
+
name: "div",
|
|
80
|
+
meta: {},
|
|
81
|
+
scope: {},
|
|
82
|
+
properties: {
|
|
83
|
+
_text: "\n ",
|
|
84
|
+
},
|
|
85
|
+
bindings: {},
|
|
86
|
+
children: [],
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"@type": "@builder.io/mitosis/node",
|
|
90
|
+
name: "props.componentRef",
|
|
91
|
+
meta: {},
|
|
92
|
+
scope: {},
|
|
93
|
+
properties: {},
|
|
94
|
+
bindings: {
|
|
95
|
+
_spread: {
|
|
96
|
+
code: "props.componentOptions",
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
children: [
|
|
100
|
+
{
|
|
101
|
+
"@type": "@builder.io/mitosis/node",
|
|
102
|
+
name: "div",
|
|
103
|
+
meta: {},
|
|
104
|
+
scope: {},
|
|
105
|
+
properties: {
|
|
106
|
+
_text: "\n ",
|
|
107
|
+
},
|
|
108
|
+
bindings: {},
|
|
109
|
+
children: [],
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"@type": "@builder.io/mitosis/node",
|
|
113
|
+
name: "div",
|
|
114
|
+
meta: {},
|
|
115
|
+
scope: {},
|
|
116
|
+
properties: {
|
|
117
|
+
_text: "\n ",
|
|
118
|
+
},
|
|
119
|
+
bindings: {},
|
|
120
|
+
children: [],
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"@type": "@builder.io/mitosis/node",
|
|
124
|
+
name: "For",
|
|
125
|
+
meta: {},
|
|
126
|
+
scope: {
|
|
127
|
+
For: ["child"],
|
|
128
|
+
},
|
|
129
|
+
properties: {
|
|
130
|
+
_forName: "child",
|
|
131
|
+
},
|
|
132
|
+
bindings: {
|
|
133
|
+
each: {
|
|
134
|
+
code: "props.blockChildren",
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
children: [
|
|
138
|
+
{
|
|
139
|
+
"@type": "@builder.io/mitosis/node",
|
|
140
|
+
name: "RenderBlock",
|
|
141
|
+
meta: {},
|
|
142
|
+
scope: {},
|
|
143
|
+
properties: {},
|
|
144
|
+
bindings: {
|
|
145
|
+
key: {
|
|
146
|
+
code: "'render-block-' + child.id",
|
|
147
|
+
},
|
|
148
|
+
block: {
|
|
149
|
+
code: "child",
|
|
150
|
+
},
|
|
151
|
+
context: {
|
|
152
|
+
code: "props.context",
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
children: [],
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"@type": "@builder.io/mitosis/node",
|
|
161
|
+
name: "div",
|
|
162
|
+
meta: {},
|
|
163
|
+
scope: {},
|
|
164
|
+
properties: {
|
|
165
|
+
_text: "\n ",
|
|
166
|
+
},
|
|
167
|
+
bindings: {},
|
|
168
|
+
children: [],
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"@type": "@builder.io/mitosis/node",
|
|
172
|
+
name: "For",
|
|
173
|
+
meta: {},
|
|
174
|
+
scope: {
|
|
175
|
+
For: ["child"],
|
|
176
|
+
},
|
|
177
|
+
properties: {
|
|
178
|
+
_forName: "child",
|
|
179
|
+
},
|
|
180
|
+
bindings: {
|
|
181
|
+
each: {
|
|
182
|
+
code: "props.blockChildren",
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
children: [
|
|
186
|
+
{
|
|
187
|
+
"@type": "@builder.io/mitosis/node",
|
|
188
|
+
name: "BlockStyles",
|
|
189
|
+
meta: {},
|
|
190
|
+
scope: {},
|
|
191
|
+
properties: {},
|
|
192
|
+
bindings: {
|
|
193
|
+
key: {
|
|
194
|
+
code: "'block-style-' + child.id",
|
|
195
|
+
},
|
|
196
|
+
block: {
|
|
197
|
+
code: "child",
|
|
198
|
+
},
|
|
199
|
+
context: {
|
|
200
|
+
code: "props.context",
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
children: [],
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"@type": "@builder.io/mitosis/node",
|
|
209
|
+
name: "div",
|
|
210
|
+
meta: {},
|
|
211
|
+
scope: {},
|
|
212
|
+
properties: {
|
|
213
|
+
_text: "\n ",
|
|
214
|
+
},
|
|
215
|
+
bindings: {},
|
|
216
|
+
children: [],
|
|
217
|
+
},
|
|
218
|
+
],
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"@type": "@builder.io/mitosis/node",
|
|
222
|
+
name: "div",
|
|
223
|
+
meta: {},
|
|
224
|
+
scope: {},
|
|
225
|
+
properties: {
|
|
226
|
+
_text: "\n ",
|
|
227
|
+
},
|
|
228
|
+
bindings: {},
|
|
229
|
+
children: [],
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
},
|
|
233
|
+
],
|
|
234
|
+
hooks: {},
|
|
235
|
+
context: {
|
|
236
|
+
get: {},
|
|
237
|
+
set: {},
|
|
238
|
+
},
|
|
239
|
+
name: "RenderComponent",
|
|
240
|
+
subComponents: [],
|
|
241
|
+
interfaces: [
|
|
242
|
+
"export interface RenderComponentProps {\n componentRef: any;\n componentOptions: any;\n blockChildren: BuilderBlock[];\n context: BuilderContextInterface;\n} // eslint-disable-next-line @builder.io/mitosis/only-default-function-and-imports",
|
|
243
|
+
],
|
|
244
|
+
propsTypeRef: "RenderComponentProps",
|
|
245
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// GENERATED BY MITOSIS
|
|
2
|
+
|
|
3
|
+
import BuilderContext from "../../context/builder.context";
|
|
4
|
+
import RenderBlock from "./render-block";
|
|
5
|
+
import {
|
|
6
|
+
Fragment,
|
|
7
|
+
component$,
|
|
8
|
+
h,
|
|
9
|
+
useContextProvider,
|
|
10
|
+
useStore,
|
|
11
|
+
} from "@builder.io/qwik";
|
|
12
|
+
export const RenderRepeatedBlock = component$((props) => {
|
|
13
|
+
useContextProvider(
|
|
14
|
+
BuilderContext,
|
|
15
|
+
useStore({
|
|
16
|
+
content: (() => {
|
|
17
|
+
return props.repeatContext.content;
|
|
18
|
+
})(),
|
|
19
|
+
state: (() => {
|
|
20
|
+
return props.repeatContext.state;
|
|
21
|
+
})(),
|
|
22
|
+
context: (() => {
|
|
23
|
+
return props.repeatContext.context;
|
|
24
|
+
})(),
|
|
25
|
+
apiKey: (() => {
|
|
26
|
+
return props.repeatContext.apiKey;
|
|
27
|
+
})(),
|
|
28
|
+
registeredComponents: (() => {
|
|
29
|
+
return props.repeatContext.registeredComponents;
|
|
30
|
+
})(),
|
|
31
|
+
})
|
|
32
|
+
);
|
|
33
|
+
return (
|
|
34
|
+
<RenderBlock block={props.block} context={props.context}></RenderBlock>
|
|
35
|
+
);
|
|
36
|
+
});
|
|
37
|
+
export default RenderRepeatedBlock;
|
|
38
|
+
export const COMPONENT = {
|
|
39
|
+
"@type": "@builder.io/mitosis/component",
|
|
40
|
+
imports: [
|
|
41
|
+
{
|
|
42
|
+
imports: {
|
|
43
|
+
BuilderContext: "default",
|
|
44
|
+
},
|
|
45
|
+
path: "../../context/builder.context.lite",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
imports: {
|
|
49
|
+
RenderBlock: "default",
|
|
50
|
+
},
|
|
51
|
+
path: "./render-block.lite",
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
exports: {},
|
|
55
|
+
inputs: [],
|
|
56
|
+
meta: {},
|
|
57
|
+
refs: {},
|
|
58
|
+
state: {},
|
|
59
|
+
children: [
|
|
60
|
+
{
|
|
61
|
+
"@type": "@builder.io/mitosis/node",
|
|
62
|
+
name: "RenderBlock",
|
|
63
|
+
meta: {},
|
|
64
|
+
scope: {},
|
|
65
|
+
properties: {},
|
|
66
|
+
bindings: {
|
|
67
|
+
block: {
|
|
68
|
+
code: "props.block",
|
|
69
|
+
},
|
|
70
|
+
context: {
|
|
71
|
+
code: "props.context",
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
children: [],
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
hooks: {},
|
|
78
|
+
context: {
|
|
79
|
+
get: {},
|
|
80
|
+
set: {
|
|
81
|
+
"../../context/builder.context.lite:default": {
|
|
82
|
+
name: "BuilderContext",
|
|
83
|
+
value: {
|
|
84
|
+
content:
|
|
85
|
+
"@builder.io/mitosis/method:get content() {\n return props.repeatContext.content;\n}",
|
|
86
|
+
state:
|
|
87
|
+
"@builder.io/mitosis/method:get state() {\n return props.repeatContext.state;\n}",
|
|
88
|
+
context:
|
|
89
|
+
"@builder.io/mitosis/method:get context() {\n return props.repeatContext.context;\n}",
|
|
90
|
+
apiKey:
|
|
91
|
+
"@builder.io/mitosis/method:get apiKey() {\n return props.repeatContext.apiKey;\n}",
|
|
92
|
+
registeredComponents:
|
|
93
|
+
"@builder.io/mitosis/method:get registeredComponents() {\n return props.repeatContext.registeredComponents;\n}",
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
name: "RenderRepeatedBlock",
|
|
99
|
+
subComponents: [],
|
|
100
|
+
types: [
|
|
101
|
+
"type Props = {\n block: BuilderBlock;\n repeatContext: BuilderContextInterface;\n context: BuilderContextInterface;\n};\n/**\n * We can't make this a generic `ProvideContext` function because Vue 2 won't support root slots, e.g.\n *\n * ```vue\n * <template>\n * <slot></slot>\n * </template>\n * ```\n */",
|
|
102
|
+
],
|
|
103
|
+
propsTypeRef: "Props",
|
|
104
|
+
};
|
|
File without changes
|