@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,43 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,211 @@
|
|
|
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({ className: "builder-symbol", content: null });
|
|
20
|
+
useClientEffect$(() => {
|
|
21
|
+
state.content = props.symbol?.content;
|
|
22
|
+
});
|
|
23
|
+
useWatch$(({ track }) => {
|
|
24
|
+
props.symbol && track(props.symbol, "content");
|
|
25
|
+
props.symbol && track(props.symbol, "model");
|
|
26
|
+
props.symbol && track(props.symbol, "entry");
|
|
27
|
+
state && track(state, "content");
|
|
28
|
+
const symbolToUse = props.symbol;
|
|
29
|
+
/**
|
|
30
|
+
* If:
|
|
31
|
+
* - we have a symbol prop
|
|
32
|
+
* - yet it does not have any content
|
|
33
|
+
* - and we have not already stored content from before
|
|
34
|
+
* - and it has a model name
|
|
35
|
+
*
|
|
36
|
+
* then we want to re-fetch the symbol content.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
if (
|
|
40
|
+
symbolToUse &&
|
|
41
|
+
!symbolToUse.content &&
|
|
42
|
+
!state.content &&
|
|
43
|
+
symbolToUse.model
|
|
44
|
+
) {
|
|
45
|
+
getContent({
|
|
46
|
+
model: symbolToUse.model,
|
|
47
|
+
apiKey: builderContext.apiKey,
|
|
48
|
+
query: {
|
|
49
|
+
id: symbolToUse.entry,
|
|
50
|
+
},
|
|
51
|
+
}).then((response) => {
|
|
52
|
+
state.content = response;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return (
|
|
57
|
+
<Host
|
|
58
|
+
{...props.attributes}
|
|
59
|
+
dataSet={{
|
|
60
|
+
class: state.className,
|
|
61
|
+
}}
|
|
62
|
+
class={state.className}
|
|
63
|
+
>
|
|
64
|
+
<RenderContent
|
|
65
|
+
apiKey={builderContext.apiKey}
|
|
66
|
+
context={builderContext.context}
|
|
67
|
+
customComponents={Object.values(builderContext.registeredComponents)}
|
|
68
|
+
data={{
|
|
69
|
+
...props.symbol?.data,
|
|
70
|
+
...builderContext.state,
|
|
71
|
+
...props.symbol?.content?.data?.state,
|
|
72
|
+
}}
|
|
73
|
+
model={props.symbol?.model}
|
|
74
|
+
content={state.content}
|
|
75
|
+
></RenderContent>
|
|
76
|
+
</Host>
|
|
77
|
+
);
|
|
78
|
+
},
|
|
79
|
+
{ tagName: "div" }
|
|
80
|
+
);
|
|
81
|
+
export default Symbol;
|
|
82
|
+
export const COMPONENT = {
|
|
83
|
+
"@type": "@builder.io/mitosis/component",
|
|
84
|
+
imports: [
|
|
85
|
+
{
|
|
86
|
+
imports: {
|
|
87
|
+
RenderContent: "default",
|
|
88
|
+
},
|
|
89
|
+
path: "../../components/render-content/render-content.lite",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
imports: {
|
|
93
|
+
BuilderContext: "default",
|
|
94
|
+
},
|
|
95
|
+
path: "../../context/builder.context.lite",
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
imports: {
|
|
99
|
+
getContent: "getContent",
|
|
100
|
+
},
|
|
101
|
+
path: "../../functions/get-content/index.js",
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
exports: {},
|
|
105
|
+
inputs: [],
|
|
106
|
+
meta: {},
|
|
107
|
+
refs: {},
|
|
108
|
+
state: {
|
|
109
|
+
className: "builder-symbol",
|
|
110
|
+
content: null,
|
|
111
|
+
},
|
|
112
|
+
children: [
|
|
113
|
+
{
|
|
114
|
+
"@type": "@builder.io/mitosis/node",
|
|
115
|
+
name: "Host",
|
|
116
|
+
meta: {},
|
|
117
|
+
scope: {},
|
|
118
|
+
properties: {},
|
|
119
|
+
bindings: {
|
|
120
|
+
_spread: {
|
|
121
|
+
code: "props.attributes",
|
|
122
|
+
},
|
|
123
|
+
dataSet: {
|
|
124
|
+
code: "{\n class: state.className\n}",
|
|
125
|
+
},
|
|
126
|
+
class: {
|
|
127
|
+
code: "state.className",
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
children: [
|
|
131
|
+
{
|
|
132
|
+
"@type": "@builder.io/mitosis/node",
|
|
133
|
+
name: "div",
|
|
134
|
+
meta: {},
|
|
135
|
+
scope: {},
|
|
136
|
+
properties: {
|
|
137
|
+
_text: "\n ",
|
|
138
|
+
},
|
|
139
|
+
bindings: {},
|
|
140
|
+
children: [],
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"@type": "@builder.io/mitosis/node",
|
|
144
|
+
name: "RenderContent",
|
|
145
|
+
meta: {},
|
|
146
|
+
scope: {},
|
|
147
|
+
properties: {},
|
|
148
|
+
bindings: {
|
|
149
|
+
apiKey: {
|
|
150
|
+
code: "builderContext.apiKey",
|
|
151
|
+
},
|
|
152
|
+
context: {
|
|
153
|
+
code: "builderContext.context",
|
|
154
|
+
},
|
|
155
|
+
customComponents: {
|
|
156
|
+
code: "Object.values(builderContext.registeredComponents)",
|
|
157
|
+
},
|
|
158
|
+
data: {
|
|
159
|
+
code: "{ ...props.symbol?.data,\n ...builderContext.state,\n ...props.symbol?.content?.data?.state\n}",
|
|
160
|
+
},
|
|
161
|
+
model: {
|
|
162
|
+
code: "props.symbol?.model",
|
|
163
|
+
},
|
|
164
|
+
content: {
|
|
165
|
+
code: "state.content",
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
children: [],
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"@type": "@builder.io/mitosis/node",
|
|
172
|
+
name: "div",
|
|
173
|
+
meta: {},
|
|
174
|
+
scope: {},
|
|
175
|
+
properties: {
|
|
176
|
+
_text: "\n ",
|
|
177
|
+
},
|
|
178
|
+
bindings: {},
|
|
179
|
+
children: [],
|
|
180
|
+
},
|
|
181
|
+
],
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
hooks: {
|
|
185
|
+
onMount: {
|
|
186
|
+
code: "\n state.content = props.symbol?.content;\n",
|
|
187
|
+
},
|
|
188
|
+
onUpdate: [
|
|
189
|
+
{
|
|
190
|
+
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",
|
|
191
|
+
deps: "[props.symbol?.content, props.symbol?.model, props.symbol?.entry, state.content]",
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
},
|
|
195
|
+
context: {
|
|
196
|
+
get: {
|
|
197
|
+
builderContext: {
|
|
198
|
+
name: "BuilderContext",
|
|
199
|
+
path: "../../context/builder.context.lite:default",
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
set: {},
|
|
203
|
+
},
|
|
204
|
+
name: "Symbol",
|
|
205
|
+
subComponents: [],
|
|
206
|
+
interfaces: [
|
|
207
|
+
"export interface SymbolInfo {\n model?: string;\n entry?: string;\n data?: any;\n content?: BuilderContent;\n inline?: boolean;\n dynamic?: boolean;\n}",
|
|
208
|
+
"export interface SymbolProps {\n symbol?: SymbolInfo;\n dataOnly?: boolean;\n dynamic?: boolean;\n builderBlock?: BuilderBlock;\n attributes?: any;\n inheritState?: boolean;\n}",
|
|
209
|
+
],
|
|
210
|
+
propsTypeRef: "SymbolProps",
|
|
211
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
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
|
+
};
|