@builder.io/sdk-qwik 0.0.5 → 0.0.8
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 +2 -65
- package/lib/index.97024df8.js +80165 -0
- package/lib/index.d8c1e37f.cjs +80165 -0
- package/lib/index.qwik.cjs +2424 -0
- package/lib/index.qwik.mjs +2424 -0
- package/package.json +3 -4
- package/tsconfig.json +1 -1
- package/types.d.ts +12 -7
- package/src/blocks/button/button.jsx +0 -211
- package/src/blocks/button/component-info.js +0 -41
- package/src/blocks/columns/columns.jsx +0 -267
- package/src/blocks/columns/component-info.js +0 -242
- package/src/blocks/custom-code/component-info.js +0 -31
- package/src/blocks/custom-code/custom-code.jsx +0 -130
- package/src/blocks/embed/component-info.js +0 -44
- package/src/blocks/embed/embed.jsx +0 -130
- package/src/blocks/embed/helpers.js +0 -9
- package/src/blocks/form/builder-blocks.jsx +0 -100
- package/src/blocks/form/component-info.js +0 -262
- package/src/blocks/form/form.jsx +0 -789
- package/src/blocks/fragment/component-info.js +0 -11
- package/src/blocks/fragment/fragment.jsx +0 -59
- package/src/blocks/image/component-info.js +0 -151
- package/src/blocks/image/image.helpers.js +0 -48
- package/src/blocks/image/image.jsx +0 -554
- package/src/blocks/img/component-info.js +0 -20
- package/src/blocks/img/img.jsx +0 -76
- package/src/blocks/input/component-info.js +0 -74
- package/src/blocks/input/input.jsx +0 -87
- package/src/blocks/raw-text/component-info.js +0 -16
- package/src/blocks/raw-text/raw-text.jsx +0 -53
- package/src/blocks/section/component-info.js +0 -49
- package/src/blocks/section/section.jsx +0 -97
- package/src/blocks/select/component-info.js +0 -59
- package/src/blocks/select/select.jsx +0 -149
- package/src/blocks/submit-button/component-info.js +0 -28
- package/src/blocks/submit-button/submit-button.jsx +0 -87
- package/src/blocks/symbol/component-info.js +0 -43
- package/src/blocks/symbol/symbol.jsx +0 -230
- package/src/blocks/text/component-info.js +0 -24
- package/src/blocks/text/text.jsx +0 -46
- package/src/blocks/textarea/component-info.js +0 -47
- package/src/blocks/textarea/textarea.jsx +0 -65
- package/src/blocks/util.js +0 -12
- package/src/blocks/video/component-info.js +0 -106
- package/src/blocks/video/video.jsx +0 -103
- package/src/components/render-block/block-styles.jsx +0 -186
- package/src/components/render-block/render-block.helpers.js +0 -23
- package/src/components/render-block/render-block.jsx +0 -749
- package/src/components/render-block/render-component.jsx +0 -257
- package/src/components/render-block/render-repeated-block.jsx +0 -119
- package/src/components/render-block/types.js +0 -0
- package/src/components/render-blocks.jsx +0 -387
- package/src/components/render-content/components/render-styles.jsx +0 -140
- package/src/components/render-content/index.js +0 -4
- package/src/components/render-content/render-content.jsx +0 -636
- package/src/components/render-inlined-styles.jsx +0 -153
- package/src/constants/builder-registered-components.js +0 -48
- package/src/constants/device-sizes.js +0 -21
- package/src/constants/target.js +0 -4
- package/src/context/builder.context.js +0 -5
- package/src/functions/camel-to-kebab-case.js +0 -4
- package/src/functions/convert-style-object.js +0 -6
- package/src/functions/evaluate.js +0 -28
- package/src/functions/event-handler-name.js +0 -7
- package/src/functions/get-block-actions.js +0 -23
- package/src/functions/get-block-component-options.js +0 -28
- package/src/functions/get-block-properties.js +0 -29
- package/src/functions/get-block-styles.js +0 -34
- package/src/functions/get-block-tag.js +0 -6
- package/src/functions/get-builder-search-params/fn.test.js +0 -13
- package/src/functions/get-builder-search-params/index.js +0 -33
- package/src/functions/get-content/ab-testing.js +0 -38
- package/src/functions/get-content/fn.test.js +0 -31
- package/src/functions/get-content/index.js +0 -99
- package/src/functions/get-content/types.js +0 -0
- package/src/functions/get-fetch.js +0 -33
- package/src/functions/get-global-this.js +0 -18
- package/src/functions/get-processed-block.js +0 -53
- package/src/functions/get-processed-block.test.js +0 -32
- package/src/functions/if-target.js +0 -15
- package/src/functions/is-browser.js +0 -6
- package/src/functions/is-editing.js +0 -7
- package/src/functions/is-iframe.js +0 -7
- package/src/functions/is-previewing.js +0 -14
- package/src/functions/on-change.js +0 -27
- package/src/functions/on-change.test.js +0 -19
- package/src/functions/register-component.js +0 -72
- package/src/functions/register.js +0 -29
- package/src/functions/sanitize-styles.js +0 -5
- package/src/functions/set-editor-settings.js +0 -15
- package/src/functions/set.js +0 -11
- package/src/functions/set.test.js +0 -16
- package/src/functions/track.js +0 -22
- package/src/functions/transform-block.js +0 -6
- package/src/helpers/css.js +0 -12
- package/src/helpers/flatten.js +0 -34
- package/src/index-helpers/blocks-exports.js +0 -22
- package/src/index-helpers/top-of-file.js +0 -4
- package/src/index.js +0 -10
- package/src/scripts/init-editing.js +0 -79
- 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
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
const componentInfo = {
|
|
2
|
-
name: "Symbol",
|
|
3
|
-
noWrap: true,
|
|
4
|
-
static: true,
|
|
5
|
-
builtIn: true,
|
|
6
|
-
inputs: [
|
|
7
|
-
{
|
|
8
|
-
name: "symbol",
|
|
9
|
-
type: "uiSymbol"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
name: "dataOnly",
|
|
13
|
-
helperText: "Make this a data symbol that doesn't display any UI",
|
|
14
|
-
type: "boolean",
|
|
15
|
-
defaultValue: false,
|
|
16
|
-
advanced: true,
|
|
17
|
-
hideFromUI: true
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: "inheritState",
|
|
21
|
-
helperText: "Inherit the parent component state and data",
|
|
22
|
-
type: "boolean",
|
|
23
|
-
defaultValue: false,
|
|
24
|
-
advanced: true
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: "renderToLiquid",
|
|
28
|
-
helperText: "Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",
|
|
29
|
-
type: "boolean",
|
|
30
|
-
defaultValue: false,
|
|
31
|
-
advanced: true,
|
|
32
|
-
hideFromUI: true
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: "useChildren",
|
|
36
|
-
hideFromUI: true,
|
|
37
|
-
type: "boolean"
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
};
|
|
41
|
-
export {
|
|
42
|
-
componentInfo
|
|
43
|
-
};
|
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
// GENERATED BY MITOSIS
|
|
2
|
-
|
|
3
|
-
import RenderContent from "../../components/render-content/render-content";
|
|
4
|
-
import BuilderContext from "../../context/builder.context";
|
|
5
|
-
import { getContent } from "../../functions/get-content/index.js";
|
|
6
|
-
import {
|
|
7
|
-
Fragment,
|
|
8
|
-
Host,
|
|
9
|
-
component$,
|
|
10
|
-
h,
|
|
11
|
-
useClientEffect$,
|
|
12
|
-
useContext,
|
|
13
|
-
useStore,
|
|
14
|
-
useWatch$,
|
|
15
|
-
} from "@builder.io/qwik";
|
|
16
|
-
export const Symbol = component$(
|
|
17
|
-
(props) => {
|
|
18
|
-
const builderContext = useContext(BuilderContext);
|
|
19
|
-
const state = useStore({
|
|
20
|
-
className: "builder-symbol",
|
|
21
|
-
content: null,
|
|
22
|
-
symbolContent: null,
|
|
23
|
-
symbolModel: null,
|
|
24
|
-
symbolEntry: null,
|
|
25
|
-
});
|
|
26
|
-
useClientEffect$(() => {
|
|
27
|
-
state.content = props.symbol?.content;
|
|
28
|
-
});
|
|
29
|
-
useWatch$(({ track }) => {
|
|
30
|
-
props && track(props, "symbol");
|
|
31
|
-
state.symbolContent = props.symbol?.content || null;
|
|
32
|
-
state.symbolModel = props.symbol?.model || null;
|
|
33
|
-
state.symbolEntry = props.symbol?.entry || null;
|
|
34
|
-
});
|
|
35
|
-
useWatch$(({ track }) => {
|
|
36
|
-
state && track(state, "symbolContent");
|
|
37
|
-
state && track(state, "symbolModel");
|
|
38
|
-
state && track(state, "symbolEntry");
|
|
39
|
-
state && track(state, "content");
|
|
40
|
-
const symbolToUse = props.symbol;
|
|
41
|
-
/**
|
|
42
|
-
* If:
|
|
43
|
-
* - we have a symbol prop
|
|
44
|
-
* - yet it does not have any content
|
|
45
|
-
* - and we have not already stored content from before
|
|
46
|
-
* - and it has a model name
|
|
47
|
-
*
|
|
48
|
-
* then we want to re-fetch the symbol content.
|
|
49
|
-
*/
|
|
50
|
-
|
|
51
|
-
if (
|
|
52
|
-
symbolToUse &&
|
|
53
|
-
!symbolToUse.content &&
|
|
54
|
-
!state.content &&
|
|
55
|
-
symbolToUse.model
|
|
56
|
-
) {
|
|
57
|
-
getContent({
|
|
58
|
-
model: symbolToUse.model,
|
|
59
|
-
apiKey: builderContext.apiKey,
|
|
60
|
-
query: {
|
|
61
|
-
id: symbolToUse.entry,
|
|
62
|
-
},
|
|
63
|
-
}).then((response) => {
|
|
64
|
-
state.content = response;
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
return (
|
|
69
|
-
<Host
|
|
70
|
-
{...props.attributes}
|
|
71
|
-
dataSet={{
|
|
72
|
-
class: state.className,
|
|
73
|
-
}}
|
|
74
|
-
class={state.className}
|
|
75
|
-
>
|
|
76
|
-
<RenderContent
|
|
77
|
-
apiKey={builderContext.apiKey}
|
|
78
|
-
context={builderContext.context}
|
|
79
|
-
customComponents={Object.values(builderContext.registeredComponents)}
|
|
80
|
-
data={{
|
|
81
|
-
...props.symbol?.data,
|
|
82
|
-
...builderContext.state,
|
|
83
|
-
...props.symbol?.content?.data?.state,
|
|
84
|
-
}}
|
|
85
|
-
model={props.symbol?.model}
|
|
86
|
-
content={state.content}
|
|
87
|
-
></RenderContent>
|
|
88
|
-
</Host>
|
|
89
|
-
);
|
|
90
|
-
},
|
|
91
|
-
{ tagName: "div" }
|
|
92
|
-
);
|
|
93
|
-
export default Symbol;
|
|
94
|
-
export const COMPONENT = {
|
|
95
|
-
"@type": "@builder.io/mitosis/component",
|
|
96
|
-
imports: [
|
|
97
|
-
{
|
|
98
|
-
imports: {
|
|
99
|
-
RenderContent: "default",
|
|
100
|
-
},
|
|
101
|
-
path: "../../components/render-content/render-content.lite",
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
imports: {
|
|
105
|
-
BuilderContext: "default",
|
|
106
|
-
},
|
|
107
|
-
path: "../../context/builder.context.lite",
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
imports: {
|
|
111
|
-
getContent: "getContent",
|
|
112
|
-
},
|
|
113
|
-
path: "../../functions/get-content/index.js",
|
|
114
|
-
},
|
|
115
|
-
],
|
|
116
|
-
exports: {},
|
|
117
|
-
inputs: [],
|
|
118
|
-
meta: {},
|
|
119
|
-
refs: {},
|
|
120
|
-
state: {
|
|
121
|
-
className: "builder-symbol",
|
|
122
|
-
content: null,
|
|
123
|
-
symbolContent: null,
|
|
124
|
-
symbolModel: null,
|
|
125
|
-
symbolEntry: null,
|
|
126
|
-
},
|
|
127
|
-
children: [
|
|
128
|
-
{
|
|
129
|
-
"@type": "@builder.io/mitosis/node",
|
|
130
|
-
name: "Host",
|
|
131
|
-
meta: {},
|
|
132
|
-
scope: {},
|
|
133
|
-
properties: {},
|
|
134
|
-
bindings: {
|
|
135
|
-
_spread: {
|
|
136
|
-
code: "props.attributes",
|
|
137
|
-
},
|
|
138
|
-
dataSet: {
|
|
139
|
-
code: "{\n class: state.className\n}",
|
|
140
|
-
},
|
|
141
|
-
class: {
|
|
142
|
-
code: "state.className",
|
|
143
|
-
},
|
|
144
|
-
},
|
|
145
|
-
children: [
|
|
146
|
-
{
|
|
147
|
-
"@type": "@builder.io/mitosis/node",
|
|
148
|
-
name: "div",
|
|
149
|
-
meta: {},
|
|
150
|
-
scope: {},
|
|
151
|
-
properties: {
|
|
152
|
-
_text: "\n ",
|
|
153
|
-
},
|
|
154
|
-
bindings: {},
|
|
155
|
-
children: [],
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
"@type": "@builder.io/mitosis/node",
|
|
159
|
-
name: "RenderContent",
|
|
160
|
-
meta: {},
|
|
161
|
-
scope: {},
|
|
162
|
-
properties: {},
|
|
163
|
-
bindings: {
|
|
164
|
-
apiKey: {
|
|
165
|
-
code: "builderContext.apiKey",
|
|
166
|
-
},
|
|
167
|
-
context: {
|
|
168
|
-
code: "builderContext.context",
|
|
169
|
-
},
|
|
170
|
-
customComponents: {
|
|
171
|
-
code: "Object.values(builderContext.registeredComponents)",
|
|
172
|
-
},
|
|
173
|
-
data: {
|
|
174
|
-
code: "{ ...props.symbol?.data,\n ...builderContext.state,\n ...props.symbol?.content?.data?.state\n}",
|
|
175
|
-
},
|
|
176
|
-
model: {
|
|
177
|
-
code: "props.symbol?.model",
|
|
178
|
-
},
|
|
179
|
-
content: {
|
|
180
|
-
code: "state.content",
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
children: [],
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
"@type": "@builder.io/mitosis/node",
|
|
187
|
-
name: "div",
|
|
188
|
-
meta: {},
|
|
189
|
-
scope: {},
|
|
190
|
-
properties: {
|
|
191
|
-
_text: "\n ",
|
|
192
|
-
},
|
|
193
|
-
bindings: {},
|
|
194
|
-
children: [],
|
|
195
|
-
},
|
|
196
|
-
],
|
|
197
|
-
},
|
|
198
|
-
],
|
|
199
|
-
hooks: {
|
|
200
|
-
onMount: {
|
|
201
|
-
code: "\n state.content = props.symbol?.content;\n",
|
|
202
|
-
},
|
|
203
|
-
onUpdate: [
|
|
204
|
-
{
|
|
205
|
-
code: "\n state.symbolContent = props.symbol?.content || null;\n state.symbolModel = props.symbol?.model || null;\n state.symbolEntry = props.symbol?.entry || null;\n",
|
|
206
|
-
deps: "[props.symbol]",
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
code: "\n const symbolToUse = props.symbol;\n /**\n * If:\n * - we have a symbol prop\n * - yet it does not have any content\n * - and we have not already stored content from before\n * - and it has a model name\n *\n * then we want to re-fetch the symbol content.\n */\n\n if (symbolToUse && !symbolToUse.content && !state.content && symbolToUse.model) {\n getContent({\n model: symbolToUse.model,\n apiKey: builderContext.apiKey!,\n query: {\n id: symbolToUse.entry\n }\n }).then(response => {\n state.content = response;\n });\n }\n",
|
|
210
|
-
deps: "[state.symbolContent, state.symbolModel, state.symbolEntry, state.content]",
|
|
211
|
-
},
|
|
212
|
-
],
|
|
213
|
-
},
|
|
214
|
-
context: {
|
|
215
|
-
get: {
|
|
216
|
-
builderContext: {
|
|
217
|
-
name: "BuilderContext",
|
|
218
|
-
path: "../../context/builder.context.lite:default",
|
|
219
|
-
},
|
|
220
|
-
},
|
|
221
|
-
set: {},
|
|
222
|
-
},
|
|
223
|
-
name: "Symbol",
|
|
224
|
-
subComponents: [],
|
|
225
|
-
interfaces: [
|
|
226
|
-
"export interface SymbolInfo {\n model?: string;\n entry?: string;\n data?: any;\n content?: BuilderContent;\n inline?: boolean;\n dynamic?: boolean;\n}",
|
|
227
|
-
"export interface SymbolProps {\n symbol?: SymbolInfo;\n dataOnly?: boolean;\n dynamic?: boolean;\n builderBlock?: BuilderBlock;\n attributes?: any;\n inheritState?: boolean;\n}",
|
|
228
|
-
],
|
|
229
|
-
propsTypeRef: "SymbolProps",
|
|
230
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
const componentInfo = {
|
|
2
|
-
name: "Text",
|
|
3
|
-
static: true,
|
|
4
|
-
builtIn: true,
|
|
5
|
-
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",
|
|
6
|
-
inputs: [
|
|
7
|
-
{
|
|
8
|
-
name: "text",
|
|
9
|
-
type: "html",
|
|
10
|
-
required: true,
|
|
11
|
-
autoFocus: true,
|
|
12
|
-
bubble: true,
|
|
13
|
-
defaultValue: "Enter some text..."
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
defaultStyles: {
|
|
17
|
-
lineHeight: "normal",
|
|
18
|
-
height: "auto",
|
|
19
|
-
textAlign: "center"
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
componentInfo
|
|
24
|
-
};
|
package/src/blocks/text/text.jsx
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// GENERATED BY MITOSIS
|
|
2
|
-
|
|
3
|
-
import { Fragment, Host, component$, h } from "@builder.io/qwik";
|
|
4
|
-
export const Text = component$(
|
|
5
|
-
(props) => {
|
|
6
|
-
return (
|
|
7
|
-
<Host class="builder-text" dangerouslySetInnerHTML={props.text}></Host>
|
|
8
|
-
);
|
|
9
|
-
},
|
|
10
|
-
{ tagName: "div" }
|
|
11
|
-
);
|
|
12
|
-
export default Text;
|
|
13
|
-
export const COMPONENT = {
|
|
14
|
-
"@type": "@builder.io/mitosis/component",
|
|
15
|
-
imports: [],
|
|
16
|
-
exports: {},
|
|
17
|
-
inputs: [],
|
|
18
|
-
meta: {},
|
|
19
|
-
refs: {},
|
|
20
|
-
state: {},
|
|
21
|
-
children: [
|
|
22
|
-
{
|
|
23
|
-
"@type": "@builder.io/mitosis/node",
|
|
24
|
-
name: "Host",
|
|
25
|
-
meta: {},
|
|
26
|
-
scope: {},
|
|
27
|
-
properties: {
|
|
28
|
-
class: "builder-text",
|
|
29
|
-
},
|
|
30
|
-
bindings: {
|
|
31
|
-
innerHTML: {
|
|
32
|
-
code: "props.text",
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
children: [],
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
hooks: {},
|
|
39
|
-
context: {
|
|
40
|
-
get: {},
|
|
41
|
-
set: {},
|
|
42
|
-
},
|
|
43
|
-
name: "Text",
|
|
44
|
-
subComponents: [],
|
|
45
|
-
propsTypeRef: "{\n text: string\n}",
|
|
46
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
const componentInfo = {
|
|
2
|
-
name: "Form:TextArea",
|
|
3
|
-
builtIn: true,
|
|
4
|
-
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
|
|
5
|
-
inputs: [
|
|
6
|
-
{
|
|
7
|
-
advanced: true,
|
|
8
|
-
name: "value",
|
|
9
|
-
type: "string"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
name: "name",
|
|
13
|
-
type: "string",
|
|
14
|
-
required: true,
|
|
15
|
-
helperText: 'Every input in a form needs a unique name describing what it gets, e.g. "email"'
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
name: "defaultValue",
|
|
19
|
-
type: "string"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
name: "placeholder",
|
|
23
|
-
type: "string",
|
|
24
|
-
defaultValue: "Hello there"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: "required",
|
|
28
|
-
type: "boolean",
|
|
29
|
-
defaultValue: false
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
|
-
defaultStyles: {
|
|
33
|
-
paddingTop: "10px",
|
|
34
|
-
paddingBottom: "10px",
|
|
35
|
-
paddingLeft: "10px",
|
|
36
|
-
paddingRight: "10px",
|
|
37
|
-
borderRadius: "3px",
|
|
38
|
-
borderWidth: "1px",
|
|
39
|
-
borderStyle: "solid",
|
|
40
|
-
borderColor: "#ccc"
|
|
41
|
-
},
|
|
42
|
-
static: true,
|
|
43
|
-
noWrap: true
|
|
44
|
-
};
|
|
45
|
-
export {
|
|
46
|
-
componentInfo
|
|
47
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
// GENERATED BY MITOSIS
|
|
2
|
-
|
|
3
|
-
import { Fragment, Host, component$, h } from "@builder.io/qwik";
|
|
4
|
-
export const Textarea = component$(
|
|
5
|
-
(props) => {
|
|
6
|
-
return (
|
|
7
|
-
<Host
|
|
8
|
-
{...props.attributes}
|
|
9
|
-
placeholder={props.placeholder}
|
|
10
|
-
name={props.name}
|
|
11
|
-
value={props.value}
|
|
12
|
-
defaultValue={props.defaultValue}
|
|
13
|
-
></Host>
|
|
14
|
-
);
|
|
15
|
-
},
|
|
16
|
-
{ tagName: "textarea" }
|
|
17
|
-
);
|
|
18
|
-
export default Textarea;
|
|
19
|
-
export const COMPONENT = {
|
|
20
|
-
"@type": "@builder.io/mitosis/component",
|
|
21
|
-
imports: [],
|
|
22
|
-
exports: {},
|
|
23
|
-
inputs: [],
|
|
24
|
-
meta: {},
|
|
25
|
-
refs: {},
|
|
26
|
-
state: {},
|
|
27
|
-
children: [
|
|
28
|
-
{
|
|
29
|
-
"@type": "@builder.io/mitosis/node",
|
|
30
|
-
name: "Host",
|
|
31
|
-
meta: {},
|
|
32
|
-
scope: {},
|
|
33
|
-
properties: {},
|
|
34
|
-
bindings: {
|
|
35
|
-
_spread: {
|
|
36
|
-
code: "props.attributes",
|
|
37
|
-
},
|
|
38
|
-
placeholder: {
|
|
39
|
-
code: "props.placeholder",
|
|
40
|
-
},
|
|
41
|
-
name: {
|
|
42
|
-
code: "props.name",
|
|
43
|
-
},
|
|
44
|
-
value: {
|
|
45
|
-
code: "props.value",
|
|
46
|
-
},
|
|
47
|
-
defaultValue: {
|
|
48
|
-
code: "props.defaultValue",
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
children: [],
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
hooks: {},
|
|
55
|
-
context: {
|
|
56
|
-
get: {},
|
|
57
|
-
set: {},
|
|
58
|
-
},
|
|
59
|
-
name: "Textarea",
|
|
60
|
-
subComponents: [],
|
|
61
|
-
interfaces: [
|
|
62
|
-
"export interface TextareaProps {\n attributes?: any;\n name?: string;\n value?: string;\n defaultValue?: string;\n placeholder?: string;\n}",
|
|
63
|
-
],
|
|
64
|
-
propsTypeRef: "TextareaProps",
|
|
65
|
-
};
|
package/src/blocks/util.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
const componentInfo = {
|
|
2
|
-
name: "Video",
|
|
3
|
-
canHaveChildren: true,
|
|
4
|
-
builtIn: true,
|
|
5
|
-
defaultStyles: {
|
|
6
|
-
minHeight: "20px",
|
|
7
|
-
minWidth: "20px"
|
|
8
|
-
},
|
|
9
|
-
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",
|
|
10
|
-
inputs: [
|
|
11
|
-
{
|
|
12
|
-
name: "video",
|
|
13
|
-
type: "file",
|
|
14
|
-
allowedFileTypes: ["mp4"],
|
|
15
|
-
bubble: true,
|
|
16
|
-
defaultValue: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",
|
|
17
|
-
required: true
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: "posterImage",
|
|
21
|
-
type: "file",
|
|
22
|
-
allowedFileTypes: ["jpeg", "png"],
|
|
23
|
-
helperText: "Image to show before the video plays"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
name: "autoPlay",
|
|
27
|
-
type: "boolean",
|
|
28
|
-
defaultValue: true
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: "controls",
|
|
32
|
-
type: "boolean",
|
|
33
|
-
defaultValue: false
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: "muted",
|
|
37
|
-
type: "boolean",
|
|
38
|
-
defaultValue: true
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
name: "loop",
|
|
42
|
-
type: "boolean",
|
|
43
|
-
defaultValue: true
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
name: "playsInline",
|
|
47
|
-
type: "boolean",
|
|
48
|
-
defaultValue: true
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
name: "fit",
|
|
52
|
-
type: "text",
|
|
53
|
-
defaultValue: "cover",
|
|
54
|
-
enum: ["contain", "cover", "fill", "auto"]
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: "fitContent",
|
|
58
|
-
type: "boolean",
|
|
59
|
-
helperText: "When child blocks are provided, fit to them instead of using the aspect ratio",
|
|
60
|
-
defaultValue: true,
|
|
61
|
-
advanced: true
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
name: "position",
|
|
65
|
-
type: "text",
|
|
66
|
-
defaultValue: "center",
|
|
67
|
-
enum: [
|
|
68
|
-
"center",
|
|
69
|
-
"top",
|
|
70
|
-
"left",
|
|
71
|
-
"right",
|
|
72
|
-
"bottom",
|
|
73
|
-
"top left",
|
|
74
|
-
"top right",
|
|
75
|
-
"bottom left",
|
|
76
|
-
"bottom right"
|
|
77
|
-
]
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: "height",
|
|
81
|
-
type: "number",
|
|
82
|
-
advanced: true
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
name: "width",
|
|
86
|
-
type: "number",
|
|
87
|
-
advanced: true
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
name: "aspectRatio",
|
|
91
|
-
type: "number",
|
|
92
|
-
advanced: true,
|
|
93
|
-
defaultValue: 0.7004048582995948
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
name: "lazyLoad",
|
|
97
|
-
type: "boolean",
|
|
98
|
-
helperText: 'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',
|
|
99
|
-
defaultValue: true,
|
|
100
|
-
advanced: true
|
|
101
|
-
}
|
|
102
|
-
]
|
|
103
|
-
};
|
|
104
|
-
export {
|
|
105
|
-
componentInfo
|
|
106
|
-
};
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
// GENERATED BY MITOSIS
|
|
2
|
-
|
|
3
|
-
import { Fragment, Host, component$, h } from "@builder.io/qwik";
|
|
4
|
-
export const videoProps = function videoProps(props, state) {
|
|
5
|
-
return {
|
|
6
|
-
...(props.autoPlay === true
|
|
7
|
-
? {
|
|
8
|
-
autoPlay: true,
|
|
9
|
-
}
|
|
10
|
-
: {}),
|
|
11
|
-
...(props.muted === true
|
|
12
|
-
? {
|
|
13
|
-
muted: true,
|
|
14
|
-
}
|
|
15
|
-
: {}),
|
|
16
|
-
...(props.controls === true
|
|
17
|
-
? {
|
|
18
|
-
controls: true,
|
|
19
|
-
}
|
|
20
|
-
: {}),
|
|
21
|
-
...(props.loop === true
|
|
22
|
-
? {
|
|
23
|
-
loop: true,
|
|
24
|
-
}
|
|
25
|
-
: {}),
|
|
26
|
-
...(props.playsInline === true
|
|
27
|
-
? {
|
|
28
|
-
playsInline: true,
|
|
29
|
-
}
|
|
30
|
-
: {}),
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
export const Video = component$(
|
|
34
|
-
(props) => {
|
|
35
|
-
const state = {};
|
|
36
|
-
return (
|
|
37
|
-
<Host
|
|
38
|
-
{...videoProps(props, state)}
|
|
39
|
-
style={{
|
|
40
|
-
width: "100%",
|
|
41
|
-
height: "100%",
|
|
42
|
-
...props.attributes?.style,
|
|
43
|
-
objectFit: props.fit,
|
|
44
|
-
objectPosition: props.position,
|
|
45
|
-
// Hack to get object fit to work as expected and
|
|
46
|
-
// not have the video overflow
|
|
47
|
-
borderRadius: 1,
|
|
48
|
-
}}
|
|
49
|
-
src={props.video || "no-src"}
|
|
50
|
-
poster={props.posterImage}
|
|
51
|
-
></Host>
|
|
52
|
-
);
|
|
53
|
-
},
|
|
54
|
-
{ tagName: "video" }
|
|
55
|
-
);
|
|
56
|
-
export default Video;
|
|
57
|
-
export const COMPONENT = {
|
|
58
|
-
"@type": "@builder.io/mitosis/component",
|
|
59
|
-
imports: [],
|
|
60
|
-
exports: {},
|
|
61
|
-
inputs: [],
|
|
62
|
-
meta: {},
|
|
63
|
-
refs: {},
|
|
64
|
-
state: {
|
|
65
|
-
videoProps:
|
|
66
|
-
"@builder.io/mitosis/method:get videoProps() {\n return { ...(props.autoPlay === true ? {\n autoPlay: true\n } : {}),\n ...(props.muted === true ? {\n muted: true\n } : {}),\n ...(props.controls === true ? {\n controls: true\n } : {}),\n ...(props.loop === true ? {\n loop: true\n } : {}),\n ...(props.playsInline === true ? {\n playsInline: true\n } : {})\n };\n}",
|
|
67
|
-
},
|
|
68
|
-
children: [
|
|
69
|
-
{
|
|
70
|
-
"@type": "@builder.io/mitosis/node",
|
|
71
|
-
name: "Host",
|
|
72
|
-
meta: {},
|
|
73
|
-
scope: {},
|
|
74
|
-
properties: {},
|
|
75
|
-
bindings: {
|
|
76
|
-
_spread: {
|
|
77
|
-
code: "videoProps(props,state)",
|
|
78
|
-
},
|
|
79
|
-
style: {
|
|
80
|
-
code: "{\n width: '100%',\n height: '100%',\n ...props.attributes?.style,\n objectFit: props.fit,\n objectPosition: props.position,\n // Hack to get object fit to work as expected and\n // not have the video overflow\n borderRadius: 1\n}",
|
|
81
|
-
},
|
|
82
|
-
src: {
|
|
83
|
-
code: "props.video || 'no-src'",
|
|
84
|
-
},
|
|
85
|
-
poster: {
|
|
86
|
-
code: "props.posterImage",
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
children: [],
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
hooks: {},
|
|
93
|
-
context: {
|
|
94
|
-
get: {},
|
|
95
|
-
set: {},
|
|
96
|
-
},
|
|
97
|
-
name: "Video",
|
|
98
|
-
subComponents: [],
|
|
99
|
-
interfaces: [
|
|
100
|
-
"export interface VideoProps {\n attributes?: any;\n video?: string;\n autoPlay?: boolean;\n controls?: boolean;\n muted?: boolean;\n loop?: boolean;\n playsInline?: boolean;\n aspectRatio?: number;\n width?: number;\n height?: number;\n fit?: 'contain' | 'cover' | 'fill';\n position?: 'center' | 'top' | 'left' | 'right' | 'bottom' | 'top left' | 'top right' | 'bottom left' | 'bottom right';\n posterImage?: string;\n lazyLoad?: boolean;\n}",
|
|
101
|
-
],
|
|
102
|
-
propsTypeRef: "VideoProps",
|
|
103
|
-
};
|