@maccesar/titools 2.7.2 → 2.9.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 (51) hide show
  1. package/README.md +6 -13
  2. package/lib/config.js +1 -1
  3. package/package.json +1 -1
  4. package/skills/purgetss/SKILL.md +25 -0
  5. package/skills/purgetss/references/EXAMPLES.md +86 -24
  6. package/skills/purgetss/references/app-branding.md +412 -0
  7. package/skills/purgetss/references/appearance-module.md +161 -0
  8. package/skills/purgetss/references/apply-directive.md +87 -31
  9. package/skills/purgetss/references/arbitrary-values.md +4 -0
  10. package/skills/purgetss/references/class-categories.md +10 -7
  11. package/skills/purgetss/references/class-index.md +25 -18
  12. package/skills/purgetss/references/cli-commands.md +219 -8
  13. package/skills/purgetss/references/configurable-properties.md +11 -7
  14. package/skills/purgetss/references/custom-rules.md +7 -3
  15. package/skills/purgetss/references/customization-deep-dive.md +52 -4
  16. package/skills/purgetss/references/dynamic-component-creation.md +29 -14
  17. package/skills/purgetss/references/grid-layout.md +20 -8
  18. package/skills/purgetss/references/icon-fonts.md +4 -0
  19. package/skills/purgetss/references/installation-setup.md +3 -8
  20. package/skills/purgetss/references/ios-large-titles.md +141 -0
  21. package/skills/purgetss/references/migration-guide.md +162 -25
  22. package/skills/purgetss/references/multi-density-images.md +363 -0
  23. package/skills/purgetss/references/opacity-modifier.md +4 -0
  24. package/skills/purgetss/references/performance-tips.md +5 -0
  25. package/skills/purgetss/references/platform-modifiers.md +4 -0
  26. package/skills/purgetss/references/semantic-colors.md +386 -0
  27. package/skills/purgetss/references/smart-mappings.md +50 -28
  28. package/skills/purgetss/references/tikit-components.md +3 -1
  29. package/skills/purgetss/references/titanium-resets.md +46 -15
  30. package/skills/purgetss/references/ui-ux-design.md +32 -6
  31. package/skills/ti-branding/SKILL.md +0 -230
  32. package/skills/ti-branding/assets/ic_launcher.xml +0 -6
  33. package/skills/ti-branding/references/android-adaptive-icons.md +0 -85
  34. package/skills/ti-branding/references/cleanup-legacy.md +0 -112
  35. package/skills/ti-branding/references/ios-appiconset.md +0 -62
  36. package/skills/ti-branding/references/master-input-guidelines.md +0 -84
  37. package/skills/ti-branding/references/notification-icons.md +0 -63
  38. package/skills/ti-branding/references/splash-screen-api.md +0 -81
  39. package/skills/ti-branding/references/ti-icon-paths.md +0 -84
  40. package/skills/ti-branding/references/tiapp-xml-snippets.md +0 -92
  41. package/skills/ti-branding/scripts/lib/cleanup-legacy.sh +0 -230
  42. package/skills/ti-branding/scripts/lib/deps.sh +0 -58
  43. package/skills/ti-branding/scripts/lib/gen-android-adaptive.sh +0 -64
  44. package/skills/ti-branding/scripts/lib/gen-android-legacy.sh +0 -36
  45. package/skills/ti-branding/scripts/lib/gen-ios.sh +0 -46
  46. package/skills/ti-branding/scripts/lib/gen-marketplace.sh +0 -55
  47. package/skills/ti-branding/scripts/lib/gen-notification.sh +0 -46
  48. package/skills/ti-branding/scripts/lib/gen-splash-icon.sh +0 -31
  49. package/skills/ti-branding/scripts/lib/prepare-master.sh +0 -48
  50. package/skills/ti-branding/scripts/lib/validate.sh +0 -67
  51. package/skills/ti-branding/scripts/ti-branding +0 -546
@@ -18,7 +18,7 @@ If you want a clean `config.cjs`, delete the existing one and run:
18
18
  purgetss init
19
19
  ```
20
20
 
21
- This creates a minimal `./purgetss/config.cjs` file:
21
+ This creates a `./purgetss/config.cjs` file with the default sections:
22
22
 
23
23
  ```javascript
24
24
  module.exports = {
@@ -34,17 +34,35 @@ module.exports = {
34
34
  plugins: [] // Array of properties to ignore
35
35
  }
36
36
  },
37
+ brand: {
38
+ splash: false, // also generate splash_icon.png × 5
39
+ padding: '15%', // Android safe-zone. Range: 12% tight (mature logos) — 20% conservative. Spec floor 19.44%.
40
+ iosPadding: '4%', // iOS aesthetic. Range: 2% bold — 8% conservative. No launcher mask.
41
+ darkBgColor: null, // opaque dark bg for DefaultIcon-Dark.png (null = transparent per Apple HIG)
42
+ bgColor: '#FFFFFF', // Android adaptive bg + iOS/marketplace flatten
43
+ notification: false, // also generate ic_stat_notify.png × 5
44
+ confirmOverwrites: true // prompt before overwriting files (set false to skip)
45
+ },
46
+ images: {
47
+ quality: 85, // JPEG/WebP/AVIF quality (0-100)
48
+ format: null, // null = keep original; 'webp' | 'jpeg' | 'png' to convert every image
49
+ confirmOverwrites: true // prompt before overwriting files (set false to skip)
50
+ },
37
51
  theme: {
38
52
  extend: {}
39
53
  }
40
54
  };
41
55
  ```
42
56
 
57
+ `init` also creates empty `purgetss/fonts/`, `purgetss/brand/`, and `purgetss/images/` folders on first run, so you can see where each kind of asset goes.
58
+
43
59
  Every section is optional. Only add what you want to change. Anything missing falls back to the defaults.
44
60
 
45
61
  ## Structure
46
62
 
47
- The config file has two main sections: `purge` and `theme`.
63
+ The config file has four main sections: `purge`, `brand`, `images`, and `theme`.
64
+
65
+ `brand:` and `images:` configure the matching CLI commands — see [CLI Commands: `brand`](./cli-commands.md#brand-command) and [CLI Commands: `images`](./cli-commands.md#images-command) for the full option lists. The rest of this page covers `purge` and `theme`.
48
66
 
49
67
  ### `purge` Section
50
68
 
@@ -177,6 +195,31 @@ module.exports = {
177
195
  };
178
196
  ```
179
197
 
198
+ ### Default `font-sans`, `font-serif`, `font-mono`
199
+
200
+ PurgeTSS generates three `fontFamily` classes by default, even when `theme.fontFamily` is not set in `config.cjs`. iOS and Android get different values on purpose so each platform picks its native system font:
201
+
202
+ | Class | iOS | Android |
203
+ | ------------ | ---------------- | ------------ |
204
+ | `font-sans` | `Helvetica Neue` | `sans-serif` |
205
+ | `font-serif` | `Georgia` | `serif` |
206
+ | `font-mono` | `monospace` | `monospace` |
207
+
208
+ If you define a value for `sans`, `serif`, or `mono` in `theme.fontFamily` (or `theme.extend.fontFamily`), your value replaces the default on both platforms — no per-platform fork needed:
209
+
210
+ `./purgetss/config.cjs`
211
+ ```javascript
212
+ module.exports = {
213
+ theme: {
214
+ extend: {
215
+ fontFamily: {
216
+ sans: 'Inter-Regular' // replaces Helvetica Neue / sans-serif on both platforms
217
+ }
218
+ }
219
+ }
220
+ };
221
+ ```
222
+
180
223
  ## Overriding and Extending Properties
181
224
 
182
225
  By default, your project inherits values from the default theme. You have two options depending on your goal.
@@ -462,8 +505,13 @@ module.exports = {
462
505
 
463
506
  This generates classes like `p-72`, `m-84`, and `h-96` in addition to all of the default spacing and sizing utilities.
464
507
 
465
- > **WARNING: Titanium Layout Constraint**
466
- > Titanium does not support native `padding` on `View`, `Window`, `ScrollView`, or `TableView`. Even if PurgeTSS can generate spacing-related utilities, prefer margins on children for those elements.
508
+ ## Community-Discovered Patterns
509
+
510
+ ### Titanium Layout Constraint: `padding` on View / Window / ScrollView / TableView
511
+
512
+ Titanium does not support native `padding` on `View`, `Window`, `ScrollView`, or `TableView`. Even if PurgeTSS generates spacing-related utilities (`p-*`, `px-*`, `py-*`), applying them to those elements is silently ignored at runtime. Prefer margins on the children of those containers instead — `m-*`, `mt-*`, `mb-*`, etc. — which Titanium honors correctly.
513
+
514
+ This is a Titanium platform constraint, not a PurgeTSS bug. `Button`, `Label`, and `TextField` do accept `padding` natively.
467
515
 
468
516
  ## List of Customizable Properties
469
517
 
@@ -1,5 +1,15 @@
1
1
  # Dynamic Component Creation with PurgeTSS
2
2
 
3
+ > **SCOPE NOTE**
4
+ >
5
+ > This reference covers dynamic component creation using **Alloy's `$.UI.create()` helper** and **`Alloy.createStyle()` + `applyProperties()`**, both combined with PurgeTSS utility classes. It is an Alloy + PurgeTSS integration guide, **not** documentation for the `purgetss.ui` native module (see [animation-system.md](./animation-system.md) and [animation-advanced.md](./animation-advanced.md) for that module).
6
+ >
7
+ > For general Alloy controller and view patterns, refer to the `alloy-guides` and `alloy-howtos` skills.
8
+
9
+ ## Community-Discovered Patterns
10
+
11
+ The guidance in this file reflects patterns that PurgeTSS users have converged on when building components imperatively from Alloy controllers. It complements — but is not a substitute for — official Alloy documentation.
12
+
3
13
  ## Overview
4
14
 
5
15
  When creating components dynamically in Controllers (not declaratively in XML), PurgeTSS provides two methods to apply utility classes:
@@ -7,8 +17,9 @@ When creating components dynamically in Controllers (not declaratively in XML),
7
17
  1. **`$.UI.create()`** - Create components with PurgeTSS classes (Recommended)
8
18
  2. **`Alloy.createStyle()` + `applyProperties()`** - Apply PurgeTSS styles to existing components
9
19
 
10
- > **💡 BEST PRACTICE**
11
- > **Always prefer `$.UI.create()` for dynamic components** - it's cleaner, more readable, and PurgeTSS will process the classes automatically during build.
20
+ > **BEST PRACTICE**
21
+ >
22
+ > Always prefer `$.UI.create()` for dynamic components — it's cleaner, more readable, and PurgeTSS will process the classes automatically during build.
12
23
 
13
24
  ---
14
25
 
@@ -333,24 +344,25 @@ function createIconGrid(items) {
333
344
 
334
345
  ### PurgeTSS Processes Classes During Build
335
346
 
336
- > **️ℹ️ HOW IT WORKS**
347
+ > **NOTE HOW IT WORKS**
348
+ >
337
349
  > When you use `$.UI.create()` or `Alloy.createStyle()` with classes:
338
350
  >
339
351
  > 1. PurgeTSS scans your controllers for these class references
340
352
  > 2. It adds the classes to the generated `app.tss`
341
353
  > 3. At runtime, Alloy applies the styles to your components
342
354
  >
343
- > This means you get **full PurgeTSS power** even with dynamic components!
355
+ > This means you get the full PurgeTSS utility surface even with dynamic components.
344
356
 
345
357
  ### Class Verification
346
358
 
347
- Just like with XML views, **always verify classes exist** before using them:
359
+ Just like with XML views, always verify classes exist before using them:
348
360
 
349
361
  ```javascript
350
- // CORRECT - Verified classes
362
+ // CORRECT - Verified classes
351
363
  classes: ['w-screen', 'h-auto', 'bg-white', 'rounded-lg']
352
364
 
353
- // WRONG - These classes don't exist
365
+ // WRONG - These classes don't exist
354
366
  classes: ['flex-row', 'justify-center', 'p-4'] // No flexbox, no p-* on View
355
367
  ```
356
368
 
@@ -425,7 +437,8 @@ function setState(state) {
425
437
  }
426
438
  ```
427
439
 
428
- > **💡 When to Use `classes` vs `applyProperties`**
440
+ > **NOTE When to use `classes` vs `applyProperties`**
441
+ >
429
442
  > - Use `classes` when you want to swap entire style sets (e.g., active/inactive states)
430
443
  > - Use `applyProperties` with direct values when changing individual properties (e.g., text, enabled)
431
444
  > - Combine both for complex state changes
@@ -434,7 +447,7 @@ function setState(state) {
434
447
 
435
448
  ## Anti-Patterns to Avoid
436
449
 
437
- ### Don't Use `Ti.UI.create()` with Manual Styles
450
+ ### Don't use `Ti.UI.create()` with Manual Styles
438
451
 
439
452
  ```javascript
440
453
  // WRONG - Manual styling, no PurgeTSS benefits
@@ -446,7 +459,7 @@ const view = Ti.UI.createView({
446
459
  })
447
460
  ```
448
461
 
449
- ### Use `$.UI.create()` with PurgeTSS Classes
462
+ ### Use `$.UI.create()` with PurgeTSS classes
450
463
 
451
464
  ```javascript
452
465
  // CORRECT - Full PurgeTSS power
@@ -455,7 +468,7 @@ const view = $.UI.create('View', {
455
468
  })
456
469
  ```
457
470
 
458
- ### Don't Mix Styles and Classes
471
+ ### Don't mix inline styles and classes
459
472
 
460
473
  ```javascript
461
474
  // CONFUSING - Mix of styles and classes
@@ -465,7 +478,7 @@ const view = $.UI.create('View', {
465
478
  })
466
479
  ```
467
480
 
468
- ### Use Only Classes (or Only Styles)
481
+ ### Use only classes (or only styles)
469
482
 
470
483
  ```javascript
471
484
  // CORRECT - Pure PurgeTSS
@@ -494,8 +507,10 @@ view.applyProperties(Alloy.createStyle('index', {
494
507
  | **`Alloy.createStyle()`** | Styling existing components | `Alloy.createStyle('view', { classes: 'bg-white' })` |
495
508
  | **`applyProperties()`** | Apply style to component | `component.applyProperties(style)` |
496
509
 
497
- > **💡 REMEMBER**
498
- > Both methods give you **full access to PurgeTSS utilities**:
510
+ > **NOTE REMEMBER**
511
+ >
512
+ > Both methods give you full access to PurgeTSS utilities:
513
+ >
499
514
  > - All color classes (`bg-*`, `text-*`, `border-*`)
500
515
  > - All spacing classes (`m-*`, `gap-*`, and `p-*` where the Titanium component supports padding)
501
516
  > - All layout classes (`horizontal`, `vertical`)
@@ -2,9 +2,6 @@
2
2
 
3
3
  The grid system is a small layout tool that lets you build rows and columns with utility classes.
4
4
 
5
- > **WARNING**
6
- > PurgeTSS grid is not CSS Grid. It is a Titanium-oriented layout helper built around horizontal and vertical layout behavior.
7
-
8
5
  The snippet below shows the simplest layout. From there, you can mix columns and rows as needed.
9
6
 
10
7
  ```xml
@@ -85,10 +82,25 @@ These are the available utilities to control the grid.
85
82
 
86
83
  Control horizontal alignment of elements within a row:
87
84
 
88
- | Class | Effect | Use case |
89
- | --- | --- | --- |
90
- | `start` | Align to the start of the row | Left-aligned content |
91
- | `end` | Align to the end of the row | Right-aligned buttons or labels |
92
- | `center` | Align to the center of the row | Centered content blocks |
85
+ | Class | Effect |
86
+ | --- | --- |
87
+ | `start` | Align to the start of the row |
88
+ | `end` | Align to the end of the row |
89
+ | `center` | Align to the center of the row |
93
90
 
94
91
  These apply to child views inside a `grid-cols-*` container and control horizontal placement within the grid cell.
92
+
93
+ ## Community-Discovered Patterns
94
+
95
+ The following notes come from community experience using the PurgeTSS grid system in Titanium projects. They clarify how the grid relates to Titanium's layout engine (not CSS Grid) and offer common use cases for row placement.
96
+
97
+ > **WARNING**
98
+ > PurgeTSS grid is not CSS Grid. It is a Titanium-oriented layout helper built around horizontal and vertical layout behavior.
99
+
100
+ ### Common Use Cases for Row Placement
101
+
102
+ | Class | Use case |
103
+ | --- | --- |
104
+ | `start` | Left-aligned content |
105
+ | `end` | Right-aligned buttons or labels |
106
+ | `center` | Centered content blocks |
@@ -166,5 +166,9 @@ exports.icons = icons;
166
166
  > **DANGER**
167
167
  > Make sure the new prefix remains unique to avoid conflicts with other class prefixes.
168
168
 
169
+ ## Community-Discovered Patterns
170
+
171
+ The following note reflects community experience working with icon fonts that depend on multiple glyphs per icon.
172
+
169
173
  > **Font Awesome Duotone**
170
174
  > Titanium cannot render Font Awesome duotone icons correctly because each icon uses two glyphs. If you work with Font Awesome Pro, avoid documenting duotone as supported.
@@ -12,16 +12,11 @@ Install PurgeTSS globally on your machine using [NPM](https://www.npmjs.com/).
12
12
  > Node.js 20+ required.
13
13
  > PurgeTSS requires Node 20.0.0 or higher.
14
14
 
15
- ## Upgrade Notes
15
+ ## XML Validation
16
16
 
17
- - `utilities.tss` is the generated utilities file. Update any scripts or docs that still use the previous output filename.
18
- - `deviceInfo()` now works in Alloy and Classic Titanium projects.
19
- - If an upgrade behaves unexpectedly, a clean reinstall is the recommended recovery step:
17
+ PurgeTSS v7.5.3 added XML validation that flags any `--` (double-dash) sequence inside XML comments. Titanium's XML parser treats `--` in comments as invalid, and PurgeTSS now detects those sequences before they break the compile step.
20
18
 
21
- ```bash
22
- npm uninstall -g purgetss
23
- npm install -g purgetss
24
- ```
19
+ If you see a validation warning from PurgeTSS pointing at a view file, replace the offending comment with an alternative marker (for example, `//` or `==`) and re-run the build.
25
20
 
26
21
  ## Run PurgeTSS the First Time
27
22
 
@@ -0,0 +1,141 @@
1
+ # iOS Large Titles
2
+
3
+ Enabling Large Titles on a Window is not a single-property change. When you pair `largeTitleEnabled` with a `ScrollView` inside a `NavigationWindow` or `TabGroup`, **three interdependent iOS Window properties** must work together — otherwise you get either content hidden behind the nav bar or a visible rendering delay when the window opens.
4
+
5
+ | Property | Value | Why it matters |
6
+ | --- | --- | --- |
7
+ | `autoAdjustScrollViewInsets` | `true` | iOS automatically adjusts the ScrollView content insets so content starts below the nav bar instead of behind it. |
8
+ | `extendEdges` | `[Ti.UI.EXTEND_EDGE_ALL]` | Content extends under the nav/tab bars, producing the translucent blur effect Large Titles depend on. |
9
+ | `largeTitleEnabled` | `true` | Shows the large title that collapses to the standard nav bar title as the user scrolls. |
10
+
11
+ Using only `largeTitleEnabled` causes the nav bar region to render empty for a moment before the title draws. Using `extendEdges` without `autoAdjustScrollViewInsets` pushes content behind the nav bar without compensating the ScrollView insets. All three must be present.
12
+
13
+ ## iOS-only — use the `ios:` modifier
14
+
15
+ Large Title properties are iOS-only. On Android they either do nothing or raise compile-time errors. Always scope them with the `ios:` platform block in `config.cjs`, not as defaults that leak to Android.
16
+
17
+ ## Global defaults in `config.cjs`
18
+
19
+ Rather than repeating the three classes on every `Window`, set them once at the Ti Element level so every iOS Window inherits the base behavior:
20
+
21
+ `./purgetss/config.cjs`
22
+ ```js
23
+ module.exports = {
24
+ theme: {
25
+ Window: {
26
+ ios: {
27
+ apply: 'auto-adjust-scroll-view-insets extend-edges-all large-title-enabled'
28
+ }
29
+ }
30
+ }
31
+ };
32
+ ```
33
+
34
+ Generated style in `./purgetss/styles/utilities.tss`:
35
+
36
+ ```tss
37
+ 'Window[platform=ios]': { autoAdjustScrollViewInsets: true, extendEdges: [ Ti.UI.EXTEND_EDGE_ALL ], largeTitleEnabled: true }
38
+ ```
39
+
40
+ Individual windows now only need to override `largeTitleDisplayMode` when they want different collapse behavior (e.g. detail windows).
41
+
42
+ > **Why an `ios:` block and not an inline `ios:` prefix?** `auto-adjust-scroll-view-insets` and `extend-edges-all` are platform-specific classes — they only exist with `[platform=ios]` suffix in `utilities.tss`. The `ios:` block ensures PurgeTSS resolves the platform-suffixed version. See [apply-directive.md](apply-directive.md) → "Platform-Specific Classes".
43
+
44
+ ## NavigationWindow example
45
+
46
+ `./app/views/index.xml`
47
+ ```xml
48
+ <Alloy>
49
+ <NavigationWindow id="navWin">
50
+ <Window title="Home">
51
+ <ScrollView class="vertical content-w-screen content-h-auto">
52
+ <!-- Content starts below the nav bar automatically -->
53
+ </ScrollView>
54
+ </Window>
55
+ </NavigationWindow>
56
+ </Alloy>
57
+ ```
58
+
59
+ The Window inherits `auto-adjust-scroll-view-insets`, `extend-edges-all`, and `large-title-enabled` from the `theme.Window.ios.apply` defaults above.
60
+
61
+ ## TabGroup example
62
+
63
+ On iOS, `TabGroup` wraps each `Tab`'s Window in an **implicit NavigationWindow**. You do not declare the inner `NavigationWindow` yourself — iOS adds it. The three-property pattern applies identically:
64
+
65
+ `./app/views/index.xml`
66
+ ```xml
67
+ <Alloy>
68
+ <TabGroup>
69
+ <Tab title="Home">
70
+ <Window title="Home">
71
+ <ScrollView class="vertical content-w-screen content-h-auto">
72
+ <!-- Each tab gets its own implicit NavigationWindow -->
73
+ </ScrollView>
74
+ </Window>
75
+ </Tab>
76
+ </TabGroup>
77
+ </Alloy>
78
+ ```
79
+
80
+ ## Controlling the collapse behavior: `largeTitleDisplayMode`
81
+
82
+ `largeTitleDisplayMode` controls how the title behaves in the navigation stack:
83
+
84
+ | Mode | Constant | Behavior |
85
+ | --- | --- | --- |
86
+ | Automatic | `Ti.UI.iOS.LARGE_TITLE_DISPLAY_MODE_AUTOMATIC` | Inherits from previous window; collapses on scroll. |
87
+ | Always | `Ti.UI.iOS.LARGE_TITLE_DISPLAY_MODE_ALWAYS` | Title stays large regardless of scroll position. |
88
+ | Never | `Ti.UI.iOS.LARGE_TITLE_DISPLAY_MODE_NEVER` | Always uses the standard (small) title size. |
89
+
90
+ ### Detail windows: use `large-title-display-mode-never`
91
+
92
+ Detail windows typically should not show a large title — it looks oversized for a secondary screen. PurgeTSS ships a utility class for this:
93
+
94
+ ```xml
95
+ <Window class="large-title-display-mode-never" title="Detail">
96
+ <!-- Standard nav bar title, regardless of global largeTitleEnabled default -->
97
+ </Window>
98
+ ```
99
+
100
+ This overrides only the display mode, so the window still benefits from the inherited `autoAdjustScrollViewInsets` and `extendEdges` defaults.
101
+
102
+ ## ScrollView pairing: `content-w-screen content-h-auto`
103
+
104
+ When Large Titles are active, the paired ScrollView needs its content area sized so iOS can shrink/grow the title as the user scrolls. The canonical pattern:
105
+
106
+ ```xml
107
+ <ScrollView class="vertical content-w-screen content-h-auto">
108
+ <!-- children -->
109
+ </ScrollView>
110
+ ```
111
+
112
+ - `content-w-screen` → `contentWidth: Ti.UI.FILL`
113
+ - `content-h-auto` → `contentHeight: Ti.UI.SIZE`
114
+
115
+ Sizing the content height to `Ti.UI.SIZE` is what lets iOS determine whether there is enough content to allow the large title to collapse on scroll.
116
+
117
+ ## Quick reference — class to property map
118
+
119
+ | Class | Property | Value |
120
+ | --- | --- | --- |
121
+ | `auto-adjust-scroll-view-insets` | `autoAdjustScrollViewInsets` | `true` |
122
+ | `extend-edges-all` | `extendEdges` | `[Ti.UI.EXTEND_EDGE_ALL]` |
123
+ | `large-title-enabled` | `largeTitleEnabled` | `true` |
124
+ | `large-title-enabled-false` | `largeTitleEnabled` | `false` |
125
+ | `large-title-display-mode-never` | `largeTitleDisplayMode` | `Ti.UI.iOS.LARGE_TITLE_DISPLAY_MODE_NEVER` |
126
+ | `content-w-screen` | `contentWidth` | `Ti.UI.FILL` |
127
+ | `content-h-auto` | `contentHeight` | `Ti.UI.SIZE` |
128
+
129
+ ## Community-Discovered Patterns
130
+
131
+ ### TabGroup implicit-NavigationWindow wrapping
132
+
133
+ A recurring source of confusion: iOS `TabGroup` already wraps each `Tab` in an implicit `NavigationWindow`. Manually nesting a `NavigationWindow` inside a `Tab` can produce a double nav bar or break `openWindow()` push transitions. Keep the markup flat — `Tab > Window` — and rely on the implicit wrapper.
134
+
135
+ ### Detail windows should opt out, not opt in
136
+
137
+ When `theme.Window.ios.apply` sets `large-title-enabled` as a default, every pushed window inherits it. Apply `large-title-display-mode-never` on detail windows pushed via `openWindow()` so the parent keeps the collapse animation while detail screens render with a standard title. This mirrors Apple's own first-party app conventions (Settings, Mail).
138
+
139
+ ### Cross-reference
140
+
141
+ The three-property pairing (`autoAdjustScrollViewInsets` + `extendEdges` + `largeTitleEnabled`) is also documented as a reusable global-defaults recipe in [apply-directive.md](apply-directive.md) under *Community-Discovered Patterns → Global Window defaults for Large Titles + ScrollView (iOS)*. Prefer that recipe over per-window repetition whenever the whole app uses Large Titles.
@@ -1,52 +1,138 @@
1
1
  # Migration Guide
2
2
 
3
- This guide is based on the PurgeTSS changelog sections in the official `README.md`. It covers the documented upgrade changes for recent versions.
3
+ This guide mirrors the official PurgeTSS changelog (see the project `README.md` / `docs/index.md`). It walks through the upgrade-relevant changes from v7.2.6 through v7.6.0, flags breaking changes, and links each section to the reference files that cover the new surface area in depth.
4
4
 
5
- ## Upgrade to v7.4.0
5
+ Changelog source of truth: [https://github.com/macCesar/purgeTSS](https://github.com/macCesar/purgeTSS).
6
+
7
+ ---
8
+
9
+ ## Upgrade to v7.6.0
10
+
11
+ v7.6.0 introduces three new CLI commands for app-asset generation plus two new `config.cjs` sections. None of the additions are breaking — existing projects continue to work untouched, and the new config sections are auto-injected on first run.
12
+
13
+ ### New CLI commands
14
+
15
+ - **`brand` command** — generates the complete Titanium branding set (launcher icons, adaptive icons, iOS 18+ Dark and Tinted variants, marketplace artwork, optional notification and splash images) from logos auto-discovered in `./purgetss/brand/`. Works on both Alloy and Classic projects.
16
+ - **`images` command** — generates multi-density UI images (Android `res-*` densities plus iPhone `@1x` / `@2x` / `@3x` scales) from sources dropped into `./purgetss/images/`. Subdirectories are preserved, and short-path scope targeting lets you re-process individual files.
17
+ - **`semantic` command** — generates Titanium semantic colors (Light/Dark mode) into `app/assets/semantic.colors.json`. Two dispatch modes:
18
+ - **Tonal palette** (default): one base hex → 11 shades with mirror inversion and auto config mapping.
19
+ - **Single purpose-based color** (`--single`): explicit per-mode hex plus optional alpha; writes both the JSON entry AND a class mapping in `config.cjs` in one shot. Class name is auto-derived by stripping the `Color` suffix (e.g. `surfaceColor` → class `surface`). Smart in-place updates when a single name matches an existing palette shade.
20
+
21
+ ### New `config.cjs` sections
22
+
23
+ - **`brand:` section** — configures padding percentages, background colors, and platform targets for the `brand` command.
24
+ - **`images:` section** — configures scale factors and output density mapping for the `images` command.
25
+
26
+ Percentages can be written as self-documenting strings (e.g. `'15%'`) or plain numbers. Both are accepted. These sections are auto-injected into older `config.cjs` files on the first run of v7.6.0.
27
+
28
+ ### What to review
29
+
30
+ - If you previously generated app icons or multi-density images manually (or with third-party tooling), plan a migration session to replace that workflow with `brand` and `images`.
31
+ - If you maintain a `semantic.colors.json` by hand, back it up before running `semantic` — the command does smart in-place updates, but a backup is cheap insurance.
32
+
33
+ ### Cross-references
34
+
35
+ - [`app-branding.md`](./app-branding.md) — full walkthrough of the `brand` command and the `./purgetss/brand/` convention.
36
+ - [`multi-density-images.md`](./multi-density-images.md) — `images` command, density mapping, and subdirectory behavior.
37
+ - [`semantic-colors.md`](./semantic-colors.md) — palette vs single-color modes, alpha handling, and config mapping.
38
+ - [`cli-commands.md#brand-command`](./cli-commands.md#brand-command)
39
+ - [`cli-commands.md#images-command`](./cli-commands.md#images-command)
40
+ - [`cli-commands.md#semantic-command`](./cli-commands.md#semantic-command)
41
+
42
+ ---
43
+
44
+ ## Upgrade to v7.5.3
45
+
46
+ v7.5.3 is a feature-and-polish release. No breaking changes.
6
47
 
7
- PurgeTSS v7.4.0 includes a bug fix and documentation improvements.
48
+ ### Added
49
+
50
+ - **Appearance module** — a new `Appearance` export for Light/Dark/System mode switching with persistence. Exposed methods: `init()`, `set(mode)`, `get()`, `toggle()`.
51
+ - **Default font family classes** — `font-sans`, `font-serif`, and `font-mono` are generated automatically with platform-appropriate values (system sans, serif, and monospace stacks for iOS and Android).
52
+ - **XML validation** — the pre-validation pass now detects illegal `--` sequences inside XML comments, which previously produced cryptic downstream errors.
53
+
54
+ ### What to review
55
+
56
+ - If you want runtime theme switching, wire up `Appearance.init()` at app boot and use `Appearance.toggle()` or `Appearance.set('dark')` where the UI exposes the control.
57
+ - If you had custom `font-sans` / `font-serif` / `font-mono` classes in `config.cjs`, check for collisions with the new auto-generated ones.
58
+
59
+ ### Cross-references
60
+
61
+ - [`appearance-module.md`](./appearance-module.md) — full `Appearance` API, persistence behavior, and integration patterns.
62
+
63
+ ---
64
+
65
+ ## Upgrade to v7.5.0
66
+
67
+ v7.5.0 adds `extend` support for component defaults and improves how `apply` directives are normalized. It also bumps Font Awesome. No breaking changes.
68
+
69
+ ### Added
70
+
71
+ - **`extend` support for Window, View, and ImageView** — customize component defaults from `theme.extend` in `config.cjs`. Previously only a subset of components supported `extend`.
72
+ - **Shorthand `apply`** — `{ apply: '...' }` is automatically normalized, so the `default:` wrapper is now optional.
73
+ - **Property deduplication** — values pulled in via `apply` now win over static defaults instead of producing duplicate property entries in the generated TSS.
74
+ - **Automatic platform resolution** — classes referenced inside `ios:` / `android:` blocks automatically find their platform-specific version instead of requiring explicit disambiguation.
75
+ - **Font Awesome 7.2.0** bundled.
8
76
 
9
77
  ### Fixed
10
78
 
11
- - `backgroundGradient.colors` serialization now correctly handles arrays of objects in custom rules.
79
+ - `extend.Window` was silently ignored in earlier versions now honored.
80
+ - Duplicate `font` properties in generated output.
81
+ - Array-type properties generating output without `[ ]` notation.
12
82
 
13
- Before the fix, a config such as:
83
+ ### What to review
14
84
 
15
- ```javascript
16
- colors: [
17
- { color: '#132C50', offset: 0 },
18
- { color: '#0A1529', offset: 1 }
19
- ]
20
- ```
85
+ - If you previously worked around the `extend.Window` bug with manual TSS overrides, you can remove those now.
86
+ - If you previously wrote `{ default: { apply: '...' } }`, the shorter `{ apply: '...' }` form is equivalent.
87
+ - Diff your generated `utilities.tss` against the pre-upgrade version: property deduplication and the array-notation fix may produce cleaner output, which is expected.
88
+
89
+ ### Cross-references
21
90
 
22
- could produce broken output in `utilities.tss`.
91
+ - [`customization-deep-dive.md`](./customization-deep-dive.md) `theme.extend` patterns for Window, View, and ImageView defaults.
92
+ - [`apply-directive.md`](./apply-directive.md) — shorthand `apply` syntax and deduplication behavior.
23
93
 
24
- Now it serializes correctly.
94
+ ---
25
95
 
26
- ### What to Review
96
+ ## Upgrade to v7.4.0
27
97
 
28
- - Re-test any custom classes that define `backgroundGradient.colors` with `{ color, offset }` objects.
29
- - Rebuild and inspect `utilities.tss` if you previously worked around this bug manually.
98
+ v7.4.0 is the **Animation module expansion**. Nine new methods bring the Animation module to 15 total.
99
+
100
+ ### Added
101
+
102
+ - **New methods**: `transition`, `pulse`, `sequence`, `swap`, `shake`, `snapTo`, `reorder`, `undraggable`, `detectCollisions`.
103
+ - **New utility classes**: `snap-back`, `snap-center`, `snap-magnet`, `keep-z-index`.
104
+ - **Delta-based drag for transformed views** — drag math now works correctly when the view already has a 2D transform applied.
105
+ - **Position normalization** and **property inheritance** from the Animation object — reduces boilerplate when sequencing multiple animations on the same view.
106
+
107
+ ### What to review
108
+
109
+ - If you previously hand-rolled sequential animations with `Ti.UI.createAnimation` callbacks, consider porting them to `sequence` for readability.
110
+ - If you implemented ad-hoc drag/snap logic, compare it with `snapTo` + `detectCollisions` — the new pipeline handles z-index, collision detection, and snap-back without manual bookkeeping.
111
+
112
+ ### Cross-references
113
+
114
+ - [`animation-system.md`](./animation-system.md) — full Animation module reference including all 15 methods and the snap / drag / collision utilities.
115
+
116
+ ---
30
117
 
31
118
  ## Upgrade to v7.3.x
32
119
 
33
- PurgeTSS v7.3 introduced a file rename and improved error handling.
120
+ v7.3.0 introduced a **breaking file rename** plus XML validation and Classic Titanium compatibility improvements.
34
121
 
35
122
  ### Breaking Changes
36
123
 
37
- - The generated utilities output is now `utilities.tss`.
124
+ - **`tailwind.tss` → `utilities.tss`** — the generated utilities output was renamed to reflect that PurgeTSS is a standalone toolkit, not a Tailwind port.
38
125
  - Generated file: `purgetss/styles/utilities.tss`
39
126
  - Distribution file: `dist/utilities.tss`
40
127
 
41
128
  ### Major Improvements
42
129
 
43
- - XML syntax validation now catches malformed Alloy XML before processing.
44
- - `deviceInfo()` now works in both Alloy and Classic Titanium projects.
45
- - The dependency on `Alloy.isTablet` and `Alloy.isHandheld` was removed.
130
+ - **XML syntax validation** — pre-validation now catches malformed Alloy XML before processing, with line numbers and fix suggestions.
131
+ - **Classic Titanium compatibility** — `deviceInfo()` now works in both Alloy and Classic projects. The dependency on `Alloy.isTablet` and `Alloy.isHandheld` was removed.
46
132
 
47
133
  ### Required Actions
48
134
 
49
- 1. Update any scripts, docs, or project references that still point to the previous output filename.
135
+ 1. Update any scripts, docs, or project references that still point to the previous `tailwind.tss` filename.
50
136
  2. Ensure your environment is running Node.js 20 or higher.
51
137
  3. If you use Font Awesome 7, verify the project after upgrade so PurgeTSS can handle the new `--fa:` properties.
52
138
 
@@ -55,7 +141,7 @@ PurgeTSS v7.3 introduced a file rename and improved error handling.
55
141
  purgetss/styles/utilities.tss
56
142
  ```
57
143
 
58
- ### Recommended Upgrade Command
144
+ ### Recommended upgrade command
59
145
 
60
146
  ```bash
61
147
  npm install -g purgetss@latest
@@ -68,9 +154,60 @@ npm uninstall -g purgetss
68
154
  npm install -g purgetss
69
155
  ```
70
156
 
157
+ ---
158
+
159
+ ## Upgrade to v7.2.7
160
+
161
+ v7.2.7 is a security and maintenance release.
162
+
163
+ ### Added / Updated
164
+
165
+ - **Security fixes** — command injection in `glob`, prototype pollution in `js-yaml`.
166
+ - **Dependency cleanup** — reduces installation size by ~45MB, removed unused packages.
167
+ - **Titanium SDK 13.1.0.GA** — new utility classes for `navBarColor`, `forceBottomPosition`, `multipleWindows`.
168
+
169
+ ### What to review
170
+
171
+ - If you pinned PurgeTSS to a pre-7.2.7 version for reproducibility, plan the bump: the security advisories affect any environment that resolves transitive `glob` or `js-yaml`.
172
+
173
+ ---
174
+
175
+ ## Upgrade to v7.2.6
176
+
177
+ v7.2.6 is a minor refresh release.
178
+
179
+ ### Updated
180
+
181
+ - Font Awesome bumped to version 7.1.0.
182
+ - Simplified flag property names in `utilities.tss`.
183
+
184
+ ---
185
+
186
+ ## Community-Discovered Patterns
187
+
188
+ Issues reported and patched outside the official changelog. These are documented here so users upgrading through multiple versions know to re-test the affected surface area. **Needs confirmation** — the version in which each fix shipped has not been verified against the official changelog at time of writing.
189
+
190
+ ### `backgroundGradient.colors` serialization with arrays of objects
191
+
192
+ Certain versions of PurgeTSS could produce broken output in `utilities.tss` when a custom rule defined `backgroundGradient.colors` as an array of `{ color, offset }` objects, for example:
193
+
194
+ ```javascript
195
+ const colors = [
196
+ { color: '#132C50', offset: 0 },
197
+ { color: '#0A1529', offset: 1 },
198
+ ];
199
+ ```
200
+
201
+ If you previously worked around this by inlining the gradient directly in TSS, re-test after upgrading: current versions serialize the array correctly. The exact version in which this was patched is not called out in the official changelog — treat this as a user-observed fix until confirmed.
202
+
203
+ ---
204
+
71
205
  ## Quick Checklist
72
206
 
73
- - Replace every legacy utilities filename reference with `utilities.tss`.
74
- - Verify Node.js 20+ before upgrading.
207
+ - Replace every legacy `tailwind.tss` reference with `utilities.tss`.
208
+ - Verify Node.js 20+ before upgrading past v7.3.0.
75
209
  - Rebuild after updating `config.cjs` or custom gradient rules.
76
210
  - Re-test any Classic Titanium code that depends on `deviceInfo()`.
211
+ - After v7.5.0: diff generated `utilities.tss` to confirm property deduplication produces the expected output.
212
+ - After v7.5.3: consider wiring `Appearance.init()` at app boot if you want runtime Light/Dark switching.
213
+ - After v7.6.0: run `brand`, `images`, and `semantic` once in a scratch project before pointing them at production assets, so you can preview the output layout.