@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,161 @@
1
+ # Custom Rules for Ti Elements, IDs, and Classes
2
+
3
+ Custom rules in PurgeTSS allow you to style **Titanium elements**, **IDs**, and **classes** with flexibility and precision. Configure these rules in the `config.cjs` file with optional platform, device, or conditional targeting.
4
+
5
+ :::info
6
+ This feature is particularly useful for meeting visual and design requirements across multiple platforms (iOS and Android).
7
+ :::
8
+
9
+ ## Table of Contents
10
+
11
+ - [Custom Rules for Ti Elements, IDs, and Classes](#custom-rules-for-ti-elements-ids-and-classes)
12
+ - [Table of Contents](#table-of-contents)
13
+ - [Naming Conventions](#naming-conventions)
14
+ - [Modifier Keys](#modifier-keys)
15
+ - [Platform, Device, and Conditional Blocks](#platform-device-and-conditional-blocks)
16
+ - [Property Values](#property-values)
17
+ - [Config Example](#config-example)
18
+ - [Generated TSS Output](#generated-tss-output)
19
+ - [Complete Styling Example](#complete-styling-example)
20
+
21
+ ---
22
+
23
+ ## Naming Conventions
24
+
25
+ | Target Type | Naming Convention | Example |
26
+ | --------------- | ------------------ | ----------------------------------- |
27
+ | **Ti Elements** | Exact element name | `Label`, `Button`, `ScrollView` |
28
+ | **IDs** | camelCase | `#mainBanner`, `#sidebarWidget` |
29
+ | **Classes** | kebab-case | `.my-custom-class`, `.feature-card` |
30
+
31
+ :::caution PurgeTSS v5 or earlier
32
+ For projects upgraded from PurgeTSS v5 or earlier, set `purge.options.missing` to `true` in `config.cjs` to get a report of any missing classes at the end of `app.tss`.
33
+ :::
34
+
35
+ ## Modifier Keys
36
+
37
+ ### Platform, Device, and Conditional Blocks
38
+
39
+ | Modifier | Description |
40
+ | ------------------------- | -------------------------------------- |
41
+ | `DEFAULT` / `default` | Global style |
42
+ | `ios` | iOS-specific |
43
+ | `android` | Android-specific |
44
+ | `tablet` | Tablet devices |
45
+ | `handheld` | Handheld devices |
46
+ | `[if=globalVariableName]` | Conditional block with global variable |
47
+
48
+ ## Property Values
49
+
50
+ - **Titanium constants, Alloy config, Global Variables**: Always enclose in quotes
51
+ - **Colors**: hex, 8-digit hex, `rgb(R,G,B)`, `rgba(R,G,B,A)`, `transparent`, or color names
52
+ - **Spacing**: `em`, `rem`, `%`, `px`, `dp`, `cm`, or `in`
53
+ - `%`, `px`, `cm`, `in` - Passed without conversion
54
+ - `em` / `rem` - Converted: `value * 16`
55
+ - `dp` - Unit removed, value intact
56
+
57
+ ## Config Example
58
+
59
+ ```javascript
60
+ // purgetss/config.cjs
61
+ module.exports = {
62
+ theme: {
63
+ // ID with platform-specific styles
64
+ '#main-banner': {
65
+ DEFAULT: {
66
+ width: '300px',
67
+ height: '80px'
68
+ },
69
+ ios: {
70
+ clipMode: 'Ti.UI.iOS.CLIP_MODE_DISABLED'
71
+ }
72
+ },
73
+
74
+ // Class with device targeting
75
+ '.gallery': {
76
+ DEFAULT: {
77
+ height: 'Ti.UI.SIZE'
78
+ },
79
+ ios: {
80
+ clipMode: 'Ti.UI.iOS.CLIP_MODE_ENABLED'
81
+ },
82
+ android: {
83
+ hiddenBehavior: 'Ti.UI.HIDDEN_BEHAVIOR_GONE'
84
+ },
85
+ handheld: {
86
+ width: '250px'
87
+ },
88
+ tablet: {
89
+ width: '500px'
90
+ }
91
+ },
92
+
93
+ // Ti Element with conditional block
94
+ TextField: {
95
+ DEFAULT: {
96
+ top: 10,
97
+ left: 20,
98
+ right: 20,
99
+ bottom: 0
100
+ },
101
+ '[if=Alloy.Globals.iPhoneX]': {
102
+ bottom: 'Alloy.CFG.iPhoneXNotchSize'
103
+ },
104
+ android: {
105
+ touchFeedback: true
106
+ }
107
+ }
108
+ }
109
+ }
110
+ ```
111
+
112
+ ## Generated TSS Output
113
+
114
+ ```css
115
+ /* Ti Element */
116
+ 'TextField': { top: 10, left: 20, right: 20, bottom: 0 }
117
+ 'TextField[if=Alloy.Globals.iPhoneX]': { bottom: Alloy.CFG.iPhoneXNotchSize }
118
+ 'TextField[platform=android]': { touchFeedback: true }
119
+
120
+ /* Custom IDs */
121
+ '#main-banner': { width: '300px', height: '80px' }
122
+ '#main-banner[platform=ios]': { clipMode: Ti.UI.iOS.CLIP_MODE_DISABLED }
123
+
124
+ /* Custom Classes */
125
+ '.gallery': { height: Ti.UI.SIZE }
126
+ '.gallery[platform=ios]': { clipMode: Ti.UI.iOS.CLIP_MODE_ENABLED }
127
+ '.gallery[platform=android]': { hiddenBehavior: Ti.UI.HIDDEN_BEHAVIOR_GONE }
128
+ '.gallery[formFactor=handheld]': { width: '250px' }
129
+ '.gallery[formFactor=tablet]': { width: '500px' }
130
+ ```
131
+
132
+ ## Complete Styling Example
133
+
134
+ ```javascript
135
+ // config.cjs - Styling a custom card component
136
+ module.exports = {
137
+ theme: {
138
+ '.card': {
139
+ DEFAULT: {
140
+ apply: 'bg-white rounded-lg shadow-md p-4 m-2'
141
+ },
142
+ ios: {
143
+ apply: 'ios:shadow-offset-0'
144
+ }
145
+ },
146
+ '.card-title': {
147
+ DEFAULT: {
148
+ apply: 'text-lg font-bold text-gray-900 mb-2'
149
+ }
150
+ },
151
+ '.card-button': {
152
+ DEFAULT: {
153
+ apply: 'bg-blue-500 text-white px-4 py-2 rounded mt-4'
154
+ },
155
+ android: {
156
+ apply: 'android:ripple-enabled'
157
+ }
158
+ }
159
+ }
160
+ }
161
+ ```