jac-client 0.2.2__py3-none-any.whl → 0.2.6__py3-none-any.whl

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 (202) hide show
  1. jac_client/examples/all-in-one/assets/workers/worker.py +5 -0
  2. jac_client/examples/all-in-one/src/app.jac +841 -0
  3. jac_client/examples/all-in-one/{button.jac → src/button.jac} +1 -1
  4. jac_client/examples/all-in-one/{components → src/components}/button.jac +1 -1
  5. jac_client/examples/asset-serving/css-with-image/{app.jac → src/app.jac} +2 -2
  6. jac_client/examples/asset-serving/image-asset/{app.jac → src/app.jac} +2 -2
  7. jac_client/examples/asset-serving/import-alias/{app.jac → src/app.jac} +7 -7
  8. jac_client/examples/basic/{app.jac → src/app.jac} +2 -2
  9. jac_client/examples/basic-auth/src/app.jac +377 -0
  10. jac_client/examples/basic-auth-with-router/{app.jac → src/app.jac} +18 -18
  11. jac_client/examples/basic-full-stack/{app.jac → src/app.jac} +175 -130
  12. jac_client/examples/css-styling/js-styling/{app.jac → src/app.jac} +6 -6
  13. jac_client/examples/css-styling/material-ui/{app.jac → src/app.jac} +5 -5
  14. jac_client/examples/css-styling/pure-css/{app.jac → src/app.jac} +6 -6
  15. jac_client/examples/css-styling/sass-example/{app.jac → src/app.jac} +6 -6
  16. jac_client/examples/css-styling/styled-components/{app.jac → src/app.jac} +5 -5
  17. jac_client/examples/css-styling/tailwind-example/{app.jac → src/app.jac} +6 -6
  18. jac_client/examples/full-stack-with-auth/{app.jac → src/app.jac} +37 -37
  19. jac_client/examples/little-x/{app.jac → src/app.jac} +27 -32
  20. jac_client/examples/little-x/src/submit-button.jac +16 -0
  21. jac_client/examples/nested-folders/nested-advance/{ButtonRoot.jac → src/ButtonRoot.jac} +1 -1
  22. jac_client/examples/nested-folders/nested-advance/{app.jac → src/app.jac} +1 -1
  23. jac_client/examples/nested-folders/nested-advance/{level1 → src/level1}/ButtonSecondL.jac +1 -1
  24. jac_client/examples/nested-folders/nested-advance/{level1 → src/level1}/Card.jac +1 -1
  25. jac_client/examples/nested-folders/nested-advance/{level1 → src/level1}/level2/ButtonThirdL.jac +1 -1
  26. jac_client/examples/nested-folders/nested-basic/{app.jac → src/app.jac} +2 -2
  27. jac_client/examples/nested-folders/nested-basic/{button.jac → src/button.jac} +1 -1
  28. jac_client/examples/nested-folders/nested-basic/{components → src/components}/button.jac +1 -1
  29. jac_client/examples/ts-support/src/app.jac +35 -0
  30. jac_client/examples/with-router/{app.jac → src/app.jac} +11 -11
  31. jac_client/plugin/cli.jac +547 -0
  32. jac_client/plugin/client.jac +52 -0
  33. jac_client/plugin/client_runtime.cl.jac +38 -0
  34. jac_client/plugin/impl/client.impl.jac +134 -0
  35. jac_client/plugin/impl/client_runtime.impl.jac +177 -0
  36. jac_client/plugin/impl/vite_client_bundle.impl.jac +72 -0
  37. jac_client/plugin/plugin_config.jac +195 -0
  38. jac_client/plugin/src/__init__.jac +20 -0
  39. jac_client/plugin/src/asset_processor.jac +33 -0
  40. jac_client/plugin/src/babel_processor.jac +18 -0
  41. jac_client/plugin/src/compiler.jac +66 -0
  42. jac_client/plugin/src/config_loader.jac +32 -0
  43. jac_client/plugin/src/impl/asset_processor.impl.jac +127 -0
  44. jac_client/plugin/src/impl/babel_processor.impl.jac +84 -0
  45. jac_client/plugin/src/impl/compiler.impl.jac +251 -0
  46. jac_client/plugin/src/impl/config_loader.impl.jac +119 -0
  47. jac_client/plugin/src/impl/import_processor.impl.jac +33 -0
  48. jac_client/plugin/src/impl/jac_to_js.impl.jac +41 -0
  49. jac_client/plugin/src/impl/package_installer.impl.jac +105 -0
  50. jac_client/plugin/src/impl/vite_bundler.impl.jac +513 -0
  51. jac_client/plugin/src/import_processor.jac +19 -0
  52. jac_client/plugin/src/jac_to_js.jac +35 -0
  53. jac_client/plugin/src/package_installer.jac +26 -0
  54. jac_client/plugin/src/vite_bundler.jac +36 -0
  55. jac_client/plugin/vite_client_bundle.jac +31 -0
  56. jac_client/tests/conftest.py +281 -0
  57. jac_client/tests/fixtures/basic-app/app.jac +2 -2
  58. jac_client/tests/fixtures/cl_file/app.cl.jac +2 -2
  59. jac_client/tests/fixtures/client_app_with_antd/app.jac +1 -1
  60. jac_client/tests/fixtures/js_import/app.jac +5 -5
  61. jac_client/tests/fixtures/spawn_test/app.jac +7 -7
  62. jac_client/tests/fixtures/with-ts/app.jac +35 -0
  63. jac_client/tests/test_cli.py +755 -0
  64. jac_client/tests/test_it.py +347 -67
  65. {jac_client-0.2.2.dist-info → jac_client-0.2.6.dist-info}/METADATA +30 -24
  66. jac_client-0.2.6.dist-info/RECORD +74 -0
  67. {jac_client-0.2.2.dist-info → jac_client-0.2.6.dist-info}/WHEEL +2 -1
  68. jac_client-0.2.6.dist-info/entry_points.txt +4 -0
  69. jac_client-0.2.6.dist-info/top_level.txt +1 -0
  70. jac_client/docs/README.md +0 -689
  71. jac_client/docs/advanced-state.md +0 -1265
  72. jac_client/docs/asset-serving/intro.md +0 -209
  73. jac_client/docs/assets/pipe_line-v2.svg +0 -32
  74. jac_client/docs/assets/pipe_line.png +0 -0
  75. jac_client/docs/file-system/app.jac.md +0 -121
  76. jac_client/docs/file-system/backend-frontend.md +0 -217
  77. jac_client/docs/file-system/intro.md +0 -72
  78. jac_client/docs/file-system/nested-imports.md +0 -348
  79. jac_client/docs/guide-example/intro.md +0 -115
  80. jac_client/docs/guide-example/step-01-setup.md +0 -270
  81. jac_client/docs/guide-example/step-02-components.md +0 -416
  82. jac_client/docs/guide-example/step-03-styling.md +0 -478
  83. jac_client/docs/guide-example/step-04-todo-ui.md +0 -477
  84. jac_client/docs/guide-example/step-05-local-state.md +0 -530
  85. jac_client/docs/guide-example/step-06-events.md +0 -749
  86. jac_client/docs/guide-example/step-07-effects.md +0 -468
  87. jac_client/docs/guide-example/step-08-walkers.md +0 -534
  88. jac_client/docs/guide-example/step-09-authentication.md +0 -586
  89. jac_client/docs/guide-example/step-10-routing.md +0 -539
  90. jac_client/docs/guide-example/step-11-final.md +0 -963
  91. jac_client/docs/imports.md +0 -1141
  92. jac_client/docs/lifecycle-hooks.md +0 -773
  93. jac_client/docs/routing.md +0 -659
  94. jac_client/docs/styling/intro.md +0 -249
  95. jac_client/docs/styling/js-styling.md +0 -367
  96. jac_client/docs/styling/material-ui.md +0 -341
  97. jac_client/docs/styling/pure-css.md +0 -299
  98. jac_client/docs/styling/sass.md +0 -403
  99. jac_client/docs/styling/styled-components.md +0 -395
  100. jac_client/docs/styling/tailwind.md +0 -298
  101. jac_client/examples/all-in-one/.babelrc +0 -9
  102. jac_client/examples/all-in-one/README.md +0 -16
  103. jac_client/examples/all-in-one/app.jac +0 -426
  104. jac_client/examples/all-in-one/assets/burger.png +0 -0
  105. jac_client/examples/all-in-one/package.json +0 -29
  106. jac_client/examples/all-in-one/styles.css +0 -26
  107. jac_client/examples/all-in-one/vite.config.js +0 -28
  108. jac_client/examples/asset-serving/css-with-image/.babelrc +0 -9
  109. jac_client/examples/asset-serving/css-with-image/README.md +0 -91
  110. jac_client/examples/asset-serving/css-with-image/assets/burger.png +0 -0
  111. jac_client/examples/asset-serving/css-with-image/package.json +0 -28
  112. jac_client/examples/asset-serving/css-with-image/styles.css +0 -26
  113. jac_client/examples/asset-serving/css-with-image/vite.config.js +0 -28
  114. jac_client/examples/asset-serving/image-asset/.babelrc +0 -9
  115. jac_client/examples/asset-serving/image-asset/README.md +0 -119
  116. jac_client/examples/asset-serving/image-asset/assets/burger.png +0 -0
  117. jac_client/examples/asset-serving/image-asset/package.json +0 -28
  118. jac_client/examples/asset-serving/image-asset/styles.css +0 -26
  119. jac_client/examples/asset-serving/image-asset/vite.config.js +0 -28
  120. jac_client/examples/asset-serving/import-alias/.babelrc +0 -9
  121. jac_client/examples/asset-serving/import-alias/README.md +0 -83
  122. jac_client/examples/asset-serving/import-alias/assets/burger.png +0 -0
  123. jac_client/examples/asset-serving/import-alias/package.json +0 -28
  124. jac_client/examples/asset-serving/import-alias/vite.config.js +0 -28
  125. jac_client/examples/basic/.babelrc +0 -9
  126. jac_client/examples/basic/README.md +0 -16
  127. jac_client/examples/basic/package.json +0 -27
  128. jac_client/examples/basic/vite.config.js +0 -27
  129. jac_client/examples/basic-auth/.babelrc +0 -9
  130. jac_client/examples/basic-auth/README.md +0 -16
  131. jac_client/examples/basic-auth/app.jac +0 -308
  132. jac_client/examples/basic-auth/package.json +0 -27
  133. jac_client/examples/basic-auth/vite.config.js +0 -27
  134. jac_client/examples/basic-auth-with-router/.babelrc +0 -9
  135. jac_client/examples/basic-auth-with-router/README.md +0 -60
  136. jac_client/examples/basic-auth-with-router/package.json +0 -28
  137. jac_client/examples/basic-auth-with-router/vite.config.js +0 -27
  138. jac_client/examples/basic-full-stack/.babelrc +0 -9
  139. jac_client/examples/basic-full-stack/README.md +0 -18
  140. jac_client/examples/basic-full-stack/package.json +0 -28
  141. jac_client/examples/basic-full-stack/vite.config.js +0 -27
  142. jac_client/examples/css-styling/js-styling/.babelrc +0 -9
  143. jac_client/examples/css-styling/js-styling/README.md +0 -183
  144. jac_client/examples/css-styling/js-styling/package.json +0 -28
  145. jac_client/examples/css-styling/js-styling/styles.js +0 -100
  146. jac_client/examples/css-styling/js-styling/vite.config.js +0 -27
  147. jac_client/examples/css-styling/material-ui/.babelrc +0 -9
  148. jac_client/examples/css-styling/material-ui/README.md +0 -16
  149. jac_client/examples/css-styling/material-ui/package.json +0 -32
  150. jac_client/examples/css-styling/material-ui/vite.config.js +0 -27
  151. jac_client/examples/css-styling/pure-css/.babelrc +0 -9
  152. jac_client/examples/css-styling/pure-css/README.md +0 -16
  153. jac_client/examples/css-styling/pure-css/package.json +0 -28
  154. jac_client/examples/css-styling/pure-css/styles.css +0 -111
  155. jac_client/examples/css-styling/pure-css/vite.config.js +0 -27
  156. jac_client/examples/css-styling/sass-example/.babelrc +0 -9
  157. jac_client/examples/css-styling/sass-example/README.md +0 -16
  158. jac_client/examples/css-styling/sass-example/package.json +0 -29
  159. jac_client/examples/css-styling/sass-example/styles.scss +0 -153
  160. jac_client/examples/css-styling/sass-example/vite.config.js +0 -27
  161. jac_client/examples/css-styling/styled-components/.babelrc +0 -9
  162. jac_client/examples/css-styling/styled-components/README.md +0 -16
  163. jac_client/examples/css-styling/styled-components/package.json +0 -29
  164. jac_client/examples/css-styling/styled-components/styled.js +0 -90
  165. jac_client/examples/css-styling/styled-components/vite.config.js +0 -27
  166. jac_client/examples/css-styling/tailwind-example/.babelrc +0 -9
  167. jac_client/examples/css-styling/tailwind-example/README.md +0 -16
  168. jac_client/examples/css-styling/tailwind-example/global.css +0 -1
  169. jac_client/examples/css-styling/tailwind-example/package.json +0 -30
  170. jac_client/examples/css-styling/tailwind-example/vite.config.js +0 -29
  171. jac_client/examples/full-stack-with-auth/.babelrc +0 -9
  172. jac_client/examples/full-stack-with-auth/README.md +0 -16
  173. jac_client/examples/full-stack-with-auth/package.json +0 -28
  174. jac_client/examples/full-stack-with-auth/vite.config.js +0 -29
  175. jac_client/examples/little-x/package.json +0 -23
  176. jac_client/examples/little-x/submit-button.jac +0 -8
  177. jac_client/examples/nested-folders/nested-advance/.babelrc +0 -9
  178. jac_client/examples/nested-folders/nested-advance/README.md +0 -77
  179. jac_client/examples/nested-folders/nested-advance/package.json +0 -29
  180. jac_client/examples/nested-folders/nested-advance/vite.config.js +0 -28
  181. jac_client/examples/nested-folders/nested-basic/.babelrc +0 -9
  182. jac_client/examples/nested-folders/nested-basic/README.md +0 -183
  183. jac_client/examples/nested-folders/nested-basic/app.js +0 -7
  184. jac_client/examples/nested-folders/nested-basic/package.json +0 -28
  185. jac_client/examples/nested-folders/nested-basic/vite.config.js +0 -27
  186. jac_client/examples/with-router/.babelrc +0 -9
  187. jac_client/examples/with-router/README.md +0 -17
  188. jac_client/examples/with-router/package.json +0 -28
  189. jac_client/examples/with-router/vite.config.js +0 -27
  190. jac_client/plugin/cli.py +0 -244
  191. jac_client/plugin/client.py +0 -152
  192. jac_client/plugin/client_runtime.jac +0 -234
  193. jac_client/plugin/vite_client_bundle.py +0 -503
  194. jac_client/tests/fixtures/js_import/utils.js +0 -21
  195. jac_client/tests/fixtures/package-lock.json +0 -329
  196. jac_client/tests/fixtures/package.json +0 -11
  197. jac_client/tests/test_asset_examples.py +0 -322
  198. jac_client/tests/test_cl.py +0 -530
  199. jac_client/tests/test_create_jac_app.py +0 -131
  200. jac_client/tests/test_nested_file.py +0 -374
  201. jac_client-0.2.2.dist-info/RECORD +0 -171
  202. jac_client-0.2.2.dist-info/entry_points.txt +0 -4
@@ -1,55 +1,57 @@
1
1
  # Todo App
2
- cl import from react {useState, useEffect}
2
+ cl import from react { useState, useEffect }
3
3
 
4
4
  node Todo {
5
- has text: str;
6
- has done: bool = False;
5
+ has text: str,
6
+ done: bool = False;
7
7
  }
8
8
 
9
9
  walker create_todo {
10
- has text:str;
10
+ has text: str;
11
+
11
12
  can create with `root entry {
12
- new_todo = here ++> Todo(text= self.text);
13
- report new_todo;
13
+ new_todo = here ++> Todo(text=self.text);
14
+ report new_todo ;
14
15
  }
15
16
  }
17
+
16
18
  walker toggle_todo {
17
19
  can toggle with Todo entry {
18
20
  here.done = not here.done;
19
- report here;
21
+ report here ;
20
22
  }
21
23
  }
24
+
22
25
  walker read_todos {
23
26
  can read with `root entry {
24
27
  visit [-->(`?Todo)];
25
28
  }
29
+
26
30
  can report_todos with exit {
27
- report here;
31
+ report here ;
28
32
  }
29
33
  }
30
34
 
31
35
  cl {
32
- def app() -> any {
33
- let [todos, setTodos] = useState([]);
34
- let [inputValue, setInputValue] = useState("");
35
- let [filter, setFilter] = useState("all");
36
+ def:pub app -> any {
37
+ [todos, setTodos] = useState([]);
38
+ [inputValue, setInputValue] = useState("");
39
+ [filter, setFilter] = useState("all");
36
40
 
37
- useEffect(lambda -> None {
38
- async def loadTodos() -> None {
41
+ useEffect(
42
+ lambda -> None{ async def loadTodos -> None {
39
43
  todos = root spawn read_todos();
40
44
  setTodos(todos.reports);
41
- }
42
- loadTodos();
43
- }, []);
45
+ } loadTodos();} ,
46
+ []
47
+ );
44
48
 
45
49
  # Add a new todo
46
- async def addTodo() -> None {
47
- if not inputValue.trim() { return; }
48
- newTodo = {
49
- "id": Date.now(),
50
- "text": inputValue.trim(),
51
- "done": False
52
- };
50
+ async def addTodo -> None {
51
+ if not inputValue.trim() {
52
+ return;
53
+ }
54
+ newTodo = {"id": Date.now(), "text": inputValue.trim(), "done": False};
53
55
  response = root spawn create_todo(text=inputValue.trim());
54
56
  newTodos = todos.concat([response.reports[0][0]]);
55
57
  setTodos(newTodos);
@@ -60,79 +62,94 @@ cl {
60
62
  async def toggleTodo(id: any) -> None {
61
63
  console.log("toggleTodo", id);
62
64
  id spawn toggle_todo();
63
- setTodos(todos.map(lambda todo: any -> any {
64
- if todo._jac_id == id {
65
- updatedTodo = {
66
- "_jac_id": todo._jac_id,
67
- "text": todo.text,
68
- "done": not todo.done,
69
- "id": todo.id
70
- };
71
- return updatedTodo;
72
- }
73
- return todo;
74
- }));
65
+ setTodos(
66
+ todos.map(
67
+ lambda todo: any -> any{ if todo._jac_id == id {
68
+ updatedTodo = {
69
+ "_jac_id": todo._jac_id,
70
+ "text": todo.text,
71
+ "done": not todo.done,
72
+ "id": todo.id
73
+ };
74
+ return updatedTodo;
75
+ }return todo; }
76
+ )
77
+ );
75
78
  }
76
79
 
77
80
  # Delete a todo
78
81
  def deleteTodo(id: any) -> None {
79
- setTodos(todos.filter(lambda todo: any -> bool { return todo.id != id; }));
82
+ setTodos(
83
+ todos.filter(lambda todo: any -> bool{ return todo.id != id; } )
84
+ );
80
85
  }
81
86
 
82
87
  # Clear all completed todos
83
- def clearCompleted() -> None {
84
- setTodos(todos.filter(lambda todo: any -> bool { return not todo.done; }));
88
+ def clearCompleted -> None {
89
+ setTodos(
90
+ todos.filter(lambda todo: any -> bool{ return not todo.done; } )
91
+ );
85
92
  }
86
93
 
87
94
  # Filter todos based on current filter
88
- def getFilteredTodos() -> list {
95
+ def getFilteredTodos -> list {
89
96
  if filter == "active" {
90
- return todos.filter(lambda todo: any -> bool { return not todo.done; });
97
+ return todos.filter(
98
+ lambda todo: any -> bool{ return not todo.done; }
99
+ );
91
100
  } elif filter == "completed" {
92
- return todos.filter(lambda todo: any -> bool { return todo.done; });
101
+ return todos.filter(lambda todo: any -> bool{ return todo.done; } );
93
102
  }
94
103
  return todos;
95
104
  }
96
105
 
97
106
  # Count active todos
98
- activeCount = todos.filter(lambda todo: any -> bool { return not todo.done; }).length;
107
+ activeCount = todos.filter(
108
+ lambda todo: any -> bool{ return not todo.done; }
109
+ ).length;
99
110
 
100
111
  filteredTodos = getFilteredTodos();
101
112
 
102
-
103
- return <div style={{
104
- "maxWidth": "600px",
105
- "margin": "40px auto",
106
- "padding": "24px",
107
- "fontFamily": "system-ui, -apple-system, sans-serif",
108
- "background": "#f9fafb",
109
- "minHeight": "100vh"
110
- }}>
111
- <h1 style={{
112
- "textAlign": "center",
113
- "color": "#1f2937",
114
- "marginBottom": "32px",
115
- "fontSize": "2.5rem",
116
- "fontWeight": "700"
117
- }}>📝 My Todo App</h1>
118
-
113
+ return <div
114
+ style={{
115
+ "maxWidth": "600px",
116
+ "margin": "40px auto",
117
+ "padding": "24px",
118
+ "fontFamily": "system-ui, -apple-system, sans-serif",
119
+ "background": "#f9fafb",
120
+ "minHeight": "100vh"
121
+ }}
122
+ >
123
+ <h1
124
+ style={{
125
+ "textAlign": "center",
126
+ "color": "#1f2937",
127
+ "marginBottom": "32px",
128
+ "fontSize": "2.5rem",
129
+ "fontWeight": "700"
130
+ }}
131
+ >
132
+ 📝 My Todo App
133
+ </h1>
119
134
  # Add todo form
120
- <div style={{
121
- "display": "flex",
122
- "gap": "8px",
123
- "marginBottom": "24px",
124
- "background": "#ffffff",
125
- "padding": "16px",
126
- "borderRadius": "12px",
127
- "boxShadow": "0 1px 3px rgba(0,0,0,0.1)"
128
- }}>
135
+ <div
136
+ style={{
137
+ "display": "flex",
138
+ "gap": "8px",
139
+ "marginBottom": "24px",
140
+ "background": "#ffffff",
141
+ "padding": "16px",
142
+ "borderRadius": "12px",
143
+ "boxShadow": "0 1px 3px rgba(0,0,0,0.1)"
144
+ }}
145
+ >
129
146
  <input
130
147
  type="text"
131
148
  value={inputValue}
132
- onChange={lambda e: any -> None { setInputValue(e.target.value); }}
133
- onKeyPress={lambda e: any -> None {
134
- if e.key == "Enter" { addTodo(); }
135
- }}
149
+ onChange={lambda e: any -> None{ setInputValue(e.target.value);} }
150
+ onKeyPress={lambda e: any -> None{ if e.key == "Enter" {
151
+ addTodo();
152
+ }} }
136
153
  placeholder="What needs to be done?"
137
154
  style={{
138
155
  "flex": "1",
@@ -160,16 +177,17 @@ cl {
160
177
  Add
161
178
  </button>
162
179
  </div>
163
-
164
180
  # Filter buttons
165
- <div style={{
166
- "display": "flex",
167
- "gap": "8px",
168
- "marginBottom": "24px",
169
- "justifyContent": "center"
170
- }}>
181
+ <div
182
+ style={{
183
+ "display": "flex",
184
+ "gap": "8px",
185
+ "marginBottom": "24px",
186
+ "justifyContent": "center"
187
+ }}
188
+ >
171
189
  <button
172
- onClick={lambda -> None { setFilter("all"); }}
190
+ onClick={lambda -> None{ setFilter("all");} }
173
191
  style={{
174
192
  "padding": "8px 16px",
175
193
  "background": ("#3b82f6" if filter == "all" else "#ffffff"),
@@ -184,7 +202,7 @@ cl {
184
202
  All
185
203
  </button>
186
204
  <button
187
- onClick={lambda -> None { setFilter("active"); }}
205
+ onClick={lambda -> None{ setFilter("active");} }
188
206
  style={{
189
207
  "padding": "8px 16px",
190
208
  "background": ("#3b82f6" if filter == "active" else "#ffffff"),
@@ -199,10 +217,12 @@ cl {
199
217
  Active
200
218
  </button>
201
219
  <button
202
- onClick={lambda -> None { setFilter("completed"); }}
220
+ onClick={lambda -> None{ setFilter("completed");} }
203
221
  style={{
204
222
  "padding": "8px 16px",
205
- "background": ("#3b82f6" if filter == "completed" else "#ffffff"),
223
+ "background": (
224
+ "#3b82f6" if filter == "completed" else "#ffffff"
225
+ ),
206
226
  "color": ("#ffffff" if filter == "completed" else "#3b82f6"),
207
227
  "border": "1px solid #3b82f6",
208
228
  "borderRadius": "6px",
@@ -214,25 +234,38 @@ cl {
214
234
  Completed
215
235
  </button>
216
236
  </div>
217
-
218
237
  # Todo list
219
- <div style={{
220
- "background": "#ffffff",
221
- "borderRadius": "12px",
222
- "boxShadow": "0 1px 3px rgba(0,0,0,0.1)",
223
- "overflow": "hidden"
224
- }}>
225
- {(<div style={{
226
- "padding": "40px",
227
- "textAlign": "center",
228
- "color": "#9ca3af"
229
- }}>
230
- {("No todos yet. Add one above!" if filter == "all" else
231
- ("No active todos!" if filter == "active" else
232
- "No completed todos!"))}
233
- </div>) if filteredTodos.length == 0 else (
234
- filteredTodos.map(lambda todo: any -> any {
235
- return <div
238
+ <div
239
+ style={{
240
+ "background": "#ffffff",
241
+ "borderRadius": "12px",
242
+ "boxShadow": "0 1px 3px rgba(0,0,0,0.1)",
243
+ "overflow": "hidden"
244
+ }}
245
+ >
246
+ {(
247
+ <div
248
+ style={{
249
+ "padding": "40px",
250
+ "textAlign": "center",
251
+ "color": "#9ca3af"
252
+ }}
253
+ >
254
+ {(
255
+ "No todos yet. Add one above!"
256
+ if filter == "all"
257
+ else (
258
+ "No active todos!"
259
+ if filter == "active"
260
+ else "No completed todos!"
261
+ )
262
+ )}
263
+ </div>
264
+ )
265
+ if filteredTodos.length == 0
266
+ else (
267
+ filteredTodos.map(
268
+ lambda todo: any -> any{ return <div
236
269
  key={todo._jac_id}
237
270
  style={{
238
271
  "display": "flex",
@@ -246,23 +279,27 @@ cl {
246
279
  <input
247
280
  type="checkbox"
248
281
  checked={todo.done}
249
- onChange={lambda -> None { toggleTodo(todo._jac_id); }}
282
+ onChange={lambda -> None{ toggleTodo(todo._jac_id);} }
250
283
  style={{
251
284
  "width": "20px",
252
285
  "height": "20px",
253
286
  "cursor": "pointer"
254
287
  }}
255
288
  />
256
- <span style={{
257
- "flex": "1",
258
- "textDecoration": ("line-through" if todo.done else "none"),
259
- "color": ("#9ca3af" if todo.done else "#1f2937"),
260
- "fontSize": "16px"
261
- }}>
289
+ <span
290
+ style={{
291
+ "flex": "1",
292
+ "textDecoration": (
293
+ "line-through" if todo.done else "none"
294
+ ),
295
+ "color": ("#9ca3af" if todo.done else "#1f2937"),
296
+ "fontSize": "16px"
297
+ }}
298
+ >
262
299
  {todo.text}
263
300
  </span>
264
301
  <button
265
- onClick={lambda -> None { deleteTodo(todo.__jac_id); }}
302
+ onClick={lambda -> None{ deleteTodo(todo.__jac_id);} }
266
303
  style={{
267
304
  "padding": "6px 12px",
268
305
  "background": "#ef4444",
@@ -277,29 +314,31 @@ cl {
277
314
  >
278
315
  Delete
279
316
  </button>
280
- </div>;
281
- })
317
+ </div>; }
318
+ )
282
319
  )}
283
320
  </div>
284
-
285
321
  # Stats and clear completed button
286
- {(<div style={{
287
- "display": "flex",
288
- "justifyContent": "space-between",
289
- "alignItems": "center",
290
- "marginTop": "24px",
291
- "padding": "16px",
292
- "background": "#ffffff",
293
- "borderRadius": "12px",
294
- "boxShadow": "0 1px 3px rgba(0,0,0,0.1)"
295
- }}>
296
- <span style={{
297
- "color": "#6b7280",
298
- "fontSize": "14px"
299
- }}>
322
+ {(
323
+ <div
324
+ style={{
325
+ "display": "flex",
326
+ "justifyContent": "space-between",
327
+ "alignItems": "center",
328
+ "marginTop": "24px",
329
+ "padding": "16px",
330
+ "background": "#ffffff",
331
+ "borderRadius": "12px",
332
+ "boxShadow": "0 1px 3px rgba(0,0,0,0.1)"
333
+ }}
334
+ >
335
+ <span
336
+ style={{"color": "#6b7280", "fontSize": "14px"}}
337
+ >
300
338
  {activeCount} {"item" if activeCount == 1 else "items"} left
301
339
  </span>
302
- {(<button
340
+ {(
341
+ <button
303
342
  onClick={clearCompleted}
304
343
  style={{
305
344
  "padding": "8px 16px",
@@ -313,8 +352,14 @@ cl {
313
352
  }}
314
353
  >
315
354
  Clear Completed
316
- </button>) if todos.some(lambda todo: any -> bool { return todo.done; }) else None}
317
- </div>) if todos.length > 0 else None}
355
+ </button>
356
+ )
357
+ if todos.some(lambda todo: any -> bool{ return todo.done; } )
358
+ else None}
359
+ </div>
360
+ )
361
+ if todos.length > 0
362
+ else None}
318
363
  </div>;
319
364
  }
320
365
  }
@@ -3,18 +3,18 @@ cl import from react { useState, useEffect }
3
3
  cl import from .styles { default as styles }
4
4
 
5
5
  cl {
6
- def app() -> any {
7
- let [count, setCount] = useState(0);
6
+ def:pub app -> any {
7
+ [count, setCount] = useState(0);
8
8
 
9
9
  useEffect(lambda -> None{ console.log("Count changed: ", count);} , [count]);
10
10
 
11
- let handleIncrement = lambda e: any -> None{ setCount(count + 1);} ;
11
+ handleIncrement = lambda e: any -> None{ setCount(count + 1);} ;
12
12
 
13
- let handleDecrement = lambda e: any -> None{ setCount(count - 1);} ;
13
+ handleDecrement = lambda e: any -> None{ setCount(count - 1);} ;
14
14
 
15
- let handleReset = lambda e: any -> None{ setCount(0);} ;
15
+ handleReset = lambda e: any -> None{ setCount(0);} ;
16
16
 
17
- let countStyle = styles.countDisplayZero
17
+ countStyle = styles.countDisplayZero
18
18
  if count == 0
19
19
  else (
20
20
  styles.countDisplayPositive if count > 0 else styles.countDisplayNegative
@@ -12,16 +12,16 @@ cl import from '@mui/icons-material/Remove' { default as RemoveIcon }
12
12
  cl import from '@mui/icons-material/Refresh' { default as RefreshIcon }
13
13
 
14
14
  cl {
15
- def app() -> any {
16
- let [count, setCount] = useState(0);
15
+ def:pub app -> any {
16
+ [count, setCount] = useState(0);
17
17
 
18
18
  useEffect(lambda -> None{ console.log("Count changed: ", count);} , [count]);
19
19
 
20
- let handleIncrement = lambda e: any -> None{ setCount(count + 1);} ;
20
+ handleIncrement = lambda e: any -> None{ setCount(count + 1);} ;
21
21
 
22
- let handleDecrement = lambda e: any -> None{ setCount(count - 1);} ;
22
+ handleDecrement = lambda e: any -> None{ setCount(count - 1);} ;
23
23
 
24
- let handleReset = lambda e: any -> None{ setCount(0);} ;
24
+ handleReset = lambda e: any -> None{ setCount(0);} ;
25
25
 
26
26
  return <Box
27
27
  sx={{
@@ -3,18 +3,18 @@ cl import from react { useState, useEffect }
3
3
  cl import ".styles.css";
4
4
 
5
5
  cl {
6
- def app() -> any {
7
- let [count, setCount] = useState(0);
6
+ def:pub app -> any {
7
+ [count, setCount] = useState(0);
8
8
 
9
9
  useEffect(lambda -> None{ console.log("Count changed: ", count);} , [count]);
10
10
 
11
- let handleIncrement = lambda e: any -> None{ setCount(count + 1);} ;
11
+ handleIncrement = lambda e: any -> None{ setCount(count + 1);} ;
12
12
 
13
- let handleDecrement = lambda e: any -> None{ setCount(count - 1);} ;
13
+ handleDecrement = lambda e: any -> None{ setCount(count - 1);} ;
14
14
 
15
- let handleReset = lambda e: any -> None{ setCount(0);} ;
15
+ handleReset = lambda e: any -> None{ setCount(0);} ;
16
16
 
17
- let countClass = "countDisplay " + (
17
+ countClass = "countDisplay " + (
18
18
  "positive" if count > 0 else "negative" if count < 0 else "zero"
19
19
  );
20
20
 
@@ -3,18 +3,18 @@ cl import from react { useState, useEffect }
3
3
  cl import ".styles.scss";
4
4
 
5
5
  cl {
6
- def app() -> any {
7
- let [count, setCount] = useState(0);
6
+ def:pub app -> any {
7
+ [count, setCount] = useState(0);
8
8
 
9
9
  useEffect(lambda -> None{ console.log("Count changed: ", count);} , [count]);
10
10
 
11
- let handleIncrement = lambda e: any -> None{ setCount(count + 1);} ;
11
+ handleIncrement = lambda e: any -> None{ setCount(count + 1);} ;
12
12
 
13
- let handleDecrement = lambda e: any -> None{ setCount(count - 1);} ;
13
+ handleDecrement = lambda e: any -> None{ setCount(count - 1);} ;
14
14
 
15
- let handleReset = lambda e: any -> None{ setCount(0);} ;
15
+ handleReset = lambda e: any -> None{ setCount(0);} ;
16
16
 
17
- let countClass = "countDisplay " + (
17
+ countClass = "countDisplay " + (
18
18
  "positive" if count > 0 else "negative" if count < 0 else "zero"
19
19
  );
20
20
 
@@ -14,16 +14,16 @@ cl import from .styled {
14
14
  }
15
15
 
16
16
  cl {
17
- def app() -> any {
18
- let [count, setCount] = useState(0);
17
+ def:pub app -> any {
18
+ [count, setCount] = useState(0);
19
19
 
20
20
  useEffect(lambda -> None{ console.log("Count changed: ", count);} , [count]);
21
21
 
22
- let handleIncrement = lambda e: any -> None{ setCount(count + 1);} ;
22
+ handleIncrement = lambda e: any -> None{ setCount(count + 1);} ;
23
23
 
24
- let handleDecrement = lambda e: any -> None{ setCount(count - 1);} ;
24
+ handleDecrement = lambda e: any -> None{ setCount(count - 1);} ;
25
25
 
26
- let handleReset = lambda e: any -> None{ setCount(0);} ;
26
+ handleReset = lambda e: any -> None{ setCount(0);} ;
27
27
 
28
28
  return <Container>
29
29
  <Card>
@@ -2,18 +2,18 @@
2
2
  cl import from react { useState, useEffect }
3
3
  cl import ".global.css";
4
4
  cl {
5
- def app() -> any {
6
- let [count, setCount] = useState(0);
5
+ def:pub app -> any {
6
+ [count, setCount] = useState(0);
7
7
 
8
8
  useEffect(lambda -> None{ console.log("Count changed: ", count);} , [count]);
9
9
 
10
- let handleIncrement = lambda e: any -> None{ setCount(count + 1);} ;
10
+ handleIncrement = lambda e: any -> None{ setCount(count + 1);} ;
11
11
 
12
- let handleDecrement = lambda e: any -> None{ setCount(count - 1);} ;
12
+ handleDecrement = lambda e: any -> None{ setCount(count - 1);} ;
13
13
 
14
- let handleReset = lambda e: any -> None{ setCount(0);} ;
14
+ handleReset = lambda e: any -> None{ setCount(0);} ;
15
15
 
16
- let countColorClass = "text-gray-800"
16
+ countColorClass = "text-gray-800"
17
17
  if count == 0
18
18
  else ("text-green-600" if count > 0 else "text-red-600");
19
19