@maccesar/titools 4.4.0 → 4.4.2
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.
- package/README.md +9 -12
- package/package.json +1 -1
- package/skills/purgetss/SKILL.md +4 -9
- package/skills/ti-api/references/api-core.md +24 -69
- package/skills/ti-api/references/api-data-network.md +18 -63
- package/skills/ti-api/references/api-media.md +15 -49
- package/skills/ti-api/references/api-modules-coremotion-urlsession.md +6 -20
- package/skills/ti-api/references/api-modules-map.md +17 -40
- package/skills/ti-api/references/api-modules-nfc.md +23 -56
- package/skills/ti-api/references/api-ui-android.md +16 -37
- package/skills/ti-api/references/api-ui-extras.md +28 -72
- package/skills/ti-api/references/api-ui-lists.md +14 -35
- package/skills/ti-api/references/api-ui-text-input.md +13 -39
- package/skills/ti-api/references/api-ui-windows-navigation.md +17 -43
- package/skills/ti-api/references/api-xml-global.md +25 -60
- package/skills/ti-expert/SKILL.md +8 -11
- package/skills/ti-expert/references/adaptive-layouts.md +15 -43
- package/skills/ti-expert/references/alloy-builtins.md +1 -4
- package/skills/ti-expert/references/alloy-structure.md +4 -12
- package/skills/ti-expert/references/anti-patterns.md +16 -45
- package/skills/ti-expert/references/code-conventions.md +2 -6
- package/skills/ti-expert/references/controller-patterns.md +1 -3
- package/skills/ti-expert/references/examples.md +3 -10
- package/skills/ti-expert/references/feedback-migration.md +17 -39
- package/skills/ti-expert/references/feedback-surfaces.md +19 -48
- package/skills/ti-expert/references/feedback-widget-contracts.md +31 -69
- package/skills/ti-expert/references/file-type-association.md +265 -0
- package/skills/ti-expert/references/migration-patterns.md +8 -18
- package/skills/ti-expert/references/sharing.md +227 -0
- package/skills/ti-expert/references/theming.md +20 -45
- package/skills/ti-guides/references/coding-best-practices.md +1 -2
- package/skills/ti-guides/references/style-and-conventions.md +1 -2
- package/skills/ti-howtos/references/debugging-profiling.md +1 -2
- package/skills/ti-howtos/references/location-and-maps.md +1 -2
- package/skills/ti-howtos/references/using-modules.md +1 -2
- package/skills/ti-howtos/references/web-content-integration.md +1 -2
- package/skills/ti-howtos/references/webpack-build-pipeline.md +1 -2
- package/skills/ti-ui/references/listviews-and-performance.md +5 -10
- package/skills/ti-ui/references/orientation.md +1 -2
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# Theming and dark mode
|
|
2
2
|
|
|
3
|
-
Choose the styling path from the project, not from personal memory. Semantic
|
|
4
|
-
roles are the shared contract; PurgeTSS or standard Alloy materializes them.
|
|
3
|
+
Choose the styling path from the project, not from personal memory. Semantic roles are the shared contract; PurgeTSS or standard Alloy materializes them.
|
|
5
4
|
|
|
6
5
|
## Contents
|
|
7
6
|
|
|
@@ -19,16 +18,13 @@ roles are the shared contract; PurgeTSS or standard Alloy materializes them.
|
|
|
19
18
|
1. Detect `purgetss/` or `purgetss/config.cjs`.
|
|
20
19
|
2. If detected, invoke the `purgetss` skill before writing any class or style.
|
|
21
20
|
3. If not detected, use standard Alloy TSS and Titanium semantic colors.
|
|
22
|
-
4. Use `Alloy.Globals` for a runtime palette only when the product requires
|
|
23
|
-
custom themes beyond the semantic light/dark/system model.
|
|
21
|
+
4. Use `Alloy.Globals` for a runtime palette only when the product requires custom themes beyond the semantic light/dark/system model.
|
|
24
22
|
|
|
25
|
-
Do not mix these paths accidentally. In particular, never teach a PurgeTSS
|
|
26
|
-
project to maintain the generated `app/styles/app.tss` by hand.
|
|
23
|
+
Do not mix these paths accidentally. In particular, never teach a PurgeTSS project to maintain the generated `app/styles/app.tss` by hand.
|
|
27
24
|
|
|
28
25
|
## Semantic color contract
|
|
29
26
|
|
|
30
|
-
Name colors by purpose rather than appearance. A practical design-system
|
|
31
|
-
contract includes:
|
|
27
|
+
Name colors by purpose rather than appearance. A practical design-system contract includes:
|
|
32
28
|
|
|
33
29
|
- app background and elevated surface;
|
|
34
30
|
- primary and secondary text;
|
|
@@ -62,28 +58,20 @@ Example:
|
|
|
62
58
|
}
|
|
63
59
|
```
|
|
64
60
|
|
|
65
|
-
Titanium resolves a semantic color name when a color-accepting property uses
|
|
66
|
-
that name. Keep component APIs tone-based (`neutral`, `success`, `warning`,
|
|
67
|
-
`error`) and map tones to semantic roles inside the visual layer. Do not pass
|
|
68
|
-
raw brand hex values through business controllers.
|
|
61
|
+
Titanium resolves a semantic color name when a color-accepting property uses that name. Keep component APIs tone-based (`neutral`, `success`, `warning`, `error`) and map tones to semantic roles inside the visual layer. Do not pass raw brand hex values through business controllers.
|
|
69
62
|
|
|
70
63
|
## PurgeTSS projects
|
|
71
64
|
|
|
72
|
-
The `purgetss` skill is the source of truth for supported classes, configuration,
|
|
73
|
-
appearance behavior, and commands. Apply these integration rules:
|
|
65
|
+
The `purgetss` skill is the source of truth for supported classes, configuration, appearance behavior, and commands. Apply these integration rules:
|
|
74
66
|
|
|
75
|
-
- Map semantic color names under `theme.extend.colors` in
|
|
76
|
-
`purgetss/config.cjs`.
|
|
67
|
+
- Map semantic color names under `theme.extend.colors` in `purgetss/config.cjs`.
|
|
77
68
|
- Use verified utility classes in Alloy XML.
|
|
78
69
|
- Configure `options.widgets: true` when Widgets contain utility classes.
|
|
79
70
|
- Prefer `config.cjs` for reusable custom rules.
|
|
80
71
|
- Treat `app/styles/app.tss` as generated output and never edit it.
|
|
81
|
-
- Keep only truly specific properties in Widget/controller TSS when no verified
|
|
82
|
-
|
|
83
|
-
-
|
|
84
|
-
creating a competing mode service.
|
|
85
|
-
- Read the current PurgeTSS references before naming any utility. Similarity to
|
|
86
|
-
Tailwind is not evidence that a class exists.
|
|
72
|
+
- Keep only truly specific properties in Widget/controller TSS when no verified utility exists.
|
|
73
|
+
- Use the PurgeTSS Appearance module for light/dark/system selection instead of creating a competing mode service.
|
|
74
|
+
- Read the current PurgeTSS references before naming any utility. Similarity to Tailwind is not evidence that a class exists.
|
|
87
75
|
|
|
88
76
|
Conceptual mapping only; verify the actual PurgeTSS syntax before use:
|
|
89
77
|
|
|
@@ -102,8 +90,7 @@ module.exports = {
|
|
|
102
90
|
}
|
|
103
91
|
```
|
|
104
92
|
|
|
105
|
-
After generation, inspect the final `app.tss` section for unused or unsupported
|
|
106
|
-
classes. A clean build that still lists a new unsupported class is not complete.
|
|
93
|
+
After generation, inspect the final `app.tss` section for unused or unsupported classes. A clean build that still lists a new unsupported class is not complete.
|
|
107
94
|
|
|
108
95
|
## Standard Alloy projects
|
|
109
96
|
|
|
@@ -133,23 +120,17 @@ Example:
|
|
|
133
120
|
}
|
|
134
121
|
```
|
|
135
122
|
|
|
136
|
-
Do not copy a large utility system into manual TSS. Create only the small set of
|
|
137
|
-
selectors the app actually uses.
|
|
123
|
+
Do not copy a large utility system into manual TSS. Create only the small set of selectors the app actually uses.
|
|
138
124
|
|
|
139
125
|
## Alloy build-time themes
|
|
140
126
|
|
|
141
|
-
Alloy's `app/themes/<name>/` folders can override views, styles, and assets at
|
|
142
|
-
build time. Select a theme through `app/config.json`. This is appropriate for
|
|
143
|
-
separate branded builds or compile-time variants.
|
|
127
|
+
Alloy's `app/themes/<name>/` folders can override views, styles, and assets at build time. Select a theme through `app/config.json`. This is appropriate for separate branded builds or compile-time variants.
|
|
144
128
|
|
|
145
|
-
Do not describe an Alloy build-time theme as runtime light/dark switching.
|
|
146
|
-
Semantic colors are the default for appearance changes while the app runs.
|
|
129
|
+
Do not describe an Alloy build-time theme as runtime light/dark switching. Semantic colors are the default for appearance changes while the app runs.
|
|
147
130
|
|
|
148
131
|
## Runtime custom themes
|
|
149
132
|
|
|
150
|
-
Use a centralized runtime palette or theme service only when semantic
|
|
151
|
-
light/dark/system colors cannot model the requirement, such as multiple user
|
|
152
|
-
selectable brand themes.
|
|
133
|
+
Use a centralized runtime palette or theme service only when semantic light/dark/system colors cannot model the requirement, such as multiple user selectable brand themes.
|
|
153
134
|
|
|
154
135
|
If that exception applies:
|
|
155
136
|
|
|
@@ -157,11 +138,9 @@ If that exception applies:
|
|
|
157
138
|
- expose semantic roles, not control IDs;
|
|
158
139
|
- document how already-created proxies receive updates;
|
|
159
140
|
- remove all listeners in controller cleanup;
|
|
160
|
-
- avoid rebuilding the entire window tree unless the app has measured and
|
|
161
|
-
accepted that tradeoff.
|
|
141
|
+
- avoid rebuilding the entire window tree unless the app has measured and accepted that tradeoff.
|
|
162
142
|
|
|
163
|
-
`Alloy.Globals` is a legacy/advanced interoperability option, not the first
|
|
164
|
-
recommendation for ordinary dark mode.
|
|
143
|
+
`Alloy.Globals` is a legacy/advanced interoperability option, not the first recommendation for ordinary dark mode.
|
|
165
144
|
|
|
166
145
|
## Component rules
|
|
167
146
|
|
|
@@ -169,10 +148,8 @@ recommendation for ordinary dark mode.
|
|
|
169
148
|
- Widgets own anatomy and behavior, not the product palette.
|
|
170
149
|
- Localized strings and business callbacks come from the host.
|
|
171
150
|
- Destructive styling must remain distinguishable in both appearances.
|
|
172
|
-
- Overlays, focus indicators, disabled states, and text must retain usable
|
|
173
|
-
|
|
174
|
-
- Do not create separate light/dark controller branches when a semantic color
|
|
175
|
-
can express the difference.
|
|
151
|
+
- Overlays, focus indicators, disabled states, and text must retain usable contrast in light, dark, and system modes.
|
|
152
|
+
- Do not create separate light/dark controller branches when a semantic color can express the difference.
|
|
176
153
|
|
|
177
154
|
## Verification
|
|
178
155
|
|
|
@@ -185,6 +162,4 @@ For every supported platform and form factor:
|
|
|
185
162
|
5. run PurgeTSS generation when detected and resolve unsupported classes;
|
|
186
163
|
6. compile and build both platform targets before claiming completion.
|
|
187
164
|
|
|
188
|
-
For exact PurgeTSS behavior, load its current `semantic-colors.md` and
|
|
189
|
-
`appearance-module.md` references. For Titanium property availability, verify
|
|
190
|
-
against the current `ti-api` skill.
|
|
165
|
+
For exact PurgeTSS behavior, load its current `semantic-colors.md` and `appearance-module.md` references. For Titanium property availability, verify against the current `ti-api` skill.
|
|
@@ -66,8 +66,7 @@ if (isAndroid) { /* Android path */ } else { /* iOS path */ }
|
|
|
66
66
|
- Avoid extending the `Ti` namespace. Three reasons:
|
|
67
67
|
1. Ti objects are proxies to native OS components — your extensions may conflict with native functionality.
|
|
68
68
|
2. Arrays stored on the namespace may be immutable; objects may be null unexpectedly.
|
|
69
|
-
3. There is no guarantee properties persist across SDK versions.
|
|
70
|
-
Use your own namespace or CommonJS module instead of modifying `Ti`.
|
|
69
|
+
3. There is no guarantee properties persist across SDK versions. Use your own namespace or CommonJS module instead of modifying `Ti`.
|
|
71
70
|
|
|
72
71
|
## 5. App architecture recommendations
|
|
73
72
|
|
|
@@ -46,8 +46,7 @@ else
|
|
|
46
46
|
const fullName = firstName + ' ' + lastName
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
Return statement placement:
|
|
50
|
-
Do not put `return` on its own line followed by an object literal. JavaScript will insert a semicolon automatically and return `undefined`.
|
|
49
|
+
Return statement placement: Do not put `return` on its own line followed by an object literal. JavaScript will insert a semicolon automatically and return `undefined`.
|
|
51
50
|
```javascript
|
|
52
51
|
// Wrong
|
|
53
52
|
return
|
|
@@ -382,8 +382,7 @@ Android Studio (GUI): Tools → Device Manager → Create Device.
|
|
|
382
382
|
|
|
383
383
|
### Modifying emulators
|
|
384
384
|
|
|
385
|
-
Increase disk space:
|
|
386
|
-
Edit `~/.android/avd/<NAME>.avd/config.ini`:
|
|
385
|
+
Increase disk space: Edit `~/.android/avd/<NAME>.avd/config.ini`:
|
|
387
386
|
```
|
|
388
387
|
disk.dataPartition.size=1024m
|
|
389
388
|
```
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
## 1. GPS position tracking
|
|
4
4
|
|
|
5
5
|
### FusedLocationProvider (Android)
|
|
6
|
-
Since TiSDK 7.1.0, Titanium supports `FusedLocationProvider` for significant battery savings.
|
|
7
|
-
Requirement: include the `ti.playservices` module in your project.
|
|
6
|
+
Since TiSDK 7.1.0, Titanium supports `FusedLocationProvider` for significant battery savings. Requirement: include the `ti.playservices` module in your project.
|
|
8
7
|
|
|
9
8
|
### Accuracy configuration
|
|
10
9
|
|
|
@@ -25,8 +25,7 @@ Community modules:
|
|
|
25
25
|
- From Zero To App list: https://fromzerotoapp.com/modules/
|
|
26
26
|
- Curated list of modules maintained by Michael Gangolf
|
|
27
27
|
|
|
28
|
-
Marketplace:
|
|
29
|
-
The original Appcelerator Marketplace is no longer available. Find community modules on GitHub and npm. A curated list is at https://fromzerotoapp.com/modules/.
|
|
28
|
+
Marketplace: The original Appcelerator Marketplace is no longer available. Find community modules on GitHub and npm. A curated list is at https://fromzerotoapp.com/modules/.
|
|
30
29
|
|
|
31
30
|
### Pre-installed modules
|
|
32
31
|
Some modules ship with the SDK and do not need separate installation: `ti.map`, `ti.identity`, `ti.webdialog`, `ti.applesignin`.
|
|
@@ -53,8 +53,7 @@ Example:
|
|
|
53
53
|
When you `import { func } from '@/utils'`, Webpack picks the correct version for the build target.
|
|
54
54
|
|
|
55
55
|
## 5. Diagnostic web UI
|
|
56
|
-
Webpack includes a web interface to analyze builds and asset sizes.
|
|
57
|
-
Default URL: `http://localhost:1732/webpack/latest/web`
|
|
56
|
+
Webpack includes a web interface to analyze builds and asset sizes. Default URL: `http://localhost:1732/webpack/latest/web`
|
|
58
57
|
|
|
59
58
|
## 6. Project plugins
|
|
60
59
|
Webpack support is powered by plugins chosen based on project type:
|
|
@@ -202,8 +202,7 @@ The following views can be used as child elements in custom templates: ActivityI
|
|
|
202
202
|
|
|
203
203
|
### Binding syntax
|
|
204
204
|
|
|
205
|
-
XML (Alloy): `bindId:property="value"`
|
|
206
|
-
JavaScript: `{ bindId: { property: value } }`
|
|
205
|
+
XML (Alloy): `bindId:property="value"` JavaScript: `{ bindId: { property: value } }`
|
|
207
206
|
|
|
208
207
|
### Programmatic binding with custom templates
|
|
209
208
|
|
|
@@ -741,14 +740,10 @@ $.myList.cacheSize = 3; // Default
|
|
|
741
740
|
|
|
742
741
|
### Common issues
|
|
743
742
|
|
|
744
|
-
Problem: Jerky scrolling
|
|
745
|
-
Solution: Remove `Ti.UI.SIZE` from templates
|
|
743
|
+
Problem: Jerky scrolling Solution: Remove `Ti.UI.SIZE` from templates
|
|
746
744
|
|
|
747
|
-
Problem: Data changes not visible
|
|
748
|
-
Solution: Use `updateItemAt()` instead of modifying views
|
|
745
|
+
Problem: Data changes not visible Solution: Use `updateItemAt()` instead of modifying views
|
|
749
746
|
|
|
750
|
-
Problem: Event not firing on template element
|
|
751
|
-
Solution: Check `bindId` in event handler
|
|
747
|
+
Problem: Event not firing on template element Solution: Check `bindId` in event handler
|
|
752
748
|
|
|
753
|
-
Problem: Wrong item updated
|
|
754
|
-
Solution: Use `e.section.getItemAt(e.itemIndex)` not a global reference
|
|
749
|
+
Problem: Wrong item updated Solution: Use `e.section.getItemAt(e.itemIndex)` not a global reference
|
|
@@ -141,8 +141,7 @@ Ti.Gesture.addEventListener('orientationchange', (e) => {
|
|
|
141
141
|
});
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
-
Anti-pattern warning: Do not use `orientationchange` listeners to force an orientation. It causes the wrong orientation to flash, repeated firing, and bad behavior. Use `tiapp.xml` or window `orientationModes`.
|
|
145
|
-
...
|
|
144
|
+
Anti-pattern warning: Do not use `orientationchange` listeners to force an orientation. It causes the wrong orientation to flash, repeated firing, and bad behavior. Use `tiapp.xml` or window `orientationModes`. ...
|
|
146
145
|
### Window orientation events
|
|
147
146
|
|
|
148
147
|
```javascript
|