@willwade/aac-processors 0.0.6 → 0.0.8
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 +2 -40
- package/dist/analytics/history.d.ts +57 -0
- package/dist/analytics/history.js +72 -0
- package/dist/core/analyze.d.ts +10 -0
- package/dist/core/analyze.js +10 -0
- package/dist/core/stringCasing.d.ts +11 -0
- package/dist/core/stringCasing.js +11 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -0
- package/dist/processors/dotProcessor.js +31 -12
- package/dist/processors/gridset/colorUtils.d.ts +69 -0
- package/dist/processors/gridset/colorUtils.js +331 -0
- package/dist/processors/gridset/helpers.d.ts +125 -0
- package/dist/processors/gridset/helpers.js +354 -0
- package/dist/processors/gridset/styleHelpers.d.ts +3 -4
- package/dist/processors/gridset/styleHelpers.js +10 -44
- package/dist/processors/index.d.ts +6 -4
- package/dist/processors/index.js +51 -3
- package/dist/processors/obfProcessor.js +10 -2
- package/dist/processors/snap/helpers.d.ts +85 -0
- package/dist/processors/snap/helpers.js +259 -2
- package/dist/processors/snapProcessor.js +27 -5
- package/dist/processors/touchchat/helpers.d.ts +12 -0
- package/dist/processors/touchchat/helpers.js +12 -2
- package/dist/utils/dotnetTicks.d.ts +13 -0
- package/dist/utils/dotnetTicks.js +21 -0
- package/package.json +8 -6
- package/docs/.keep +0 -1
- package/docs/ApplePanels.md +0 -309
- package/docs/Grid3-Styling-Guide.md +0 -287
- package/docs/Grid3-XML-Format.md +0 -1788
- package/docs/TobiiDynavox-Snap-Details.md +0 -394
- package/docs/asterics-Grid-fileformat-details.md +0 -443
- package/docs/obf_.obz Open Board File Formats.md +0 -432
- package/docs/touchchat.md +0 -520
package/docs/ApplePanels.md
DELETED
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
## Apple Panels
|
|
2
|
-
|
|
3
|
-
This is not exactly a aac tool. but can be used as open
|
|
4
|
-
|
|
5
|
-
File format:
|
|
6
|
-
|
|
7
|
-
in a folder called '*.ascconfig'
|
|
8
|
-
|
|
9
|
-
we have Contents/
|
|
10
|
-
|
|
11
|
-
in this folder we have a file called 'Info.plist'
|
|
12
|
-
|
|
13
|
-
```xml
|
|
14
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
15
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
16
|
-
<plist version="1.0">
|
|
17
|
-
<dict>
|
|
18
|
-
<key>ASCConfigurationDisplayName</key>
|
|
19
|
-
<string>Default Panels</string>
|
|
20
|
-
<key>ASCConfigurationIdentifier</key>
|
|
21
|
-
<string>49F8121E-736B-4FC2-BEA8-209C3EF54ED9</string>
|
|
22
|
-
<key>ASCConfigurationProductSupportType</key>
|
|
23
|
-
<string>VirtualKeyboard</string>
|
|
24
|
-
<key>ASCConfigurationVersion</key>
|
|
25
|
-
<string>7.1</string>
|
|
26
|
-
<key>CFBundleDevelopmentRegion</key>
|
|
27
|
-
<string>en</string>
|
|
28
|
-
<key>CFBundleIdentifier</key>
|
|
29
|
-
<string>com.apple.AssistiveControl.panel.newDoc.defs</string>
|
|
30
|
-
<key>CFBundleName</key>
|
|
31
|
-
<string>Assistive Control Panels</string>
|
|
32
|
-
<key>CFBundleShortVersionString</key>
|
|
33
|
-
<string>2.0</string>
|
|
34
|
-
<key>CFBundleVersion</key>
|
|
35
|
-
<string>383</string>
|
|
36
|
-
<key>NSHumanReadableCopyright</key>
|
|
37
|
-
<string>Copyright © 2016-2024 Apple Inc. All Rights Reserved.</string>
|
|
38
|
-
</dict>
|
|
39
|
-
</plist>
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
then Resources/ (so Contents/Resources/)
|
|
43
|
-
We have 'AssetIndex.plist'
|
|
44
|
-
|
|
45
|
-
```xml
|
|
46
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
47
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
48
|
-
<plist version="1.0">
|
|
49
|
-
<dict/>
|
|
50
|
-
</plist>
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
and then PanelDefinitions.plist
|
|
54
|
-
|
|
55
|
-
``xml
|
|
56
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
57
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
58
|
-
<plist version="1.0">
|
|
59
|
-
<dict>
|
|
60
|
-
<key>Panels</key>
|
|
61
|
-
<dict>
|
|
62
|
-
<key>USER.82FC8D2C-6991-41E9-B534-78E52F101AC7</key>
|
|
63
|
-
<dict>
|
|
64
|
-
<key>DisplayOrder</key>
|
|
65
|
-
<integer>1</integer>
|
|
66
|
-
<key>GlidingLensSize</key>
|
|
67
|
-
<integer>5</integer>
|
|
68
|
-
<key>HasTransientPosition</key>
|
|
69
|
-
<false/>
|
|
70
|
-
<key>HideHome</key>
|
|
71
|
-
<false/>
|
|
72
|
-
<key>HideMinimize</key>
|
|
73
|
-
<false/>
|
|
74
|
-
<key>HidePanelAdjustments</key>
|
|
75
|
-
<false/>
|
|
76
|
-
<key>HideSwitchDock</key>
|
|
77
|
-
<false/>
|
|
78
|
-
<key>HideSwitchDockContextualButtons</key>
|
|
79
|
-
<false/>
|
|
80
|
-
<key>HideTitlebar</key>
|
|
81
|
-
<false/>
|
|
82
|
-
<key>ID</key>
|
|
83
|
-
<string>USER.82FC8D2C-6991-41E9-B534-78E52F101AC7</string>
|
|
84
|
-
<key>Name</key>
|
|
85
|
-
<string>New Panel</string>
|
|
86
|
-
<key>PanelObjects</key>
|
|
87
|
-
<array>
|
|
88
|
-
<dict>
|
|
89
|
-
<key>Actions</key>
|
|
90
|
-
<array>
|
|
91
|
-
<dict>
|
|
92
|
-
<key>ActionParam</key>
|
|
93
|
-
<dict>
|
|
94
|
-
<key>CharString</key>
|
|
95
|
-
<string>Enter this Text</string>
|
|
96
|
-
<key>isStickyKey</key>
|
|
97
|
-
<false/>
|
|
98
|
-
</dict>
|
|
99
|
-
<key>ActionRecordedOffset</key>
|
|
100
|
-
<real>0.0</real>
|
|
101
|
-
<key>ActionType</key>
|
|
102
|
-
<string>ActionPressKeyCharSequence</string>
|
|
103
|
-
<key>ID</key>
|
|
104
|
-
<string>Action.A502D835-D3B7-4253-80A3-97FE4B433EBE</string>
|
|
105
|
-
</dict>
|
|
106
|
-
</array>
|
|
107
|
-
<key>ButtonType</key>
|
|
108
|
-
<integer>0</integer>
|
|
109
|
-
<key>DisplayColor</key>
|
|
110
|
-
<string>0.041 0.375 0.998 1.000</string>
|
|
111
|
-
<key>DisplayImageResourceIsTemplate</key>
|
|
112
|
-
<false/>
|
|
113
|
-
<key>DisplayImageWeight</key>
|
|
114
|
-
<string>FontWeightRegular</string>
|
|
115
|
-
<key>DisplayText</key>
|
|
116
|
-
<string>enter text button</string>
|
|
117
|
-
<key>FontSize</key>
|
|
118
|
-
<real>12</real>
|
|
119
|
-
<key>ID</key>
|
|
120
|
-
<string>Button.186CD086-698B-496F-8496-1326D141833C</string>
|
|
121
|
-
<key>PanelObjectType</key>
|
|
122
|
-
<string>Button</string>
|
|
123
|
-
<key>Rect</key>
|
|
124
|
-
<string>{{0, 0}, {100, 25}}</string>
|
|
125
|
-
</dict>
|
|
126
|
-
<dict>
|
|
127
|
-
<key>Actions</key>
|
|
128
|
-
<array>
|
|
129
|
-
<dict>
|
|
130
|
-
<key>ActionParam</key>
|
|
131
|
-
<dict>
|
|
132
|
-
<key>PanelID</key>
|
|
133
|
-
<string>ACSH.homePanel.primary.dwell</string>
|
|
134
|
-
</dict>
|
|
135
|
-
<key>ActionRecordedOffset</key>
|
|
136
|
-
<real>0.0</real>
|
|
137
|
-
<key>ActionType</key>
|
|
138
|
-
<string>ActionOpenPanel</string>
|
|
139
|
-
<key>ID</key>
|
|
140
|
-
<string>Action.6C2E1080-B39F-491A-8F8A-F60460A35732</string>
|
|
141
|
-
</dict>
|
|
142
|
-
</array>
|
|
143
|
-
<key>ButtonType</key>
|
|
144
|
-
<integer>0</integer>
|
|
145
|
-
<key>DisplayColor</key>
|
|
146
|
-
<string>0.161 0.781 0.197 1.000</string>
|
|
147
|
-
<key>DisplayImageResourceIsTemplate</key>
|
|
148
|
-
<false/>
|
|
149
|
-
<key>DisplayImageWeight</key>
|
|
150
|
-
<string>FontWeightRegular</string>
|
|
151
|
-
<key>DisplayText</key>
|
|
152
|
-
<string>nav button</string>
|
|
153
|
-
<key>FontSize</key>
|
|
154
|
-
<real>12</real>
|
|
155
|
-
<key>ID</key>
|
|
156
|
-
<string>Button.8CD3879D-A328-47FB-BB7E-BB0E1973AFE8</string>
|
|
157
|
-
<key>PanelObjectType</key>
|
|
158
|
-
<string>Button</string>
|
|
159
|
-
<key>Rect</key>
|
|
160
|
-
<string>{{105, 0}, {100, 25}}</string>
|
|
161
|
-
</dict>
|
|
162
|
-
<dict>
|
|
163
|
-
<key>ButtonType</key>
|
|
164
|
-
<integer>0</integer>
|
|
165
|
-
<key>DisplayImageResource</key>
|
|
166
|
-
<string>DoubleClick</string>
|
|
167
|
-
<key>DisplayImageResourceIsTemplate</key>
|
|
168
|
-
<false/>
|
|
169
|
-
<key>DisplayImageWeight</key>
|
|
170
|
-
<string>FontWeightRegular</string>
|
|
171
|
-
<key>DisplayText</key>
|
|
172
|
-
<string>button with image</string>
|
|
173
|
-
<key>FontSize</key>
|
|
174
|
-
<real>12</real>
|
|
175
|
-
<key>ID</key>
|
|
176
|
-
<string>Button.36BCE679-1DF3-422F-80BB-F37F2E8527F2</string>
|
|
177
|
-
<key>PanelObjectType</key>
|
|
178
|
-
<string>Button</string>
|
|
179
|
-
<key>Rect</key>
|
|
180
|
-
<string>{{215, 0}, {100, 25}}</string>
|
|
181
|
-
</dict>
|
|
182
|
-
<dict>
|
|
183
|
-
<key>Actions</key>
|
|
184
|
-
<array>
|
|
185
|
-
<dict>
|
|
186
|
-
<key>ActionRecordedOffset</key>
|
|
187
|
-
<real>0.0</real>
|
|
188
|
-
</dict>
|
|
189
|
-
</array>
|
|
190
|
-
<key>ButtonType</key>
|
|
191
|
-
<integer>0</integer>
|
|
192
|
-
<key>DisplayImageResourceIsTemplate</key>
|
|
193
|
-
<false/>
|
|
194
|
-
<key>DisplayImageWeight</key>
|
|
195
|
-
<string>FontWeightRegular</string>
|
|
196
|
-
<key>DisplayText</key>
|
|
197
|
-
<string>Current Text</string>
|
|
198
|
-
<key>FontSize</key>
|
|
199
|
-
<real>12</real>
|
|
200
|
-
<key>ID</key>
|
|
201
|
-
<string>Button.39446632-CBCB-4D6D-945A-8F413DB611FA</string>
|
|
202
|
-
<key>LocalizedDisplayText</key>
|
|
203
|
-
<string>defaultButton.hoverText</string>
|
|
204
|
-
<key>PanelObjectType</key>
|
|
205
|
-
<string>Button</string>
|
|
206
|
-
<key>Rect</key>
|
|
207
|
-
<string>{{325, 0}, {100, 25}}</string>
|
|
208
|
-
</dict>
|
|
209
|
-
<dict>
|
|
210
|
-
<key>ButtonType</key>
|
|
211
|
-
<integer>0</integer>
|
|
212
|
-
<key>DisplayImageResourceIsTemplate</key>
|
|
213
|
-
<false/>
|
|
214
|
-
<key>DisplayImageWeight</key>
|
|
215
|
-
<string>FontWeightRegular</string>
|
|
216
|
-
<key>DisplayText</key>
|
|
217
|
-
<string>untitled</string>
|
|
218
|
-
<key>FontSize</key>
|
|
219
|
-
<real>12</real>
|
|
220
|
-
<key>ID</key>
|
|
221
|
-
<string>Button.711EC127-B802-49DD-AC6A-2996D8DBCADF</string>
|
|
222
|
-
<key>PanelObjectType</key>
|
|
223
|
-
<string>Button</string>
|
|
224
|
-
<key>Rect</key>
|
|
225
|
-
<string>{{0, 30}, {100, 25}}</string>
|
|
226
|
-
</dict>
|
|
227
|
-
<dict>
|
|
228
|
-
<key>ButtonType</key>
|
|
229
|
-
<integer>0</integer>
|
|
230
|
-
<key>DisplayImageResourceIsTemplate</key>
|
|
231
|
-
<false/>
|
|
232
|
-
<key>DisplayImageWeight</key>
|
|
233
|
-
<string>FontWeightRegular</string>
|
|
234
|
-
<key>DisplayText</key>
|
|
235
|
-
<string>untitled</string>
|
|
236
|
-
<key>FontSize</key>
|
|
237
|
-
<real>12</real>
|
|
238
|
-
<key>ID</key>
|
|
239
|
-
<string>Button.52D329DC-F607-4C62-9598-2C5B9F14D9B7</string>
|
|
240
|
-
<key>PanelObjectType</key>
|
|
241
|
-
<string>Button</string>
|
|
242
|
-
<key>Rect</key>
|
|
243
|
-
<string>{{105, 30}, {100, 25}}</string>
|
|
244
|
-
</dict>
|
|
245
|
-
<dict>
|
|
246
|
-
<key>ButtonType</key>
|
|
247
|
-
<integer>0</integer>
|
|
248
|
-
<key>DisplayImageResourceIsTemplate</key>
|
|
249
|
-
<false/>
|
|
250
|
-
<key>DisplayImageWeight</key>
|
|
251
|
-
<string>FontWeightRegular</string>
|
|
252
|
-
<key>DisplayText</key>
|
|
253
|
-
<string>untitled</string>
|
|
254
|
-
<key>FontSize</key>
|
|
255
|
-
<real>12</real>
|
|
256
|
-
<key>ID</key>
|
|
257
|
-
<string>Button.E48FC5B5-D13C-4776-A7FB-9E8BDBAF1988</string>
|
|
258
|
-
<key>PanelObjectType</key>
|
|
259
|
-
<string>Button</string>
|
|
260
|
-
<key>Rect</key>
|
|
261
|
-
<string>{{215, 30}, {100, 25}}</string>
|
|
262
|
-
</dict>
|
|
263
|
-
<dict>
|
|
264
|
-
<key>ButtonType</key>
|
|
265
|
-
<integer>0</integer>
|
|
266
|
-
<key>DisplayImageResourceIsTemplate</key>
|
|
267
|
-
<false/>
|
|
268
|
-
<key>DisplayImageWeight</key>
|
|
269
|
-
<string>FontWeightRegular</string>
|
|
270
|
-
<key>DisplayText</key>
|
|
271
|
-
<string>untitled</string>
|
|
272
|
-
<key>FontSize</key>
|
|
273
|
-
<real>12</real>
|
|
274
|
-
<key>ID</key>
|
|
275
|
-
<string>Button.DD4A146E-35FA-4CFE-81F7-C01AB245C955</string>
|
|
276
|
-
<key>PanelObjectType</key>
|
|
277
|
-
<string>Button</string>
|
|
278
|
-
<key>Rect</key>
|
|
279
|
-
<string>{{325, 30}, {100, 25}}</string>
|
|
280
|
-
</dict>
|
|
281
|
-
</array>
|
|
282
|
-
<key>ProductSupportType</key>
|
|
283
|
-
<string>All</string>
|
|
284
|
-
<key>Rect</key>
|
|
285
|
-
<string>{{15, 75}, {425, 55}}</string>
|
|
286
|
-
<key>ScanStyle</key>
|
|
287
|
-
<integer>0</integer>
|
|
288
|
-
<key>ShowPanelLocationString</key>
|
|
289
|
-
<string>CustomPanelList</string>
|
|
290
|
-
<key>UsesPinnedResizing</key>
|
|
291
|
-
<false/>
|
|
292
|
-
</dict>
|
|
293
|
-
</dict>
|
|
294
|
-
<key>ToolbarOrdering</key>
|
|
295
|
-
<dict>
|
|
296
|
-
<key>ToolbarIdentifiersAfterBasePanel</key>
|
|
297
|
-
<array/>
|
|
298
|
-
<key>ToolbarIdentifiersPriorToBasePanel</key>
|
|
299
|
-
<array>
|
|
300
|
-
<string>ACSH.systemPanel.dynamic.bestDwellActions</string>
|
|
301
|
-
<string>ACSH.systemPanel.dynamic.hoverText</string>
|
|
302
|
-
<string>ACSH.systemPanel.dynamic.bestSuggestions</string>
|
|
303
|
-
<string>ACSH.systemPanel.dynamic.bestFunctionKeys</string>
|
|
304
|
-
</array>
|
|
305
|
-
</dict>
|
|
306
|
-
</dict>
|
|
307
|
-
</plist>
|
|
308
|
-
|
|
309
|
-
```
|
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
# Grid3 Styling Guide
|
|
2
|
-
|
|
3
|
-
This guide explains how to work with Grid3 styles using the AACProcessors library.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
Grid3 uses a sophisticated styling system with:
|
|
8
|
-
- **Default styles** for common UI elements
|
|
9
|
-
- **Category styles** for organizing content by semantic meaning
|
|
10
|
-
- **Inline style overrides** for cell-specific customization
|
|
11
|
-
- **Style inheritance** through `BasedOnStyle` references
|
|
12
|
-
|
|
13
|
-
## Default Styles
|
|
14
|
-
|
|
15
|
-
The library provides built-in default styles for common use cases:
|
|
16
|
-
|
|
17
|
-
### Available Default Styles
|
|
18
|
-
|
|
19
|
-
| Style Name | Purpose | Background | Text Color |
|
|
20
|
-
|-----------|---------|-----------|-----------|
|
|
21
|
-
| `Default` | General purpose cells | Light blue (#E2EDF8) | Black |
|
|
22
|
-
| `Workspace` | Message/chat area | White (#FFFFFF) | Black |
|
|
23
|
-
| `Auto content` | Wordlists, predictions | Light blue (#E8F4F8) | Black |
|
|
24
|
-
| `Vocab cell` | Vocabulary cells | Light blue (#E8F4F8) | Black |
|
|
25
|
-
| `Keyboard key` | On-screen keyboard | Light gray (#F0F0F0) | Black |
|
|
26
|
-
|
|
27
|
-
### Category Styles
|
|
28
|
-
|
|
29
|
-
Category styles are used for organizing content by semantic meaning:
|
|
30
|
-
|
|
31
|
-
| Style Name | Color | Use Case |
|
|
32
|
-
|-----------|-------|----------|
|
|
33
|
-
| `Actions category style` | Blue (#4472C4) | Action verbs, commands |
|
|
34
|
-
| `People category style` | Orange (#ED7D31) | Names, people |
|
|
35
|
-
| `Places category style` | Gray (#A5A5A5) | Locations, places |
|
|
36
|
-
| `Descriptive category style` | Green (#70AD47) | Adjectives, descriptors |
|
|
37
|
-
| `Social category style` | Gold (#FFC000) | Social phrases, greetings |
|
|
38
|
-
| `Questions category style` | Light blue (#5B9BD5) | Questions, interrogatives |
|
|
39
|
-
| `Little words category style` | Brown (#C55A11) | Function words, particles |
|
|
40
|
-
|
|
41
|
-
## Using Styles in Code
|
|
42
|
-
|
|
43
|
-
### Import Style Helpers
|
|
44
|
-
|
|
45
|
-
```typescript
|
|
46
|
-
import {
|
|
47
|
-
DEFAULT_GRID3_STYLES,
|
|
48
|
-
CATEGORY_STYLES,
|
|
49
|
-
createDefaultStylesXml,
|
|
50
|
-
createCategoryStyle,
|
|
51
|
-
ensureAlphaChannel,
|
|
52
|
-
} from 'aac-processors';
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### Access Predefined Styles
|
|
56
|
-
|
|
57
|
-
```typescript
|
|
58
|
-
// Get a specific default style
|
|
59
|
-
const defaultStyle = DEFAULT_GRID3_STYLES['Default'];
|
|
60
|
-
console.log(defaultStyle.BackColour); // #E2EDF8FF
|
|
61
|
-
|
|
62
|
-
// Get a category style
|
|
63
|
-
const actionStyle = CATEGORY_STYLES['Actions category style'];
|
|
64
|
-
console.log(actionStyle.BackColour); // #4472C4FF
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### Create Custom Category Styles
|
|
68
|
-
|
|
69
|
-
```typescript
|
|
70
|
-
// Create a custom category style with automatic border darkening
|
|
71
|
-
const customStyle = createCategoryStyle(
|
|
72
|
-
'My Category',
|
|
73
|
-
'#FF6B6B', // Background color
|
|
74
|
-
'#FFFFFF' // Font color (optional, defaults to white)
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
// Result:
|
|
78
|
-
// {
|
|
79
|
-
// BackColour: '#FF6B6BFF',
|
|
80
|
-
// TileColour: '#FF6B6BFF',
|
|
81
|
-
// BorderColour: '#CB5555FF', // Automatically darkened
|
|
82
|
-
// FontColour: '#FFFFFFFF',
|
|
83
|
-
// FontName: 'Arial',
|
|
84
|
-
// FontSize: '16'
|
|
85
|
-
// }
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### Generate Default Styles XML
|
|
89
|
-
|
|
90
|
-
```typescript
|
|
91
|
-
// Generate Settings0/styles.xml with all default and category styles
|
|
92
|
-
const stylesXml = createDefaultStylesXml(true);
|
|
93
|
-
|
|
94
|
-
// Or just default styles without categories
|
|
95
|
-
const basicStylesXml = createDefaultStylesXml(false);
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### Ensure Color Has Alpha Channel
|
|
99
|
-
|
|
100
|
-
Grid3 requires colors in 8-digit ARGB format (#AARRGGBBFF):
|
|
101
|
-
|
|
102
|
-
```typescript
|
|
103
|
-
import { ensureAlphaChannel } from 'aac-processors';
|
|
104
|
-
|
|
105
|
-
ensureAlphaChannel('#FF0000'); // Returns: #FF0000FF
|
|
106
|
-
ensureAlphaChannel('#F00'); // Returns: #FF0000FF
|
|
107
|
-
ensureAlphaChannel('#FF0000FF'); // Returns: #FF0000FF (unchanged)
|
|
108
|
-
ensureAlphaChannel(undefined); // Returns: #FFFFFFFF (white)
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
## Applying Styles to Cells
|
|
112
|
-
|
|
113
|
-
### Using BasedOnStyle Reference
|
|
114
|
-
|
|
115
|
-
In Grid3 XML, cells reference styles by name:
|
|
116
|
-
|
|
117
|
-
```xml
|
|
118
|
-
<Cell X="0" Y="0">
|
|
119
|
-
<Content>
|
|
120
|
-
<CaptionAndImage>
|
|
121
|
-
<Caption>Hello</Caption>
|
|
122
|
-
</CaptionAndImage>
|
|
123
|
-
<Style>
|
|
124
|
-
<BasedOnStyle>Actions category style</BasedOnStyle>
|
|
125
|
-
</Style>
|
|
126
|
-
</Content>
|
|
127
|
-
</Cell>
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
### Inline Style Overrides
|
|
131
|
-
|
|
132
|
-
You can override specific properties while keeping the base style:
|
|
133
|
-
|
|
134
|
-
```xml
|
|
135
|
-
<Cell X="1" Y="0">
|
|
136
|
-
<Content>
|
|
137
|
-
<CaptionAndImage>
|
|
138
|
-
<Caption>Custom</Caption>
|
|
139
|
-
</CaptionAndImage>
|
|
140
|
-
<Style>
|
|
141
|
-
<BasedOnStyle>Default</BasedOnStyle>
|
|
142
|
-
<BackColour>#FF0000FF</BackColour> <!-- Override background -->
|
|
143
|
-
<FontSize>20</FontSize> <!-- Override font size -->
|
|
144
|
-
</Style>
|
|
145
|
-
</Content>
|
|
146
|
-
</Cell>
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
## Color Format
|
|
150
|
-
|
|
151
|
-
Grid3 uses 8-digit ARGB hexadecimal format: `#AARRGGBBFF`
|
|
152
|
-
|
|
153
|
-
- **AA**: Alpha channel (FF = fully opaque, 00 = fully transparent)
|
|
154
|
-
- **RR**: Red component (00-FF)
|
|
155
|
-
- **GG**: Green component (00-FF)
|
|
156
|
-
- **BB**: Blue component (00-FF)
|
|
157
|
-
- **FF**: Always FF for Grid3 (fully opaque)
|
|
158
|
-
|
|
159
|
-
### Examples
|
|
160
|
-
|
|
161
|
-
| Color | Hex Code | Description |
|
|
162
|
-
|-------|----------|-------------|
|
|
163
|
-
| White | #FFFFFFFF | Fully opaque white |
|
|
164
|
-
| Black | #000000FF | Fully opaque black |
|
|
165
|
-
| Red | #FF0000FF | Fully opaque red |
|
|
166
|
-
| Blue | #0000FFFF | Fully opaque blue |
|
|
167
|
-
| Green | #00FF00FF | Fully opaque green |
|
|
168
|
-
|
|
169
|
-
## Style Inheritance
|
|
170
|
-
|
|
171
|
-
Grid3 uses a cascading style system:
|
|
172
|
-
|
|
173
|
-
1. **Theme** provides base properties (Modern, Kids/Bubble, Flat/Blocky, Explorer)
|
|
174
|
-
2. **Built-in style** defines category defaults
|
|
175
|
-
3. **Cell-specific overrides** apply on top
|
|
176
|
-
|
|
177
|
-
```xml
|
|
178
|
-
<!-- Example: Override just the background color -->
|
|
179
|
-
<Style>
|
|
180
|
-
<BasedOnStyle>Actions category style</BasedOnStyle>
|
|
181
|
-
<BackColour>#FF0000FF</BackColour> <!-- Override just this property -->
|
|
182
|
-
</Style>
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
## Creating Gridsets with Styles
|
|
186
|
-
|
|
187
|
-
### Using GridsetProcessor
|
|
188
|
-
|
|
189
|
-
```typescript
|
|
190
|
-
import { GridsetProcessor, AACTree, AACPage, AACButton } from 'aac-processors';
|
|
191
|
-
|
|
192
|
-
const processor = new GridsetProcessor();
|
|
193
|
-
const tree = new AACTree();
|
|
194
|
-
|
|
195
|
-
// Create a page with styling
|
|
196
|
-
const page = new AACPage({
|
|
197
|
-
id: 'main-page',
|
|
198
|
-
name: 'Main Board',
|
|
199
|
-
grid: [],
|
|
200
|
-
buttons: [],
|
|
201
|
-
parentId: null,
|
|
202
|
-
style: {
|
|
203
|
-
backgroundColor: '#f0f8ff',
|
|
204
|
-
fontFamily: 'Arial',
|
|
205
|
-
fontSize: 16,
|
|
206
|
-
},
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
// Create styled buttons
|
|
210
|
-
const button = new AACButton({
|
|
211
|
-
id: 'btn-1',
|
|
212
|
-
label: 'Hello',
|
|
213
|
-
message: 'Hello, how are you?',
|
|
214
|
-
style: {
|
|
215
|
-
backgroundColor: '#4472C4', // Blue (Actions category)
|
|
216
|
-
fontColor: '#FFFFFF',
|
|
217
|
-
fontSize: 18,
|
|
218
|
-
fontFamily: 'Arial',
|
|
219
|
-
},
|
|
220
|
-
});
|
|
221
|
-
|
|
222
|
-
page.addButton(button);
|
|
223
|
-
tree.addPage(page);
|
|
224
|
-
|
|
225
|
-
// Save with styles
|
|
226
|
-
processor.saveFromTree(tree, 'output.gridset');
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
### Using Grid-Generator
|
|
230
|
-
|
|
231
|
-
```typescript
|
|
232
|
-
import { generateGridset } from '@willwade/grid-generator';
|
|
233
|
-
|
|
234
|
-
const template = {
|
|
235
|
-
aacsystem: 'Grid3',
|
|
236
|
-
homeGrid: {
|
|
237
|
-
enabled: true,
|
|
238
|
-
name: 'Home',
|
|
239
|
-
title: 'Categories',
|
|
240
|
-
},
|
|
241
|
-
wordlists: [
|
|
242
|
-
{
|
|
243
|
-
name: 'Greetings',
|
|
244
|
-
items: ['Hello', 'Hi', 'Hey'],
|
|
245
|
-
partOfSpeech: 'Interjection',
|
|
246
|
-
},
|
|
247
|
-
],
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
const gridset = generateGridset(template);
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
## Best Practices
|
|
254
|
-
|
|
255
|
-
1. **Use category styles** for semantic organization - helps with accessibility and consistency
|
|
256
|
-
2. **Maintain contrast** - ensure text color has sufficient contrast with background
|
|
257
|
-
3. **Use consistent fonts** - stick to standard fonts like Arial, Verdana, or Roboto
|
|
258
|
-
4. **Test in Grid3** - always verify styling in the actual Grid3 application
|
|
259
|
-
5. **Document custom styles** - if creating custom category styles, document their purpose
|
|
260
|
-
6. **Use inline overrides sparingly** - prefer creating new styles for significant variations
|
|
261
|
-
|
|
262
|
-
## Troubleshooting
|
|
263
|
-
|
|
264
|
-
### Styles Not Appearing
|
|
265
|
-
|
|
266
|
-
- Verify `Settings0/styles.xml` exists in the gridset
|
|
267
|
-
- Check that style names in cells match exactly (case-sensitive)
|
|
268
|
-
- Ensure colors are in 8-digit ARGB format
|
|
269
|
-
|
|
270
|
-
### Colors Look Wrong
|
|
271
|
-
|
|
272
|
-
- Verify alpha channel is FF (fully opaque)
|
|
273
|
-
- Check RGB values are correct
|
|
274
|
-
- Test in Grid3 to see actual rendering
|
|
275
|
-
|
|
276
|
-
### Performance Issues
|
|
277
|
-
|
|
278
|
-
- Avoid creating too many unique styles (consolidate similar styles)
|
|
279
|
-
- Use style references instead of inline overrides when possible
|
|
280
|
-
- Keep font sizes reasonable (12-24 points typical)
|
|
281
|
-
|
|
282
|
-
## See Also
|
|
283
|
-
|
|
284
|
-
- [Grid3 XML Format Documentation](./Grid3-XML-Format.md)
|
|
285
|
-
- [Wordlist Helpers Guide](./Grid3-Wordlist-Helpers.md)
|
|
286
|
-
- [AACProcessors API Reference](./API-Reference.md)
|
|
287
|
-
|