@builder.io/mitosis 0.0.49 → 0.0.50-0
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/generators/react-native.js +23 -14
- package/dist/test/qwik/Accordion/low.jsx +39 -33
- package/dist/test/qwik/Accordion/med.jsx +1 -0
- package/dist/test/qwik/For/high.jsx +1 -0
- package/dist/test/qwik/For/low.jsx +63 -0
- package/dist/test/qwik/For/med.jsx +10 -0
- package/dist/test/qwik/Image/low.js +20 -47
- package/dist/test/qwik/Image/med.js +3 -1
- package/dist/test/qwik/Image.slow/low.js +20 -47
- package/dist/test/qwik/Image.slow/med.js +3 -1
- package/dist/test/qwik/Todo/Todo.cjs/med.cjs +46 -41
- package/dist/test/qwik/Todo/Todo.js/med.js +1 -1
- package/dist/test/qwik/Todo/Todo.tsx/med.tsx +30 -25
- package/dist/test/qwik/Todos/Todo.tsx/low.tsx +28 -19
- package/dist/test/qwik/Todos/Todo.tsx/med.tsx +1 -0
- package/dist/test/qwik/button/low.js +18 -10
- package/dist/test/qwik/button/med.js +3 -1
- package/dist/test/qwik/component/bindings/high.jsx +1 -0
- package/dist/test/qwik/component/bindings/low.jsx +84 -0
- package/dist/test/qwik/component/bindings/med.jsx +47 -0
- package/dist/test/qwik/hello_world/stylesheet/low.jsx +10 -4
- package/dist/test/qwik/hello_world/stylesheet/med.jsx +1 -0
- package/dist/test/qwik/page-with-symbol/low.js +23 -17
- package/dist/test/qwik/page-with-symbol/med.js +1 -0
- package/dist/test/qwik/svg/low.js +16 -10
- package/dist/test/qwik/svg/med.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -67,25 +67,34 @@ var collectReactNativeStyles = function (json) {
|
|
|
67
67
|
return styleMap;
|
|
68
68
|
};
|
|
69
69
|
exports.collectReactNativeStyles = collectReactNativeStyles;
|
|
70
|
+
// Plugin to convert DOM tags to <View /> and <Text />
|
|
71
|
+
function processReactNative() {
|
|
72
|
+
return function () { return ({
|
|
73
|
+
json: {
|
|
74
|
+
pre: function (json) {
|
|
75
|
+
(0, traverse_1.default)(json).forEach(function (node) {
|
|
76
|
+
var _a, _b, _c;
|
|
77
|
+
if ((0, is_mitosis_node_1.isMitosisNode)(node)) {
|
|
78
|
+
// TODO: handle TextInput, Image, etc
|
|
79
|
+
if (node.name.toLowerCase() === node.name) {
|
|
80
|
+
node.name = 'View';
|
|
81
|
+
}
|
|
82
|
+
if (((_a = node.properties._text) === null || _a === void 0 ? void 0 : _a.trim().length) ||
|
|
83
|
+
((_c = (_b = node.bindings._text) === null || _b === void 0 ? void 0 : _b.trim()) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
84
|
+
node.name = 'Text';
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
}); };
|
|
91
|
+
}
|
|
70
92
|
var componentToReactNative = function (options) {
|
|
71
93
|
if (options === void 0) { options = {}; }
|
|
72
94
|
return function (_a) {
|
|
73
95
|
var component = _a.component, path = _a.path;
|
|
74
96
|
var json = (0, fast_clone_1.fastClone)(component);
|
|
75
|
-
(0,
|
|
76
|
-
var _a, _b, _c;
|
|
77
|
-
if ((0, is_mitosis_node_1.isMitosisNode)(node)) {
|
|
78
|
-
// TODO: handle TextInput, Image, etc
|
|
79
|
-
if (node.name.toLowerCase() === node.name) {
|
|
80
|
-
node.name = 'View';
|
|
81
|
-
}
|
|
82
|
-
if (((_a = node.properties._text) === null || _a === void 0 ? void 0 : _a.trim().length) ||
|
|
83
|
-
((_c = (_b = node.bindings._text) === null || _b === void 0 ? void 0 : _b.trim()) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
84
|
-
node.name = 'Text';
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
return (0, react_1.componentToReact)(__assign(__assign({}, options), { stylesType: options.stylesType || 'react-native', type: 'native' }))({ component: json, path: path });
|
|
97
|
+
return (0, react_1.componentToReact)(__assign(__assign({}, options), { plugins: (options.plugins || []).concat([processReactNative()]), stylesType: options.stylesType || 'react-native', type: 'native' }))({ component: json, path: path });
|
|
89
98
|
};
|
|
90
99
|
};
|
|
91
100
|
exports.componentToReactNative = componentToReactNative;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { __merge } from "./med";
|
|
2
|
+
|
|
1
3
|
import { h, qHook } from "@builder.io/qwik";
|
|
2
4
|
|
|
3
5
|
|
|
@@ -41,52 +43,56 @@ export const MyComponent_styles = `
|
|
|
41
43
|
}
|
|
42
44
|
`;
|
|
43
45
|
|
|
44
|
-
export const MyComponent_onRender = qHook((
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
46
|
+
export const MyComponent_onRender = qHook((__props__, __state__) => {
|
|
47
|
+
const state = __merge(__state__, __props__);
|
|
48
|
+
;
|
|
49
|
+
return (
|
|
50
|
+
<div gridRowWidth="25%"
|
|
51
|
+
class="csw5022"
|
|
52
|
+
items={[{title:[{'@type':'@builder.io/sdk:Element','@version':2,layerName:'Accordion item title',id:'builder-5fed2723c1cc4fb39e9d22b9c54ef179',children:[{'@type':'@builder.io/sdk:Element','@version':2,id:'builder-2cad86b387ec405d82917895d7af0a12',component:{name:'Text',options:{text:'<p>Item 1</p>'}},responsiveStyles:{large:{textAlign:'left',display:'flex',flexDirection:'column'}}}],responsiveStyles:{large:{marginTop:'10px',position:'relative',display:'flex',alignItems:'stretch',flexDirection:'column',paddingBottom:'10px'}}}],detail:[{'@type':'@builder.io/sdk:Element','@version':2,layerName:'Accordion item detail',id:'builder-18279a99b32240f19aa21d3f4b015cc9',children:[{'@type':'@builder.io/sdk:Element','@version':2,id:'builder-2dbfa56b8988461c8566bbe759580e9b',component:{name:'Text',options:{text:'<p>Item 1 content</p>'}},responsiveStyles:{large:{paddingTop:'50px',textAlign:'left',display:'flex',flexDirection:'column',paddingBottom:'50px'}}}],responsiveStyles:{large:{position:'relative',display:'flex',alignItems:'stretch',flexDirection:'column',marginTop:'10px',paddingBottom:'10px'}}}]},{title:[{'@type':'@builder.io/sdk:Element','@version':2,layerName:'Accordion item title',id:'builder-2a93def22a354cf7aa193c20d1ad6def',children:[{'@type':'@builder.io/sdk:Element','@version':2,id:'builder-1365fc457ece45db82ad90dbe9819e7c',component:{name:'Text',options:{text:'<p>Item 2</p>'}},responsiveStyles:{large:{textAlign:'left',display:'flex',flexDirection:'column'}}}],responsiveStyles:{large:{marginTop:'10px',position:'relative',display:'flex',alignItems:'stretch',flexDirection:'column',paddingBottom:'10px'}}}],detail:[{'@type':'@builder.io/sdk:Element','@version':2,layerName:'Accordion item detail',id:'builder-fd6ef41da6d040328fbd8b0801611fe5',children:[{'@type':'@builder.io/sdk:Element','@version':2,id:'builder-7362f9fd64c647c5a400d9e75c74473f',component:{name:'Text',options:{text:'<p>Item 2 content</p>'}},responsiveStyles:{large:{paddingTop:'50px',textAlign:'left',display:'flex',flexDirection:'column',paddingBottom:'50px'}}}],responsiveStyles:{large:{position:'relative',display:'flex',alignItems:'stretch',flexDirection:'column',marginTop:'10px',paddingBottom:'10px'}}}]}]}
|
|
53
|
+
animate={true}>
|
|
54
|
+
<div>
|
|
55
|
+
<div builder="accordion">
|
|
56
|
+
<div builder="accordion-title">
|
|
57
|
+
<div class="csanagh">
|
|
58
|
+
<div class="crwdrpw">
|
|
59
|
+
<div innerHTML="<p>Item 1</p>"
|
|
60
|
+
class="builder-text">
|
|
61
|
+
</div>
|
|
56
62
|
</div>
|
|
57
63
|
</div>
|
|
58
64
|
</div>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
<div builder="accordion-detail">
|
|
66
|
+
<div class="c4qyc1p">
|
|
67
|
+
<div class="ctcw2m4">
|
|
68
|
+
<div innerHTML="<p>Item 1 content</p>"
|
|
69
|
+
class="builder-text">
|
|
70
|
+
</div>
|
|
65
71
|
</div>
|
|
66
72
|
</div>
|
|
67
73
|
</div>
|
|
68
74
|
</div>
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
<div builder="accordion">
|
|
76
|
+
<div builder="accordion-title">
|
|
77
|
+
<div class="csanagh">
|
|
78
|
+
<div class="crwdrpw">
|
|
79
|
+
<div innerHTML="<p>Item 2</p>"
|
|
80
|
+
class="builder-text">
|
|
81
|
+
</div>
|
|
76
82
|
</div>
|
|
77
83
|
</div>
|
|
78
84
|
</div>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
<div builder="accordion-detail">
|
|
86
|
+
<div class="c4qyc1p">
|
|
87
|
+
<div class="ctcw2m4">
|
|
88
|
+
<div innerHTML="<p>Item 2 content</p>"
|
|
89
|
+
class="builder-text">
|
|
90
|
+
</div>
|
|
85
91
|
</div>
|
|
86
92
|
</div>
|
|
87
93
|
</div>
|
|
88
94
|
</div>
|
|
89
95
|
</div>
|
|
90
96
|
</div>
|
|
91
|
-
|
|
92
|
-
)
|
|
97
|
+
);
|
|
98
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { qComponent, qHook } from "@builder.io/qwik";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
export const __merge = function __merge(state,props,create){if(create === void 0){create = false;}for(var key in props){if(key.indexOf(':')==-1 && !key.startsWith('__')&& Object.prototype.hasOwnProperty.call(props,key)){state[key] = props[key];}}if(create && typeof __STATE__ == 'object' && props.serverStateId){debugger;Object.assign(state,__STATE__[props.serverStateId]);}return state;};
|
|
4
5
|
export const onMountCreateEmptyState = qHook(() => ({}));
|
|
5
6
|
export const MyComponent = qComponent({
|
|
6
7
|
onMount: qHook("./med#onMountCreateEmptyState"),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { __merge } from "./med";
|
|
2
|
+
|
|
3
|
+
import { h, qHook } from "@builder.io/qwik";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export const MyComponent_styles = `
|
|
7
|
+
.cvdfnp5{
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
position: relative;
|
|
11
|
+
flex-shrink: 0;
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
margin-top: 0px;
|
|
14
|
+
padding-left: 20px;
|
|
15
|
+
padding-right: 20px;
|
|
16
|
+
padding-top: 50px;
|
|
17
|
+
padding-bottom: 50px;
|
|
18
|
+
width: 100vw;
|
|
19
|
+
margin-left: calc(50% - 50vw);
|
|
20
|
+
}
|
|
21
|
+
.cz5wnof{
|
|
22
|
+
width: 100%;
|
|
23
|
+
align-self: stretch;
|
|
24
|
+
flex-grow: 1;
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
max-width: 1200px;
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
align-items: stretch;
|
|
30
|
+
margin-left: auto;
|
|
31
|
+
margin-right: auto;
|
|
32
|
+
}
|
|
33
|
+
.cdrk993{
|
|
34
|
+
text-align: center;
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
export const MyComponent_onRender = qHook((__props__, __state__) => {
|
|
39
|
+
const state = __merge(__state__, __props__);
|
|
40
|
+
;
|
|
41
|
+
return (
|
|
42
|
+
<div class="cvdfnp5"
|
|
43
|
+
maxWidth={1200}>
|
|
44
|
+
<section class="cz5wnof">
|
|
45
|
+
{ (state.simpleList.results || []).map((function(__value__) {
|
|
46
|
+
var state = Object.assign({}, this, {resultsItem: __value__ == null ? {} : __value__});
|
|
47
|
+
return (<div class="cdrk993">
|
|
48
|
+
<div class="builder-text"
|
|
49
|
+
innerHTML={(() => {
|
|
50
|
+
try { var _virtual_index=state.resultsItem.data.title;return _virtual_index }
|
|
51
|
+
catch (err) {
|
|
52
|
+
console.warn('Builder code error', err);
|
|
53
|
+
}
|
|
54
|
+
})()}>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
}).bind(state))
|
|
59
|
+
}
|
|
60
|
+
</section>
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { qComponent, qHook } from "@builder.io/qwik";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export const __merge = function __merge(state,props,create){if(create === void 0){create = false;}for(var key in props){if(key.indexOf(':')==-1 && !key.startsWith('__')&& Object.prototype.hasOwnProperty.call(props,key)){state[key] = props[key];}}if(create && typeof __STATE__ == 'object' && props.serverStateId){debugger;Object.assign(state,__STATE__[props.serverStateId]);}return state;};
|
|
5
|
+
export const onMountCreateEmptyState = qHook(() => ({}));
|
|
6
|
+
export const MyComponent = qComponent({
|
|
7
|
+
onMount: qHook("./med#onMountCreateEmptyState"),
|
|
8
|
+
onRender: qHook("./low#MyComponent_onRender"),
|
|
9
|
+
styles: "./low#MyComponent_styles"
|
|
10
|
+
});
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { __merge } from "./med";
|
|
2
|
+
|
|
3
|
+
import { Image } from "./med.js";
|
|
4
|
+
|
|
1
5
|
import { h, qHook } from "@builder.io/qwik";
|
|
2
6
|
|
|
3
7
|
|
|
@@ -13,56 +17,25 @@ export const MyComponent_styles = `
|
|
|
13
17
|
min-width: 20px;
|
|
14
18
|
overflow: hidden;
|
|
15
19
|
}
|
|
16
|
-
.c4vjsfu{
|
|
17
|
-
width: 100%;
|
|
18
|
-
padding-top: 100%;
|
|
19
|
-
pointer-events: none;
|
|
20
|
-
font-size: 0;
|
|
21
|
-
}
|
|
22
|
-
.cffxoir{
|
|
23
|
-
object-fit: cover;
|
|
24
|
-
object-position: center;
|
|
25
|
-
position: absolute;
|
|
26
|
-
height: 100%;
|
|
27
|
-
width: 100%;
|
|
28
|
-
top: 0;
|
|
29
|
-
left: 0;
|
|
30
|
-
}
|
|
31
20
|
`;
|
|
32
21
|
|
|
33
|
-
export const MyComponent_onRender = qHook((
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
class: "cvk52jt"
|
|
38
|
-
},
|
|
39
|
-
h(
|
|
40
|
-
"picture",
|
|
41
|
-
{
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
h(
|
|
45
|
-
"source",
|
|
46
|
-
{
|
|
47
|
-
srcset: "https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=100 100w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=200 200w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=400 400w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=800 800w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=1200 1200w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=1600 1600w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=2000 2000w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b",
|
|
48
|
-
type: "image/webp"
|
|
49
|
-
}
|
|
50
|
-
),
|
|
51
|
-
h(
|
|
52
|
-
"img",
|
|
53
|
-
{
|
|
54
|
-
src: "https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b",
|
|
55
|
-
srcset: "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",
|
|
56
|
-
class: "cffxoir",
|
|
57
|
-
loading: "lazy"
|
|
58
|
-
}
|
|
59
|
-
)
|
|
60
|
-
),
|
|
22
|
+
export const MyComponent_onRender = qHook((__props__, __state__) => {
|
|
23
|
+
const state = __merge(__state__, __props__);
|
|
24
|
+
;
|
|
25
|
+
return (
|
|
61
26
|
h(
|
|
62
|
-
|
|
27
|
+
Image,
|
|
63
28
|
{
|
|
64
|
-
|
|
29
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b",
|
|
30
|
+
backgroundSize: "cover",
|
|
31
|
+
backgroundPosition: "center",
|
|
32
|
+
class: "cvk52jt",
|
|
33
|
+
lazy: true,
|
|
34
|
+
fitContent: true,
|
|
35
|
+
aspectRatio: 1,
|
|
36
|
+
height: 1300,
|
|
37
|
+
width: 1300
|
|
65
38
|
}
|
|
66
39
|
)
|
|
67
|
-
)
|
|
68
|
-
)
|
|
40
|
+
);
|
|
41
|
+
});
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { qComponent, qHook } from "@builder.io/qwik";
|
|
1
|
+
import { h, qComponent, qHook } from "@builder.io/qwik";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
export const __merge = function __merge(state,props,create){if(create === void 0){create = false;}for(var key in props){if(key.indexOf(':')==-1 && !key.startsWith('__')&& Object.prototype.hasOwnProperty.call(props,key)){state[key] = props[key];}}if(create && typeof __STATE__ == 'object' && props.serverStateId){debugger;Object.assign(state,__STATE__[props.serverStateId]);}return state;};
|
|
4
5
|
export const onMountCreateEmptyState = qHook(() => ({}));
|
|
5
6
|
export const MyComponent = qComponent({
|
|
6
7
|
onMount: qHook("./med#onMountCreateEmptyState"),
|
|
7
8
|
onRender: qHook("./low#MyComponent_onRender"),
|
|
8
9
|
styles: "./low#MyComponent_styles"
|
|
9
10
|
});
|
|
11
|
+
export const Image = function Image(props){var jsx = props.children || [];var image = props.image;if(image){var isBuilderIoImage = !!(image || '').match(/builder\.io/);var imgProps ={src:props.image,style:"object-fit:".concat(props.backgroundSize || 'cover',";object-position:").concat(props.backgroundPosition || 'center',";")+(props.aspectRatio ? 'position:absolute;height:100%;width:100%;top:0;left:0':''),sizes:props.sizes,alt:props.altText,loading:props.lazy ? 'lazy':undefined,srcset:undefined,};var sizingDiv = h('div',{class:'builder-image-sizer',style:"width:100%;padding-top:".concat((props.aspectRatio || 1)* 100,"%;pointer-events:none;font-size:0"),});if(isBuilderIoImage){var srcset = ['100','200','400','800','1200','1600','2000'] .map(function(size){return updateQueryParam(image,'width',size)+ ' ' + size + 'w';}).concat([image]).join(',');imgProps.srcset = srcset;jsx = jsx = [ h('picture',{},[ h('source',{type:'image/webp',srcset:srcset}),h('img',imgProps,jsx),]),sizingDiv,];}else{jsx = [h('img',imgProps,jsx),sizingDiv];}}var children = props.children ? [jsx].concat(props.children):[jsx];return h(props.href ? 'a':'div',{href:props.href,class:props.class},children);function updateQueryParam(uri,key,value){if(uri === void 0){uri = '';}var re = new RegExp('([?&])' + key + '=.*?(&|$)','i');var separator = uri.indexOf('?')!==-1 ? '&':'?';if(uri.match(re)){return uri.replace(re,'$1' + key + '=' + encodeURIComponent(value)+ '$2');}return uri + separator + key + '=' + encodeURIComponent(value);}};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { __merge } from "./med";
|
|
2
|
+
|
|
3
|
+
import { Image } from "./med.js";
|
|
4
|
+
|
|
1
5
|
import { h, qHook } from "@builder.io/qwik";
|
|
2
6
|
|
|
3
7
|
|
|
@@ -13,56 +17,25 @@ export const MyComponent_styles = `
|
|
|
13
17
|
min-width: 20px;
|
|
14
18
|
overflow: hidden;
|
|
15
19
|
}
|
|
16
|
-
.c4vjsfu{
|
|
17
|
-
width: 100%;
|
|
18
|
-
padding-top: 100%;
|
|
19
|
-
pointer-events: none;
|
|
20
|
-
font-size: 0;
|
|
21
|
-
}
|
|
22
|
-
.cffxoir{
|
|
23
|
-
object-fit: cover;
|
|
24
|
-
object-position: center;
|
|
25
|
-
position: absolute;
|
|
26
|
-
height: 100%;
|
|
27
|
-
width: 100%;
|
|
28
|
-
top: 0;
|
|
29
|
-
left: 0;
|
|
30
|
-
}
|
|
31
20
|
`;
|
|
32
21
|
|
|
33
|
-
export const MyComponent_onRender = qHook((
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
class: "cvk52jt"
|
|
38
|
-
},
|
|
39
|
-
h(
|
|
40
|
-
"picture",
|
|
41
|
-
{
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
h(
|
|
45
|
-
"source",
|
|
46
|
-
{
|
|
47
|
-
srcset: "https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=100 100w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=200 200w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=400 400w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=800 800w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=1200 1200w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=1600 1600w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=2000 2000w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b",
|
|
48
|
-
type: "image/webp"
|
|
49
|
-
}
|
|
50
|
-
),
|
|
51
|
-
h(
|
|
52
|
-
"img",
|
|
53
|
-
{
|
|
54
|
-
src: "https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b",
|
|
55
|
-
srcset: "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",
|
|
56
|
-
class: "cffxoir",
|
|
57
|
-
loading: "lazy"
|
|
58
|
-
}
|
|
59
|
-
)
|
|
60
|
-
),
|
|
22
|
+
export const MyComponent_onRender = qHook((__props__, __state__) => {
|
|
23
|
+
const state = __merge(__state__, __props__);
|
|
24
|
+
;
|
|
25
|
+
return (
|
|
61
26
|
h(
|
|
62
|
-
|
|
27
|
+
Image,
|
|
63
28
|
{
|
|
64
|
-
|
|
29
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b",
|
|
30
|
+
backgroundSize: "cover",
|
|
31
|
+
backgroundPosition: "center",
|
|
32
|
+
class: "cvk52jt",
|
|
33
|
+
lazy: true,
|
|
34
|
+
fitContent: true,
|
|
35
|
+
aspectRatio: 1,
|
|
36
|
+
height: 1300,
|
|
37
|
+
width: 1300
|
|
65
38
|
}
|
|
66
39
|
)
|
|
67
|
-
)
|
|
68
|
-
)
|
|
40
|
+
);
|
|
41
|
+
});
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { qComponent, qHook } from "@builder.io/qwik";
|
|
1
|
+
import { h, qComponent, qHook } from "@builder.io/qwik";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
export const __merge = function __merge(state,props,create){if(create === void 0){create = false;}for(var key in props){if(key.indexOf(':')==-1 && !key.startsWith('__')&& Object.prototype.hasOwnProperty.call(props,key)){state[key] = props[key];}}if(create && typeof __STATE__ == 'object' && props.serverStateId){debugger;Object.assign(state,__STATE__[props.serverStateId]);}return state;};
|
|
4
5
|
export const onMountCreateEmptyState = qHook(() => ({}));
|
|
5
6
|
export const MyComponent = qComponent({
|
|
6
7
|
onMount: qHook("./med#onMountCreateEmptyState"),
|
|
7
8
|
onRender: qHook("./low#MyComponent_onRender"),
|
|
8
9
|
styles: "./low#MyComponent_styles"
|
|
9
10
|
});
|
|
11
|
+
export const Image = function Image(props){var jsx = props.children || [];var image = props.image;if(image){var isBuilderIoImage = !!(image || '').match(/builder\.io/);var imgProps ={src:props.image,style:"object-fit:".concat(props.backgroundSize || 'cover',";object-position:").concat(props.backgroundPosition || 'center',";")+(props.aspectRatio ? 'position:absolute;height:100%;width:100%;top:0;left:0':''),sizes:props.sizes,alt:props.altText,loading:props.lazy ? 'lazy':undefined,srcset:undefined,};var sizingDiv = h('div',{class:'builder-image-sizer',style:"width:100%;padding-top:".concat((props.aspectRatio || 1)* 100,"%;pointer-events:none;font-size:0"),});if(isBuilderIoImage){var srcset = ['100','200','400','800','1200','1600','2000'] .map(function(size){return updateQueryParam(image,'width',size)+ ' ' + size + 'w';}).concat([image]).join(',');imgProps.srcset = srcset;jsx = jsx = [ h('picture',{},[ h('source',{type:'image/webp',srcset:srcset}),h('img',imgProps,jsx),]),sizingDiv,];}else{jsx = [h('img',imgProps,jsx),sizingDiv];}}var children = props.children ? [jsx].concat(props.children):[jsx];return h(props.href ? 'a':'div',{href:props.href,class:props.class},children);function updateQueryParam(uri,key,value){if(uri === void 0){uri = '';}var re = new RegExp('([?&])' + key + '=.*?(&|$)','i');var separator = uri.indexOf('?')!==-1 ? '&':'?';if(uri.match(re)){return uri.replace(re,'$1' + key + '=' + encodeURIComponent(value)+ '$2');}return uri + separator + key + '=' + encodeURIComponent(value);}};
|
|
@@ -3,57 +3,62 @@ const qComponent = require("@builder.io/qwik").qComponent;
|
|
|
3
3
|
const qHook = require("@builder.io/qwik").qHook;
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
exports.__merge = function __merge(state,props,create){if(create === void 0){create = false;}for(var key in props){if(key.indexOf(':')==-1 && !key.startsWith('__')&& Object.prototype.hasOwnProperty.call(props,key)){state[key] = props[key];}}if(create && typeof __STATE__ == 'object' && props.serverStateId){debugger;Object.assign(state,__STATE__[props.serverStateId]);}return state;};
|
|
6
7
|
exports.onMountCreateEmptyState = qHook(() => ({}));
|
|
7
8
|
exports.Todo = qComponent({
|
|
8
9
|
onMount: qHook("./med#onMountCreateEmptyState"),
|
|
9
10
|
onRender: qHook("./med#Todo_onRender")
|
|
10
11
|
});
|
|
11
12
|
|
|
12
|
-
exports.Todo_onRender = qHook((
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class: `${props.todo.completed ? 'completed' : ''} ${state.editing ? 'editing' : ''}`
|
|
17
|
-
},
|
|
13
|
+
exports.Todo_onRender = qHook((__props__, __state__) => {
|
|
14
|
+
const state = exports.__merge(__state__, __props__);
|
|
15
|
+
;
|
|
16
|
+
return (
|
|
18
17
|
h(
|
|
19
|
-
"
|
|
18
|
+
"li",
|
|
20
19
|
{
|
|
21
|
-
class:
|
|
20
|
+
class: `${props.todo.completed ? 'completed' : ''} ${state.editing ? 'editing' : ''}`
|
|
22
21
|
},
|
|
23
22
|
h(
|
|
24
|
-
"
|
|
23
|
+
"div",
|
|
25
24
|
{
|
|
26
|
-
|
|
27
|
-
class: "toggle",
|
|
28
|
-
checked: props.todo.completed,
|
|
29
|
-
"on:click": qHook("./high#Todo_onClick_0")
|
|
30
|
-
}
|
|
31
|
-
),
|
|
32
|
-
h(
|
|
33
|
-
"label",
|
|
34
|
-
{
|
|
35
|
-
"on:dblclick": qHook("./high#Todo_onDblClick_1")
|
|
25
|
+
class: "view"
|
|
36
26
|
},
|
|
37
|
-
|
|
27
|
+
h(
|
|
28
|
+
"input",
|
|
29
|
+
{
|
|
30
|
+
type: "checkbox",
|
|
31
|
+
class: "toggle",
|
|
32
|
+
checked: props.todo.completed,
|
|
33
|
+
"on:click": qHook("./high#Todo_onClick_0")
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
h(
|
|
37
|
+
"label",
|
|
38
|
+
{
|
|
39
|
+
"on:dblclick": qHook("./high#Todo_onDblClick_1")
|
|
40
|
+
},
|
|
41
|
+
props.todo.text
|
|
42
|
+
),
|
|
43
|
+
h(
|
|
44
|
+
"button",
|
|
45
|
+
{
|
|
46
|
+
class: "destroy",
|
|
47
|
+
"on:click": qHook("./high#Todo_onClick_2")
|
|
48
|
+
}
|
|
49
|
+
)
|
|
38
50
|
),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"on:blur": qHook("./high#Todo_onBlur_3"),
|
|
54
|
-
"on:keyup": qHook("./high#Todo_onKeyUp_4")
|
|
55
|
-
}
|
|
56
|
-
)
|
|
57
|
-
: null
|
|
58
|
-
)
|
|
59
|
-
));
|
|
51
|
+
state.editing ?
|
|
52
|
+
h(
|
|
53
|
+
"input",
|
|
54
|
+
{
|
|
55
|
+
class: "edit",
|
|
56
|
+
value: props.todo.text,
|
|
57
|
+
"on:blur": qHook("./high#Todo_onBlur_3"),
|
|
58
|
+
"on:keyup": qHook("./high#Todo_onKeyUp_4")
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
: null
|
|
62
|
+
)
|
|
63
|
+
);
|
|
64
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h,qComponent,qHook}from"@builder.io/qwik";export const onMountCreateEmptyState=qHook(()=>({}));export const Todo=qComponent({onMount:qHook("./med#onMountCreateEmptyState"),onRender:qHook("./med#Todo_onRender")});export const Todo_onRender=qHook((
|
|
1
|
+
import{h,qComponent,qHook}from"@builder.io/qwik";export const __merge=function __merge(state,props,create){if(create === void 0){create = false;}for(var key in props){if(key.indexOf(':')==-1 && !key.startsWith('__')&& Object.prototype.hasOwnProperty.call(props,key)){state[key] = props[key];}}if(create && typeof __STATE__ == 'object' && props.serverStateId){debugger;Object.assign(state,__STATE__[props.serverStateId]);}return state;};export const onMountCreateEmptyState=qHook(()=>({}));export const Todo=qComponent({onMount:qHook("./med#onMountCreateEmptyState"),onRender:qHook("./med#Todo_onRender")});export const Todo_onRender=qHook((__props__,__state__)=>{const state=__merge(__state__,__props__);;return (h("li",{class:`${props.todo.completed ? 'completed' : ''} ${state.editing ? 'editing' : ''}`},h("div",{class:"view"},h("input",{type:"checkbox",class:"toggle",checked:props.todo.completed,"on:click":qHook("./high#Todo_onClick_0")}),h("label",{"on:dblclick":qHook("./high#Todo_onDblClick_1")},props.todo.text),h("button",{class:"destroy","on:click":qHook("./high#Todo_onClick_2")})),state.editing?h("input",{class:"edit",value:props.todo.text,"on:blur":qHook("./high#Todo_onBlur_3"),"on:keyup":qHook("./high#Todo_onKeyUp_4")}):null));});
|
|
@@ -1,34 +1,39 @@
|
|
|
1
1
|
import { h, qComponent, qHook } from "@builder.io/qwik";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
export const __merge = function __merge(state,props,create){if(create === void 0){create = false;}for(var key in props){if(key.indexOf(':')==-1 && !key.startsWith('__')&& Object.prototype.hasOwnProperty.call(props,key)){state[key] = props[key];}}if(create && typeof __STATE__ == 'object' && props.serverStateId){debugger;Object.assign(state,__STATE__[props.serverStateId]);}return state;};
|
|
4
5
|
export const onMountCreateEmptyState = qHook<any, any>(() => ({}));
|
|
5
6
|
export const Todo = qComponent<any, any>({
|
|
6
7
|
onMount: qHook("./med#onMountCreateEmptyState"),
|
|
7
8
|
onRender: qHook("./med#Todo_onRender")
|
|
8
9
|
});
|
|
9
10
|
|
|
10
|
-
export const Todo_onRender = qHook((
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
11
|
+
export const Todo_onRender = qHook((__props__, __state__) => {
|
|
12
|
+
const state = __merge(__state__, __props__);
|
|
13
|
+
;
|
|
14
|
+
return (
|
|
15
|
+
<li class={`${props.todo.completed ? 'completed' : ''} ${state.editing ? 'editing' : ''}`}>
|
|
16
|
+
<div class="view">
|
|
17
|
+
<input type="checkbox"
|
|
18
|
+
class="toggle"
|
|
19
|
+
checked={props.todo.completed}
|
|
20
|
+
on:click={qHook("./high#Todo_onClick_0")}>
|
|
21
|
+
</input>
|
|
22
|
+
<label on:dblclick={qHook("./high#Todo_onDblClick_1")}>
|
|
23
|
+
{props.todo.text}
|
|
24
|
+
</label>
|
|
25
|
+
<button class="destroy"
|
|
26
|
+
on:click={qHook("./high#Todo_onClick_2")}>
|
|
27
|
+
</button>
|
|
28
|
+
</div>
|
|
29
|
+
{ state.editing ?
|
|
30
|
+
<input class="edit"
|
|
31
|
+
value={props.todo.text}
|
|
32
|
+
on:blur={qHook("./high#Todo_onBlur_3")}
|
|
33
|
+
on:keyup={qHook("./high#Todo_onKeyUp_4")}>
|
|
34
|
+
</input>
|
|
35
|
+
: null
|
|
36
|
+
}
|
|
37
|
+
</li>
|
|
38
|
+
);
|
|
39
|
+
});
|