@lotics/cli 0.55.0 → 0.57.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/app_commands.d.ts +1 -1
- package/dist/client.d.ts +8 -0
- package/dist/client.js +59 -1
- package/dist/client.test.d.ts +1 -0
- package/dist/client.test.js +47 -0
- package/dist/dev/wrapper_page.d.ts +5 -3
- package/dist/dev/wrapper_page.js +33 -27
- package/dist/src/cli.js +1673 -1419
- package/dist/starter_template.js +16 -13
- package/package.json +1 -1
package/dist/starter_template.js
CHANGED
|
@@ -379,10 +379,10 @@ mount(
|
|
|
379
379
|
path: "src/App.tsx",
|
|
380
380
|
// Default scaffold = a minimal in-app router example (a list screen and a
|
|
381
381
|
// detail screen), so a new app starts with the recommended routing shape:
|
|
382
|
-
// - The app uses react-router via `AppRouter` (from @lotics/app-sdk/router)
|
|
383
|
-
//
|
|
384
|
-
// host
|
|
385
|
-
//
|
|
382
|
+
// - The app uses react-router via `AppRouter` (from @lotics/app-sdk/router).
|
|
383
|
+
// The app owns its own url — embedded, that's the iframe's own url (the
|
|
384
|
+
// host never sees it, so navigation never reloads the app); standalone,
|
|
385
|
+
// real path URLs. Browser Back/Forward walk app screens in both.
|
|
386
386
|
// - The full-container layout pattern is preserved in `Screen`: an outer
|
|
387
387
|
// <View flex:1> claims the iframe height (index.html sets
|
|
388
388
|
// html/body/#root to 100% + #root is a flex column). Keep that chain
|
|
@@ -397,11 +397,13 @@ import { Card } from "@lotics/ui/card";
|
|
|
397
397
|
import { Text } from "@lotics/ui/text";
|
|
398
398
|
import { Button } from "@lotics/ui/button";
|
|
399
399
|
|
|
400
|
-
// AppRouter makes the app's screens real
|
|
401
|
-
//
|
|
402
|
-
//
|
|
403
|
-
//
|
|
404
|
-
//
|
|
400
|
+
// AppRouter makes the app's screens real URLs — write plain react-router
|
|
401
|
+
// (useNavigate / useParams / <Link>) and it handles both modes. The app owns its
|
|
402
|
+
// own url, so navigation never reloads the app:
|
|
403
|
+
// - Embedded in the Lotics host: the app drives the iframe's OWN url (invisible
|
|
404
|
+
// to the user, never seen by the host). Browser Back / Forward walk app
|
|
405
|
+
// screens; the screen is also mirrored to the host url, so it's shareable and
|
|
406
|
+
// survives a full refresh (handled by AppRouter — no extra code).
|
|
405
407
|
// - Standalone at <slug>.lotics.app: a normal browser router with real path URLs.
|
|
406
408
|
|
|
407
409
|
const ITEMS = [
|
|
@@ -648,10 +650,11 @@ the full export list at https://www.npmjs.com/package/@lotics/ui.
|
|
|
648
650
|
## Routing
|
|
649
651
|
|
|
650
652
|
\`src/App.tsx\` ships a minimal in-app router. Write plain react-router and wrap
|
|
651
|
-
your routes in \`AppRouter\` from \`@lotics/app-sdk/router\` —
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
653
|
+
your routes in \`AppRouter\` from \`@lotics/app-sdk/router\` — the app owns its own
|
|
654
|
+
url, so navigation never reloads the app. Embedded in the Lotics host it drives
|
|
655
|
+
the iframe's own url (invisible to the user, never seen by the host); browser
|
|
656
|
+
Back/Forward walk app screens, and the screen is mirrored to the host url so it's
|
|
657
|
+
shareable and survives a full refresh. Standalone (\`<slug>.lotics.app\`) it's a
|
|
655
658
|
normal browser router with real path URLs. A single-screen app can drop the
|
|
656
659
|
router and render one screen directly.
|
|
657
660
|
|