@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,554 @@
|
|
|
1
|
+
// GENERATED BY MITOSIS
|
|
2
|
+
|
|
3
|
+
import { getSrcSet } from "./image.helpers";
|
|
4
|
+
import {
|
|
5
|
+
Fragment,
|
|
6
|
+
Host,
|
|
7
|
+
Slot,
|
|
8
|
+
component$,
|
|
9
|
+
h,
|
|
10
|
+
useStylesScoped$,
|
|
11
|
+
} from "@builder.io/qwik";
|
|
12
|
+
export const srcSetToUse = function srcSetToUse(props, state) {
|
|
13
|
+
const imageToUse = props.image || props.src;
|
|
14
|
+
const url = imageToUse;
|
|
15
|
+
|
|
16
|
+
if (
|
|
17
|
+
!url || // We can auto add srcset for cdn.builder.io and shopify
|
|
18
|
+
// images, otherwise you can supply this prop manually
|
|
19
|
+
!(url.match(/builder\.io/) || url.match(/cdn\.shopify\.com/))
|
|
20
|
+
) {
|
|
21
|
+
return props.srcset;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (props.srcset && props.image?.includes("builder.io/api/v1/image")) {
|
|
25
|
+
if (!props.srcset.includes(props.image.split("?")[0])) {
|
|
26
|
+
console.debug("Removed given srcset");
|
|
27
|
+
return getSrcSet(url);
|
|
28
|
+
}
|
|
29
|
+
} else if (props.image && !props.srcset) {
|
|
30
|
+
return getSrcSet(url);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return getSrcSet(url);
|
|
34
|
+
};
|
|
35
|
+
export const webpSrcSet = function webpSrcSet(props, state) {
|
|
36
|
+
if (srcSetToUse(props, state)?.match(/builder\.io/) && !props.noWebp) {
|
|
37
|
+
return srcSetToUse(props, state).replace(/\?/g, "?format=webp&");
|
|
38
|
+
} else {
|
|
39
|
+
return "";
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
export const Image = component$(
|
|
43
|
+
(props) => {
|
|
44
|
+
useStylesScoped$(STYLES);
|
|
45
|
+
const state = {};
|
|
46
|
+
return (
|
|
47
|
+
<Host class="div-Image">
|
|
48
|
+
<>
|
|
49
|
+
<picture>
|
|
50
|
+
{webpSrcSet(props, state) ? (
|
|
51
|
+
<source
|
|
52
|
+
type="image/webp"
|
|
53
|
+
srcset={webpSrcSet(props, state)}
|
|
54
|
+
></source>
|
|
55
|
+
) : null}
|
|
56
|
+
<img
|
|
57
|
+
loading="lazy"
|
|
58
|
+
alt={props.altText}
|
|
59
|
+
role={props.altText ? "presentation" : undefined}
|
|
60
|
+
style={{
|
|
61
|
+
objectPosition: props.backgroundSize || "center",
|
|
62
|
+
objectFit: props.backgroundSize || "cover",
|
|
63
|
+
}}
|
|
64
|
+
class={
|
|
65
|
+
"builder-image" +
|
|
66
|
+
(props.className ? " " + props.className : "") +
|
|
67
|
+
" img-Image"
|
|
68
|
+
}
|
|
69
|
+
src={props.image}
|
|
70
|
+
srcset={srcSetToUse(props, state)}
|
|
71
|
+
sizes={props.sizes}
|
|
72
|
+
></img>
|
|
73
|
+
<source srcset={srcSetToUse(props, state)}></source>
|
|
74
|
+
</picture>
|
|
75
|
+
{props.aspectRatio &&
|
|
76
|
+
!(props.fitContent && props.builderBlock?.children?.length) ? (
|
|
77
|
+
<div
|
|
78
|
+
class="builder-image-sizer div-Image-2"
|
|
79
|
+
style={{
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
81
|
+
paddingTop: props.aspectRatio * 100 + "%",
|
|
82
|
+
}}
|
|
83
|
+
></div>
|
|
84
|
+
) : null}
|
|
85
|
+
{props.builderBlock?.children?.length && props.fitContent ? (
|
|
86
|
+
<Slot></Slot>
|
|
87
|
+
) : null}
|
|
88
|
+
{!props.fitContent ? (
|
|
89
|
+
<div class="div-Image-3">
|
|
90
|
+
<Slot></Slot>
|
|
91
|
+
</div>
|
|
92
|
+
) : null}
|
|
93
|
+
</>
|
|
94
|
+
</Host>
|
|
95
|
+
);
|
|
96
|
+
},
|
|
97
|
+
{ tagName: "div" }
|
|
98
|
+
);
|
|
99
|
+
export default Image;
|
|
100
|
+
export const STYLES = `.div-Image {
|
|
101
|
+
position: relative; }.img-Image {
|
|
102
|
+
opacity: 1;
|
|
103
|
+
transition: opacity 0.2s ease-in-out;
|
|
104
|
+
position: absolute;
|
|
105
|
+
height: 100%;
|
|
106
|
+
width: 100%;
|
|
107
|
+
top: 0px;
|
|
108
|
+
left: 0px; }.div-Image-2 {
|
|
109
|
+
width: 100%;
|
|
110
|
+
pointer-events: none;
|
|
111
|
+
font-size: 0; }.div-Image-3 {
|
|
112
|
+
display: flex;
|
|
113
|
+
flex-direction: column;
|
|
114
|
+
align-items: stretch;
|
|
115
|
+
position: absolute;
|
|
116
|
+
top: 0;
|
|
117
|
+
left: 0;
|
|
118
|
+
width: 100%;
|
|
119
|
+
height: 100%; }`;
|
|
120
|
+
export const COMPONENT = {
|
|
121
|
+
"@type": "@builder.io/mitosis/component",
|
|
122
|
+
imports: [
|
|
123
|
+
{
|
|
124
|
+
imports: {
|
|
125
|
+
getSrcSet: "getSrcSet",
|
|
126
|
+
},
|
|
127
|
+
path: "./image.helpers",
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
exports: {},
|
|
131
|
+
inputs: [],
|
|
132
|
+
meta: {},
|
|
133
|
+
refs: {},
|
|
134
|
+
state: {
|
|
135
|
+
srcSetToUse:
|
|
136
|
+
"@builder.io/mitosis/method:get srcSetToUse() {\n const imageToUse = props.image || props.src;\n const url = imageToUse;\n\n if (!url || // We can auto add srcset for cdn.builder.io and shopify\n // images, otherwise you can supply this prop manually\n !(url.match(/builder\\.io/) || url.match(/cdn\\.shopify\\.com/))) {\n return props.srcset;\n }\n\n if (props.srcset && props.image?.includes('builder.io/api/v1/image')) {\n if (!props.srcset.includes(props.image.split('?')[0])) {\n console.debug('Removed given srcset');\n return getSrcSet(url);\n }\n } else if (props.image && !props.srcset) {\n return getSrcSet(url);\n }\n\n return getSrcSet(url);\n}",
|
|
137
|
+
webpSrcSet:
|
|
138
|
+
"@builder.io/mitosis/method:get webpSrcSet() {\n if (srcSetToUse(props,state)?.match(/builder\\.io/) && !props.noWebp) {\n return srcSetToUse(props,state).replace(/\\?/g, '?format=webp&');\n } else {\n return '';\n }\n}",
|
|
139
|
+
},
|
|
140
|
+
children: [
|
|
141
|
+
{
|
|
142
|
+
"@type": "@builder.io/mitosis/node",
|
|
143
|
+
name: "Host",
|
|
144
|
+
meta: {},
|
|
145
|
+
scope: {},
|
|
146
|
+
properties: {
|
|
147
|
+
class: "div-Image",
|
|
148
|
+
},
|
|
149
|
+
bindings: {},
|
|
150
|
+
children: [
|
|
151
|
+
{
|
|
152
|
+
"@type": "@builder.io/mitosis/node",
|
|
153
|
+
name: "div",
|
|
154
|
+
meta: {},
|
|
155
|
+
scope: {},
|
|
156
|
+
properties: {
|
|
157
|
+
_text: "\n ",
|
|
158
|
+
},
|
|
159
|
+
bindings: {},
|
|
160
|
+
children: [],
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"@type": "@builder.io/mitosis/node",
|
|
164
|
+
name: "picture",
|
|
165
|
+
meta: {},
|
|
166
|
+
scope: {},
|
|
167
|
+
properties: {},
|
|
168
|
+
bindings: {},
|
|
169
|
+
children: [
|
|
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
|
+
"@type": "@builder.io/mitosis/node",
|
|
183
|
+
name: "Show",
|
|
184
|
+
meta: {},
|
|
185
|
+
scope: {},
|
|
186
|
+
properties: {},
|
|
187
|
+
bindings: {
|
|
188
|
+
when: {
|
|
189
|
+
code: "webpSrcSet(props,state)",
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
children: [
|
|
193
|
+
{
|
|
194
|
+
"@type": "@builder.io/mitosis/node",
|
|
195
|
+
name: "div",
|
|
196
|
+
meta: {},
|
|
197
|
+
scope: {},
|
|
198
|
+
properties: {
|
|
199
|
+
_text: "\n ",
|
|
200
|
+
},
|
|
201
|
+
bindings: {},
|
|
202
|
+
children: [],
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"@type": "@builder.io/mitosis/node",
|
|
206
|
+
name: "source",
|
|
207
|
+
meta: {},
|
|
208
|
+
scope: {},
|
|
209
|
+
properties: {
|
|
210
|
+
type: "image/webp",
|
|
211
|
+
},
|
|
212
|
+
bindings: {
|
|
213
|
+
srcset: {
|
|
214
|
+
code: "webpSrcSet(props,state)",
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
children: [],
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"@type": "@builder.io/mitosis/node",
|
|
221
|
+
name: "div",
|
|
222
|
+
meta: {},
|
|
223
|
+
scope: {},
|
|
224
|
+
properties: {
|
|
225
|
+
_text: "\n ",
|
|
226
|
+
},
|
|
227
|
+
bindings: {},
|
|
228
|
+
children: [],
|
|
229
|
+
},
|
|
230
|
+
],
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"@type": "@builder.io/mitosis/node",
|
|
234
|
+
name: "div",
|
|
235
|
+
meta: {},
|
|
236
|
+
scope: {},
|
|
237
|
+
properties: {
|
|
238
|
+
_text: "\n ",
|
|
239
|
+
},
|
|
240
|
+
bindings: {},
|
|
241
|
+
children: [],
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"@type": "@builder.io/mitosis/node",
|
|
245
|
+
name: "img",
|
|
246
|
+
meta: {},
|
|
247
|
+
scope: {},
|
|
248
|
+
properties: {
|
|
249
|
+
loading: "lazy",
|
|
250
|
+
},
|
|
251
|
+
bindings: {
|
|
252
|
+
alt: {
|
|
253
|
+
code: "props.altText",
|
|
254
|
+
},
|
|
255
|
+
role: {
|
|
256
|
+
code: "props.altText ? 'presentation' : undefined",
|
|
257
|
+
},
|
|
258
|
+
style: {
|
|
259
|
+
code: "{\n objectPosition: props.backgroundSize || 'center',\n objectFit: props.backgroundSize || 'cover'\n}",
|
|
260
|
+
},
|
|
261
|
+
class: {
|
|
262
|
+
code: "'builder-image' + (props.className ? ' ' + props.className : '') + ' img-Image'",
|
|
263
|
+
},
|
|
264
|
+
src: {
|
|
265
|
+
code: "props.image",
|
|
266
|
+
},
|
|
267
|
+
srcset: {
|
|
268
|
+
code: "srcSetToUse(props,state)",
|
|
269
|
+
},
|
|
270
|
+
sizes: {
|
|
271
|
+
code: "props.sizes",
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
children: [],
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"@type": "@builder.io/mitosis/node",
|
|
278
|
+
name: "div",
|
|
279
|
+
meta: {},
|
|
280
|
+
scope: {},
|
|
281
|
+
properties: {
|
|
282
|
+
_text: "\n ",
|
|
283
|
+
},
|
|
284
|
+
bindings: {},
|
|
285
|
+
children: [],
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"@type": "@builder.io/mitosis/node",
|
|
289
|
+
name: "source",
|
|
290
|
+
meta: {},
|
|
291
|
+
scope: {},
|
|
292
|
+
properties: {},
|
|
293
|
+
bindings: {
|
|
294
|
+
srcset: {
|
|
295
|
+
code: "srcSetToUse(props,state)",
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
children: [],
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"@type": "@builder.io/mitosis/node",
|
|
302
|
+
name: "div",
|
|
303
|
+
meta: {},
|
|
304
|
+
scope: {},
|
|
305
|
+
properties: {
|
|
306
|
+
_text: "\n ",
|
|
307
|
+
},
|
|
308
|
+
bindings: {},
|
|
309
|
+
children: [],
|
|
310
|
+
},
|
|
311
|
+
],
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"@type": "@builder.io/mitosis/node",
|
|
315
|
+
name: "div",
|
|
316
|
+
meta: {},
|
|
317
|
+
scope: {},
|
|
318
|
+
properties: {
|
|
319
|
+
_text: "\n ",
|
|
320
|
+
},
|
|
321
|
+
bindings: {},
|
|
322
|
+
children: [],
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
"@type": "@builder.io/mitosis/node",
|
|
326
|
+
name: "Show",
|
|
327
|
+
meta: {},
|
|
328
|
+
scope: {},
|
|
329
|
+
properties: {},
|
|
330
|
+
bindings: {
|
|
331
|
+
when: {
|
|
332
|
+
code: "props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)",
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
children: [
|
|
336
|
+
{
|
|
337
|
+
"@type": "@builder.io/mitosis/node",
|
|
338
|
+
name: "div",
|
|
339
|
+
meta: {},
|
|
340
|
+
scope: {},
|
|
341
|
+
properties: {
|
|
342
|
+
_text: "\n ",
|
|
343
|
+
},
|
|
344
|
+
bindings: {},
|
|
345
|
+
children: [],
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"@type": "@builder.io/mitosis/node",
|
|
349
|
+
name: "div",
|
|
350
|
+
meta: {},
|
|
351
|
+
scope: {},
|
|
352
|
+
properties: {
|
|
353
|
+
class: "builder-image-sizer div-Image-2",
|
|
354
|
+
},
|
|
355
|
+
bindings: {
|
|
356
|
+
style: {
|
|
357
|
+
code: "{\n paddingTop: // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n props.aspectRatio * 100 + '%'\n}",
|
|
358
|
+
},
|
|
359
|
+
},
|
|
360
|
+
children: [],
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"@type": "@builder.io/mitosis/node",
|
|
364
|
+
name: "div",
|
|
365
|
+
meta: {},
|
|
366
|
+
scope: {},
|
|
367
|
+
properties: {
|
|
368
|
+
_text: "\n ",
|
|
369
|
+
},
|
|
370
|
+
bindings: {},
|
|
371
|
+
children: [],
|
|
372
|
+
},
|
|
373
|
+
],
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"@type": "@builder.io/mitosis/node",
|
|
377
|
+
name: "div",
|
|
378
|
+
meta: {},
|
|
379
|
+
scope: {},
|
|
380
|
+
properties: {
|
|
381
|
+
_text: "\n ",
|
|
382
|
+
},
|
|
383
|
+
bindings: {},
|
|
384
|
+
children: [],
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
"@type": "@builder.io/mitosis/node",
|
|
388
|
+
name: "Show",
|
|
389
|
+
meta: {},
|
|
390
|
+
scope: {},
|
|
391
|
+
properties: {},
|
|
392
|
+
bindings: {
|
|
393
|
+
when: {
|
|
394
|
+
code: "props.builderBlock?.children?.length && props.fitContent",
|
|
395
|
+
},
|
|
396
|
+
},
|
|
397
|
+
children: [
|
|
398
|
+
{
|
|
399
|
+
"@type": "@builder.io/mitosis/node",
|
|
400
|
+
name: "div",
|
|
401
|
+
meta: {},
|
|
402
|
+
scope: {},
|
|
403
|
+
properties: {
|
|
404
|
+
_text: "\n ",
|
|
405
|
+
},
|
|
406
|
+
bindings: {},
|
|
407
|
+
children: [],
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"@type": "@builder.io/mitosis/node",
|
|
411
|
+
name: "div",
|
|
412
|
+
meta: {},
|
|
413
|
+
scope: {},
|
|
414
|
+
properties: {},
|
|
415
|
+
bindings: {
|
|
416
|
+
_text: {
|
|
417
|
+
code: "props.children",
|
|
418
|
+
},
|
|
419
|
+
},
|
|
420
|
+
children: [],
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"@type": "@builder.io/mitosis/node",
|
|
424
|
+
name: "div",
|
|
425
|
+
meta: {},
|
|
426
|
+
scope: {},
|
|
427
|
+
properties: {
|
|
428
|
+
_text: "\n ",
|
|
429
|
+
},
|
|
430
|
+
bindings: {},
|
|
431
|
+
children: [],
|
|
432
|
+
},
|
|
433
|
+
],
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
"@type": "@builder.io/mitosis/node",
|
|
437
|
+
name: "div",
|
|
438
|
+
meta: {},
|
|
439
|
+
scope: {},
|
|
440
|
+
properties: {
|
|
441
|
+
_text: "\n\n ",
|
|
442
|
+
},
|
|
443
|
+
bindings: {},
|
|
444
|
+
children: [],
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
"@type": "@builder.io/mitosis/node",
|
|
448
|
+
name: "Show",
|
|
449
|
+
meta: {},
|
|
450
|
+
scope: {},
|
|
451
|
+
properties: {},
|
|
452
|
+
bindings: {
|
|
453
|
+
when: {
|
|
454
|
+
code: "!props.fitContent",
|
|
455
|
+
},
|
|
456
|
+
},
|
|
457
|
+
children: [
|
|
458
|
+
{
|
|
459
|
+
"@type": "@builder.io/mitosis/node",
|
|
460
|
+
name: "div",
|
|
461
|
+
meta: {},
|
|
462
|
+
scope: {},
|
|
463
|
+
properties: {
|
|
464
|
+
_text: "\n ",
|
|
465
|
+
},
|
|
466
|
+
bindings: {},
|
|
467
|
+
children: [],
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"@type": "@builder.io/mitosis/node",
|
|
471
|
+
name: "div",
|
|
472
|
+
meta: {},
|
|
473
|
+
scope: {},
|
|
474
|
+
properties: {
|
|
475
|
+
class: "div-Image-3",
|
|
476
|
+
},
|
|
477
|
+
bindings: {},
|
|
478
|
+
children: [
|
|
479
|
+
{
|
|
480
|
+
"@type": "@builder.io/mitosis/node",
|
|
481
|
+
name: "div",
|
|
482
|
+
meta: {},
|
|
483
|
+
scope: {},
|
|
484
|
+
properties: {
|
|
485
|
+
_text: "\n ",
|
|
486
|
+
},
|
|
487
|
+
bindings: {},
|
|
488
|
+
children: [],
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
"@type": "@builder.io/mitosis/node",
|
|
492
|
+
name: "div",
|
|
493
|
+
meta: {},
|
|
494
|
+
scope: {},
|
|
495
|
+
properties: {},
|
|
496
|
+
bindings: {
|
|
497
|
+
_text: {
|
|
498
|
+
code: "props.children",
|
|
499
|
+
},
|
|
500
|
+
},
|
|
501
|
+
children: [],
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
"@type": "@builder.io/mitosis/node",
|
|
505
|
+
name: "div",
|
|
506
|
+
meta: {},
|
|
507
|
+
scope: {},
|
|
508
|
+
properties: {
|
|
509
|
+
_text: "\n ",
|
|
510
|
+
},
|
|
511
|
+
bindings: {},
|
|
512
|
+
children: [],
|
|
513
|
+
},
|
|
514
|
+
],
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
"@type": "@builder.io/mitosis/node",
|
|
518
|
+
name: "div",
|
|
519
|
+
meta: {},
|
|
520
|
+
scope: {},
|
|
521
|
+
properties: {
|
|
522
|
+
_text: "\n ",
|
|
523
|
+
},
|
|
524
|
+
bindings: {},
|
|
525
|
+
children: [],
|
|
526
|
+
},
|
|
527
|
+
],
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"@type": "@builder.io/mitosis/node",
|
|
531
|
+
name: "div",
|
|
532
|
+
meta: {},
|
|
533
|
+
scope: {},
|
|
534
|
+
properties: {
|
|
535
|
+
_text: "\n ",
|
|
536
|
+
},
|
|
537
|
+
bindings: {},
|
|
538
|
+
children: [],
|
|
539
|
+
},
|
|
540
|
+
],
|
|
541
|
+
},
|
|
542
|
+
],
|
|
543
|
+
hooks: {},
|
|
544
|
+
context: {
|
|
545
|
+
get: {},
|
|
546
|
+
set: {},
|
|
547
|
+
},
|
|
548
|
+
name: "Image",
|
|
549
|
+
subComponents: [],
|
|
550
|
+
interfaces: [
|
|
551
|
+
"export interface ImageProps {\n className?: string;\n image: string;\n sizes?: string;\n lazy?: boolean;\n height?: number;\n width?: number;\n altText?: string;\n backgroundSize?: string;\n backgroundPosition?: string;\n srcset?: string;\n aspectRatio?: number;\n children?: JSX.Element;\n fitContent?: boolean;\n builderBlock?: BuilderBlock;\n noWebp?: boolean;\n src?: string;\n}",
|
|
552
|
+
],
|
|
553
|
+
propsTypeRef: "ImageProps",
|
|
554
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const componentInfo = {
|
|
2
|
+
name: "Raw:Img",
|
|
3
|
+
hideFromInsertMenu: true,
|
|
4
|
+
builtIn: true,
|
|
5
|
+
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
|
|
6
|
+
inputs: [
|
|
7
|
+
{
|
|
8
|
+
name: "image",
|
|
9
|
+
bubble: true,
|
|
10
|
+
type: "file",
|
|
11
|
+
allowedFileTypes: ["jpeg", "jpg", "png", "svg"],
|
|
12
|
+
required: true
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
noWrap: true,
|
|
16
|
+
static: true
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
componentInfo
|
|
20
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// GENERATED BY MITOSIS
|
|
2
|
+
|
|
3
|
+
import { isEditing } from "../../functions/is-editing.js";
|
|
4
|
+
import { Fragment, Host, component$, h } from "@builder.io/qwik";
|
|
5
|
+
export const ImgComponent = component$(
|
|
6
|
+
(props) => {
|
|
7
|
+
return (
|
|
8
|
+
<Host
|
|
9
|
+
style={{
|
|
10
|
+
objectFit: props.backgroundSize || "cover",
|
|
11
|
+
objectPosition: props.backgroundPosition || "center",
|
|
12
|
+
}}
|
|
13
|
+
{...props.attributes}
|
|
14
|
+
key={(isEditing() && props.imgSrc) || "default-key"}
|
|
15
|
+
alt={props.altText}
|
|
16
|
+
src={props.imgSrc}
|
|
17
|
+
></Host>
|
|
18
|
+
);
|
|
19
|
+
},
|
|
20
|
+
{ tagName: "img" }
|
|
21
|
+
);
|
|
22
|
+
export default ImgComponent;
|
|
23
|
+
export const COMPONENT = {
|
|
24
|
+
"@type": "@builder.io/mitosis/component",
|
|
25
|
+
imports: [
|
|
26
|
+
{
|
|
27
|
+
imports: {
|
|
28
|
+
isEditing: "isEditing",
|
|
29
|
+
},
|
|
30
|
+
path: "../../functions/is-editing.js",
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
exports: {},
|
|
34
|
+
inputs: [],
|
|
35
|
+
meta: {},
|
|
36
|
+
refs: {},
|
|
37
|
+
state: {},
|
|
38
|
+
children: [
|
|
39
|
+
{
|
|
40
|
+
"@type": "@builder.io/mitosis/node",
|
|
41
|
+
name: "Host",
|
|
42
|
+
meta: {},
|
|
43
|
+
scope: {},
|
|
44
|
+
properties: {},
|
|
45
|
+
bindings: {
|
|
46
|
+
style: {
|
|
47
|
+
code: "{\n objectFit: props.backgroundSize || 'cover',\n objectPosition: props.backgroundPosition || 'center'\n}",
|
|
48
|
+
},
|
|
49
|
+
_spread: {
|
|
50
|
+
code: "props.attributes",
|
|
51
|
+
},
|
|
52
|
+
key: {
|
|
53
|
+
code: "isEditing() && props.imgSrc || 'default-key'",
|
|
54
|
+
},
|
|
55
|
+
alt: {
|
|
56
|
+
code: "props.altText",
|
|
57
|
+
},
|
|
58
|
+
src: {
|
|
59
|
+
code: "props.imgSrc",
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
children: [],
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
hooks: {},
|
|
66
|
+
context: {
|
|
67
|
+
get: {},
|
|
68
|
+
set: {},
|
|
69
|
+
},
|
|
70
|
+
name: "ImgComponent",
|
|
71
|
+
subComponents: [],
|
|
72
|
+
interfaces: [
|
|
73
|
+
"export interface ImgProps {\n attributes?: any;\n imgSrc?: string;\n altText?: string;\n backgroundSize?: 'cover' | 'contain';\n backgroundPosition?: 'center' | 'top' | 'left' | 'right' | 'bottom' | 'top left' | 'top right' | 'bottom left' | 'bottom right';\n}",
|
|
74
|
+
],
|
|
75
|
+
propsTypeRef: "ImgProps",
|
|
76
|
+
};
|