@maccesar/titools 2.0.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.
Files changed (120) hide show
  1. package/AGENTS-TEMPLATE.md +173 -0
  2. package/README.md +867 -0
  3. package/agents/ti-researcher.md +108 -0
  4. package/bin/titools.js +53 -0
  5. package/lib/commands/agents.js +126 -0
  6. package/lib/commands/install.js +188 -0
  7. package/lib/commands/uninstall.js +215 -0
  8. package/lib/commands/update.js +159 -0
  9. package/lib/config.js +119 -0
  10. package/lib/downloader.js +153 -0
  11. package/lib/installer.js +253 -0
  12. package/lib/platform.js +108 -0
  13. package/lib/symlink.js +142 -0
  14. package/lib/utils.js +270 -0
  15. package/package.json +67 -0
  16. package/skills/alloy-expert/SKILL.md +247 -0
  17. package/skills/alloy-expert/assets/ControllerAutoCleanup.js +182 -0
  18. package/skills/alloy-expert/references/alloy-structure.md +381 -0
  19. package/skills/alloy-expert/references/anti-patterns.md +133 -0
  20. package/skills/alloy-expert/references/code-conventions.md +469 -0
  21. package/skills/alloy-expert/references/contracts.md +280 -0
  22. package/skills/alloy-expert/references/controller-patterns.md +520 -0
  23. package/skills/alloy-expert/references/error-handling.md +484 -0
  24. package/skills/alloy-expert/references/examples.md +735 -0
  25. package/skills/alloy-expert/references/migration-patterns.md +298 -0
  26. package/skills/alloy-expert/references/patterns.md +448 -0
  27. package/skills/alloy-expert/references/performance-patterns.md +855 -0
  28. package/skills/alloy-expert/references/security-patterns.md +847 -0
  29. package/skills/alloy-expert/references/state-management.md +779 -0
  30. package/skills/alloy-expert/references/testing.md +872 -0
  31. package/skills/alloy-guides/SKILL.md +214 -0
  32. package/skills/alloy-guides/references/CLI_TASKS.md +243 -0
  33. package/skills/alloy-guides/references/CONCEPTS.md +191 -0
  34. package/skills/alloy-guides/references/CONTROLLERS.md +298 -0
  35. package/skills/alloy-guides/references/MODELS.md +1028 -0
  36. package/skills/alloy-guides/references/PURGETSS.md +56 -0
  37. package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +242 -0
  38. package/skills/alloy-guides/references/VIEWS_STYLES.md +388 -0
  39. package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +109 -0
  40. package/skills/alloy-guides/references/VIEWS_XML.md +558 -0
  41. package/skills/alloy-guides/references/WIDGETS.md +176 -0
  42. package/skills/alloy-howtos/SKILL.md +203 -0
  43. package/skills/alloy-howtos/references/best_practices.md +138 -0
  44. package/skills/alloy-howtos/references/cli_reference.md +253 -0
  45. package/skills/alloy-howtos/references/config_files.md +87 -0
  46. package/skills/alloy-howtos/references/custom_tags.md +147 -0
  47. package/skills/alloy-howtos/references/debugging_troubleshooting.md +101 -0
  48. package/skills/alloy-howtos/references/samples.md +167 -0
  49. package/skills/purgetss/SKILL.md +442 -0
  50. package/skills/purgetss/assets/purgetss.config.cjs +17 -0
  51. package/skills/purgetss/references/EXAMPLES.md +247 -0
  52. package/skills/purgetss/references/animation-system.md +1294 -0
  53. package/skills/purgetss/references/apply-directive.md +375 -0
  54. package/skills/purgetss/references/arbitrary-values.md +612 -0
  55. package/skills/purgetss/references/class-index.md +1350 -0
  56. package/skills/purgetss/references/cli-commands.md +948 -0
  57. package/skills/purgetss/references/configurable-properties.md +654 -0
  58. package/skills/purgetss/references/custom-rules.md +161 -0
  59. package/skills/purgetss/references/customization-deep-dive.md +722 -0
  60. package/skills/purgetss/references/dynamic-component-creation.md +489 -0
  61. package/skills/purgetss/references/grid-layout.md +455 -0
  62. package/skills/purgetss/references/icon-fonts.md +609 -0
  63. package/skills/purgetss/references/installation-setup.md +366 -0
  64. package/skills/purgetss/references/opacity-modifier.md +291 -0
  65. package/skills/purgetss/references/platform-modifiers.md +479 -0
  66. package/skills/purgetss/references/smart-mappings.md +42 -0
  67. package/skills/purgetss/references/titanium-resets.md +359 -0
  68. package/skills/purgetss/references/ui-ux-design.md +1526 -0
  69. package/skills/ti-guides/SKILL.md +94 -0
  70. package/skills/ti-guides/references/advanced-data-and-images.md +19 -0
  71. package/skills/ti-guides/references/alloy-cli-advanced.md +84 -0
  72. package/skills/ti-guides/references/alloy-data-mastery.md +29 -0
  73. package/skills/ti-guides/references/alloy-widgets-and-themes.md +19 -0
  74. package/skills/ti-guides/references/android-manifest.md +97 -0
  75. package/skills/ti-guides/references/app-distribution.md +258 -0
  76. package/skills/ti-guides/references/application-frameworks.md +377 -0
  77. package/skills/ti-guides/references/cli-reference.md +402 -0
  78. package/skills/ti-guides/references/coding-best-practices.md +102 -0
  79. package/skills/ti-guides/references/commonjs-advanced.md +134 -0
  80. package/skills/ti-guides/references/hello-world.md +100 -0
  81. package/skills/ti-guides/references/hyperloop-native-access.md +62 -0
  82. package/skills/ti-guides/references/javascript-primer.md +411 -0
  83. package/skills/ti-guides/references/reserved-words.md +36 -0
  84. package/skills/ti-guides/references/resources.md +183 -0
  85. package/skills/ti-guides/references/style-and-conventions.md +48 -0
  86. package/skills/ti-guides/references/tiapp-config.md +609 -0
  87. package/skills/ti-howtos/SKILL.md +174 -0
  88. package/skills/ti-howtos/references/android-platform-deep-dives.md +658 -0
  89. package/skills/ti-howtos/references/automation-fastlane-appium.md +95 -0
  90. package/skills/ti-howtos/references/buffer-codec-streams.md +140 -0
  91. package/skills/ti-howtos/references/cross-platform-development.md +348 -0
  92. package/skills/ti-howtos/references/debugging-profiling.md +543 -0
  93. package/skills/ti-howtos/references/extending-titanium.md +723 -0
  94. package/skills/ti-howtos/references/google-maps-v2.md +169 -0
  95. package/skills/ti-howtos/references/ios-map-kit.md +143 -0
  96. package/skills/ti-howtos/references/ios-platform-deep-dives.md +783 -0
  97. package/skills/ti-howtos/references/local-data-sources.md +301 -0
  98. package/skills/ti-howtos/references/location-and-maps.md +252 -0
  99. package/skills/ti-howtos/references/media-apis.md +210 -0
  100. package/skills/ti-howtos/references/notification-services.md +599 -0
  101. package/skills/ti-howtos/references/remote-data-sources.md +349 -0
  102. package/skills/ti-howtos/references/tutorials.md +502 -0
  103. package/skills/ti-howtos/references/using-modules.md +237 -0
  104. package/skills/ti-howtos/references/web-content-integration.md +307 -0
  105. package/skills/ti-howtos/references/webpack-build-pipeline.md +78 -0
  106. package/skills/ti-ui/SKILL.md +179 -0
  107. package/skills/ti-ui/references/accessibility-deep-dive.md +242 -0
  108. package/skills/ti-ui/references/animation-and-matrices.md +599 -0
  109. package/skills/ti-ui/references/application-structures.md +655 -0
  110. package/skills/ti-ui/references/custom-fonts-styling.md +579 -0
  111. package/skills/ti-ui/references/event-handling.md +393 -0
  112. package/skills/ti-ui/references/gestures.md +473 -0
  113. package/skills/ti-ui/references/icons-and-splash-screens.md +409 -0
  114. package/skills/ti-ui/references/layouts-and-positioning.md +462 -0
  115. package/skills/ti-ui/references/listviews-and-performance.md +619 -0
  116. package/skills/ti-ui/references/orientation.md +362 -0
  117. package/skills/ti-ui/references/platform-ui-android.md +635 -0
  118. package/skills/ti-ui/references/platform-ui-ios.md +469 -0
  119. package/skills/ti-ui/references/scrolling-views.md +252 -0
  120. package/skills/ti-ui/references/tableviews.md +568 -0
@@ -0,0 +1,169 @@
1
+ # Google Maps v2 for Android
2
+
3
+ Guide for implementing native maps on Android using the `ti.map` module (v2).
4
+
5
+ ## Table of Contents
6
+
7
+ - [Google Maps v2 for Android](#google-maps-v2-for-android)
8
+ - [Table of Contents](#table-of-contents)
9
+ - [1. Initial Configuration](#1-initial-configuration)
10
+ - [Module Installation](#module-installation)
11
+ - [Obtaining an API Key (Google Cloud Console)](#obtaining-an-api-key-google-cloud-console)
12
+ - [Get SHA-1 (Debug)](#get-sha-1-debug)
13
+ - [Configure tiapp.xml](#configure-tiappxml)
14
+ - [2. Google Play Services Verification](#2-google-play-services-verification)
15
+ - [3. Using the Map View](#3-using-the-map-view)
16
+ - [Basic Creation](#basic-creation)
17
+ - [Map Types](#map-types)
18
+ - [4. Advanced Annotations (Pins)](#4-advanced-annotations-pins)
19
+ - [Available Pin Colors](#available-pin-colors)
20
+ - [5. Routes (Polylines)](#5-routes-polylines)
21
+ - [6. Critical Events](#6-critical-events)
22
+ - [7. Limitations and Troubleshooting](#7-limitations-and-troubleshooting)
23
+
24
+ ---
25
+
26
+ ## 1. Initial Configuration
27
+
28
+ ### Module Installation
29
+ Add the module to your `tiapp.xml`:
30
+ ```xml
31
+ <modules>
32
+ <module platform="android">ti.map</module>
33
+ </modules>
34
+ ```
35
+
36
+ ### Obtaining an API Key (Google Cloud Console)
37
+ 1. Create a project in the [Google Cloud Console](https://console.cloud.google.com/).
38
+ 2. Enable "Maps SDK for Android".
39
+ 3. Generate an API Key. You will need the **Application ID** from your `tiapp.xml` and the **SHA-1 fingerprint** from your keystore.
40
+
41
+ #### Get SHA-1 (Debug)
42
+ ```bash
43
+ keytool -list -v -keystore ~/Library/Application\ Support/titanium/mobilesdk/osx/<VERSION>/android/dev_keystore
44
+ ```
45
+ *Default password: <empty> (press Enter)*
46
+
47
+ ### Configure tiapp.xml
48
+ Add the API Key in the Android section:
49
+ ```xml
50
+ <android xmlns:android="http://schemas.android.com/apk/res/android">
51
+ <manifest>
52
+ <application>
53
+ <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="YOUR_API_KEY_HERE"/>
54
+ </application>
55
+ </manifest>
56
+ </android>
57
+ ```
58
+
59
+ ## 2. Google Play Services Verification
60
+
61
+ It is mandatory to verify availability before rendering the map:
62
+
63
+ ```javascript
64
+ const MapModule = require('ti.map');
65
+ const rc = MapModule.isGooglePlayServicesAvailable();
66
+
67
+ switch (rc) {
68
+ case MapModule.SUCCESS:
69
+ Ti.API.info('Google Play services is installed.');
70
+ break;
71
+ case MapModule.SERVICE_MISSING:
72
+ alert('Google Play services is missing. Please install it.');
73
+ break;
74
+ case MapModule.SERVICE_VERSION_UPDATE_REQUIRED:
75
+ alert('Google Play services is out of date. Please update.');
76
+ break;
77
+ default:
78
+ alert(`Google Play services error: ${rc}`);
79
+ }
80
+ ```
81
+
82
+ ## 3. Using the Map View
83
+
84
+ ### Basic Creation
85
+ ```javascript
86
+ const MapModule = require('ti.map');
87
+ const mapView = MapModule.createView({
88
+ mapType: MapModule.NORMAL_TYPE,
89
+ userLocation: true,
90
+ traffic: true, // Show real-time traffic
91
+ animate: true,
92
+ region: {
93
+ latitude: -33.87365,
94
+ longitude: 151.20689,
95
+ latitudeDelta: 0.1,
96
+ longitudeDelta: 0.1
97
+ }
98
+ });
99
+ ```
100
+
101
+ ### Map Types
102
+ - `MapModule.NORMAL_TYPE`: Standard map.
103
+ - `MapModule.SATELLITE_TYPE`: Satellite imagery.
104
+ - `MapModule.TERRAIN_TYPE`: Terrain map.
105
+ - `MapModule.HYBRID_TYPE`: Satellite with labels.
106
+
107
+ ## 4. Advanced Annotations (Pins)
108
+
109
+ ```javascript
110
+ const opera = MapModule.createAnnotation({
111
+ latitude: -33.8569,
112
+ longitude: 151.2153,
113
+ title: 'Sydney Opera House',
114
+ subtitle: 'NSW, Australia',
115
+ pincolor: MapModule.ANNOTATION_VIOLET,
116
+ image: 'custom_pin.png', // Custom image
117
+ draggable: true, // Allow pin dragging
118
+ // Complete custom view (replaces the pin)
119
+ customView: Ti.UI.createLabel({ text: '📍', backgroundColor: 'white' })
120
+ });
121
+
122
+ mapView.addAnnotation(opera);
123
+ ```
124
+
125
+ ### Available Pin Colors
126
+ `ANNOTATION_AZURE`, `BLUE`, `CYAN`, `GREEN`, `MAGENTA`, `ORANGE`, `RED`, `ROSE`, `VIOLET`, `YELLOW`.
127
+
128
+ ## 5. Routes (Polylines)
129
+
130
+ ```javascript
131
+ const route = MapModule.createRoute({
132
+ width: 5,
133
+ color: '#f00',
134
+ points: [
135
+ { latitude: -33.8569, longitude: 151.2153 },
136
+ { latitude: -33.8522, longitude: 151.2105 }
137
+ ]
138
+ });
139
+
140
+ mapView.addRoute(route);
141
+ ```
142
+
143
+ ## 6. Critical Events
144
+
145
+ ```javascript
146
+ // Detect click on annotation or its buttons
147
+ mapView.addEventListener('click', (e) => {
148
+ if (e.clicksource === 'pin') {
149
+ Ti.API.info(`Pin clicked: ${e.title}`);
150
+ }
151
+ });
152
+
153
+ // Detect drag state changes
154
+ mapView.addEventListener('pinchangedragstate', (e) => {
155
+ if (e.newState === MapModule.ANNOTATION_DRAG_STATE_END) {
156
+ Ti.API.info(`New position: ${e.annotation.latitude}`);
157
+ }
158
+ });
159
+
160
+ // Detect complete rendering
161
+ mapView.addEventListener('complete', (e) => {
162
+ Ti.API.info('Map loaded');
163
+ });
164
+ ```
165
+
166
+ ## 7. Limitations and Troubleshooting
167
+ - **Single Map:** Android (legacy) only allows one MapView instance per application. v2 allows multiple views.
168
+ - **Blank Map:** Verify the API Key is correct and that `android:anyDensity` is NOT set to true in the manifest if using old resolutions.
169
+ - **Simulator:** Google Maps v2 is NOT compatible with the standard emulator without x86 Google Play Services. Real device testing is recommended.
@@ -0,0 +1,143 @@
1
+ # iOS Map Kit
2
+
3
+ Guide for implementing native maps on iOS using the `ti.map` module.
4
+
5
+ ## Table of Contents
6
+
7
+ - [iOS Map Kit](#ios-map-kit)
8
+ - [Table of Contents](#table-of-contents)
9
+ - [1. Initial Configuration](#1-initial-configuration)
10
+ - [Module Installation](#module-installation)
11
+ - [Location Permissions (Info.plist)](#location-permissions-infoplist)
12
+ - [2. Using the Map View](#2-using-the-map-view)
13
+ - [Basic Creation](#basic-creation)
14
+ - [3. 3D Camera (Perspective)](#3-3d-camera-perspective)
15
+ - [4. iOS Annotations](#4-ios-annotations)
16
+ - [System Buttons and Callouts](#system-buttons-and-callouts)
17
+ - [Center Offset](#center-offset)
18
+ - [5. Advanced Routes](#5-advanced-routes)
19
+ - [Overlay Levels](#overlay-levels)
20
+ - [6. Events](#6-events)
21
+
22
+ ---
23
+
24
+ ## 1. Initial Configuration
25
+
26
+ ### Module Installation
27
+ Add the module to your `tiapp.xml`:
28
+ ```xml
29
+ <modules>
30
+ <module platform="iphone">ti.map</module>
31
+ </modules>
32
+ ```
33
+
34
+ ### Location Permissions (Info.plist)
35
+ Add the mandatory usage descriptions in `tiapp.xml`:
36
+ ```xml
37
+ <ios>
38
+ <plist>
39
+ <dict>
40
+ <key>NSLocationWhenInUseUsageDescription</key>
41
+ <string>We need your location to show it on the map.</string>
42
+ <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
43
+ <string>We need continuous location access for navigation.</string>
44
+ </dict>
45
+ </plist>
46
+ </ios>
47
+ ```
48
+
49
+ ## 2. Using the Map View
50
+
51
+ ### Basic Creation
52
+ ```javascript
53
+ const MapModule = require('ti.map');
54
+ const mapView = MapModule.createView({
55
+ mapType: MapModule.NORMAL_TYPE,
56
+ userLocation: true,
57
+ rotatesEnabled: true, // Allow two-finger rotation
58
+ region: {
59
+ latitude: 48.8582,
60
+ longitude: 2.2945,
61
+ latitudeDelta: 0.02,
62
+ longitudeDelta: 0.02
63
+ }
64
+ });
65
+ ```
66
+
67
+ ## 3. 3D Camera (Perspective)
68
+
69
+ iOS allows tilting and rotating the map programmatically for 3D views.
70
+
71
+ ```javascript
72
+ const myCam = MapModule.createCamera({
73
+ altitude: 300, // Meters above ground
74
+ centerCoordinate: { latitude: 48.8582, longitude: 2.2945 },
75
+ heading: -45, // Angle relative to North
76
+ pitch: 60 // Tilt angle downward
77
+ });
78
+
79
+ // Apply camera with animation
80
+ mapView.animateCamera({
81
+ camera: myCam,
82
+ curve: Ti.UI.ANIMATION_CURVE_EASE_IN,
83
+ duration: 1000
84
+ });
85
+
86
+ // Additional 3D view properties
87
+ mapView.pitchEnabled = true;
88
+ mapView.showsBuildings = true; // 3D Buildings
89
+ ```
90
+
91
+ ## 4. iOS Annotations
92
+
93
+ ### System Buttons and Callouts
94
+ iOS allows using native buttons inside the pin's callout (popup window).
95
+
96
+ ```javascript
97
+ const bridge = MapModule.createAnnotation({
98
+ latitude: -33.8522,
99
+ longitude: 151.2105,
100
+ title: 'Harbour Bridge',
101
+ subtitle: 'Port Jackson',
102
+ pincolor: MapModule.ANNOTATION_PURPLE,
103
+ // iOS system buttons in the callout
104
+ leftButton: Ti.UI.iOS.SystemButton.INFO_DARK,
105
+ rightButton: Ti.UI.iOS.SystemButton.CONTACT_ADD,
106
+ canShowCallout: true // Default is true
107
+ });
108
+
109
+ mapView.addAnnotation(bridge);
110
+ ```
111
+
112
+ ### Center Offset
113
+ If using a custom pin image that is not centered:
114
+ ```javascript
115
+ const customPin = MapModule.createAnnotation({
116
+ image: 'flag.png',
117
+ centerOffset: { x: 10, y: -20 } // Visually moves the pin
118
+ });
119
+ ```
120
+
121
+ ## 5. Advanced Routes
122
+
123
+ ### Overlay Levels
124
+ Control if the route goes above labels or above roads.
125
+ ```javascript
126
+ const route = MapModule.createRoute({
127
+ points: [...],
128
+ color: 'blue',
129
+ width: 4,
130
+ // OVERLAY_LEVEL_ABOVE_LABELS or OVERLAY_LEVEL_ABOVE_ROADS
131
+ level: MapModule.OVERLAY_LEVEL_ABOVE_LABELS
132
+ });
133
+ ```
134
+
135
+ ## 6. Events
136
+ Same as Android, but with specialized `clicksource` for system buttons:
137
+ ```javascript
138
+ mapView.addEventListener('click', (e) => {
139
+ if (e.clicksource === 'leftButton' || e.clicksource === 'rightButton') {
140
+ Ti.API.info('Callout button clicked');
141
+ }
142
+ });
143
+ ```