kasy-cli 1.19.3 → 1.20.1

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 (83) hide show
  1. package/README.md +11 -3
  2. package/bin/kasy.js +1 -0
  3. package/lib/commands/new.js +87 -37
  4. package/lib/commands/run.js +14 -0
  5. package/lib/scaffold/backends/api/patch/lib/core/data/api/meta_ads_api.dart +1 -1
  6. package/lib/scaffold/backends/api/patch/lib/core/data/api/storage_api.dart +1 -1
  7. package/lib/scaffold/backends/api/patch/lib/core/data/entities/user_entity.dart +1 -1
  8. package/lib/scaffold/backends/api/patch/lib/features/authentication/api/authentication_api.dart +4 -5
  9. package/lib/scaffold/backends/api/patch/lib/features/feedbacks/api/feature_request_api.dart +1 -1
  10. package/lib/scaffold/backends/api/patch/lib/features/feedbacks/api/feature_vote_api.dart +1 -1
  11. package/lib/scaffold/backends/api/patch/lib/features/llm_chat/api/llm_chat_api.dart +1 -1
  12. package/lib/scaffold/backends/api/patch/lib/features/llm_chat/providers/llm_chat_notifier.dart +317 -0
  13. package/lib/scaffold/backends/api/patch/lib/features/notifications/api/device_api.dart +40 -1
  14. package/lib/scaffold/backends/api/patch/lib/features/notifications/api/entities/notifications_entity.dart +2 -0
  15. package/lib/scaffold/backends/api/patch/lib/features/onboarding/api/entities/user_info_entity.dart +1 -1
  16. package/lib/scaffold/backends/api/patch/lib/features/subscription/api/entities/subscription_entity.dart +1 -1
  17. package/lib/scaffold/backends/api/patch/lib/features/subscription/shared/maybeshow_premium.dart +0 -2
  18. package/lib/scaffold/backends/api/pubspec.yaml.tpl +2 -0
  19. package/lib/scaffold/backends/firebase/enable-auth-via-cli.js +11 -8
  20. package/lib/scaffold/backends/firebase/setup-from-scratch.js +91 -2
  21. package/lib/scaffold/backends/supabase/deploy.js +56 -3
  22. package/lib/scaffold/backends/supabase/patch/lib/core/data/api/storage_api.dart +5 -11
  23. package/lib/scaffold/backends/supabase/patch/lib/core/data/entities/user_entity.dart +2 -2
  24. package/lib/scaffold/backends/supabase/patch/lib/features/notifications/api/device_api.dart +31 -1
  25. package/lib/scaffold/backends/supabase/patch/lib/features/onboarding/api/entities/user_info_entity.dart +1 -1
  26. package/lib/scaffold/backends/supabase/patch/lib/features/subscription/api/entities/subscription_entity.dart +1 -1
  27. package/lib/scaffold/backends/supabase/pubspec.yaml.tpl +2 -0
  28. package/lib/scaffold/catalog.js +2 -2
  29. package/lib/scaffold/engine.js +5 -0
  30. package/lib/scaffold/generate.js +23 -3
  31. package/lib/scaffold/shared/generator-utils.js +303 -56
  32. package/lib/scaffold/shared/post-build.js +11 -0
  33. package/lib/utils/i18n/messages-en.js +6 -1
  34. package/lib/utils/i18n/messages-es.js +6 -1
  35. package/lib/utils/i18n/messages-pt.js +6 -1
  36. package/package.json +1 -1
  37. package/templates/firebase/android/app/src/main/res/drawable/background.png +0 -0
  38. package/templates/firebase/android/app/src/main/res/drawable-night/background.png +0 -0
  39. package/templates/firebase/android/app/src/main/res/drawable-night-v21/background.png +0 -0
  40. package/templates/firebase/android/app/src/main/res/drawable-v21/background.png +0 -0
  41. package/templates/firebase/android/app/src/main/res/values-night-v31/styles.xml +1 -1
  42. package/templates/firebase/android/app/src/main/res/values-v31/styles.xml +1 -1
  43. package/templates/firebase/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png +0 -0
  44. package/templates/firebase/ios/Runner/Assets.xcassets/LaunchBackground.imageset/darkbackground.png +0 -0
  45. package/templates/firebase/lib/components/kasy_date_picker.dart +14 -8
  46. package/templates/firebase/lib/components/kasy_sidebar_pro.dart +1150 -0
  47. package/templates/firebase/lib/components/kasy_tabs.dart +156 -43
  48. package/templates/firebase/lib/components/kasy_text_field.dart +37 -34
  49. package/templates/firebase/lib/core/bottom_menu/bottom_menu.dart +13 -82
  50. package/templates/firebase/lib/core/bottom_menu/bottom_router.dart +6 -102
  51. package/templates/firebase/lib/core/bottom_menu/kasy_bottom_bar_factory.dart +8 -1
  52. package/templates/firebase/lib/core/dev_inspector/dev_inspector.dart +433 -243
  53. package/templates/firebase/lib/core/dev_inspector/dev_inspector_service.dart +198 -83
  54. package/templates/firebase/lib/core/icons/kasy_icons.dart +1 -0
  55. package/templates/firebase/lib/core/states/user_state_notifier.dart +8 -10
  56. package/templates/firebase/lib/core/theme/colors.dart +6 -2
  57. package/templates/firebase/lib/core/web_device_preview/web_device_preview.dart +119 -19
  58. package/templates/firebase/lib/core/widgets/kasy_hover.dart +68 -27
  59. package/templates/firebase/lib/features/home/home_components_page.dart +11 -14
  60. package/templates/firebase/lib/features/home/home_components_preview_registry.dart +121 -66
  61. package/templates/firebase/lib/features/home/home_page.dart +7 -8
  62. package/templates/firebase/lib/features/settings/settings_page.dart +27 -146
  63. package/templates/firebase/lib/features/settings/ui/components/admin/admin_bottom_sheet.dart +16 -3
  64. package/templates/firebase/lib/features/settings/ui/widgets/settings_tile.dart +22 -5
  65. package/templates/firebase/lib/i18n/en.i18n.json +3 -1
  66. package/templates/firebase/lib/i18n/es.i18n.json +3 -1
  67. package/templates/firebase/lib/i18n/pt.i18n.json +3 -1
  68. package/templates/firebase/lib/router.dart +60 -0
  69. package/templates/firebase/pubspec.yaml +6 -4
  70. package/templates/firebase/test/core/bottom_menu/detail_route_menu_test.dart +57 -0
  71. package/templates/firebase/web/index.html +7 -17
  72. package/lib/scaffold/backends/api/patch/lib/core/rating/widgets/review_popup.dart +0 -211
  73. package/lib/scaffold/backends/api/patch/lib/features/notifications/providers/models/notification.dart +0 -185
  74. package/lib/scaffold/backends/api/patch/lib/features/onboarding/ui/components/onboarding_notifications_setup.dart +0 -73
  75. package/lib/scaffold/backends/api/patch/lib/main.dart +0 -275
  76. package/lib/scaffold/backends/api/patch/lib/router.dart +0 -133
  77. package/lib/scaffold/backends/supabase/patch/lib/core/rating/widgets/review_popup.dart +0 -211
  78. package/lib/scaffold/backends/supabase/patch/lib/features/feedbacks/ui/component/add_feature_form.dart +0 -199
  79. package/lib/scaffold/backends/supabase/patch/lib/features/notifications/providers/models/notification.dart +0 -174
  80. package/lib/scaffold/backends/supabase/patch/lib/features/onboarding/ui/components/onboarding_notifications_setup.dart +0 -73
  81. package/lib/scaffold/backends/supabase/patch/lib/main.dart +0 -307
  82. package/lib/scaffold/backends/supabase/patch/lib/router.dart +0 -133
  83. package/templates/firebase/lib/firebase_options.dart +0 -75
@@ -1,21 +1,20 @@
1
1
  import 'package:bart/bart.dart';
2
2
  import 'package:flutter/material.dart';
3
3
  import 'package:kasy_kit/components/kasy_app_bar.dart';
4
- import 'package:kasy_kit/core/bottom_menu/bart_inner_paths.dart';
5
4
  import 'package:kasy_kit/core/bottom_menu/notification_bottom_item.dart';
6
5
  import 'package:kasy_kit/core/navigation/kasy_navigation_config.dart';
7
6
  import 'package:kasy_kit/core/navigation/kasy_route_transition.dart';
8
7
  import 'package:kasy_kit/core/rating/widgets/rate_banner.dart';
9
8
  import 'package:kasy_kit/core/theme/theme.dart';
10
- import 'package:kasy_kit/features/home/design_system_page.dart';
11
- import 'package:kasy_kit/features/home/home_components_page.dart';
12
- import 'package:kasy_kit/features/home/home_components_preview_page.dart';
13
- import 'package:kasy_kit/features/home/home_features_page.dart';
14
9
  import 'package:kasy_kit/features/home/home_page.dart';
15
10
  import 'package:kasy_kit/features/notifications/ui/notifications_page.dart';
16
11
  import 'package:kasy_kit/features/settings/settings_page.dart';
17
12
  import 'package:kasy_kit/i18n/translations.g.dart';
18
13
 
14
+ /// Bart tab routes (bottom bar). Detail screens reachable from a tab — Features,
15
+ /// Components, Design System, component previews — are NOT inner routes here:
16
+ /// they're pushed on the ROOT navigator (see home_page.dart / home_components_page.dart)
17
+ /// so they open full-screen without the bottom bar and return to the tab intact.
19
18
  List<BartMenuRoute> subRoutes() {
20
19
  return [
21
20
  BartMenuRoute.bottomBar(
@@ -50,79 +49,9 @@ List<BartMenuRoute> subRoutes() {
50
49
  transitionDuration: bottomBarTransitionDuration,
51
50
  transitionsBuilder: bottomBarTransition,
52
51
  ),
53
- BartMenuRoute.innerRoute(
54
- path: bartInnerPath('home', 'features'),
55
- showBottomBar: false,
56
- pageBuilder: (_, _, _) =>
57
- const _HomeInnerRoute(child: HomeFeaturesPage()),
58
- transitionDuration: bottomBarTransitionDuration,
59
- transitionsBuilder: bottomBarTransition,
60
- ),
61
- BartMenuRoute.innerRoute(
62
- path: bartInnerPath('home', 'components'),
63
- showBottomBar: false,
64
- pageBuilder: (_, _, _) =>
65
- const _HomeInnerRoute(child: HomeComponentsPage()),
66
- transitionDuration: bottomBarTransitionDuration,
67
- transitionsBuilder: bottomBarTransition,
68
- ),
69
- BartMenuRoute.innerRoute(
70
- path: bartInnerPath('home', 'design-system'),
71
- showBottomBar: false,
72
- pageBuilder: (_, _, _) =>
73
- const _HomeInnerRoute(child: DesignSystemPage()),
74
- transitionDuration: bottomBarTransitionDuration,
75
- transitionsBuilder: bottomBarTransition,
76
- ),
77
- BartMenuRoute.innerRoute(
78
- path: bartInnerPath('home', 'components-preview'),
79
- showBottomBar: false,
80
- pageBuilder: (_, _, settings) {
81
- final extra = settings?.arguments;
82
- if (extra is! HomeComponentPreviewRouteExtra) {
83
- return const PageFake();
84
- }
85
- return _HomeInnerRoute(
86
- child: HomeComponentsPreviewPage(
87
- title: extra.title,
88
- variants: extra.variants,
89
- ),
90
- );
91
- },
92
- transitionDuration: bottomBarTransitionDuration,
93
- transitionsBuilder: bottomBarTransition,
94
- ),
95
- BartMenuRoute.innerRoute(
96
- path: bartInnerPath('home', 'search'),
97
- showBottomBar: false,
98
- pageBuilder: (_, _, _) => const _HomeInnerRoute(child: PageFake()),
99
- transitionDuration: bottomBarTransitionDuration,
100
- transitionsBuilder: bottomBarTransition,
101
- ),
102
- BartMenuRoute.innerRoute(
103
- path: bartInnerPath('home', 'search/subscribe'),
104
- showBottomBar: false,
105
- pageBuilder: (_, _, _) => const _HomeInnerRoute(child: PageFake()),
106
- transitionDuration: bottomBarTransitionDuration,
107
- transitionsBuilder: bottomBarTransition,
108
- ),
109
52
  ];
110
53
  }
111
54
 
112
- /// Marker wrapper for inner home routes. Visibility is owned by
113
- /// [BottomMenu] (see [BottomMenu._onRouteChanged] + [BartMenuRoute.innerRoute]
114
- /// `showBottomBar: false`); this widget exists for symmetry with the dashboard
115
- /// cards and to keep `HomeFeaturesPage` / `HomeComponentsPage` / etc. agnostic
116
- /// of how they were pushed.
117
- class _HomeInnerRoute extends StatelessWidget {
118
- final Widget child;
119
-
120
- const _HomeInnerRoute({required this.child});
121
-
122
- @override
123
- Widget build(BuildContext context) => child;
124
- }
125
-
126
55
  /// Placeholder page for the wishlist tab.
127
56
  /// Replace this with your own implementation.
128
57
  class WishlistPage extends StatelessWidget {
@@ -136,8 +65,8 @@ class WishlistPage extends StatelessWidget {
136
65
  crossAxisAlignment: CrossAxisAlignment.stretch,
137
66
  children: [
138
67
  KasyAppBar(
139
- title: context.t.navigation.wishlist,
140
- style: KasyAppBarStyle.rootTab,
68
+ title: context.t.navigation.wishlist,
69
+ style: KasyAppBarStyle.rootTab,
141
70
  ),
142
71
  Expanded(
143
72
  child: Padding(
@@ -201,31 +130,6 @@ class WishlistPage extends StatelessWidget {
201
130
  }
202
131
  }
203
132
 
204
- /// This is a fake page to show how to use Bart
205
- /// You can replace it with your own pages
206
- class PageFake extends StatelessWidget {
207
- final Color? color;
208
-
209
- const PageFake({this.color, super.key});
210
-
211
- @override
212
- Widget build(BuildContext context) {
213
- return SafeArea(
214
- // ignore: use_colored_box
215
- child: Container(
216
- color: color ?? context.colors.background,
217
- child: Column(
218
- children: [
219
- const RateBanner(forceInDebug: true),
220
- const SizedBox(height: 100),
221
- Opacity(opacity: 0.5, child: Text(context.t.bottom_router.fake_page_text)),
222
- ],
223
- ),
224
- ),
225
- );
226
- }
227
- }
228
-
229
133
  Widget bottomBarTransition(
230
134
  BuildContext context,
231
135
  Animation<double> animation,
@@ -38,6 +38,13 @@ final class KasyPaddedSurfaceBottomBarFactory extends BartBottomBarFactory {
38
38
  required void Function(int) onTap,
39
39
  required int currentIndex,
40
40
  }) {
41
+ return TooltipVisibility(
42
+ visible: false,
43
+ child: _build(context),
44
+ );
45
+ }
46
+
47
+ Widget _build(BuildContext context) {
41
48
  final KasyColors colors = context.colors;
42
49
  final MenuRouter menuRouter = MenuRouter.of(context);
43
50
  final BorderSide topEdge = BorderSide(
@@ -72,7 +79,7 @@ final class KasyPaddedSurfaceBottomBarFactory extends BartBottomBarFactory {
72
79
  ),
73
80
  ),
74
81
  BartCupertinoBottomBar(
75
- routes: routes,
82
+ routes: menuRouter.routesBuilder(),
76
83
  theme: CupertinoBottomBarTheme(
77
84
  bgColor: colors.surface,
78
85
  height: _kBottomBarHeightCupertino - kasyBottomBarTopPadding,