@builder.io/mitosis 0.0.77 → 0.0.78
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/dist/src/parsers/builder/builder.d.ts +34 -0
- package/dist/src/parsers/{builder.js → builder/builder.js} +16 -12
- package/dist/src/parsers/{helpers/state.d.ts → builder/helpers.d.ts} +2 -2
- package/dist/src/parsers/builder/helpers.js +26 -0
- package/dist/src/parsers/builder/index.d.ts +1 -0
- package/dist/src/parsers/builder/index.js +17 -0
- package/dist/src/parsers/jsx/function-parser.js +54 -73
- package/dist/src/parsers/jsx/helpers.d.ts +1 -0
- package/dist/src/parsers/jsx/helpers.js +10 -2
- package/dist/src/parsers/jsx/{metadata.d.ts → hooks.d.ts} +1 -1
- package/dist/src/parsers/jsx/{metadata.js → hooks.js} +3 -3
- package/dist/src/parsers/jsx/index.d.ts +1 -2
- package/dist/src/parsers/jsx/index.js +3 -5
- package/dist/src/parsers/jsx/jsx.js +4 -2
- package/dist/src/parsers/jsx/state.d.ts +2 -4
- package/dist/src/parsers/jsx/state.js +50 -27
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mAccordion/high.jsx +0 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mAccordion/low.jsx +240 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mAccordion/med.jsx +4 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mFor/high.jsx +0 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mFor/low.jsx +54 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mFor/med.jsx +4 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mImage/high.js +9 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mImage/low.js +0 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mImage/med.js +151 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mImage.slow/high.js +9 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mImage.slow/low.js +0 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mImage.slow/med.js +151 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mbindings/high.cjs +0 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mbindings/low.cjs +45 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mbindings/med.cjs +3 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mbutton/high.js +3 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mbutton/low.js +25 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mbutton/med.js +31 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mcomponent/033[2m/>//033[22mbindings/high.jsx +0 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mcomponent/033[2m/>//033[22mbindings/low.jsx +108 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mcomponent/033[2m/>//033[22mbindings/med.jsx +7 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mcomponent/033[2m/>//033[22mcomponent/inputs/high.cjsx +9 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mcomponent/033[2m/>//033[22mcomponent/inputs/low.cjsx +0 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mcomponent/033[2m/>//033[22mcomponent/inputs/med.cjsx +68 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mfor-loop.bindings/high.cjs +0 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mfor-loop.bindings/low.cjs +58 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mfor-loop.bindings/med.cjs +5 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mhello_world/033[2m/>//033[22mstylesheet/high.jsx +0 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mhello_world/033[2m/>//033[22mstylesheet/low.jsx +26 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mhello_world/033[2m/>//033[22mstylesheet/med.jsx +4 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mmount/high.cjs +0 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mmount/low.cjs +47 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mmount/med.cjs +3 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mpage-with-symbol/high.js +0 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mpage-with-symbol/low.js +33 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mpage-with-symbol/med.js +4 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mshow-hide/high.jsx +9 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mshow-hide/low.jsx +0 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mshow-hide/med.jsx +170 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22msvg/high.js +0 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22msvg/low.js +30 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22msvg/med.js +4 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mtodo/033[2m/>//033[22mTodo.cjs/high.cjs +19 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mtodo/033[2m/>//033[22mTodo.cjs/low.cjs +0 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mtodo/033[2m/>//033[22mTodo.cjs/med.cjs +51 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mtodo/033[2m/>//033[22mTodo.js/high.js +19 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mtodo/033[2m/>//033[22mTodo.js/low.js +0 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mtodo/033[2m/>//033[22mTodo.js/med.js +47 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mtodo/033[2m/>//033[22mTodo.tsx/high.tsx +19 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mtodo/033[2m/>//033[22mTodo.tsx/low.tsx +0 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mtodo/033[2m/>//033[22mTodo.tsx/med.tsx +43 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mtodos/033[2m/>//033[22mTodo.tsx/high.tsx +7 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mtodos/033[2m/>//033[22mTodo.tsx/low.tsx +34 -0
- package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mtodos/033[2m/>//033[22mTodo.tsx/med.tsx +4 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/parsers/builder.d.ts +0 -104
- package/dist/src/parsers/constants/outdated-prefixes.d.ts +0 -10
- package/dist/src/parsers/constants/outdated-prefixes.js +0 -13
- package/dist/src/parsers/helpers/state.js +0 -30
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Fragment,
|
|
3
|
+
h,
|
|
4
|
+
qrl,
|
|
5
|
+
useStore,
|
|
6
|
+
useStylesScopedQrl,
|
|
7
|
+
} from "@builder.io/qwik";
|
|
8
|
+
export const MyComponentStyles = `.csw5022{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:20px;align-items:stretch}.csanagh{margin-top:10px;position:relative;display:flex;align-items:stretch;flex-direction:column;padding-bottom:10px}.c4qyc1p{position:relative;display:flex;align-items:stretch;flex-direction:column;margin-top:10px;padding-bottom:10px}.crwdrpw{text-align:left;display:flex;flex-direction:column}.ctcw2m4{padding-top:50px;text-align:left;display:flex;flex-direction:column;padding-bottom:50px}`;
|
|
9
|
+
export const MyComponentOnMount = (props) => {
|
|
10
|
+
const state = useStore(() => {
|
|
11
|
+
const state = Object.assign(
|
|
12
|
+
{},
|
|
13
|
+
props,
|
|
14
|
+
typeof __STATE__ === "object" ? __STATE__[props.serverStateId] : undefined
|
|
15
|
+
);
|
|
16
|
+
return state;
|
|
17
|
+
});
|
|
18
|
+
useStylesScopedQrl(qrl("./low.js", "MyComponentStyles", []));
|
|
19
|
+
return (
|
|
20
|
+
<div
|
|
21
|
+
builder-id="builder-bb2f62792e464d73b7cb89258027f356"
|
|
22
|
+
gridRowWidth="25%"
|
|
23
|
+
class="csw5022 builder-block"
|
|
24
|
+
items={[
|
|
25
|
+
{
|
|
26
|
+
title: [
|
|
27
|
+
{
|
|
28
|
+
"@type": "@builder.io/sdk:Element",
|
|
29
|
+
"@version": 2,
|
|
30
|
+
layerName: "Accordion item title",
|
|
31
|
+
id: "builder-5fed2723c1cc4fb39e9d22b9c54ef179",
|
|
32
|
+
children: [
|
|
33
|
+
{
|
|
34
|
+
"@type": "@builder.io/sdk:Element",
|
|
35
|
+
"@version": 2,
|
|
36
|
+
id: "builder-2cad86b387ec405d82917895d7af0a12",
|
|
37
|
+
component: {
|
|
38
|
+
name: "Text",
|
|
39
|
+
options: { text: "<p>Item 1</p>" },
|
|
40
|
+
},
|
|
41
|
+
responsiveStyles: {
|
|
42
|
+
large: {
|
|
43
|
+
textAlign: "left",
|
|
44
|
+
display: "flex",
|
|
45
|
+
flexDirection: "column",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
responsiveStyles: {
|
|
51
|
+
large: {
|
|
52
|
+
marginTop: "10px",
|
|
53
|
+
position: "relative",
|
|
54
|
+
display: "flex",
|
|
55
|
+
alignItems: "stretch",
|
|
56
|
+
flexDirection: "column",
|
|
57
|
+
paddingBottom: "10px",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
detail: [
|
|
63
|
+
{
|
|
64
|
+
"@type": "@builder.io/sdk:Element",
|
|
65
|
+
"@version": 2,
|
|
66
|
+
layerName: "Accordion item detail",
|
|
67
|
+
id: "builder-18279a99b32240f19aa21d3f4b015cc9",
|
|
68
|
+
children: [
|
|
69
|
+
{
|
|
70
|
+
"@type": "@builder.io/sdk:Element",
|
|
71
|
+
"@version": 2,
|
|
72
|
+
id: "builder-2dbfa56b8988461c8566bbe759580e9b",
|
|
73
|
+
component: {
|
|
74
|
+
name: "Text",
|
|
75
|
+
options: { text: "<p>Item 1 content</p>" },
|
|
76
|
+
},
|
|
77
|
+
responsiveStyles: {
|
|
78
|
+
large: {
|
|
79
|
+
paddingTop: "50px",
|
|
80
|
+
textAlign: "left",
|
|
81
|
+
display: "flex",
|
|
82
|
+
flexDirection: "column",
|
|
83
|
+
paddingBottom: "50px",
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
responsiveStyles: {
|
|
89
|
+
large: {
|
|
90
|
+
position: "relative",
|
|
91
|
+
display: "flex",
|
|
92
|
+
alignItems: "stretch",
|
|
93
|
+
flexDirection: "column",
|
|
94
|
+
marginTop: "10px",
|
|
95
|
+
paddingBottom: "10px",
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
title: [
|
|
103
|
+
{
|
|
104
|
+
"@type": "@builder.io/sdk:Element",
|
|
105
|
+
"@version": 2,
|
|
106
|
+
layerName: "Accordion item title",
|
|
107
|
+
id: "builder-2a93def22a354cf7aa193c20d1ad6def",
|
|
108
|
+
children: [
|
|
109
|
+
{
|
|
110
|
+
"@type": "@builder.io/sdk:Element",
|
|
111
|
+
"@version": 2,
|
|
112
|
+
id: "builder-1365fc457ece45db82ad90dbe9819e7c",
|
|
113
|
+
component: {
|
|
114
|
+
name: "Text",
|
|
115
|
+
options: { text: "<p>Item 2</p>" },
|
|
116
|
+
},
|
|
117
|
+
responsiveStyles: {
|
|
118
|
+
large: {
|
|
119
|
+
textAlign: "left",
|
|
120
|
+
display: "flex",
|
|
121
|
+
flexDirection: "column",
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
responsiveStyles: {
|
|
127
|
+
large: {
|
|
128
|
+
marginTop: "10px",
|
|
129
|
+
position: "relative",
|
|
130
|
+
display: "flex",
|
|
131
|
+
alignItems: "stretch",
|
|
132
|
+
flexDirection: "column",
|
|
133
|
+
paddingBottom: "10px",
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
detail: [
|
|
139
|
+
{
|
|
140
|
+
"@type": "@builder.io/sdk:Element",
|
|
141
|
+
"@version": 2,
|
|
142
|
+
layerName: "Accordion item detail",
|
|
143
|
+
id: "builder-fd6ef41da6d040328fbd8b0801611fe5",
|
|
144
|
+
children: [
|
|
145
|
+
{
|
|
146
|
+
"@type": "@builder.io/sdk:Element",
|
|
147
|
+
"@version": 2,
|
|
148
|
+
id: "builder-7362f9fd64c647c5a400d9e75c74473f",
|
|
149
|
+
component: {
|
|
150
|
+
name: "Text",
|
|
151
|
+
options: { text: "<p>Item 2 content</p>" },
|
|
152
|
+
},
|
|
153
|
+
responsiveStyles: {
|
|
154
|
+
large: {
|
|
155
|
+
paddingTop: "50px",
|
|
156
|
+
textAlign: "left",
|
|
157
|
+
display: "flex",
|
|
158
|
+
flexDirection: "column",
|
|
159
|
+
paddingBottom: "50px",
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
responsiveStyles: {
|
|
165
|
+
large: {
|
|
166
|
+
position: "relative",
|
|
167
|
+
display: "flex",
|
|
168
|
+
alignItems: "stretch",
|
|
169
|
+
flexDirection: "column",
|
|
170
|
+
marginTop: "10px",
|
|
171
|
+
paddingBottom: "10px",
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
],
|
|
176
|
+
},
|
|
177
|
+
]}
|
|
178
|
+
animate={true}
|
|
179
|
+
>
|
|
180
|
+
<div>
|
|
181
|
+
<div builder="accordion">
|
|
182
|
+
<div builder="accordion-title">
|
|
183
|
+
<div
|
|
184
|
+
builder-id="builder-5fed2723c1cc4fb39e9d22b9c54ef179"
|
|
185
|
+
class="csanagh"
|
|
186
|
+
>
|
|
187
|
+
<div class="crwdrpw">
|
|
188
|
+
<div
|
|
189
|
+
dangerouslySetInnerHTML="<p>Item 1</p>"
|
|
190
|
+
class="builder-text"
|
|
191
|
+
></div>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
<div builder="accordion-detail">
|
|
196
|
+
<div
|
|
197
|
+
builder-id="builder-18279a99b32240f19aa21d3f4b015cc9"
|
|
198
|
+
class="c4qyc1p"
|
|
199
|
+
>
|
|
200
|
+
<div class="ctcw2m4">
|
|
201
|
+
<div
|
|
202
|
+
dangerouslySetInnerHTML="<p>Item 1 content</p>"
|
|
203
|
+
class="builder-text"
|
|
204
|
+
></div>
|
|
205
|
+
</div>
|
|
206
|
+
</div>
|
|
207
|
+
</div>
|
|
208
|
+
</div>
|
|
209
|
+
<div builder="accordion">
|
|
210
|
+
<div builder="accordion-title">
|
|
211
|
+
<div
|
|
212
|
+
builder-id="builder-2a93def22a354cf7aa193c20d1ad6def"
|
|
213
|
+
class="csanagh"
|
|
214
|
+
>
|
|
215
|
+
<div class="crwdrpw">
|
|
216
|
+
<div
|
|
217
|
+
dangerouslySetInnerHTML="<p>Item 2</p>"
|
|
218
|
+
class="builder-text"
|
|
219
|
+
></div>
|
|
220
|
+
</div>
|
|
221
|
+
</div>
|
|
222
|
+
</div>
|
|
223
|
+
<div builder="accordion-detail">
|
|
224
|
+
<div
|
|
225
|
+
builder-id="builder-fd6ef41da6d040328fbd8b0801611fe5"
|
|
226
|
+
class="c4qyc1p"
|
|
227
|
+
>
|
|
228
|
+
<div class="ctcw2m4">
|
|
229
|
+
<div
|
|
230
|
+
dangerouslySetInnerHTML="<p>Item 2 content</p>"
|
|
231
|
+
class="builder-text"
|
|
232
|
+
></div>
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
</div>
|
|
239
|
+
);
|
|
240
|
+
};
|
package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mFor/high.jsx
ADDED
|
File without changes
|
package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mFor/low.jsx
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Fragment,
|
|
3
|
+
h,
|
|
4
|
+
qrl,
|
|
5
|
+
useStore,
|
|
6
|
+
useStylesScopedQrl,
|
|
7
|
+
} from "@builder.io/qwik";
|
|
8
|
+
export const MyComponentStyles = `.cvdfnp5{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:0px;padding-left:20px;padding-right:20px;padding-top:50px;padding-bottom:50px;width:100vw;margin-left:calc(50% - 50vw)}.cz5wnof{width:100%;align-self:stretch;flex-grow:1;box-sizing:border-box;max-width:1200px;display:flex;flex-direction:column;align-items:stretch;margin-left:auto;margin-right:auto}.cdrk993{text-align:center}`;
|
|
9
|
+
export const MyComponentOnMount = (props) => {
|
|
10
|
+
const state = useStore(() => {
|
|
11
|
+
const state = Object.assign(
|
|
12
|
+
{},
|
|
13
|
+
props,
|
|
14
|
+
typeof __STATE__ === "object" ? __STATE__[props.serverStateId] : undefined
|
|
15
|
+
);
|
|
16
|
+
return state;
|
|
17
|
+
});
|
|
18
|
+
useStylesScopedQrl(qrl("./low.js", "MyComponentStyles", []));
|
|
19
|
+
return (
|
|
20
|
+
<div
|
|
21
|
+
builder-id="builder-a58a66676d9b4ecc826c1b8bc5ad91f1"
|
|
22
|
+
class="cvdfnp5 builder-block"
|
|
23
|
+
maxWidth={1200}
|
|
24
|
+
>
|
|
25
|
+
<section
|
|
26
|
+
builder-id="builder-a58a66676d9b4ecc826c1b8bc5ad91f1"
|
|
27
|
+
class="cz5wnof"
|
|
28
|
+
>
|
|
29
|
+
{(state.simpleList.results || []).map(
|
|
30
|
+
function (item) {
|
|
31
|
+
var state = Object.assign({}, this, {
|
|
32
|
+
resultsItem: item == null ? {} : item,
|
|
33
|
+
});
|
|
34
|
+
return (
|
|
35
|
+
<div class="cdrk993">
|
|
36
|
+
<div
|
|
37
|
+
class="builder-text"
|
|
38
|
+
dangerouslySetInnerHTML={(() => {
|
|
39
|
+
try {
|
|
40
|
+
var _virtual_index = state.resultsItem.data.title;
|
|
41
|
+
return _virtual_index;
|
|
42
|
+
} catch (err) {
|
|
43
|
+
console.warn("Builder code error", err);
|
|
44
|
+
}
|
|
45
|
+
})()}
|
|
46
|
+
></div>
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
}.bind(state)
|
|
50
|
+
)}
|
|
51
|
+
</section>
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
};
|
package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mImage/low.js
ADDED
|
File without changes
|
package/dist/test/src/__tests__/qwik.test.ts/033[2m/>//033[22mqwik/033[2m/>//033[22mImage/med.js
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Fragment,
|
|
3
|
+
componentQrl,
|
|
4
|
+
h,
|
|
5
|
+
qrl,
|
|
6
|
+
useStore,
|
|
7
|
+
useStylesScopedQrl,
|
|
8
|
+
} from "@builder.io/qwik";
|
|
9
|
+
export const MyComponentStyles = `.cvk52jt{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:20px;min-height:20px;min-width:20px;overflow:hidden}.cjrqfb1{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:20px;line-height:normal;height:auto;text-align:center}`;
|
|
10
|
+
export const MyComponentOnMount = (props) => {
|
|
11
|
+
const state = useStore(() => {
|
|
12
|
+
const state = Object.assign(
|
|
13
|
+
{},
|
|
14
|
+
props,
|
|
15
|
+
typeof __STATE__ === "object" ? __STATE__[props.serverStateId] : undefined
|
|
16
|
+
);
|
|
17
|
+
if (!state.hasOwnProperty("myState")) state.myState = "initialValue";
|
|
18
|
+
return state;
|
|
19
|
+
});
|
|
20
|
+
useStylesScopedQrl(qrl("./med.js", "MyComponentStyles", []));
|
|
21
|
+
return h(
|
|
22
|
+
Fragment,
|
|
23
|
+
null,
|
|
24
|
+
h(Image, {
|
|
25
|
+
"builder-id": "builder-fa4480d2f48a44a7a2e98cf07c54927b",
|
|
26
|
+
image:
|
|
27
|
+
"https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=1160",
|
|
28
|
+
backgroundSize: "cover",
|
|
29
|
+
backgroundPosition: "center",
|
|
30
|
+
srcset:
|
|
31
|
+
"https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=100 100w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=200 200w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=400 400w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=800 800w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=1200 1200w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=1600 1600w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=2000 2000w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=1160 1160w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=598 598w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=958 958w",
|
|
32
|
+
sizes: "(max-width: 638px) 94vw, (max-width: 998px) 96vw, 83vw",
|
|
33
|
+
class: "cvk52jt builder-block",
|
|
34
|
+
onClick$: qrl("./high.js", "MyComponent_onClick_0", [state]),
|
|
35
|
+
lazy: false,
|
|
36
|
+
fitContent: true,
|
|
37
|
+
aspectRatio: 1,
|
|
38
|
+
height: 1300,
|
|
39
|
+
width: 1300,
|
|
40
|
+
}),
|
|
41
|
+
h(
|
|
42
|
+
"div",
|
|
43
|
+
{ class: "cjrqfb1" },
|
|
44
|
+
h("div", {
|
|
45
|
+
class: "builder-text",
|
|
46
|
+
dangerouslySetInnerHTML: (() => {
|
|
47
|
+
try {
|
|
48
|
+
var _virtual_index = state.myState;
|
|
49
|
+
return _virtual_index;
|
|
50
|
+
} catch (err) {
|
|
51
|
+
console.warn("Builder code error", err);
|
|
52
|
+
}
|
|
53
|
+
})(),
|
|
54
|
+
})
|
|
55
|
+
)
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
export const MyComponent = componentQrl(
|
|
59
|
+
qrl("./med.js", "MyComponentOnMount", [])
|
|
60
|
+
);
|
|
61
|
+
export const Image = function Image(props) {
|
|
62
|
+
let jsx = props.children || [];
|
|
63
|
+
let image = props.image;
|
|
64
|
+
if (image) {
|
|
65
|
+
const isBuilderIoImage =
|
|
66
|
+
!!(image || "").match(/\.builder\.io/) && !props.noWebp;
|
|
67
|
+
const isPixel = props.builderBlock?.id.startsWith("builder-pixel-");
|
|
68
|
+
const imgProps = {
|
|
69
|
+
src: props.image,
|
|
70
|
+
style:
|
|
71
|
+
`object-fit:${props.backgroundSize || "cover"};object-position:${
|
|
72
|
+
props.backgroundPosition || "center"
|
|
73
|
+
};` +
|
|
74
|
+
(props.aspectRatio
|
|
75
|
+
? "position:absolute;height:100%;width:100%;top:0;left:0"
|
|
76
|
+
: ""),
|
|
77
|
+
sizes: props.sizes,
|
|
78
|
+
alt: props.altText,
|
|
79
|
+
role: !props.altText ? "presentation" : void 0,
|
|
80
|
+
loading: isPixel ? "eager" : "lazy",
|
|
81
|
+
srcset: void 0,
|
|
82
|
+
};
|
|
83
|
+
const qwikBugWorkaround = (imgProps2) =>
|
|
84
|
+
Object.keys(imgProps2).forEach(
|
|
85
|
+
(k) => imgProps2[k] === void 0 && delete imgProps2[k]
|
|
86
|
+
);
|
|
87
|
+
qwikBugWorkaround(imgProps);
|
|
88
|
+
if (isBuilderIoImage) {
|
|
89
|
+
const webpImage = updateQueryParam(image, "format", "webp");
|
|
90
|
+
const srcset = ["100", "200", "400", "800", "1200", "1600", "2000"]
|
|
91
|
+
.concat(props.srcsetSizes ? String(props.srcsetSizes).split(" ") : [])
|
|
92
|
+
.map((size) => {
|
|
93
|
+
return updateQueryParam(webpImage, "width", size) + " " + size + "w";
|
|
94
|
+
})
|
|
95
|
+
.concat([image])
|
|
96
|
+
.join(",");
|
|
97
|
+
imgProps.srcset = srcset;
|
|
98
|
+
jsx = jsx = [
|
|
99
|
+
h("picture", {}, [
|
|
100
|
+
h("source", { type: "image/webp", srcset }),
|
|
101
|
+
h("img", imgProps, jsx),
|
|
102
|
+
]),
|
|
103
|
+
];
|
|
104
|
+
} else {
|
|
105
|
+
jsx = [h("img", imgProps, jsx)];
|
|
106
|
+
}
|
|
107
|
+
if (
|
|
108
|
+
props.aspectRatio &&
|
|
109
|
+
!(props.fitContent && props.children && props.children.length)
|
|
110
|
+
) {
|
|
111
|
+
const sizingDiv = h("div", {
|
|
112
|
+
class: "builder-image-sizer",
|
|
113
|
+
style: `width:100%;padding-top:${
|
|
114
|
+
(props.aspectRatio || 1) * 100
|
|
115
|
+
}%;pointer-events:none;font-size:0`,
|
|
116
|
+
});
|
|
117
|
+
jsx.push(sizingDiv);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
const children = props.children ? [jsx].concat(props.children) : [jsx];
|
|
121
|
+
return h(
|
|
122
|
+
props.href ? "a" : "div",
|
|
123
|
+
__passThroughProps__({ href: props.href, class: props.class }, props),
|
|
124
|
+
children
|
|
125
|
+
);
|
|
126
|
+
function updateQueryParam(uri = "", key, value) {
|
|
127
|
+
const re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
|
|
128
|
+
const separator = uri.indexOf("?") !== -1 ? "&" : "?";
|
|
129
|
+
if (uri.match(re)) {
|
|
130
|
+
return uri.replace(
|
|
131
|
+
re,
|
|
132
|
+
"$1" + key + "=" + encodeURIComponent(value) + "$2"
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
return uri + separator + key + "=" + encodeURIComponent(value);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
export const __passThroughProps__ = function __passThroughProps__(
|
|
139
|
+
dstProps,
|
|
140
|
+
srcProps
|
|
141
|
+
) {
|
|
142
|
+
for (const key in srcProps) {
|
|
143
|
+
if (
|
|
144
|
+
Object.prototype.hasOwnProperty.call(srcProps, key) &&
|
|
145
|
+
((key.startsWith("on") && key.endsWith("$")) || key == "style")
|
|
146
|
+
) {
|
|
147
|
+
dstProps[key] = srcProps[key];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return dstProps;
|
|
151
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Fragment,
|
|
3
|
+
componentQrl,
|
|
4
|
+
h,
|
|
5
|
+
qrl,
|
|
6
|
+
useStore,
|
|
7
|
+
useStylesScopedQrl,
|
|
8
|
+
} from "@builder.io/qwik";
|
|
9
|
+
export const MyComponentStyles = `.cvk52jt{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:20px;min-height:20px;min-width:20px;overflow:hidden}.cjrqfb1{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:20px;line-height:normal;height:auto;text-align:center}`;
|
|
10
|
+
export const MyComponentOnMount = (props) => {
|
|
11
|
+
const state = useStore(() => {
|
|
12
|
+
const state = Object.assign(
|
|
13
|
+
{},
|
|
14
|
+
props,
|
|
15
|
+
typeof __STATE__ === "object" ? __STATE__[props.serverStateId] : undefined
|
|
16
|
+
);
|
|
17
|
+
if (!state.hasOwnProperty("myState")) state.myState = "initialValue";
|
|
18
|
+
return state;
|
|
19
|
+
});
|
|
20
|
+
useStylesScopedQrl(qrl("./med.js", "MyComponentStyles", []));
|
|
21
|
+
return h(
|
|
22
|
+
Fragment,
|
|
23
|
+
null,
|
|
24
|
+
h(Image, {
|
|
25
|
+
"builder-id": "builder-fa4480d2f48a44a7a2e98cf07c54927b",
|
|
26
|
+
image:
|
|
27
|
+
"https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=1160",
|
|
28
|
+
backgroundSize: "cover",
|
|
29
|
+
backgroundPosition: "center",
|
|
30
|
+
srcset:
|
|
31
|
+
"https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=100 100w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=200 200w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=400 400w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=800 800w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=1200 1200w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=1600 1600w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=2000 2000w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=1160 1160w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=598 598w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=958 958w",
|
|
32
|
+
sizes: "(max-width: 638px) 94vw, (max-width: 998px) 96vw, 83vw",
|
|
33
|
+
class: "cvk52jt builder-block",
|
|
34
|
+
onClick$: qrl("./high.js", "MyComponent_onClick_0", [state]),
|
|
35
|
+
lazy: false,
|
|
36
|
+
fitContent: true,
|
|
37
|
+
aspectRatio: 1,
|
|
38
|
+
height: 1300,
|
|
39
|
+
width: 1300,
|
|
40
|
+
}),
|
|
41
|
+
h(
|
|
42
|
+
"div",
|
|
43
|
+
{ class: "cjrqfb1" },
|
|
44
|
+
h("div", {
|
|
45
|
+
class: "builder-text",
|
|
46
|
+
dangerouslySetInnerHTML: (() => {
|
|
47
|
+
try {
|
|
48
|
+
var _virtual_index = state.myState;
|
|
49
|
+
return _virtual_index;
|
|
50
|
+
} catch (err) {
|
|
51
|
+
console.warn("Builder code error", err);
|
|
52
|
+
}
|
|
53
|
+
})(),
|
|
54
|
+
})
|
|
55
|
+
)
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
export const MyComponent = componentQrl(
|
|
59
|
+
qrl("./med.js", "MyComponentOnMount", [])
|
|
60
|
+
);
|
|
61
|
+
export const Image = function Image(props) {
|
|
62
|
+
let jsx = props.children || [];
|
|
63
|
+
let image = props.image;
|
|
64
|
+
if (image) {
|
|
65
|
+
const isBuilderIoImage =
|
|
66
|
+
!!(image || "").match(/\.builder\.io/) && !props.noWebp;
|
|
67
|
+
const isPixel = props.builderBlock?.id.startsWith("builder-pixel-");
|
|
68
|
+
const imgProps = {
|
|
69
|
+
src: props.image,
|
|
70
|
+
style:
|
|
71
|
+
`object-fit:${props.backgroundSize || "cover"};object-position:${
|
|
72
|
+
props.backgroundPosition || "center"
|
|
73
|
+
};` +
|
|
74
|
+
(props.aspectRatio
|
|
75
|
+
? "position:absolute;height:100%;width:100%;top:0;left:0"
|
|
76
|
+
: ""),
|
|
77
|
+
sizes: props.sizes,
|
|
78
|
+
alt: props.altText,
|
|
79
|
+
role: !props.altText ? "presentation" : void 0,
|
|
80
|
+
loading: isPixel ? "eager" : "lazy",
|
|
81
|
+
srcset: void 0,
|
|
82
|
+
};
|
|
83
|
+
const qwikBugWorkaround = (imgProps2) =>
|
|
84
|
+
Object.keys(imgProps2).forEach(
|
|
85
|
+
(k) => imgProps2[k] === void 0 && delete imgProps2[k]
|
|
86
|
+
);
|
|
87
|
+
qwikBugWorkaround(imgProps);
|
|
88
|
+
if (isBuilderIoImage) {
|
|
89
|
+
const webpImage = updateQueryParam(image, "format", "webp");
|
|
90
|
+
const srcset = ["100", "200", "400", "800", "1200", "1600", "2000"]
|
|
91
|
+
.concat(props.srcsetSizes ? String(props.srcsetSizes).split(" ") : [])
|
|
92
|
+
.map((size) => {
|
|
93
|
+
return updateQueryParam(webpImage, "width", size) + " " + size + "w";
|
|
94
|
+
})
|
|
95
|
+
.concat([image])
|
|
96
|
+
.join(",");
|
|
97
|
+
imgProps.srcset = srcset;
|
|
98
|
+
jsx = jsx = [
|
|
99
|
+
h("picture", {}, [
|
|
100
|
+
h("source", { type: "image/webp", srcset }),
|
|
101
|
+
h("img", imgProps, jsx),
|
|
102
|
+
]),
|
|
103
|
+
];
|
|
104
|
+
} else {
|
|
105
|
+
jsx = [h("img", imgProps, jsx)];
|
|
106
|
+
}
|
|
107
|
+
if (
|
|
108
|
+
props.aspectRatio &&
|
|
109
|
+
!(props.fitContent && props.children && props.children.length)
|
|
110
|
+
) {
|
|
111
|
+
const sizingDiv = h("div", {
|
|
112
|
+
class: "builder-image-sizer",
|
|
113
|
+
style: `width:100%;padding-top:${
|
|
114
|
+
(props.aspectRatio || 1) * 100
|
|
115
|
+
}%;pointer-events:none;font-size:0`,
|
|
116
|
+
});
|
|
117
|
+
jsx.push(sizingDiv);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
const children = props.children ? [jsx].concat(props.children) : [jsx];
|
|
121
|
+
return h(
|
|
122
|
+
props.href ? "a" : "div",
|
|
123
|
+
__passThroughProps__({ href: props.href, class: props.class }, props),
|
|
124
|
+
children
|
|
125
|
+
);
|
|
126
|
+
function updateQueryParam(uri = "", key, value) {
|
|
127
|
+
const re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
|
|
128
|
+
const separator = uri.indexOf("?") !== -1 ? "&" : "?";
|
|
129
|
+
if (uri.match(re)) {
|
|
130
|
+
return uri.replace(
|
|
131
|
+
re,
|
|
132
|
+
"$1" + key + "=" + encodeURIComponent(value) + "$2"
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
return uri + separator + key + "=" + encodeURIComponent(value);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
export const __passThroughProps__ = function __passThroughProps__(
|
|
139
|
+
dstProps,
|
|
140
|
+
srcProps
|
|
141
|
+
) {
|
|
142
|
+
for (const key in srcProps) {
|
|
143
|
+
if (
|
|
144
|
+
Object.prototype.hasOwnProperty.call(srcProps, key) &&
|
|
145
|
+
((key.startsWith("on") && key.endsWith("$")) || key == "style")
|
|
146
|
+
) {
|
|
147
|
+
dstProps[key] = srcProps[key];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return dstProps;
|
|
151
|
+
};
|
|
File without changes
|