craft-native 0.0.246 → 0.0.248

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 (46) hide show
  1. package/dist/android/src/index.d.ts +11 -0
  2. package/dist/android/src/index.js +33 -21
  3. package/dist/android/templates/AndroidManifest.xml.template +1 -0
  4. package/dist/android/templates/CraftBridge.kt.template +136 -1
  5. package/dist/android/templates/CraftHeartRate.kt.template +938 -0
  6. package/dist/android/templates/CraftHeartRateCore.kt.template +485 -0
  7. package/dist/android/templates/CraftNative.kt.template +17 -0
  8. package/dist/android/templates/CraftNativeFlatList.kt.template +115 -40
  9. package/dist/android/templates/CraftNativeMapGoogle.kt.template +92 -5
  10. package/dist/android/templates/CraftNativeMapLibre.kt.template +90 -3
  11. package/dist/android/templates/CraftNativeMutation.kt.template +32 -0
  12. package/dist/android/templates/CraftNativeRefreshableFlatList.kt.template +7 -2
  13. package/dist/android/templates/CraftNativeServices.kt.template +59 -1
  14. package/dist/android/templates/CraftNativeShell.kt.template +54 -14
  15. package/dist/android/templates/MainActivityNative.kt.template +369 -69
  16. package/dist/android/templates/build.gradle.kts.project.template +1 -1
  17. package/dist/api/mobile.d.ts +39 -3
  18. package/dist/browser.js +9 -9
  19. package/dist/cli.js +90 -673
  20. package/dist/components/index.d.ts +50 -9
  21. package/dist/index.cjs +394 -438
  22. package/dist/index.d.cts +1 -1
  23. package/dist/index.d.ts +1 -1
  24. package/dist/index.js +446 -493
  25. package/dist/ios/src/index.d.ts +2 -0
  26. package/dist/ios/src/index.js +54 -53
  27. package/dist/ios/templates/CraftApp.swift +37 -2
  28. package/dist/ios/templates/CraftHealth.swift +217 -0
  29. package/dist/ios/templates/CraftHeartRate.swift +6 -3
  30. package/dist/ios/templates/CraftHybrid.swift +18 -19
  31. package/dist/ios/templates/CraftLiveActivities.swift +1 -1
  32. package/dist/ios/templates/CraftNativeActions.swift +87 -8
  33. package/dist/ios/templates/CraftNativeFiles.swift +15 -3
  34. package/dist/ios/templates/CraftNativeFlatList.swift +18 -1
  35. package/dist/ios/templates/CraftNativeMutation.swift +36 -0
  36. package/dist/ios/templates/CraftNativeScreen.swift +813 -65
  37. package/dist/ios/templates/CraftNativeServices.swift +4 -2
  38. package/dist/ios/templates/CraftNativeUI.swift +10 -2
  39. package/dist/ios/templates/testing/DriverTests.swift.template +1 -0
  40. package/dist/ios/templates/testing/HostApp.swift +9 -2
  41. package/dist/macos/templates/CraftNativeMutation.swift +36 -0
  42. package/dist/macos/templates/native_layout.zig +226 -2
  43. package/dist/mobile-testing.js +21 -3
  44. package/dist/mobile.js +101 -63
  45. package/dist/testing/media-cache/media-cache.kt +4 -2
  46. package/package.json +1 -1
@@ -89,6 +89,8 @@ export interface LayoutStyle {
89
89
  display?: 'flex' | 'none' | 'grid';
90
90
  /** Equal-width grid track count or CSS-shaped `repeat(N, 1fr)` tracks. */
91
91
  gridTemplateColumns?: number | string;
92
+ /** Equal-height grid track count or CSS-shaped `repeat(N, 1fr)` tracks. */
93
+ gridTemplateRows?: number | string;
92
94
  /** Legacy numeric alias for the grid track count. */
93
95
  gridColumns?: number;
94
96
  /** Intrinsic or fixed height for automatically-created grid rows. */
@@ -359,6 +361,8 @@ export interface RefreshControlProps extends BaseProps {
359
361
  export interface TextProps extends BaseProps {
360
362
  /** Style object or array */
361
363
  style?: StyleValue<TextStyle>;
364
+ /** Allow the user to select and copy the rendered text. */
365
+ selectable?: boolean;
362
366
  /** Number of lines before truncation */
363
367
  numberOfLines?: number;
364
368
  /** Ellipsize mode */
@@ -486,6 +490,21 @@ export interface MapRegion {
486
490
  longitudeDelta: number;
487
491
  };
488
492
  }
493
+ /** A keyed route overlay supplied as map data instead of a child node. */
494
+ export interface MapPolylineOverlay {
495
+ id: string;
496
+ geometry: number[];
497
+ strokeColor?: string;
498
+ strokeWidth?: number;
499
+ }
500
+ /** A keyed marker supplied as map data instead of a child node. */
501
+ export interface MapMarkerOverlay {
502
+ id: string;
503
+ geometry: number[];
504
+ title?: string;
505
+ pinColor?: string;
506
+ bearing?: number;
507
+ }
489
508
  export interface MapProps extends BaseProps {
490
509
  style?: StyleValue<ViewStyle>;
491
510
  region?: MapRegion;
@@ -512,9 +531,14 @@ export interface MapProps extends BaseProps {
512
531
  mapType?: 'standard' | 'satellite' | 'hybrid';
513
532
  showsCompass?: boolean;
514
533
  showsScale?: boolean;
534
+ /** Allow tilt gestures and camera pitch updates on the native map. */
535
+ pitchEnabled?: boolean;
515
536
  /** Requested tilt in degrees; the platform may lower it for the current altitude or map type. */
516
537
  cameraPitch?: number;
517
538
  cameraHeading?: number;
539
+ /** Keyed overlays for large collections; child nodes remain supported. */
540
+ polylines?: MapPolylineOverlay[];
541
+ markers?: MapMarkerOverlay[];
518
542
  /** A coordinate tapped on the map, excluding annotation presses. */
519
543
  onPress?: (event: {
520
544
  nativeEvent: {
@@ -540,10 +564,19 @@ export interface MapPolylineProps extends BaseProps {
540
564
  strokeColor?: string;
541
565
  strokeWidth?: number;
542
566
  }
567
+ export interface MapPolygonProps extends BaseProps {
568
+ /** Flat latitude/longitude pairs; the host closes the ring for drawing. */
569
+ geometry: number[];
570
+ fillColor?: string;
571
+ strokeColor?: string;
572
+ strokeWidth?: number;
573
+ }
543
574
  export interface MapMarkerProps extends BaseProps {
544
575
  geometry: number[];
545
576
  id: string;
546
577
  title?: string;
578
+ /** Tint for the native marker pin; `label` and `secondaryLabel` follow the current system appearance. */
579
+ pinColor?: string;
547
580
  /** A direction arrow in place of the default marker, clockwise from north. */
548
581
  bearing?: number;
549
582
  onPress?: (event: {
@@ -613,10 +646,8 @@ export interface SvgTextProps extends SvgPaintProps {
613
646
  textAnchor?: 'start' | 'middle' | 'end' | string;
614
647
  dominantBaseline?: string;
615
648
  }
616
- /**
617
- * ScrollView component props.
618
- */
619
- export interface ScrollViewProps extends ViewProps {
649
+ /** Shared scroll-container props consumed by ScrollView and FlatList. */
650
+ interface ScrollViewBaseProps extends ViewProps {
620
651
  /** Horizontal scrolling */
621
652
  horizontal?: boolean;
622
653
  /** Show horizontal scroll indicator */
@@ -649,19 +680,22 @@ export interface ScrollViewProps extends ViewProps {
649
680
  keyboardDismissMode?: 'none' | 'on-drag' | 'interactive';
650
681
  /** Keyboard should persist taps */
651
682
  keyboardShouldPersistTaps?: 'always' | 'never' | 'handled';
652
- /** Keep indexed vertical children pinned while scrolling. */
653
- stickyHeaderIndices?: number[];
654
683
  /** Scroll a child into view when this target changes. */
655
684
  scrollTarget?: string | {
656
685
  id: string;
657
686
  animated?: boolean;
658
687
  key?: string;
659
688
  } | null;
660
- /** Render content in reverse order along the scroll axis. */
661
- inverted?: boolean;
662
689
  /** Controlled native pull-to-refresh component. */
663
690
  refreshControl?: RefreshControlProps;
664
691
  }
692
+ /**
693
+ * ScrollView component props.
694
+ */
695
+ export interface ScrollViewProps extends ScrollViewBaseProps {
696
+ /** Keep indexed vertical children pinned while scrolling. */
697
+ stickyHeaderIndices?: number[];
698
+ }
665
699
  /**
666
700
  * Pressable component props.
667
701
  */
@@ -732,6 +766,8 @@ export interface SwitchProps extends BaseProps {
732
766
  style?: StyleValue<ViewStyle>;
733
767
  /** Controlled boolean state; malformed native bridge values stay off. */
734
768
  value?: boolean;
769
+ /** Compatibility alias used when `value` is null; `value` takes precedence. */
770
+ checked?: boolean;
735
771
  onValueChange?: (value: boolean) => void;
736
772
  onChange?: (value: boolean) => void;
737
773
  disabled?: boolean;
@@ -746,6 +782,7 @@ export interface CheckboxProps extends BaseProps {
746
782
  style?: StyleValue<ViewStyle>;
747
783
  /** Controlled boolean state; malformed native bridge values stay off. */
748
784
  value?: boolean;
785
+ /** Compatibility alias; `checked` takes precedence when both are provided. */
749
786
  checked?: boolean;
750
787
  indeterminate?: boolean;
751
788
  label?: string;
@@ -777,6 +814,8 @@ export interface PickerProps extends BaseProps {
777
814
  style?: StyleValue<ViewStyle>;
778
815
  /** Typed options; child options remain supported when omitted. */
779
816
  items?: PickerOption[];
817
+ /** Controlled selection alias; `selectedValue` takes precedence when set. */
818
+ value?: string | number;
780
819
  selectedValue?: string | number;
781
820
  onValueChange?: (value: string | number, index: number) => void;
782
821
  onChange?: (value: string | number, index: number) => void;
@@ -808,7 +847,7 @@ export interface ActivityIndicatorProps extends BaseProps {
808
847
  /**
809
848
  * FlatList component props.
810
849
  */
811
- export interface FlatListProps<T> extends ScrollViewProps {
850
+ export interface FlatListProps<T> extends ScrollViewBaseProps {
812
851
  /** Data array */
813
852
  data: T[];
814
853
  /** Render item function */
@@ -820,6 +859,8 @@ export interface FlatListProps<T> extends ScrollViewProps {
820
859
  keyExtractor?: (item: T, index: number) => string;
821
860
  /** Number of columns */
822
861
  numColumns?: number;
862
+ /** Render rows in reverse order along the scroll axis. */
863
+ inverted?: boolean;
823
864
  /** End reached handler */
824
865
  onEndReached?: () => void;
825
866
  /** End reached threshold */