@maccesar/titools 2.2.4 → 2.2.9

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 (98) hide show
  1. package/README.md +23 -23
  2. package/agents/ti-pro.md +17 -17
  3. package/lib/commands/update.js +6 -14
  4. package/lib/downloader.js +17 -2
  5. package/package.json +1 -1
  6. package/skills/alloy-guides/SKILL.md +31 -31
  7. package/skills/alloy-guides/references/CONCEPTS.md +3 -3
  8. package/skills/alloy-guides/references/CONTROLLERS.md +1 -1
  9. package/skills/alloy-guides/references/MODELS.md +6 -6
  10. package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +1 -1
  11. package/skills/alloy-guides/references/VIEWS_XML.md +1 -1
  12. package/skills/alloy-guides/references/WIDGETS.md +1 -1
  13. package/skills/alloy-howtos/SKILL.md +27 -27
  14. package/skills/alloy-howtos/references/best_practices.md +9 -9
  15. package/skills/alloy-howtos/references/cli_reference.md +14 -14
  16. package/skills/alloy-howtos/references/config_files.md +16 -16
  17. package/skills/alloy-howtos/references/custom_tags.md +16 -16
  18. package/skills/alloy-howtos/references/debugging_troubleshooting.md +11 -15
  19. package/skills/alloy-howtos/references/samples.md +19 -19
  20. package/skills/purgetss/SKILL.md +11 -1
  21. package/skills/purgetss/references/animation-system.md +1 -1
  22. package/skills/purgetss/references/cli-commands.md +3 -3
  23. package/skills/purgetss/references/customization-deep-dive.md +1 -1
  24. package/skills/purgetss/references/dynamic-component-creation.md +1 -1
  25. package/skills/purgetss/references/icon-fonts.md +4 -0
  26. package/skills/purgetss/references/installation-setup.md +8 -1
  27. package/skills/purgetss/references/migration-guide.md +4 -0
  28. package/skills/purgetss/references/tikit-components.md +193 -204
  29. package/skills/purgetss/references/ui-ux-design.md +1 -1
  30. package/skills/ti-expert/SKILL.md +78 -118
  31. package/skills/ti-expert/references/alloy-builtins.md +18 -18
  32. package/skills/ti-expert/references/alloy-structure.md +21 -21
  33. package/skills/ti-expert/references/anti-patterns.md +15 -15
  34. package/skills/ti-expert/references/cli-expert.md +15 -15
  35. package/skills/ti-expert/references/code-conventions.md +38 -38
  36. package/skills/ti-expert/references/contracts.md +8 -8
  37. package/skills/ti-expert/references/controller-patterns.md +14 -14
  38. package/skills/ti-expert/references/error-handling.md +11 -11
  39. package/skills/ti-expert/references/examples.md +12 -12
  40. package/skills/ti-expert/references/migration-patterns.md +24 -24
  41. package/skills/ti-expert/references/patterns.md +10 -10
  42. package/skills/ti-expert/references/performance-listview.md +16 -16
  43. package/skills/ti-expert/references/performance-optimization.md +41 -41
  44. package/skills/ti-expert/references/security-device.md +22 -22
  45. package/skills/ti-expert/references/security-fundamentals.md +19 -19
  46. package/skills/ti-expert/references/state-management.md +33 -33
  47. package/skills/ti-expert/references/testing-e2e-ci.md +25 -25
  48. package/skills/ti-expert/references/testing-unit.md +24 -24
  49. package/skills/ti-expert/references/theming.md +15 -15
  50. package/skills/ti-guides/SKILL.md +58 -60
  51. package/skills/ti-guides/references/advanced-data-and-images.md +33 -33
  52. package/skills/ti-guides/references/android-manifest.md +15 -15
  53. package/skills/ti-guides/references/app-distribution.md +70 -166
  54. package/skills/ti-guides/references/application-frameworks.md +96 -114
  55. package/skills/ti-guides/references/cli-reference.md +294 -294
  56. package/skills/ti-guides/references/coding-best-practices.md +42 -33
  57. package/skills/ti-guides/references/commonjs-advanced.md +57 -51
  58. package/skills/ti-guides/references/hello-world.md +36 -36
  59. package/skills/ti-guides/references/hyperloop-native-access.md +66 -66
  60. package/skills/ti-guides/references/javascript-primer.md +83 -101
  61. package/skills/ti-guides/references/reserved-words.md +9 -9
  62. package/skills/ti-guides/references/resources.md +75 -83
  63. package/skills/ti-guides/references/style-and-conventions.md +35 -28
  64. package/skills/ti-guides/references/tiapp-config.md +110 -74
  65. package/skills/ti-howtos/SKILL.md +88 -92
  66. package/skills/ti-howtos/references/android-platform-deep-dives.md +104 -104
  67. package/skills/ti-howtos/references/automation-fastlane-appium.md +39 -39
  68. package/skills/ti-howtos/references/buffer-codec-streams.md +60 -60
  69. package/skills/ti-howtos/references/cross-platform-development.md +115 -136
  70. package/skills/ti-howtos/references/debugging-profiling.md +167 -181
  71. package/skills/ti-howtos/references/extending-titanium.md +121 -121
  72. package/skills/ti-howtos/references/google-maps-v2.md +84 -82
  73. package/skills/ti-howtos/references/ios-map-kit.md +65 -60
  74. package/skills/ti-howtos/references/ios-platform-deep-dives.md +123 -123
  75. package/skills/ti-howtos/references/local-data-sources.md +79 -78
  76. package/skills/ti-howtos/references/location-and-maps.md +116 -120
  77. package/skills/ti-howtos/references/media-apis.md +87 -86
  78. package/skills/ti-howtos/references/notification-services.md +250 -260
  79. package/skills/ti-howtos/references/remote-data-sources.md +98 -93
  80. package/skills/ti-howtos/references/tutorials.md +226 -216
  81. package/skills/ti-howtos/references/using-modules.md +73 -102
  82. package/skills/ti-howtos/references/web-content-integration.md +101 -103
  83. package/skills/ti-howtos/references/webpack-build-pipeline.md +52 -44
  84. package/skills/ti-ui/SKILL.md +85 -85
  85. package/skills/ti-ui/references/accessibility-deep-dive.md +57 -57
  86. package/skills/ti-ui/references/animation-and-matrices.md +79 -79
  87. package/skills/ti-ui/references/application-structures.md +96 -99
  88. package/skills/ti-ui/references/custom-fonts-styling.md +99 -99
  89. package/skills/ti-ui/references/event-handling.md +58 -58
  90. package/skills/ti-ui/references/gestures.md +62 -64
  91. package/skills/ti-ui/references/icons-and-splash-screens.md +88 -88
  92. package/skills/ti-ui/references/layouts-and-positioning.md +87 -97
  93. package/skills/ti-ui/references/listviews-and-performance.md +107 -107
  94. package/skills/ti-ui/references/orientation.md +87 -88
  95. package/skills/ti-ui/references/platform-ui-android.md +87 -81
  96. package/skills/ti-ui/references/platform-ui-ios.md +63 -61
  97. package/skills/ti-ui/references/scrolling-views.md +29 -29
  98. package/skills/ti-ui/references/tableviews.md +56 -56
@@ -1,23 +1,22 @@
1
- # Application Structures and Core Building Blocks
1
+ # Application structures and core building blocks
2
2
 
3
3
  ## 1. Overview
4
4
 
5
- Titanium apps are built from three core components:
6
- - **Windows** - Top-level containers (like web pages)
7
- - **Views** - Generic content containers (like HTML divs)
8
- - **TabGroups** - Tab-based navigation containers
5
+ Titanium apps are built from three core components.
6
+ - Windows: top-level containers, similar to web pages.
7
+ - Views: generic content containers, similar to HTML divs.
8
+ - TabGroups: tab-based navigation containers.
9
9
 
10
10
  ## 2. Windows
11
11
 
12
- ### Window Concepts
12
+ ### Window concepts
13
13
 
14
- In web development terms:
15
- - **Window** **Web page** (top-level container)
16
- - **View** **div** (generic content container)
17
- - Windows can run in their own execution context
18
- - Windows are top-level containers that hold views
14
+ If you think in web terms:
15
+ - A window is like a page. It is the top-level container.
16
+ - A view is like a div. It sits inside a window.
17
+ - Windows can run in their own execution context.
19
18
 
20
- ### Creating Windows
19
+ ### Creating windows
21
20
 
22
21
  ```javascript
23
22
  const win = Ti.UI.createWindow({
@@ -31,7 +30,7 @@ const win = Ti.UI.createWindow({
31
30
  win.open();
32
31
  ```
33
32
  ...
34
- ### Window Events
33
+ ### Window events
35
34
 
36
35
  ```javascript
37
36
  win.addEventListener('open', (e) => {
@@ -51,9 +50,9 @@ win.addEventListener('blur', (e) => {
51
50
  });
52
51
  ```
53
52
 
54
- ### Window Lifecycle
53
+ ### Window lifecycle
55
54
 
56
- Windows exist in a stack. Opening a window pushes it onto the stack; closing pops it from the stack.
55
+ Windows live in a stack. Opening a window pushes it on top. Closing it pops it off.
57
56
 
58
57
  ```javascript
59
58
  const win1 = Ti.UI.createWindow({ title: 'Window 1' });
@@ -67,14 +66,14 @@ win2.open(); // Pushed on top of win1
67
66
 
68
67
  ## 3. Views
69
68
 
70
- ### View Concepts
69
+ ### View concepts
71
70
 
72
- Views are style-able generic containers that:
73
- - Hold other components (buttons, labels, etc.)
74
- - Must be contained within a window
75
- - Are analogous to HTML divs
71
+ Views are stylable containers that:
72
+ - Hold other components (buttons, labels, etc.).
73
+ - Must be contained within a window.
74
+ - Map closely to HTML divs.
76
75
 
77
- ### Creating Views
76
+ ### Creating views
78
77
 
79
78
  ```javascript
80
79
  const view = Ti.UI.createView({
@@ -88,7 +87,7 @@ const view = Ti.UI.createView({
88
87
  win.add(view);
89
88
  ```
90
89
 
91
- ### Common View Types
90
+ ### Common view types
92
91
 
93
92
  ```javascript
94
93
  // Basic view
@@ -115,7 +114,7 @@ const webView = Ti.UI.createWebView({
115
114
  });
116
115
  ```
117
116
 
118
- ### Adding Views to Windows
117
+ ### Adding views to windows
119
118
 
120
119
  ```javascript
121
120
  // Add single view
@@ -130,7 +129,7 @@ container.add(childView);
130
129
  win.add(container);
131
130
  ```
132
131
 
133
- ### Removing Views
132
+ ### Removing views
134
133
 
135
134
  ```javascript
136
135
  // Remove specific view
@@ -142,9 +141,9 @@ win.removeAllChildren();
142
141
 
143
142
  ## 4. TabGroups
144
143
 
145
- ### Tab-Based Apps
144
+ ### Tab-based apps
146
145
 
147
- TabGroups contain multiple tabs, each containing a window. This is the most common mobile app pattern.
146
+ TabGroups contain multiple tabs, each with a window. This is a common mobile pattern.
148
147
 
149
148
  ```javascript
150
149
  // Create tab group
@@ -182,7 +181,7 @@ tabGroup.addTab(tab2);
182
181
  tabGroup.open();
183
182
  ```
184
183
 
185
- ### Tab Properties
184
+ ### Tab properties
186
185
 
187
186
  | Property | Description |
188
187
  | ------------ | ---------------------- |
@@ -192,7 +191,7 @@ tabGroup.open();
192
191
  | `badge` | Badge number |
193
192
  | `activeIcon` | Icon when active (iOS) |
194
193
 
195
- ### Window Titles vs Tab Titles
194
+ ### Window titles vs tab titles
196
195
 
197
196
  ```javascript
198
197
  const tab = Ti.UI.createTab({
@@ -203,7 +202,7 @@ const tab = Ti.UI.createTab({
203
202
  });
204
203
  ```
205
204
 
206
- ### Tab Events
205
+ ### Tab events
207
206
 
208
207
  ```javascript
209
208
  tabGroup.addEventListener('focus', (e) => {
@@ -213,30 +212,28 @@ tabGroup.addEventListener('focus', (e) => {
213
212
  });
214
213
  ```
215
214
 
216
- ### Tab Recommendations
215
+ ### Tab recommendations
217
216
 
218
- **Limit tabs to 4 or less**:
219
- - iOS: Fixed minimum width, shows "More" for overflow
220
- - Android: Tabs shrink to fit (can become unusable)
221
- - Both platforms: All tabs visible = better UX
217
+ Keep tabs to four or fewer.
218
+ - iOS uses a fixed minimum width and shows "More" for overflow.
219
+ - Android shrinks tabs to fit, which can make them hard to use.
220
+ - On both platforms, visible tabs are easier to scan.
222
221
 
223
- **Tab expectations**:
224
- - Tabs are peers (siblings), not hierarchical
225
- - Each tab focuses on limited, related functionality
226
- - Tabs are related within overall app purpose
222
+ Tabs should be peers. They are not a hierarchy.
223
+ - Each tab should focus on a narrow slice of functionality.
224
+ - All tabs should make sense as parts of a single app.
227
225
 
228
- ### Tab-Based Applications
226
+ ### Tab-based applications
229
227
 
230
- **Characteristics**:
231
- - 2-4 tabs at bottom
232
- - Each tab contains a window
233
- - Easy navigation between features
234
- - Most common mobile pattern
228
+ Typical characteristics:
229
+ - Two to four tabs at the bottom.
230
+ - Each tab contains a window.
231
+ - Switching between features is quick.
235
232
 
236
- **Example apps**:
237
- - Social networks (feed, profile, messages)
238
- - News apps (headlines, sports, business)
239
- - Utilities with distinct features
233
+ Example apps:
234
+ - Social networks (feed, profile, messages).
235
+ - News apps (headlines, sports, business).
236
+ - Utilities with distinct features.
240
237
 
241
238
  ```javascript
242
239
  // Classic tab-based app
@@ -276,7 +273,7 @@ navWindow.open();
276
273
 
277
274
  ## 6. NavigationWindow (iOS)
278
275
 
279
- NavigationWindow provides iOS-style navigation with push/pop transitions.
276
+ NavigationWindow provides iOS-style navigation with push and pop transitions.
280
277
 
281
278
  ```javascript
282
279
  const navWindow = Ti.UI.createNavigationWindow({
@@ -298,7 +295,7 @@ navWindow.openWindow(detailWin, { animated: true });
298
295
  detailWin.close();
299
296
  ```
300
297
 
301
- ### Navigation Bar Customization
298
+ ### Navigation bar customization
302
299
 
303
300
  ```javascript
304
301
  const win = Ti.UI.createWindow({
@@ -322,9 +319,9 @@ win.rightNavButton = Ti.UI.createButton({
322
319
  });
323
320
  ```
324
321
 
325
- ## 7. Modal Windows
322
+ ## 7. Modal windows
326
323
 
327
- ### iOS Modal Windows
324
+ ### iOS modal windows
328
325
 
329
326
  ```javascript
330
327
  const modalWin = Ti.UI.createWindow({
@@ -336,17 +333,17 @@ const modalWin = Ti.UI.createWindow({
336
333
  modalWin.open({ modal: true });
337
334
  ```
338
335
 
339
- **Modal behavior**:
340
- - Fills entire screen
341
- - Covers tab bar (if in tab)
342
- - Must be explicitly closed
343
- - No automatic back button
336
+ Modal behavior:
337
+ - Fills the entire screen.
338
+ - Covers the tab bar if the app uses tabs.
339
+ - Must be explicitly closed.
340
+ - No automatic back button.
344
341
 
345
- ## 8. Heavyweight vs Lightweight Windows
342
+ ## 8. Heavyweight vs lightweight windows
346
343
 
347
- ### Heavyweight Windows (Android)
344
+ ### Heavyweight windows (Android)
348
345
 
349
- Android windows are "heavyweight" - they each run in their own activity/context.
346
+ Android windows are heavyweight. Each runs in its own activity and context.
350
347
 
351
348
  ```javascript
352
349
  // Explicit heavyweight (Android)
@@ -357,13 +354,13 @@ const win = Ti.UI.createWindow({
357
354
  });
358
355
  ```
359
356
 
360
- **Heavyweight characteristics**:
361
- - Each window = separate Android Activity
362
- - Own back button handling
363
- - Own lifecycle
364
- - More memory intensive
357
+ Heavyweight characteristics:
358
+ - Each window is a separate Android Activity.
359
+ - Each has its own back button handling.
360
+ - Each has its own lifecycle.
361
+ - They use more memory.
365
362
 
366
- ### Lightweight Windows
363
+ ### Lightweight windows
367
364
 
368
365
  ```javascript
369
366
  // Lightweight (same context)
@@ -373,15 +370,15 @@ const win = Ti.UI.createWindow({
373
370
  });
374
371
  ```
375
372
 
376
- **Lightweight characteristics**:
377
- - Share context with opening window
378
- - No back button (typically)
379
- - Less memory usage
380
- - Faster creation
373
+ Lightweight characteristics:
374
+ - Share context with the opening window.
375
+ - No back button (typically).
376
+ - Use less memory.
377
+ - Create faster.
381
378
 
382
- ## 9. Window Hierarchy and Stacking
379
+ ## 9. Window hierarchy and stacking
383
380
 
384
- ### Understanding the Stack
381
+ ### Understanding the stack
385
382
 
386
383
  ```javascript
387
384
  const win1 = Ti.UI.createWindow({ title: '1' });
@@ -404,7 +401,7 @@ win2.close();
404
401
  // Stack: [win1]
405
402
  ```
406
403
 
407
- ### Accessing the Stack
404
+ ### Accessing the stack
408
405
 
409
406
  ```javascript
410
407
  // Get current window (some contexts)
@@ -414,11 +411,11 @@ const currentWin = Ti.UI.currentWindow;
414
411
  const activity = Ti.Android.currentActivity;
415
412
  ```
416
413
 
417
- ## 10. Platform-Specific Navigation
414
+ ## 10. Platform-specific navigation
418
415
 
419
- ### Android Navigation Patterns
416
+ ### Android navigation patterns
420
417
 
421
- **Back Button**:
418
+ Back button:
422
419
  ```javascript
423
420
  win.addEventListener('androidback', (e) => {
424
421
  // Override default behavior
@@ -438,7 +435,7 @@ win.addEventListener('androidback', (e) => {
438
435
  });
439
436
  ```
440
437
 
441
- **Menu Button**:
438
+ Menu button:
442
439
  ```javascript
443
440
  const activity = Ti.Android.currentActivity;
444
441
 
@@ -470,9 +467,9 @@ activity.onOptionsItemSelected = (e) => {
470
467
  };
471
468
  ```
472
469
 
473
- ### iOS Navigation Patterns
470
+ ### iOS navigation patterns
474
471
 
475
- **NavigationWindow** (most common):
472
+ NavigationWindow (most common):
476
473
  ```javascript
477
474
  const navWindow = Ti.UI.createNavigationWindow({
478
475
  window: rootWindow
@@ -480,13 +477,13 @@ const navWindow = Ti.UI.createNavigationWindow({
480
477
  navWindow.open();
481
478
  ```
482
479
 
483
- **Tab Bar Controller**:
480
+ Tab bar controller:
484
481
  ```javascript
485
482
  const tabGroup = Ti.UI.createTabGroup();
486
483
  tabGroup.open();
487
484
  ```
488
485
 
489
- **SplitWindow** (iPad):
486
+ SplitWindow (iPad):
490
487
  ```javascript
491
488
  const splitWin = Ti.UI.iOS.createSplitWindow({
492
489
  masterView: masterWindow,
@@ -495,11 +492,11 @@ const splitWin = Ti.UI.iOS.createSplitWindow({
495
492
  splitWin.open();
496
493
  ```
497
494
 
498
- ## 11. Execution Contexts
495
+ ## 11. Execution contexts
499
496
 
500
- ### Lightweight Contexts
497
+ ### Lightweight contexts
501
498
 
502
- Windows share contexts by default:
499
+ Windows share contexts by default.
503
500
 
504
501
  ```javascript
505
502
  const win1 = Ti.UI.createWindow();
@@ -509,9 +506,9 @@ const win2 = Ti.UI.createWindow();
509
506
  const sharedVariable = 123; // Accessible in both
510
507
  ```
511
508
  ...
512
- ## 12. Common Patterns
509
+ ## 12. Common patterns
513
510
 
514
- ### Drill-Down Navigation
511
+ ### Drill-down navigation
515
512
 
516
513
  ```javascript
517
514
  // Root level
@@ -537,7 +534,7 @@ table.addEventListener('click', (e) => {
537
534
  });
538
535
  ```
539
536
 
540
- ### Modal Forms
537
+ ### Modal forms
541
538
 
542
539
  ```javascript
543
540
  function showModalForm() {
@@ -569,7 +566,7 @@ function showModalForm() {
569
566
  }
570
567
  ```
571
568
 
572
- ### Tab with Navigation
569
+ ### Tab with navigation
573
570
 
574
571
  ```javascript
575
572
  const navWindow = Ti.UI.createNavigationWindow({
@@ -588,22 +585,22 @@ const tab = Ti.UI.createTab({
588
585
  tabGroup.addTab(tab);
589
586
  ```
590
587
 
591
- ## 13. Best Practices
588
+ ## 13. Best practices
592
589
 
593
- 1. **Prefer TabGroups for multi-feature apps** - Most common pattern
594
- 2. **Use NavigationWindow for iOS hierarchy** - Standard iOS pattern
595
- 3. **Limit to 4 tabs** - All tabs visible = better UX
596
- 4. **Handle androidback appropriately** - Confirm before destructive actions
597
- 5. **Use modal windows for focused tasks** - Forms, confirmations
598
- 6. **Consider execution contexts** - Heavyweight windows don't share variables
599
- 7. **Test on both platforms** - Navigation patterns differ significantly
590
+ 1. Prefer TabGroups for multi-feature apps. It is the most common pattern.
591
+ 2. Use NavigationWindow for iOS hierarchy. It matches platform expectations.
592
+ 3. Limit to 4 tabs. All tabs visible is better UX.
593
+ 4. Handle `androidback` with care. Confirm destructive actions.
594
+ 5. Use modal windows for focused tasks like forms and confirmations.
595
+ 6. Remember execution contexts. Heavyweight windows do not share variables.
596
+ 7. Test on both platforms. Navigation differs in real use.
600
597
 
601
- ## 14. Platform Differences Summary
598
+ ## 14. Platform differences summary
602
599
 
603
600
  | Feature | iOS | Android |
604
601
  | ------------- | ---------------------------- | -------------------------------------- |
605
602
  | Modal windows | Fill screen, cover tab bar | No effect (windows always full screen) |
606
- | Navigation | NavigationWindow | Back button + Menu button |
603
+ | Navigation | NavigationWindow | Back button and menu button |
607
604
  | Tabs | Fixed width, "More" overflow | Shrink to fit |
608
605
  | Window stack | Manual management | Back button navigation |
609
606
  | Heavyweight | Requires fullscreen | Default behavior |