jac-client 0.2.13__tar.gz → 0.2.15__tar.gz
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.
- {jac_client-0.2.13 → jac_client-0.2.15}/PKG-INFO +2 -2
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/all-in-one/components/Header.jac +1 -1
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/all-in-one/components/ProfitOverview.jac +1 -1
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/all-in-one/components/Summary.jac +1 -1
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/all-in-one/components/TransactionList.jac +2 -2
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/all-in-one/components/navigation.jac +3 -9
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/all-in-one/context/BudgetContext.jac +1 -1
- jac_client-0.2.13/jac_client/examples/all-in-one/pages/BudgetPlanner.jac → jac_client-0.2.15/jac_client/examples/all-in-one/main.jac +37 -16
- jac_client-0.2.13/jac_client/examples/all-in-one/main.jac → jac_client-0.2.15/jac_client/examples/all-in-one/pages/(auth)/index.jac +3 -246
- jac_client-0.2.13/jac_client/examples/all-in-one/pages/nestedDemo.jac → jac_client-0.2.15/jac_client/examples/all-in-one/pages/(auth)/nested.jac +3 -13
- jac_client-0.2.13/jac_client/examples/all-in-one/pages/loginPage.jac → jac_client-0.2.15/jac_client/examples/all-in-one/pages/(public)/login.jac +1 -1
- jac_client-0.2.13/jac_client/examples/all-in-one/pages/signupPage.jac → jac_client-0.2.15/jac_client/examples/all-in-one/pages/(public)/signup.jac +1 -1
- jac_client-0.2.13/jac_client/examples/all-in-one/pages/notFound.jac → jac_client-0.2.15/jac_client/examples/all-in-one/pages/[...notFound].jac +2 -1
- jac_client-0.2.15/jac_client/examples/all-in-one/pages/budget.jac +11 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/all-in-one/pages/budget_planner_ui.cl.jac +1 -1
- jac_client-0.2.15/jac_client/examples/all-in-one/pages/features.jac +8 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/all-in-one/pages/features_test_ui.cl.jac +7 -7
- jac_client-0.2.13/jac_client/examples/all-in-one/pages/LandingPage.jac → jac_client-0.2.15/jac_client/examples/all-in-one/pages/landing.jac +4 -9
- jac_client-0.2.15/jac_client/examples/all-in-one/pages/layout.jac +20 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/nested-folders/nested-advance/src/ButtonRoot.jac +1 -1
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/nested-folders/nested-advance/src/level1/ButtonSecondL.jac +1 -1
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/nested-folders/nested-advance/src/level1/level2/ButtonThirdL.jac +1 -1
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/client_runtime.cl.jac +4 -2
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/impl/client_runtime.impl.jac +12 -1
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/plugin_config.jac +4 -11
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/compiler.jac +15 -1
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/impl/compiler.impl.jac +216 -23
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/impl/package_installer.impl.jac +3 -2
- jac_client-0.2.15/jac_client/plugin/src/impl/route_scanner.impl.jac +201 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/impl/vite_bundler.impl.jac +15 -11
- jac_client-0.2.15/jac_client/plugin/src/route_scanner.jac +44 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/utils/impl/bun_installer.impl.jac +16 -19
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/utils/impl/client_deps.impl.jac +12 -16
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/templates/fullstack.jacpack +3 -2
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/tests/test_e2e.py +19 -28
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/tests/test_it.py +247 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client.egg-info/PKG-INFO +2 -2
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client.egg-info/SOURCES.txt +11 -7
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client.egg-info/requires.txt +1 -1
- {jac_client-0.2.13 → jac_client-0.2.15}/pyproject.toml +2 -2
- jac_client-0.2.13/jac_client/examples/all-in-one/pages/FeaturesTest.jac +0 -157
- {jac_client-0.2.13 → jac_client-0.2.15}/README.md +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/all-in-one/assets/workers/worker.py +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/all-in-one/button.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/all-in-one/components/CategoryFilter.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/all-in-one/components/TransactionForm.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/all-in-one/components/TransactionItem.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/all-in-one/components/button.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/all-in-one/constants/categories.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/all-in-one/constants/clients.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/all-in-one/hooks/useBudget.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/all-in-one/hooks/useLocalStorage.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/all-in-one/utils/formatters.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/asset-serving/css-with-image/main.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/asset-serving/image-asset/main.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/asset-serving/import-alias/main.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/basic/main.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/basic-auth/main.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/basic-auth-with-router/main.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/basic-full-stack/main.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/css-styling/js-styling/main.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/css-styling/material-ui/main.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/css-styling/pure-css/main.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/css-styling/sass-example/main.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/css-styling/styled-components/main.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/css-styling/tailwind-example/main.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/full-stack-with-auth/main.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/little-x/main.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/little-x/src/submit-button.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/nested-folders/nested-advance/main.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/nested-folders/nested-advance/src/level1/Card.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/nested-folders/nested-basic/main.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/nested-folders/nested-basic/src/button.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/nested-folders/nested-basic/src/components/button.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/ts-support/main.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/with-router/main.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/cli.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/client.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/impl/client.impl.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/impl/vite_client_bundle.impl.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/__init__.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/asset_processor.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/config_loader.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/desktop_config.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/impl/asset_processor.impl.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/impl/config_loader.impl.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/impl/desktop_config.impl.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/impl/import_processor.impl.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/impl/jac_to_js.impl.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/import_processor.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/jac_to_js.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/package_installer.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/targets/desktop/sidecar/main.py +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/targets/desktop_target.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/targets/impl/desktop_target.impl.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/targets/impl/registry.impl.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/targets/impl/web_target.impl.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/targets/register.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/targets/registry.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/targets/web_target.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/src/vite_bundler.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/utils/__init__.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/utils/bun_installer.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/utils/client_deps.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/plugin/vite_client_bundle.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/templates/client.jacpack +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/tests/__init__.py +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/tests/conftest.py +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/tests/fixtures/basic-app/app.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/tests/fixtures/cl_file/app.cl.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/tests/fixtures/cl_file/app.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/tests/fixtures/client_app_with_antd/app.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/tests/fixtures/js_import/app.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/tests/fixtures/relative_import/app.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/tests/fixtures/relative_import/button.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/tests/fixtures/spawn_test/app.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/tests/fixtures/test_fragments_spread/app.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/tests/fixtures/with-ts/app.jac +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/tests/test_cli.py +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/tests/test_desktop_api_url.py +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/tests/test_helpers.py +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client/tests/test_it_desktop.py +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client.egg-info/dependency_links.txt +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client.egg-info/entry_points.txt +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/jac_client.egg-info/top_level.txt +0 -0
- {jac_client-0.2.13 → jac_client-0.2.15}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jac-client
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.15
|
|
4
4
|
Summary: Build full-stack web applications with Jac - one language for frontend and backend.
|
|
5
5
|
Author-email: Jason Mars <jason@mars.ninja>
|
|
6
6
|
Maintainer-email: Jason Mars <jason@mars.ninja>
|
|
@@ -11,7 +11,7 @@ Project-URL: Documentation, https://jac-lang.org
|
|
|
11
11
|
Keywords: jac,jaclang,jaseci,frontend,full-stack,web-development
|
|
12
12
|
Requires-Python: >=3.12
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
|
-
Requires-Dist: jaclang>=0.9.
|
|
14
|
+
Requires-Dist: jaclang>=0.9.15
|
|
15
15
|
Provides-Extra: dev
|
|
16
16
|
Requires-Dist: python-dotenv==1.0.1; extra == "dev"
|
|
17
17
|
Requires-Dist: pytest==8.3.5; extra == "dev"
|
|
@@ -6,7 +6,7 @@ cl import from .TransactionItem {
|
|
|
6
6
|
|
|
7
7
|
cl {
|
|
8
8
|
# Props: transactions list and delete handler
|
|
9
|
-
def:pub TransactionList(transactions: list, onDelete: any) ->
|
|
9
|
+
def:pub TransactionList(transactions: list, onDelete: any) -> JsxElement {
|
|
10
10
|
if transactions.length == 0 {
|
|
11
11
|
return
|
|
12
12
|
<div className="empty-state">
|
|
@@ -25,7 +25,7 @@ cl {
|
|
|
25
25
|
Transactions ({transactions.length})
|
|
26
26
|
</h3>
|
|
27
27
|
{transactions.map(
|
|
28
|
-
lambda tx: dict ->
|
|
28
|
+
lambda tx: dict -> JsxElement { return
|
|
29
29
|
<TransactionItem
|
|
30
30
|
key={tx["id"]}
|
|
31
31
|
id={tx["id"]}
|
{jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/all-in-one/components/navigation.jac
RENAMED
|
@@ -7,7 +7,7 @@ cl import from "@jac/runtime" {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
cl {
|
|
10
|
-
def:pub Navigation ->
|
|
10
|
+
def:pub Navigation -> JsxElement {
|
|
11
11
|
location = useLocation();
|
|
12
12
|
isLoggedIn = jacIsLoggedIn();
|
|
13
13
|
navigate = useNavigate();
|
|
@@ -93,19 +93,13 @@ cl {
|
|
|
93
93
|
<Link to="/nested" style={linkStyle("/nested")}>
|
|
94
94
|
Nested Imports
|
|
95
95
|
</Link>
|
|
96
|
-
<Link
|
|
97
|
-
to="/features-test"
|
|
98
|
-
style={linkStyle("/features-test")}
|
|
99
|
-
>
|
|
96
|
+
<Link to="/features" style={linkStyle("/features")}>
|
|
100
97
|
Features Test
|
|
101
98
|
</Link>
|
|
102
99
|
<Link to="/landing" style={linkStyle("/landing")}>
|
|
103
100
|
Landing Page
|
|
104
101
|
</Link>
|
|
105
|
-
<Link
|
|
106
|
-
to="/budget-planner"
|
|
107
|
-
style={linkStyle("/budget-planner")}
|
|
108
|
-
>
|
|
102
|
+
<Link to="/budget" style={linkStyle("/budget")}>
|
|
109
103
|
Budget Planner
|
|
110
104
|
</Link>
|
|
111
105
|
</>
|
{jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/all-in-one/context/BudgetContext.jac
RENAMED
|
@@ -11,7 +11,7 @@ cl {
|
|
|
11
11
|
glob:pub BudgetContext = createContext(None);
|
|
12
12
|
|
|
13
13
|
# Provider component - wraps app and provides budget state
|
|
14
|
-
def:pub BudgetProvider(children: any) ->
|
|
14
|
+
def:pub BudgetProvider(children: any) -> JsxElement {
|
|
15
15
|
budget = useBudget();
|
|
16
16
|
|
|
17
17
|
return
|
|
@@ -1,17 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
#
|
|
1
|
+
import from datetime { datetime, timedelta }
|
|
2
|
+
|
|
3
|
+
#
|
|
4
|
+
# Basic backend walkers
|
|
5
|
+
#
|
|
6
|
+
node Todo {
|
|
7
|
+
has text: str,
|
|
8
|
+
done: bool = False;
|
|
9
|
+
}
|
|
4
10
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
walker:pub create_todo {
|
|
12
|
+
has text: str;
|
|
13
|
+
|
|
14
|
+
can create with `root entry {
|
|
15
|
+
new_todo = here ++> Todo(text=self.text);
|
|
16
|
+
report new_todo;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
walker:pub ping_server {
|
|
21
|
+
can ping with `root entry {
|
|
22
|
+
report "pong from backend!";
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
walker:pub get_server_message {
|
|
27
|
+
can info with `root entry {
|
|
28
|
+
report "hello from a basic walker!";
|
|
29
|
+
}
|
|
12
30
|
}
|
|
13
31
|
|
|
14
|
-
#
|
|
32
|
+
# Features Test - Backend Walkers
|
|
15
33
|
node TestData {
|
|
16
34
|
has message: str,
|
|
17
35
|
count: int = 0,
|
|
@@ -129,12 +147,15 @@ walker process_complex_data {
|
|
|
129
147
|
}
|
|
130
148
|
}
|
|
131
149
|
|
|
132
|
-
#
|
|
133
|
-
cl
|
|
134
|
-
import from .budget_planner_ui { BudgetPlanner as BudgetPlannerUI }
|
|
150
|
+
# Global CSS styles
|
|
151
|
+
cl import ".styles/styles.css";
|
|
135
152
|
|
|
136
|
-
|
|
153
|
+
# App wrapper -- file-based routing is handled automatically via pages/ directory
|
|
154
|
+
cl {
|
|
155
|
+
def:pub app(children: any = None) -> any {
|
|
137
156
|
return
|
|
138
|
-
<
|
|
157
|
+
<div style={{"fontFamily": "system-ui, -apple-system, sans-serif"}}>
|
|
158
|
+
{children}
|
|
159
|
+
</div>;
|
|
139
160
|
}
|
|
140
161
|
}
|
|
@@ -1,217 +1,9 @@
|
|
|
1
|
-
import from datetime { datetime, timedelta }
|
|
2
|
-
|
|
3
|
-
#
|
|
4
|
-
# Basic backend walkers
|
|
5
|
-
#
|
|
6
|
-
node Todo {
|
|
7
|
-
has text: str,
|
|
8
|
-
done: bool = False;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
walker:pub create_todo {
|
|
12
|
-
has text: str;
|
|
13
|
-
|
|
14
|
-
can create with `root entry {
|
|
15
|
-
new_todo = here ++> Todo(text=self.text);
|
|
16
|
-
report new_todo;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
walker:pub ping_server {
|
|
21
|
-
can ping with `root entry {
|
|
22
|
-
report "pong from backend!";
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
walker:pub get_server_message {
|
|
27
|
-
can info with `root entry {
|
|
28
|
-
report "hello from a basic walker!";
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
# Features Test Page - Backend Logic
|
|
33
|
-
# This file is intentionally kept empty to demonstrate the separation of concerns
|
|
34
|
-
# where UI logic resides in .cl.jac files and backend walker logic in app.jac
|
|
35
|
-
|
|
36
|
-
# All walker implementations for this feature are in main.jac
|
|
37
|
-
# This demonstrates that you can have separate .jac files for different purposes
|
|
38
|
-
# Features Test - Backend Walkers
|
|
39
|
-
# This file demonstrates walker functionality for testing various JAC features
|
|
40
|
-
|
|
41
|
-
# Node definition for storing test data
|
|
42
|
-
node TestData {
|
|
43
|
-
has message: str,
|
|
44
|
-
count: int = 0,
|
|
45
|
-
created_at: str = "";
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
# Walker: Create test data
|
|
49
|
-
walker create_test_data {
|
|
50
|
-
has message: str;
|
|
51
|
-
|
|
52
|
-
can create with `root entry {
|
|
53
|
-
new_data = here ++> TestData(
|
|
54
|
-
message=self.message,
|
|
55
|
-
count=1,
|
|
56
|
-
created_at=datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
|
57
|
-
);
|
|
58
|
-
report new_data;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
# Walker: Read all test data
|
|
63
|
-
walker read_test_data {
|
|
64
|
-
can read with `root entry {
|
|
65
|
-
visit [-->(`?TestData)];
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
can report_data with exit {
|
|
69
|
-
report here;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
# Walker: Update test data
|
|
74
|
-
walker update_test_data {
|
|
75
|
-
has new_message: str;
|
|
76
|
-
|
|
77
|
-
can update with TestData entry {
|
|
78
|
-
here.message = self.new_message;
|
|
79
|
-
here.count = here.count + 1;
|
|
80
|
-
report here;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
# Walker: Delete test data
|
|
85
|
-
walker delete_test_data {
|
|
86
|
-
can delete with TestData entry {
|
|
87
|
-
del here;
|
|
88
|
-
report {"status": "deleted"};
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
# Walker: String manipulation test
|
|
93
|
-
walker test_string_methods {
|
|
94
|
-
has input_text: str;
|
|
95
|
-
|
|
96
|
-
can process with `root entry {
|
|
97
|
-
result = {
|
|
98
|
-
"original": self.input_text,
|
|
99
|
-
"uppercase": self.input_text.upper(),
|
|
100
|
-
"lowercase": self.input_text.lower(),
|
|
101
|
-
"capitalized": self.input_text.capitalize(),
|
|
102
|
-
"reversed": self.input_text[::-1],
|
|
103
|
-
"length": len(self.input_text),
|
|
104
|
-
"words": self.input_text.split(),
|
|
105
|
-
"trimmed": self.input_text.strip(),
|
|
106
|
-
"replaced": self.input_text.replace("test", "demo")
|
|
107
|
-
};
|
|
108
|
-
report result;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
# Walker: Array/List operations test
|
|
113
|
-
walker test_list_operations {
|
|
114
|
-
has numbers: list;
|
|
115
|
-
|
|
116
|
-
can process with `root entry {
|
|
117
|
-
result = {
|
|
118
|
-
"original": self.numbers,
|
|
119
|
-
"sorted": sorted(self.numbers),
|
|
120
|
-
"reversed": list(reversed(self.numbers)),
|
|
121
|
-
"sum": sum(self.numbers),
|
|
122
|
-
"max": max(self.numbers) if len(self.numbers) > 0 else 0,
|
|
123
|
-
"min": min(self.numbers) if len(self.numbers) > 0 else 0,
|
|
124
|
-
"length": len(self.numbers),
|
|
125
|
-
"doubled": [x * 2 for x in self.numbers]
|
|
126
|
-
};
|
|
127
|
-
report result;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
# Walker: Complex data processing
|
|
132
|
-
walker process_complex_data {
|
|
133
|
-
has items: list;
|
|
134
|
-
|
|
135
|
-
can process with `root entry {
|
|
136
|
-
processed = [];
|
|
137
|
-
for item in self.items {
|
|
138
|
-
processed.append(
|
|
139
|
-
{
|
|
140
|
-
"id": item.get("id", 0),
|
|
141
|
-
"name": item.get("name", "").upper(),
|
|
142
|
-
"value": item.get("value", 0) * 2,
|
|
143
|
-
"processed_at": datetime.now().strftime("%H:%M:%S")
|
|
144
|
-
}
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
result = {
|
|
149
|
-
"original_count": len(self.items),
|
|
150
|
-
"processed_count": len(processed),
|
|
151
|
-
"items": processed,
|
|
152
|
-
"total_value": sum([p["value"] for p in processed])
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
report result;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
#
|
|
160
|
-
# Combined example: auth + routing + CSS styling + asset serving + nested folder imports
|
|
161
|
-
#
|
|
162
1
|
cl import from react { useEffect, useRef }
|
|
163
|
-
cl import from
|
|
164
|
-
|
|
165
|
-
Routes,
|
|
166
|
-
Route,
|
|
167
|
-
Link,
|
|
168
|
-
useNavigate,
|
|
169
|
-
Navigate,
|
|
170
|
-
jacIsLoggedIn
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
# Pure CSS + asset-in-CSS example
|
|
174
|
-
cl import ".styles/styles.css";
|
|
175
|
-
|
|
176
|
-
# Login Page
|
|
177
|
-
cl import from .pages.loginPage { LoginPage }
|
|
178
|
-
|
|
179
|
-
# Signup Page
|
|
180
|
-
cl import from .pages.signupPage { SignupPage }
|
|
181
|
-
|
|
182
|
-
# Simple 404 page
|
|
183
|
-
cl import from .pages.notFound { NotFound }
|
|
2
|
+
cl import from ...components.Card.tsx { Card }
|
|
3
|
+
sv import from ...main { ping_server, get_server_message, create_todo }
|
|
184
4
|
|
|
185
|
-
# Navigation component with active link styling and auth
|
|
186
|
-
cl import from .components.navigation {
|
|
187
|
-
Navigation
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
# Page showing nested imports from different folders
|
|
191
|
-
cl import from .pages.nestedDemo {
|
|
192
|
-
NestedImportsDemo
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
cl import from .pages.FeaturesTest { FeaturesTest }
|
|
196
|
-
|
|
197
|
-
cl import from .pages.LandingPage { LandingPage }
|
|
198
|
-
|
|
199
|
-
cl import from .pages.BudgetPlanner { BudgetPlanner }
|
|
200
|
-
|
|
201
|
-
# Context provider
|
|
202
|
-
cl import from .context.BudgetContext { BudgetProvider }
|
|
203
|
-
|
|
204
|
-
# TypeScript component import
|
|
205
|
-
cl import from ".components/Card.tsx" { Card }
|
|
206
|
-
|
|
207
|
-
# Main app wrapped in Router (same API as with-router/ example)
|
|
208
5
|
cl {
|
|
209
|
-
def:pub
|
|
210
|
-
# Check if user is logged in, redirect if not
|
|
211
|
-
if not jacIsLoggedIn() {
|
|
212
|
-
return
|
|
213
|
-
<Navigate to="/login" />;
|
|
214
|
-
}
|
|
6
|
+
def:pub page -> JsxElement {
|
|
215
7
|
has count: int = 0,
|
|
216
8
|
pingResult: str = "",
|
|
217
9
|
serverMessage: str = "",
|
|
@@ -221,7 +13,6 @@ cl {
|
|
|
221
13
|
console.log("Home count changed: ", count);
|
|
222
14
|
}
|
|
223
15
|
|
|
224
|
-
# Call simple backend walkers
|
|
225
16
|
async def handlePing -> None {
|
|
226
17
|
result = root spawn ping_server();
|
|
227
18
|
if result.reports and result.reports.length > 0 {
|
|
@@ -236,7 +27,6 @@ cl {
|
|
|
236
27
|
}
|
|
237
28
|
}
|
|
238
29
|
|
|
239
|
-
# Create a sample Todo node in the graph with a hardcoded payload
|
|
240
30
|
async def handleCreateSampleTodo -> None {
|
|
241
31
|
result = root spawn create_todo(text="Sample todo from all-in-one app");
|
|
242
32
|
if result.reports and result.reports.length > 0 {
|
|
@@ -250,7 +40,6 @@ cl {
|
|
|
250
40
|
await loadServerMessage();
|
|
251
41
|
}
|
|
252
42
|
|
|
253
|
-
# Initialize a Web Worker and handle message-based communication
|
|
254
43
|
workerRef = useRef(None);
|
|
255
44
|
has message: str = "";
|
|
256
45
|
|
|
@@ -507,36 +296,4 @@ cl {
|
|
|
507
296
|
</div>
|
|
508
297
|
</div>;
|
|
509
298
|
}
|
|
510
|
-
|
|
511
|
-
def:pub app -> any {
|
|
512
|
-
return
|
|
513
|
-
<Router>
|
|
514
|
-
<div style={{"fontFamily": "system-ui, -apple-system, sans-serif"}}>
|
|
515
|
-
<Navigation />
|
|
516
|
-
<div
|
|
517
|
-
style={{
|
|
518
|
-
"maxWidth": "960px",
|
|
519
|
-
"margin": "0 auto",
|
|
520
|
-
"padding": "0 1rem 3rem 1rem"
|
|
521
|
-
}}
|
|
522
|
-
>
|
|
523
|
-
<Routes>
|
|
524
|
-
<Route path="/" element={<HomePage />} />
|
|
525
|
-
<Route path="/login" element={<LoginPage />} />
|
|
526
|
-
<Route path="/signup" element={<SignupPage />} />
|
|
527
|
-
<Route path="/nested" element={<NestedImportsDemo />} />
|
|
528
|
-
<Route path="/features-test" element={<FeaturesTest />} />
|
|
529
|
-
<Route path="/landing" element={<LandingPage />} />
|
|
530
|
-
<Route
|
|
531
|
-
path="/budget-planner"
|
|
532
|
-
element={<BudgetProvider>
|
|
533
|
-
<BudgetPlanner />
|
|
534
|
-
</BudgetProvider>}
|
|
535
|
-
/>
|
|
536
|
-
<Route path="*" element={<NotFound />} />
|
|
537
|
-
</Routes>
|
|
538
|
-
</div>
|
|
539
|
-
</div>
|
|
540
|
-
</Router>;
|
|
541
|
-
}
|
|
542
299
|
}
|
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
cl import from
|
|
3
|
-
CustomButton
|
|
4
|
-
}
|
|
5
|
-
cl import from ..button { CustomButtonRoot }
|
|
6
|
-
cl import from "@jac/runtime" { Navigate, jacIsLoggedIn }
|
|
1
|
+
cl import from ...components.nestedDemo.CustomButton.tsx { CustomButton }
|
|
2
|
+
cl import from ...button { CustomButtonRoot }
|
|
7
3
|
|
|
8
4
|
cl {
|
|
9
|
-
def:pub
|
|
10
|
-
# Check if user is logged in, redirect if not
|
|
11
|
-
if not jacIsLoggedIn() {
|
|
12
|
-
return
|
|
13
|
-
<Navigate to="/login" />;
|
|
14
|
-
}
|
|
15
|
-
|
|
5
|
+
def:pub page -> JsxElement {
|
|
16
6
|
return
|
|
17
7
|
<div
|
|
18
8
|
style={{
|
|
@@ -12,7 +12,7 @@ cl import from ..components.CategoryFilter { CategoryFilter }
|
|
|
12
12
|
cl import from ..constants.categories { CATEGORY_COLORS }
|
|
13
13
|
|
|
14
14
|
# cl import from "..components.PieChart.tsx" { PieChart }
|
|
15
|
-
cl def:pub BudgetPlanner ->
|
|
15
|
+
cl def:pub BudgetPlanner -> JsxElement {
|
|
16
16
|
[filter, setFilter] = useState("ALL");
|
|
17
17
|
budget = useBudgetContext();
|
|
18
18
|
|
{jac_client-0.2.13 → jac_client-0.2.15}/jac_client/examples/all-in-one/pages/features_test_ui.cl.jac
RENAMED
|
@@ -21,7 +21,7 @@ import from ..utils.helpers {
|
|
|
21
21
|
import from ..utils.formatters { formatCurrency }
|
|
22
22
|
|
|
23
23
|
# Import walkers from server module
|
|
24
|
-
sv import from
|
|
24
|
+
sv import from ..main {
|
|
25
25
|
create_test_data,
|
|
26
26
|
read_test_data,
|
|
27
27
|
update_test_data,
|
|
@@ -38,7 +38,7 @@ sv import from .FeaturesTest {
|
|
|
38
38
|
# Button component demonstrating props - NEW PATTERN: Direct parameters
|
|
39
39
|
def:pub TestButton(
|
|
40
40
|
text: str, onClick: any, variant: str
|
|
41
|
-
) ->
|
|
41
|
+
) -> JsxElement {
|
|
42
42
|
bg_color = "#3b82f6" if variant == "primary" else "#6b7280";
|
|
43
43
|
hover_color = "#2563eb" if variant == "primary" else "#4b5563";
|
|
44
44
|
|
|
@@ -66,7 +66,7 @@ def:pub TestButton(
|
|
|
66
66
|
# # Card component with props - NEW PATTERN: Direct parameters
|
|
67
67
|
def:pub TestCard(
|
|
68
68
|
title: str, children: any, color: str
|
|
69
|
-
) ->
|
|
69
|
+
) -> JsxElement {
|
|
70
70
|
return
|
|
71
71
|
<div
|
|
72
72
|
style={{
|
|
@@ -106,7 +106,7 @@ def:pub TestCard(
|
|
|
106
106
|
# Result display component - NEW PATTERN: Direct parameters
|
|
107
107
|
def:pub ResultDisplay(
|
|
108
108
|
data: any, label: str
|
|
109
|
-
) ->
|
|
109
|
+
) -> JsxElement {
|
|
110
110
|
if not data {
|
|
111
111
|
return
|
|
112
112
|
<div style={{"color": "#9ca3af", "fontStyle": "italic"}}>
|
|
@@ -146,7 +146,7 @@ def:pub ResultDisplay(
|
|
|
146
146
|
# ============================================================================
|
|
147
147
|
# MAIN PAGE COMPONENT
|
|
148
148
|
# ============================================================================
|
|
149
|
-
def:pub FeaturesTest ->
|
|
149
|
+
def:pub FeaturesTest -> JsxElement {
|
|
150
150
|
navigate = useNavigate();
|
|
151
151
|
|
|
152
152
|
# State management
|
|
@@ -408,7 +408,7 @@ def:pub FeaturesTest -> any {
|
|
|
408
408
|
No data yet. Create some!
|
|
409
409
|
</p>}
|
|
410
410
|
{testData.map(
|
|
411
|
-
lambda item: any ->
|
|
411
|
+
lambda item: any -> JsxElement { return
|
|
412
412
|
<div
|
|
413
413
|
key={item._jac_id}
|
|
414
414
|
style={{
|
|
@@ -480,7 +480,7 @@ def:pub FeaturesTest -> any {
|
|
|
480
480
|
}}
|
|
481
481
|
>
|
|
482
482
|
{Object.keys(string_demos).map(
|
|
483
|
-
lambda key: str ->
|
|
483
|
+
lambda key: str -> JsxElement { return
|
|
484
484
|
<div key={key} style={{"marginBottom": "5px"}}>
|
|
485
485
|
<span style={{"fontWeight": "600"}}>
|
|
486
486
|
{key}:
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
# Professional landing page with hero, features, and CTA sections
|
|
3
|
-
# Demonstrates: routing with Link, dark theme design, responsive layout
|
|
4
|
-
cl import from "@jac/runtime" {
|
|
5
|
-
Link,
|
|
6
|
-
}
|
|
1
|
+
cl import from "@jac/runtime" { Link }
|
|
7
2
|
|
|
8
3
|
cl {
|
|
9
|
-
def:pub
|
|
4
|
+
def:pub page -> JsxElement {
|
|
10
5
|
return
|
|
11
6
|
<div className="landing-container">
|
|
12
7
|
<section className="hero-section">
|
|
@@ -29,7 +24,7 @@ cl {
|
|
|
29
24
|
"justifyContent": "center"
|
|
30
25
|
}}
|
|
31
26
|
>
|
|
32
|
-
<Link to="/
|
|
27
|
+
<Link to="/budget">
|
|
33
28
|
<button className="cta-button">
|
|
34
29
|
Let's Plan
|
|
35
30
|
</button>
|
|
@@ -101,7 +96,7 @@ cl {
|
|
|
101
96
|
"justifyContent": "center"
|
|
102
97
|
}}
|
|
103
98
|
>
|
|
104
|
-
<Link to="/
|
|
99
|
+
<Link to="/budget">
|
|
105
100
|
<button className="cta-button">
|
|
106
101
|
Get Started Free
|
|
107
102
|
</button>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
cl import from "@jac/runtime" { Outlet }
|
|
2
|
+
cl import from ..components.navigation { Navigation }
|
|
3
|
+
|
|
4
|
+
cl {
|
|
5
|
+
def:pub layout -> JsxElement {
|
|
6
|
+
return
|
|
7
|
+
<>
|
|
8
|
+
<Navigation />
|
|
9
|
+
<div
|
|
10
|
+
style={{
|
|
11
|
+
"maxWidth": "960px",
|
|
12
|
+
"margin": "0 auto",
|
|
13
|
+
"padding": "0 1rem 3rem 1rem"
|
|
14
|
+
}}
|
|
15
|
+
>
|
|
16
|
+
<Outlet />
|
|
17
|
+
</div>
|
|
18
|
+
</>;
|
|
19
|
+
}
|
|
20
|
+
}
|