@maccesar/titools 2.10.1 → 3.2.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 (95) hide show
  1. package/AGENTS-VERCEL-RESEARCH.md +23 -12
  2. package/README.md +81 -182
  3. package/agents/ti-pro.md +8 -14
  4. package/lib/cleanup.js +13 -0
  5. package/lib/commands/skills.js +2 -1
  6. package/lib/config.js +9 -11
  7. package/lib/platform.js +1 -1
  8. package/package.json +2 -3
  9. package/skills/purgetss/SKILL.md +44 -57
  10. package/skills/purgetss/references/EXAMPLES.md +8 -1
  11. package/skills/purgetss/references/app-branding.md +96 -16
  12. package/skills/purgetss/references/apply-directive.md +26 -1
  13. package/skills/purgetss/references/arbitrary-values.md +72 -2
  14. package/skills/purgetss/references/class-categories.md +1 -1
  15. package/skills/purgetss/references/cli-commands.md +37 -13
  16. package/skills/purgetss/references/customization-deep-dive.md +18 -11
  17. package/skills/purgetss/references/dynamic-component-creation.md +0 -1
  18. package/skills/purgetss/references/migration-guide.md +162 -1
  19. package/skills/purgetss/references/multi-density-images.md +69 -0
  20. package/skills/purgetss/references/version-history.md +82 -0
  21. package/skills/ti-expert/SKILL.md +1 -1
  22. package/skills/ti-ui/SKILL.md +1 -1
  23. package/skills/alloy-guides/SKILL.md +0 -190
  24. package/skills/alloy-guides/references/CLI_TASKS.md +0 -233
  25. package/skills/alloy-guides/references/CONCEPTS.md +0 -171
  26. package/skills/alloy-guides/references/CONTROLLERS.md +0 -279
  27. package/skills/alloy-guides/references/MODELS.md +0 -1214
  28. package/skills/alloy-guides/references/PURGETSS.md +0 -46
  29. package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +0 -235
  30. package/skills/alloy-guides/references/VIEWS_STYLES.md +0 -375
  31. package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +0 -102
  32. package/skills/alloy-guides/references/VIEWS_XML.md +0 -581
  33. package/skills/alloy-guides/references/WIDGETS.md +0 -160
  34. package/skills/alloy-howtos/SKILL.md +0 -181
  35. package/skills/alloy-howtos/references/best_practices.md +0 -121
  36. package/skills/alloy-howtos/references/cli_reference.md +0 -230
  37. package/skills/alloy-howtos/references/config_files.md +0 -158
  38. package/skills/alloy-howtos/references/custom_tags.md +0 -148
  39. package/skills/alloy-howtos/references/debugging_troubleshooting.md +0 -78
  40. package/skills/alloy-howtos/references/samples.md +0 -156
  41. package/skills/ti-api/SKILL.md +0 -109
  42. package/skills/ti-api/references/api-android.md +0 -675
  43. package/skills/ti-api/references/api-app-platform.md +0 -636
  44. package/skills/ti-api/references/api-core.md +0 -764
  45. package/skills/ti-api/references/api-data-network.md +0 -641
  46. package/skills/ti-api/references/api-media.md +0 -655
  47. package/skills/ti-api/references/api-modules-ble-bluetooth.md +0 -657
  48. package/skills/ti-api/references/api-modules-coremotion-urlsession.md +0 -411
  49. package/skills/ti-api/references/api-modules-map.md +0 -632
  50. package/skills/ti-api/references/api-modules-nfc.md +0 -725
  51. package/skills/ti-api/references/api-modules-social-misc.md +0 -526
  52. package/skills/ti-api/references/api-services.md +0 -700
  53. package/skills/ti-api/references/api-ui-android.md +0 -499
  54. package/skills/ti-api/references/api-ui-extras.md +0 -702
  55. package/skills/ti-api/references/api-ui-ios-animator.md +0 -378
  56. package/skills/ti-api/references/api-ui-ios.md +0 -756
  57. package/skills/ti-api/references/api-ui-lists.md +0 -581
  58. package/skills/ti-api/references/api-ui-text-input.md +0 -607
  59. package/skills/ti-api/references/api-ui-views.md +0 -572
  60. package/skills/ti-api/references/api-ui-windows-navigation.md +0 -676
  61. package/skills/ti-api/references/api-xml-global.md +0 -743
  62. package/skills/ti-guides/SKILL.md +0 -75
  63. package/skills/ti-guides/references/advanced-data-and-images.md +0 -155
  64. package/skills/ti-guides/references/android-manifest.md +0 -97
  65. package/skills/ti-guides/references/app-distribution.md +0 -373
  66. package/skills/ti-guides/references/application-frameworks.md +0 -366
  67. package/skills/ti-guides/references/cli-reference.md +0 -700
  68. package/skills/ti-guides/references/coding-best-practices.md +0 -150
  69. package/skills/ti-guides/references/commonjs-advanced.md +0 -279
  70. package/skills/ti-guides/references/hello-world.md +0 -99
  71. package/skills/ti-guides/references/hyperloop-native-access.md +0 -458
  72. package/skills/ti-guides/references/javascript-primer.md +0 -402
  73. package/skills/ti-guides/references/reserved-words.md +0 -36
  74. package/skills/ti-guides/references/resources.md +0 -172
  75. package/skills/ti-guides/references/style-and-conventions.md +0 -104
  76. package/skills/ti-guides/references/tiapp-config.md +0 -655
  77. package/skills/ti-howtos/SKILL.md +0 -143
  78. package/skills/ti-howtos/references/android-platform-deep-dives.md +0 -609
  79. package/skills/ti-howtos/references/automation-fastlane-appium.md +0 -96
  80. package/skills/ti-howtos/references/buffer-codec-streams.md +0 -162
  81. package/skills/ti-howtos/references/cross-platform-development.md +0 -358
  82. package/skills/ti-howtos/references/debugging-profiling.md +0 -473
  83. package/skills/ti-howtos/references/extending-titanium.md +0 -684
  84. package/skills/ti-howtos/references/google-maps-v2.md +0 -172
  85. package/skills/ti-howtos/references/ios-map-kit.md +0 -149
  86. package/skills/ti-howtos/references/ios-platform-deep-dives.md +0 -595
  87. package/skills/ti-howtos/references/local-data-sources.md +0 -310
  88. package/skills/ti-howtos/references/location-and-maps.md +0 -267
  89. package/skills/ti-howtos/references/media-apis.md +0 -268
  90. package/skills/ti-howtos/references/notification-services.md +0 -539
  91. package/skills/ti-howtos/references/remote-data-sources.md +0 -339
  92. package/skills/ti-howtos/references/tutorials.md +0 -552
  93. package/skills/ti-howtos/references/using-modules.md +0 -182
  94. package/skills/ti-howtos/references/web-content-integration.md +0 -288
  95. package/skills/ti-howtos/references/webpack-build-pipeline.md +0 -125
@@ -1,172 +0,0 @@
1
- # Google Maps v2 for Android
2
-
3
- Guide to implementing native maps on Android using the `ti.map` module (v2).
4
-
5
- ## 1. Initial configuration
6
-
7
- ### Module installation
8
- Add the module to `tiapp.xml`:
9
-
10
- ```xml
11
- <modules>
12
- <module platform="android">ti.map</module>
13
- </modules>
14
- ```
15
-
16
- ### Obtaining an API key (Google Cloud Console)
17
- 1. Create a project in the Google Cloud Console.
18
- 2. Enable "Maps SDK for Android".
19
- 3. Generate an API key. You will need the application ID from your `tiapp.xml` and the SHA-1 fingerprint from your keystore.
20
-
21
- #### Get SHA-1 (debug)
22
- ```bash
23
- keytool -list -v -keystore ~/Library/Application\ Support/titanium/mobilesdk/osx/<VERSION>/android/dev_keystore
24
- ```
25
- Default password: empty (press Enter).
26
-
27
- ### Configure tiapp.xml
28
- Add the API key in the Android section:
29
-
30
- ```xml
31
- <android xmlns:android="http://schemas.android.com/apk/res/android">
32
- <manifest>
33
- <application>
34
- <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="YOUR_API_KEY_HERE"/>
35
- </application>
36
- </manifest>
37
- </android>
38
- ```
39
-
40
- ## 2. Google Play Services verification
41
-
42
- Verify availability before rendering the map:
43
-
44
- ```javascript
45
- const MapModule = require('ti.map');
46
- const rc = MapModule.isGooglePlayServicesAvailable();
47
-
48
- switch (rc) {
49
- case MapModule.SUCCESS:
50
- Ti.API.info('Google Play Services available');
51
- break;
52
- case MapModule.SERVICE_MISSING:
53
- Ti.API.error('Google Play Services is missing');
54
- break;
55
- case MapModule.SERVICE_VERSION_UPDATE_REQUIRED:
56
- Ti.API.error('Google Play Services needs update');
57
- break;
58
- case MapModule.SERVICE_DISABLED:
59
- Ti.API.error('Google Play Services is disabled');
60
- break;
61
- case MapModule.SERVICE_INVALID:
62
- Ti.API.error('Google Play Services is invalid');
63
- break;
64
- }
65
- ```
66
-
67
- ## 3. Using the map view
68
-
69
- ### Basic creation
70
- ```javascript
71
- const MapModule = require('ti.map');
72
- const mapView = MapModule.createView({
73
- mapType: MapModule.NORMAL_TYPE,
74
- userLocation: true,
75
- traffic: true, // Show real-time traffic
76
- animate: true,
77
- region: {
78
- latitude: -33.87365,
79
- longitude: 151.20689,
80
- latitudeDelta: 0.1,
81
- longitudeDelta: 0.1
82
- }
83
- });
84
- ```
85
-
86
- ### Map types
87
- - `MapModule.NORMAL_TYPE`: standard map
88
- - `MapModule.SATELLITE_TYPE`: satellite imagery
89
- - `MapModule.TERRAIN_TYPE`: terrain map
90
- - `MapModule.HYBRID_TYPE`: satellite with labels
91
-
92
- ## 4. Advanced annotations (pins)
93
-
94
- ```javascript
95
- const opera = MapModule.createAnnotation({
96
- latitude: -33.8569,
97
- longitude: 151.2153,
98
- title: 'Sydney Opera House',
99
- subtitle: 'NSW, Australia',
100
- pincolor: MapModule.ANNOTATION_VIOLET,
101
- image: 'custom_pin.png', // Custom image
102
- draggable: true, // Allow pin dragging
103
- // Complete custom view (replaces the pin)
104
- customView: Ti.UI.createLabel({ text: 'Pin', backgroundColor: 'white' })
105
- });
106
-
107
- mapView.addAnnotation(opera);
108
- ```
109
-
110
- ### Additional annotation properties
111
- - `customView`: a `Ti.UI.View` that replaces the entire annotation (takes precedence over `image`)
112
- - `centerOffset`: `{x, y}` offset for the annotation relative to the coordinate
113
- - `canShowCallout`: whether tapping shows the info bubble (default: `true`)
114
-
115
- Precedence: `customView` > `image` > default pin. For buttons: `leftView`/`rightView` take precedence over `leftButton`/`rightButton`.
116
-
117
- ### Available pin colors
118
- `ANNOTATION_AZURE`, `BLUE`, `CYAN`, `GREEN`, `MAGENTA`, `ORANGE`, `RED`, `ROSE`, `VIOLET`, `YELLOW`.
119
-
120
- ## 5. Routes (polylines)
121
-
122
- ```javascript
123
- const route = MapModule.createRoute({
124
- width: 5,
125
- color: '#f00',
126
- points: [
127
- { latitude: -33.8569, longitude: 151.2153 },
128
- { latitude: -33.8522, longitude: 151.2105 }
129
- ]
130
- });
131
-
132
- mapView.addRoute(route);
133
- ```
134
-
135
- ## 6. Critical events
136
-
137
- ```javascript
138
- // Detect click on annotation or its buttons
139
- mapView.addEventListener('click', (e) => {
140
- if (e.clicksource === 'pin') {
141
- Ti.API.info(`Pin clicked: ${e.title}`);
142
- }
143
- });
144
-
145
- // Detect drag state changes
146
- // e.newState holds the drag state constant; e.annotation holds the annotation object
147
- mapView.addEventListener('pinchangedragstate', (e) => {
148
- if (e.newState === MapModule.ANNOTATION_DRAG_STATE_END) {
149
- Ti.API.info(`Dropped at: ${e.annotation.latitude}, ${e.annotation.longitude}`);
150
- }
151
- });
152
- // Drag states: ANNOTATION_DRAG_STATE_START, ANNOTATION_DRAG_STATE_END
153
-
154
- // Detect region changes
155
- mapView.addEventListener('regionchanged', (e) => {
156
- Ti.API.info(`New region: ${e.latitude}, ${e.longitude} (delta: ${e.latitudeDelta}, ${e.longitudeDelta})`);
157
- });
158
-
159
- // Detect complete rendering
160
- mapView.addEventListener('complete', (e) => {
161
- Ti.API.info('Map loaded');
162
- });
163
- ```
164
-
165
- ## 7. Migration from legacy Titanium.Map
166
-
167
- The `ti.map` module replaced the legacy `Titanium.Map` API. Key differences: use `NORMAL_TYPE` instead of `STANDARD_TYPE`, `ANNOTATION_VIOLET` instead of `ANNOTATION_PURPLE`, and routes are created with `Map.createRoute()` instead of abstract data types. Multiple MapView instances are supported.
168
-
169
- ## 8. Limitations and troubleshooting
170
- - Single map: Android (legacy) only allows one MapView instance per application. v2 allows multiple views.
171
- - Blank map: verify the API key and make sure `android:anyDensity` is not set to true in the manifest if you use old resolutions.
172
- - Simulator: Google Maps v2 is not compatible with the standard emulator without x86 Google Play Services. Test on a real device.
@@ -1,149 +0,0 @@
1
- # iOS Map Kit
2
-
3
- Guide to implementing native maps on iOS with the `ti.map` module.
4
-
5
- ## 1. Initial configuration
6
-
7
- ### Module installation
8
- Add the module to `tiapp.xml`:
9
-
10
- ```xml
11
- <modules>
12
- <module platform="iphone">ti.map</module>
13
- </modules>
14
- ```
15
-
16
- ### Location permissions (Info.plist)
17
- Add the required usage descriptions in `tiapp.xml`:
18
-
19
- ```xml
20
- <ios>
21
- <plist>
22
- <dict>
23
- <key>NSLocationWhenInUseUsageDescription</key>
24
- <string>We need your location to show it on the map.</string>
25
- <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
26
- <string>We need continuous location access for navigation.</string>
27
- </dict>
28
- </plist>
29
- </ios>
30
- ```
31
-
32
- iOS 11+: include both `NSLocationWhenInUseUsageDescription` and `NSLocationAlwaysAndWhenInUseUsageDescription`. Users can still choose "When in Use" even if you request "Always".
33
-
34
- ## 2. Using the map view
35
-
36
- ### Basic creation
37
- ```javascript
38
- const MapModule = require('ti.map');
39
- const mapView = MapModule.createView({
40
- mapType: MapModule.NORMAL_TYPE, // Also: SATELLITE_TYPE, HYBRID_TYPE, STANDARD_TYPE (alias for NORMAL_TYPE with labels)
41
- userLocation: true,
42
- rotatesEnabled: true, // Allow two-finger rotation
43
- region: {
44
- latitude: 48.8582,
45
- longitude: 2.2945,
46
- latitudeDelta: 0.02,
47
- longitudeDelta: 0.02
48
- }
49
- });
50
- ```
51
-
52
- ## 3. 3D camera (perspective)
53
-
54
- iOS lets you tilt and rotate the map for 3D views.
55
-
56
- Important: the map must be visible on screen before using camera APIs. Wait for the `complete` event before calling `animateCamera()` or setting camera properties.
57
-
58
- ```javascript
59
- const myCam = MapModule.createCamera({
60
- altitude: 300, // meters above ground
61
- centerCoordinate: { latitude: 48.8582, longitude: 2.2945 },
62
- heading: -45, // angle relative to North
63
- pitch: 60 // tilt angle downward
64
- });
65
-
66
- // Apply camera with animation
67
- mapView.animateCamera({
68
- camera: myCam,
69
- curve: Ti.UI.ANIMATION_CURVE_EASE_IN,
70
- duration: 1000
71
- });
72
-
73
- // Additional 3D view properties
74
- mapView.pitchEnabled = true;
75
- mapView.showsBuildings = true; // 3D buildings
76
- ```
77
-
78
- ## 4. iOS annotations
79
-
80
- ### iOS pin colors
81
- iOS supports only three pin color constants (unlike Android's ten):
82
- - `MapModule.ANNOTATION_GREEN`
83
- - `MapModule.ANNOTATION_PURPLE`
84
- - `MapModule.ANNOTATION_RED`
85
-
86
- ### System buttons and callouts
87
- iOS allows native buttons in the pin callout (popup window).
88
-
89
- ```javascript
90
- const bridge = MapModule.createAnnotation({
91
- latitude: -33.8522,
92
- longitude: 151.2105,
93
- title: 'Harbour Bridge',
94
- subtitle: 'Port Jackson',
95
- pincolor: MapModule.ANNOTATION_PURPLE,
96
- // iOS system buttons in the callout
97
- leftButton: Ti.UI.iOS.SystemButton.INFO_DARK,
98
- rightButton: Ti.UI.iOS.SystemButton.CONTACT_ADD,
99
- canShowCallout: true // Controls whether tapping the annotation shows the callout bubble (default: true)
100
- });
101
-
102
- mapView.addAnnotation(bridge);
103
- ```
104
-
105
- ### Center offset
106
- If you use a custom pin image that is not centered:
107
-
108
- ```javascript
109
- const customPin = MapModule.createAnnotation({
110
- image: 'flag.png',
111
- centerOffset: { x: 10, y: -20 } // Visually moves the pin
112
- });
113
- ```
114
-
115
- ## 5. Advanced routes
116
-
117
- ### Overlay levels
118
- Control whether the route appears above labels or above roads.
119
-
120
- ```javascript
121
- const route = MapModule.createRoute({
122
- points: routePoints,
123
- color: '#00f',
124
- width: 4,
125
- level: MapModule.OVERLAY_LEVEL_ABOVE_LABELS // default
126
- // or MapModule.OVERLAY_LEVEL_ABOVE_ROADS (below labels)
127
- });
128
- ```
129
-
130
- ## 6. Events
131
-
132
- Key map events: `click`, `complete` (map loaded), `regionchanged`, `pinchangedragstate`.
133
-
134
- Same as Android, but with specialized `clicksource` values for system buttons:
135
-
136
- ```javascript
137
- mapView.addEventListener('click', (e) => {
138
- if (e.clicksource === 'leftButton' || e.clicksource === 'rightButton') {
139
- Ti.API.info('Callout button clicked');
140
- }
141
- });
142
-
143
- // e.newState holds the drag state constant; e.annotation holds the annotation object
144
- mapView.addEventListener('pinchangedragstate', (e) => {
145
- if (e.newState === MapModule.ANNOTATION_DRAG_STATE_END) {
146
- Ti.API.info(`Dropped at: ${e.annotation.latitude}, ${e.annotation.longitude}`);
147
- }
148
- });
149
- ```