@builder.io/mitosis 0.0.50-6 → 0.0.50

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.
Files changed (138) hide show
  1. package/dist/src/__tests__/angular.test.js +6 -0
  2. package/dist/src/__tests__/builder.test.js +5 -1
  3. package/dist/src/__tests__/data/blocks/multiple-onUpdate.raw.d.ts +1 -0
  4. package/dist/src/__tests__/data/blocks/multiple-onUpdate.raw.jsx +13 -0
  5. package/dist/src/__tests__/data/blocks/multiple-onUpdateWithDeps.raw.d.ts +1 -0
  6. package/dist/src/__tests__/data/blocks/multiple-onUpdateWithDeps.raw.jsx +19 -0
  7. package/dist/src/__tests__/data/blocks/onUpdateWithDeps.raw.jsx +6 -3
  8. package/dist/src/__tests__/data/blocks/self-referencing-component-with-children.raw.d.ts +1 -0
  9. package/dist/src/__tests__/data/blocks/self-referencing-component-with-children.raw.jsx +15 -0
  10. package/dist/src/__tests__/data/blocks/self-referencing-component.raw.d.ts +1 -0
  11. package/dist/src/__tests__/data/blocks/self-referencing-component.raw.jsx +12 -0
  12. package/dist/src/__tests__/data/blocks/shadow-dom.raw.d.ts +6 -0
  13. package/dist/src/__tests__/data/blocks/shadow-dom.raw.jsx +54 -0
  14. package/dist/src/__tests__/data/blocks/slot.raw.d.ts +5 -0
  15. package/dist/src/__tests__/data/blocks/slot.raw.jsx +6 -0
  16. package/dist/src/__tests__/data/blocks/stamped-io.raw.jsx +8 -0
  17. package/dist/src/__tests__/data/blocks/styles.raw.d.ts +1 -0
  18. package/dist/src/__tests__/data/blocks/styles.raw.jsx +10 -0
  19. package/dist/src/__tests__/data/context/simple.context.lite.d.ts +8 -1
  20. package/dist/src/__tests__/html.test.js +6 -0
  21. package/dist/src/__tests__/qwik.directive.test.d.ts +1 -0
  22. package/dist/src/__tests__/qwik.directive.test.js +107 -0
  23. package/dist/src/__tests__/qwik.test.js +256 -128
  24. package/dist/src/__tests__/react-native.test.js +12 -0
  25. package/dist/src/__tests__/react.test.js +12 -0
  26. package/dist/src/__tests__/svelte.test.js +24 -0
  27. package/dist/src/__tests__/vue.test.js +12 -0
  28. package/dist/src/__tests__/webcomponent.test.d.ts +1 -0
  29. package/dist/src/__tests__/webcomponent.test.js +12 -0
  30. package/dist/src/constants/html_tags.d.ts +1 -0
  31. package/dist/src/constants/html_tags.js +119 -0
  32. package/dist/src/generators/angular.js +7 -4
  33. package/dist/src/generators/context/react copy.d.ts +8 -0
  34. package/dist/src/generators/context/react copy.js +28 -0
  35. package/dist/src/generators/context/solid.d.ts +8 -0
  36. package/dist/src/generators/context/solid.js +28 -0
  37. package/dist/src/generators/context/svelte.d.ts +8 -0
  38. package/dist/src/generators/context/svelte.js +28 -0
  39. package/dist/src/generators/helpers/context.d.ts +2 -0
  40. package/dist/src/generators/helpers/context.js +8 -0
  41. package/dist/src/generators/html.js +20 -14
  42. package/dist/src/generators/mitosis.js +4 -3
  43. package/dist/src/generators/qwik/component.js +26 -5
  44. package/dist/src/generators/qwik/directives.d.ts +14 -5
  45. package/dist/src/generators/qwik/directives.js +32 -25
  46. package/dist/src/generators/qwik/handlers.js +3 -4
  47. package/dist/src/generators/qwik/jsx.js +17 -5
  48. package/dist/src/generators/qwik/src-generator.d.ts +0 -9
  49. package/dist/src/generators/qwik/src-generator.js +93 -101
  50. package/dist/src/generators/qwik/styles.js +8 -11
  51. package/dist/src/generators/react.js +9 -8
  52. package/dist/src/generators/solid.js +82 -8
  53. package/dist/src/generators/stencil/generate.js +5 -3
  54. package/dist/src/generators/stencil/index.js +5 -1
  55. package/dist/src/generators/svelte.d.ts +9 -1
  56. package/dist/src/generators/svelte.js +175 -76
  57. package/dist/src/generators/vue.d.ts +1 -1
  58. package/dist/src/generators/vue.js +86 -10
  59. package/dist/src/helpers/babel-transform copy.d.ts +8 -0
  60. package/dist/src/helpers/babel-transform copy.js +138 -0
  61. package/dist/src/helpers/babel-transform.d.ts +4 -7
  62. package/dist/src/helpers/babel-transform.js +18 -2
  63. package/dist/src/helpers/babel-transform.test.d.ts +1 -0
  64. package/dist/src/helpers/babel-transform.test.js +7 -0
  65. package/dist/src/helpers/create-mitosis-component.js +1 -1
  66. package/dist/src/helpers/get-state-object-string.js +2 -1
  67. package/dist/src/helpers/map-refs.js +22 -9
  68. package/dist/src/helpers/parsers.d.ts +8 -0
  69. package/dist/src/helpers/parsers.js +66 -0
  70. package/dist/src/helpers/render-imports.d.ts +2 -4
  71. package/dist/src/helpers/render-imports.js +32 -14
  72. package/dist/src/index.d.ts +10 -5
  73. package/dist/src/index.js +11 -5
  74. package/dist/src/parsers/builder.d.ts +16 -50
  75. package/dist/src/parsers/builder.js +22 -40
  76. package/dist/src/parsers/context.js +5 -1
  77. package/dist/src/parsers/jsx.d.ts +7 -0
  78. package/dist/src/parsers/jsx.js +27 -5
  79. package/dist/src/parsers/liquid.js +5 -1
  80. package/dist/src/plugins/compile-away-builder-components.js +5 -1
  81. package/dist/src/symbols/symbol-processor.js +3 -3
  82. package/dist/src/targets.d.ts +1 -1
  83. package/dist/src/types/mitosis-component.d.ts +8 -3
  84. package/dist/test/qwik/Accordion/high.jsx +0 -1
  85. package/dist/test/qwik/Accordion/low.jsx +171 -65
  86. package/dist/test/qwik/Accordion/med.jsx +9 -10
  87. package/dist/test/qwik/For/high.jsx +0 -1
  88. package/dist/test/qwik/For/low.jsx +25 -58
  89. package/dist/test/qwik/For/med.jsx +9 -10
  90. package/dist/test/qwik/Image/high.js +9 -1
  91. package/dist/test/qwik/Image/low.js +0 -42
  92. package/dist/test/qwik/Image/med.js +149 -12
  93. package/dist/test/qwik/Image.slow/high.js +9 -1
  94. package/dist/test/qwik/Image.slow/low.js +0 -42
  95. package/dist/test/qwik/Image.slow/med.js +149 -12
  96. package/dist/{src/types/generators.d.ts → test/qwik/bindings/high.cjs} +0 -0
  97. package/dist/test/qwik/bindings/low.cjs +33 -0
  98. package/dist/test/qwik/bindings/med.cjs +12 -0
  99. package/dist/test/qwik/button/high.js +1 -13
  100. package/dist/test/qwik/button/low.js +8 -40
  101. package/dist/test/qwik/button/med.js +36 -11
  102. package/dist/test/qwik/component/bindings/high.jsx +0 -1
  103. package/dist/test/qwik/component/bindings/low.jsx +26 -71
  104. package/dist/test/qwik/component/bindings/med.jsx +48 -39
  105. package/dist/test/qwik/component/component/inputs/high.cjsx +9 -0
  106. package/dist/test/qwik/component/component/inputs/low.cjsx +0 -0
  107. package/dist/test/qwik/component/component/inputs/med.cjsx +65 -0
  108. package/dist/test/qwik/hello_world/stylesheet/high.jsx +0 -1
  109. package/dist/test/qwik/hello_world/stylesheet/low.jsx +6 -27
  110. package/dist/test/qwik/hello_world/stylesheet/med.jsx +9 -10
  111. package/dist/test/qwik/page-with-symbol/high.js +0 -1
  112. package/dist/test/qwik/page-with-symbol/low.js +15 -52
  113. package/dist/test/qwik/page-with-symbol/med.js +9 -10
  114. package/dist/test/qwik/show-hide/high.jsx +9 -0
  115. package/dist/test/qwik/show-hide/low.jsx +0 -0
  116. package/dist/test/qwik/show-hide/med.jsx +174 -0
  117. package/dist/test/qwik/svg/high.js +0 -1
  118. package/dist/test/qwik/svg/low.js +9 -35
  119. package/dist/test/qwik/svg/med.js +9 -10
  120. package/dist/test/qwik/todo/Todo.cjs/high.cjs +4 -39
  121. package/dist/test/qwik/todo/Todo.cjs/low.cjs +0 -1
  122. package/dist/test/qwik/todo/Todo.cjs/med.cjs +38 -61
  123. package/dist/test/qwik/todo/Todo.js/high.js +22 -5
  124. package/dist/test/qwik/todo/Todo.js/med.js +45 -1
  125. package/dist/test/qwik/todo/Todo.tsx/high.tsx +4 -39
  126. package/dist/test/qwik/todo/Todo.tsx/low.tsx +0 -1
  127. package/dist/test/qwik/todo/Todo.tsx/med.tsx +31 -34
  128. package/dist/test/qwik/todos/Todo.tsx/high.tsx +0 -12
  129. package/dist/test/qwik/todos/Todo.tsx/low.tsx +18 -25
  130. package/dist/test/qwik/todos/Todo.tsx/med.tsx +8 -10
  131. package/dist/tsconfig.build.tsbuildinfo +1 -0
  132. package/dist/tsconfig.tsbuildinfo +1 -1
  133. package/package.json +22 -22
  134. package/dist/src/__tests__/data/blocks/onMount-onUnMount.d.ts +0 -1
  135. package/dist/src/__tests__/data/blocks/onMount-onUnMount.jsx +0 -13
  136. package/dist/src/__tests__/data/blocks/onMount.d.ts +0 -1
  137. package/dist/src/__tests__/data/blocks/onMount.jsx +0 -13
  138. package/dist/src/types/generators.js +0 -1
@@ -1,71 +1,48 @@
1
- const component = require("@builder.io/qwik").component;
2
- const createStore = require("@builder.io/qwik").createStore;
1
+ const componentQrl = require("@builder.io/qwik").componentQrl;
3
2
  const h = require("@builder.io/qwik").h;
4
3
  const qrl = require("@builder.io/qwik").qrl;
5
4
  const useLexicalScope = require("@builder.io/qwik").useLexicalScope;
6
-
7
-
8
- 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){Object.assign(state,__STATE__[props.serverStateId]);}return state;};
9
- exports.Todo_onMount = (__props__) => {
10
- const __state__ = createStore({});
11
- const state = exports.__merge(__state__, __props__,true);
12
- ;
13
- return qrl("./med.js", "Todo_onRender", [__props__,__state__]);
5
+ exports.Todo_onMount = (state) => {
6
+ typeof __STATE__ === "object" &&
7
+ Object.assign(state, __STATE__[state.serverStateId]);
8
+ return qrl("./med.js", "Todo_onRender", [state]);
14
9
  };
15
- exports.Todo = component(qrl("./med.js", "Todo_onMount", []));
16
-
10
+ exports.Todo = componentQrl(qrl("./med.js", "Todo_onMount", []));
17
11
  exports.Todo_onRender = () => {
18
- const __scope__ = useLexicalScope();
19
- const __props__ = __scope__[0];
20
- const __state__ = __scope__[1];
21
- const state = exports.__merge(__state__, __props__);
22
- ;
23
- return (
12
+ const state = useLexicalScope()[0];
13
+ return h(
14
+ "li",
15
+ {
16
+ class: `${props.todo.completed ? "completed" : ""} ${
17
+ state.editing ? "editing" : ""
18
+ }`,
19
+ },
24
20
  h(
25
- "li",
26
- {
27
- class: `${props.todo.completed ? 'completed' : ''} ${state.editing ? 'editing' : ''}`
28
- },
21
+ "div",
22
+ { class: "view" },
23
+ h("input", {
24
+ type: "checkbox",
25
+ class: "toggle",
26
+ checked: props.todo.completed,
27
+ onClickQrl: qrl("./high.js", "Todo_onClick_0", [state]),
28
+ }),
29
29
  h(
30
- "div",
31
- {
32
- class: "view"
33
- },
34
- h(
35
- "input",
36
- {
37
- type: "checkbox",
38
- class: "toggle",
39
- checked: props.todo.completed,
40
- "on:click": qrl("./high.js", "Todo_onClick_0", [__props__, __state__])
41
- }
42
- ),
43
- h(
44
- "label",
45
- {
46
- "on:dblclick": qrl("./high.js", "Todo_onDblClick_1", [__props__, __state__])
47
- },
48
- props.todo.text
49
- ),
50
- h(
51
- "button",
52
- {
53
- class: "destroy",
54
- "on:click": qrl("./high.js", "Todo_onClick_2", [__props__, __state__])
55
- }
56
- )
30
+ "label",
31
+ { onDblClickQrl: qrl("./high.js", "Todo_onDblClick_1", [state]) },
32
+ props.todo.text
57
33
  ),
58
- state.editing ?
59
- h(
60
- "input",
61
- {
62
- class: "edit",
63
- value: props.todo.text,
64
- "on:blur": qrl("./high.js", "Todo_onBlur_3", [__props__, __state__]),
65
- "on:keyup": qrl("./high.js", "Todo_onKeyUp_4", [__props__, __state__])
66
- }
67
- )
68
- : null
69
- )
34
+ h("button", {
35
+ class: "destroy",
36
+ onClickQrl: qrl("./high.js", "Todo_onClick_2", [state]),
37
+ })
38
+ ),
39
+ state.editing
40
+ ? h("input", {
41
+ class: "edit",
42
+ value: props.todo.text,
43
+ onBlurQrl: qrl("./high.js", "Todo_onBlur_3", [state]),
44
+ onKeyUpQrl: qrl("./high.js", "Todo_onKeyUp_4", [state]),
45
+ })
46
+ : null
70
47
  );
71
48
  };
@@ -1,5 +1,22 @@
1
- import{__merge}from"./med.js";import{useEvent,useLexicalScope}from"@builder.io/qwik";export const Todo_onClick_0=()=>{const __scope__=useLexicalScope();const __props__=__scope__[0];const __state__=__scope__[1];const state=__merge(__state__,__props__);;
2
- state.toggle();};export const Todo_onDblClick_1=()=>{const __scope__=useLexicalScope();const __props__=__scope__[0];const __state__=__scope__[1];const state=__merge(__state__,__props__);;
3
- state.editing = true;};export const Todo_onClick_2=()=>{const __scope__=useLexicalScope();const __props__=__scope__[0];const __state__=__scope__[1];const state=__merge(__state__,__props__);;
4
- todosState.todos.splice(todosState.todos.indexOf(props.todo));};export const Todo_onBlur_3=()=>{const __scope__=useLexicalScope();const __props__=__scope__[0];const __state__=__scope__[1];const state=__merge(__state__,__props__);;
5
- state.editing = false;};export const Todo_onKeyUp_4=()=>{const __scope__=useLexicalScope();const __props__=__scope__[0];const __state__=__scope__[1];const state=__merge(__state__,__props__);;{const event=useEvent();props.todo.text = event.target.value}};
1
+ import { useEvent, useLexicalScope } from "@builder.io/qwik";
2
+ export const Todo_onClick_0 = () => {
3
+ const state = useLexicalScope()[0];
4
+ state.toggle();
5
+ };
6
+ export const Todo_onDblClick_1 = () => {
7
+ const state = useLexicalScope()[0];
8
+ state.editing = true;
9
+ };
10
+ export const Todo_onClick_2 = () => {
11
+ todosState.todos.splice(todosState.todos.indexOf(props.todo));
12
+ };
13
+ export const Todo_onBlur_3 = () => {
14
+ const state = useLexicalScope()[0];
15
+ state.editing = false;
16
+ };
17
+ export const Todo_onKeyUp_4 = () => {
18
+ {
19
+ const event = useEvent();
20
+ props.todo.text = event.target.value;
21
+ }
22
+ };
@@ -1 +1,45 @@
1
- import{component,createStore,h,qrl,useLexicalScope}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){Object.assign(state,__STATE__[props.serverStateId]);}return state;};export const Todo_onMount=(__props__)=>{const __state__=createStore({});const state=__merge(__state__,__props__,true);;return qrl("./med.js","Todo_onRender",[__props__,__state__]);};export const Todo=component(qrl("./med.js","Todo_onMount",[]));export const Todo_onRender=()=>{const __scope__=useLexicalScope();const __props__=__scope__[0];const __state__=__scope__[1];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":qrl("./high.js","Todo_onClick_0",[__props__, __state__])}),h("label",{"on:dblclick":qrl("./high.js","Todo_onDblClick_1",[__props__, __state__])},props.todo.text),h("button",{class:"destroy","on:click":qrl("./high.js","Todo_onClick_2",[__props__, __state__])})),state.editing?h("input",{class:"edit",value:props.todo.text,"on:blur":qrl("./high.js","Todo_onBlur_3",[__props__, __state__]),"on:keyup":qrl("./high.js","Todo_onKeyUp_4",[__props__, __state__])}):null));};
1
+ import { componentQrl, h, qrl, useLexicalScope } from "@builder.io/qwik";
2
+ export const Todo_onMount = (state) => {
3
+ typeof __STATE__ === "object" &&
4
+ Object.assign(state, __STATE__[state.serverStateId]);
5
+ return qrl("./med.js", "Todo_onRender", [state]);
6
+ };
7
+ export const Todo = componentQrl(qrl("./med.js", "Todo_onMount", []));
8
+ export const Todo_onRender = () => {
9
+ const state = useLexicalScope()[0];
10
+ return h(
11
+ "li",
12
+ {
13
+ class: `${props.todo.completed ? "completed" : ""} ${
14
+ state.editing ? "editing" : ""
15
+ }`,
16
+ },
17
+ h(
18
+ "div",
19
+ { class: "view" },
20
+ h("input", {
21
+ type: "checkbox",
22
+ class: "toggle",
23
+ checked: props.todo.completed,
24
+ onClickQrl: qrl("./high.js", "Todo_onClick_0", [state]),
25
+ }),
26
+ h(
27
+ "label",
28
+ { onDblClickQrl: qrl("./high.js", "Todo_onDblClick_1", [state]) },
29
+ props.todo.text
30
+ ),
31
+ h("button", {
32
+ class: "destroy",
33
+ onClickQrl: qrl("./high.js", "Todo_onClick_2", [state]),
34
+ })
35
+ ),
36
+ state.editing
37
+ ? h("input", {
38
+ class: "edit",
39
+ value: props.todo.text,
40
+ onBlurQrl: qrl("./high.js", "Todo_onBlur_3", [state]),
41
+ onKeyUpQrl: qrl("./high.js", "Todo_onKeyUp_4", [state]),
42
+ })
43
+ : null
44
+ );
45
+ };
@@ -1,57 +1,22 @@
1
- import { __merge } from "./med.js";
2
-
3
1
  import { useEvent, useLexicalScope } from "@builder.io/qwik";
4
-
5
-
6
2
  export const Todo_onClick_0 = () => {
7
- const __scope__ = useLexicalScope();
8
- const __props__ = __scope__[0];
9
- const __state__ = __scope__[1];
10
- const state = __merge(__state__, __props__);
11
- ;
12
-
3
+ const state = useLexicalScope()[0];
13
4
  state.toggle();
14
5
  };
15
-
16
6
  export const Todo_onDblClick_1 = () => {
17
- const __scope__ = useLexicalScope();
18
- const __props__ = __scope__[0];
19
- const __state__ = __scope__[1];
20
- const state = __merge(__state__, __props__);
21
- ;
22
-
7
+ const state = useLexicalScope()[0];
23
8
  state.editing = true;
24
9
  };
25
-
26
10
  export const Todo_onClick_2 = () => {
27
- const __scope__ = useLexicalScope();
28
- const __props__ = __scope__[0];
29
- const __state__ = __scope__[1];
30
- const state = __merge(__state__, __props__);
31
- ;
32
-
33
11
  todosState.todos.splice(todosState.todos.indexOf(props.todo));
34
12
  };
35
-
36
13
  export const Todo_onBlur_3 = () => {
37
- const __scope__ = useLexicalScope();
38
- const __props__ = __scope__[0];
39
- const __state__ = __scope__[1];
40
- const state = __merge(__state__, __props__);
41
- ;
42
-
14
+ const state = useLexicalScope()[0];
43
15
  state.editing = false;
44
16
  };
45
-
46
17
  export const Todo_onKeyUp_4 = () => {
47
- const __scope__ = useLexicalScope();
48
- const __props__ = __scope__[0];
49
- const __state__ = __scope__[1];
50
- const state = __merge(__state__, __props__);
51
- ;
52
18
  {
53
19
  const event = useEvent();
54
- props.todo.text = event.target.value
20
+ props.todo.text = event.target.value;
55
21
  }
56
22
  };
57
-
@@ -1 +0,0 @@
1
-
@@ -1,44 +1,41 @@
1
- import { component, createStore, h, qrl, useLexicalScope } 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){Object.assign(state,__STATE__[props.serverStateId]);}return state;};
5
- export const Todo_onMount = (__props__) => {
6
- const __state__ = createStore({});
7
- const state = __merge(__state__, __props__,true);
8
- ;
9
- return qrl("./med.js", "Todo_onRender", [__props__,__state__]);
1
+ import { componentQrl, h, qrl, useLexicalScope } from "@builder.io/qwik";
2
+ export const Todo_onMount = (state) => {
3
+ typeof __STATE__ === "object" &&
4
+ Object.assign(state, __STATE__[state.serverStateId]);
5
+ return qrl("./med.js", "Todo_onRender", [state]);
10
6
  };
11
- export const Todo = component<any, any>(qrl("./med.js", "Todo_onMount", []));
12
-
7
+ export const Todo = componentQrl<any, any>(qrl("./med.js", "Todo_onMount", []));
13
8
  export const Todo_onRender = () => {
14
- const __scope__ = useLexicalScope();
15
- const __props__ = __scope__[0];
16
- const __state__ = __scope__[1];
17
- const state = __merge(__state__, __props__);
18
- ;
9
+ const state = useLexicalScope()[0];
19
10
  return (
20
- <li class={`${props.todo.completed ? 'completed' : ''} ${state.editing ? 'editing' : ''}`}>
11
+ <li
12
+ class={`${props.todo.completed ? "completed" : ""} ${
13
+ state.editing ? "editing" : ""
14
+ }`}
15
+ >
21
16
  <div class="view">
22
- <input type="checkbox"
23
- class="toggle"
24
- checked={props.todo.completed}
25
- on:click={qrl("./high.js", "Todo_onClick_0", [__props__, __state__])}>
26
- </input>
27
- <label on:dblclick={qrl("./high.js", "Todo_onDblClick_1", [__props__, __state__])}>
17
+ <input
18
+ type="checkbox"
19
+ class="toggle"
20
+ checked={props.todo.completed}
21
+ onClickQrl={qrl("./high.js", "Todo_onClick_0", [state])}
22
+ ></input>
23
+ <label onDblClickQrl={qrl("./high.js", "Todo_onDblClick_1", [state])}>
28
24
  {props.todo.text}
29
25
  </label>
30
- <button class="destroy"
31
- on:click={qrl("./high.js", "Todo_onClick_2", [__props__, __state__])}>
32
- </button>
26
+ <button
27
+ class="destroy"
28
+ onClickQrl={qrl("./high.js", "Todo_onClick_2", [state])}
29
+ ></button>
33
30
  </div>
34
- { state.editing ?
35
- <input class="edit"
36
- value={props.todo.text}
37
- on:blur={qrl("./high.js", "Todo_onBlur_3", [__props__, __state__])}
38
- on:keyup={qrl("./high.js", "Todo_onKeyUp_4", [__props__, __state__])}>
39
- </input>
40
- : null
41
- }
31
+ {state.editing ? (
32
+ <input
33
+ class="edit"
34
+ value={props.todo.text}
35
+ onBlurQrl={qrl("./high.js", "Todo_onBlur_3", [state])}
36
+ onKeyUpQrl={qrl("./high.js", "Todo_onKeyUp_4", [state])}
37
+ ></input>
38
+ ) : null}
42
39
  </li>
43
40
  );
44
41
  };
@@ -1,19 +1,7 @@
1
- import { __merge } from "./med.js";
2
-
3
- import { useLexicalScope } from "@builder.io/qwik";
4
-
5
-
6
1
  export const Todos_onClick_0 = () => {
7
- const __scope__ = useLexicalScope();
8
- const __props__ = __scope__[0];
9
- const __state__ = __scope__[1];
10
- const state = __merge(__state__, __props__);
11
- ;
12
-
13
2
  const newValue = !todosState.allCompleted;
14
3
 
15
4
  for (const todoItem of todosState.todos) {
16
5
  todoItem.completed = newValue;
17
6
  }
18
7
  };
19
-
@@ -1,33 +1,26 @@
1
- import { Todo, __merge } from "./med.js";
2
-
1
+ import { Todo } from "./med.js";
3
2
  import { h, qrl, useLexicalScope } from "@builder.io/qwik";
4
-
5
-
6
-
7
3
  export const Todos_onRender = () => {
8
- const __scope__ = useLexicalScope();
9
- const __props__ = __scope__[0];
10
- const __state__ = __scope__[1];
11
- const state = __merge(__state__, __props__);
12
- ;
4
+ const state = useLexicalScope()[0];
13
5
  return (
14
6
  <section class="main">
15
- { todosState.todos.length ?
16
- <input type="checkbox"
17
- class="toggle-all"
18
- checked={todosState.allCompleted}
19
- on:click={qrl("./high.js", "Todos_onClick_0", [__props__, __state__])}>
20
- </input>
21
- : null
22
- }
7
+ {todosState.todos.length ? (
8
+ <input
9
+ type="checkbox"
10
+ class="toggle-all"
11
+ checked={todosState.allCompleted}
12
+ onClickQrl={qrl("./high.js", "Todos_onClick_0", [state])}
13
+ ></input>
14
+ ) : null}
23
15
  <ul class="todo-list">
24
- { (todosState.todos || []).map((function(__value__) {
25
- var state = Object.assign({}, this, {todosItem: __value__ == null ? {} : __value__});
26
- return (<Todo todo={todo}>
27
- </Todo>
28
- );
29
- }).bind(state))
30
- }
16
+ {(todosState.todos || []).map(
17
+ function (__value__) {
18
+ var state = Object.assign({}, this, {
19
+ todosItem: __value__ == null ? {} : __value__,
20
+ });
21
+ return <Todo todo={todo}></Todo>;
22
+ }.bind(state)
23
+ )}
31
24
  </ul>
32
25
  </section>
33
26
  );
@@ -1,11 +1,9 @@
1
- import { component, createStore, qrl } 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){Object.assign(state,__STATE__[props.serverStateId]);}return state;};
5
- export const Todos_onMount = (__props__) => {
6
- const __state__ = createStore({});
7
- const state = __merge(__state__, __props__,true);
8
- ;
9
- return qrl("./low.js", "Todos_onRender", [__props__,__state__]);
1
+ import { componentQrl, qrl } from "@builder.io/qwik";
2
+ export const Todos_onMount = (state) => {
3
+ typeof __STATE__ === "object" &&
4
+ Object.assign(state, __STATE__[state.serverStateId]);
5
+ return qrl("./low.js", "Todos_onRender", [state]);
10
6
  };
11
- export const Todos = component<any, any>(qrl("./med.js", "Todos_onMount", []));
7
+ export const Todos = componentQrl<any, any>(
8
+ qrl("./med.js", "Todos_onMount", [])
9
+ );