@willwade/aac-processors 0.0.11 → 0.0.13

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 (56) hide show
  1. package/README.md +44 -41
  2. package/dist/cli/index.js +7 -0
  3. package/dist/core/analyze.js +1 -0
  4. package/dist/core/treeStructure.d.ts +45 -2
  5. package/dist/core/treeStructure.js +22 -3
  6. package/dist/index.d.ts +2 -1
  7. package/dist/index.js +20 -3
  8. package/dist/{analytics → optional/analytics}/history.d.ts +15 -4
  9. package/dist/{analytics → optional/analytics}/history.js +3 -3
  10. package/dist/optional/analytics/index.d.ts +30 -0
  11. package/dist/optional/analytics/index.js +78 -0
  12. package/dist/optional/analytics/metrics/comparison.d.ts +36 -0
  13. package/dist/optional/analytics/metrics/comparison.js +334 -0
  14. package/dist/optional/analytics/metrics/core.d.ts +45 -0
  15. package/dist/optional/analytics/metrics/core.js +575 -0
  16. package/dist/optional/analytics/metrics/effort.d.ts +147 -0
  17. package/dist/optional/analytics/metrics/effort.js +211 -0
  18. package/dist/optional/analytics/metrics/index.d.ts +15 -0
  19. package/dist/optional/analytics/metrics/index.js +36 -0
  20. package/dist/optional/analytics/metrics/obl-types.d.ts +93 -0
  21. package/dist/optional/analytics/metrics/obl-types.js +7 -0
  22. package/dist/optional/analytics/metrics/obl.d.ts +40 -0
  23. package/dist/optional/analytics/metrics/obl.js +287 -0
  24. package/dist/optional/analytics/metrics/sentence.d.ts +49 -0
  25. package/dist/optional/analytics/metrics/sentence.js +112 -0
  26. package/dist/optional/analytics/metrics/types.d.ts +157 -0
  27. package/dist/optional/analytics/metrics/types.js +7 -0
  28. package/dist/optional/analytics/metrics/vocabulary.d.ts +65 -0
  29. package/dist/optional/analytics/metrics/vocabulary.js +142 -0
  30. package/dist/optional/analytics/reference/index.d.ts +51 -0
  31. package/dist/optional/analytics/reference/index.js +102 -0
  32. package/dist/optional/analytics/utils/idGenerator.d.ts +59 -0
  33. package/dist/optional/analytics/utils/idGenerator.js +96 -0
  34. package/dist/optional/symbolTools.js +13 -16
  35. package/dist/processors/astericsGridProcessor.d.ts +15 -0
  36. package/dist/processors/astericsGridProcessor.js +17 -0
  37. package/dist/processors/gridset/helpers.d.ts +4 -1
  38. package/dist/processors/gridset/helpers.js +4 -0
  39. package/dist/processors/gridset/pluginTypes.js +51 -50
  40. package/dist/processors/gridset/symbolExtractor.js +3 -2
  41. package/dist/processors/gridset/symbolSearch.js +9 -7
  42. package/dist/processors/gridsetProcessor.js +82 -20
  43. package/dist/processors/index.d.ts +1 -0
  44. package/dist/processors/index.js +5 -3
  45. package/dist/processors/obfProcessor.js +37 -2
  46. package/dist/processors/obfsetProcessor.d.ts +26 -0
  47. package/dist/processors/obfsetProcessor.js +179 -0
  48. package/dist/processors/snap/helpers.d.ts +5 -1
  49. package/dist/processors/snap/helpers.js +5 -0
  50. package/dist/processors/snapProcessor.d.ts +2 -0
  51. package/dist/processors/snapProcessor.js +184 -5
  52. package/dist/processors/touchchatProcessor.js +50 -4
  53. package/dist/types/aac.d.ts +67 -0
  54. package/dist/types/aac.js +33 -0
  55. package/dist/validation/gridsetValidator.js +10 -0
  56. package/package.json +1 -1
@@ -1,4 +1,54 @@
1
1
  import { AACSemanticAction } from '../core/treeStructure';
2
+ /**
3
+ * Scanning selection methods for switch access
4
+ * Determines how the scanning advances through items
5
+ */
6
+ export declare enum ScanningSelectionMethod {
7
+ /** Automatically advance through items at timed intervals */
8
+ AutoScan = "AutoScan",
9
+ /** Automatic scanning with overscan (two-stage scanning) */
10
+ AutoScanWithOverscan = "AutoScanWithOverscan",
11
+ /** Hold switch to advance, release to select */
12
+ HoldToAdvance = "HoldToAdvance",
13
+ /** Hold to advance with overscan */
14
+ HoldToAdvanceWithOverscan = "HoldToAdvanceWithOverscan",
15
+ /** Tap switch to advance, tap again to select */
16
+ TapToAdvance = "TapToAdvance"
17
+ }
18
+ /**
19
+ * Cell scanning order patterns
20
+ * Determines the sequence in which cells are highlighted
21
+ */
22
+ export declare enum CellScanningOrder {
23
+ /** Simple linear scan across rows (left-to-right, top-to-bottom) */
24
+ SimpleScan = "SimpleScan",
25
+ /** Simple linear scan down columns (top-to-bottom, left-to-right) */
26
+ SimpleScanColumnsFirst = "SimpleScanColumnsFirst",
27
+ /** Row-group scanning: highlight rows first, then cells within selected row */
28
+ RowColumnScan = "RowColumnScan",
29
+ /** Column-group scanning: highlight columns first, then cells within selected column */
30
+ ColumnRowScan = "ColumnRowScan"
31
+ }
32
+ /**
33
+ * Scanning configuration for a page or pageset
34
+ * Controls how switch scanning operates
35
+ */
36
+ export interface ScanningConfig {
37
+ /** Method for advancing through items */
38
+ selectionMethod?: ScanningSelectionMethod;
39
+ /** Order in which cells are scanned */
40
+ cellScanningOrder?: CellScanningOrder;
41
+ /** Whether block scanning is enabled (group cells by scanBlock number) */
42
+ blockScanEnabled?: boolean;
43
+ /** Whether to include the workspace/message bar in scanning */
44
+ scanWorkspace?: boolean;
45
+ /** Time in milliseconds to highlight each item */
46
+ forwardScanSpeed?: number;
47
+ /** Time in milliseconds to wait before auto-accepting selection */
48
+ dwellTime?: number;
49
+ /** How the selection is accepted */
50
+ acceptScanMethod?: 'Switch' | 'Timeout' | 'Hold';
51
+ }
2
52
  export interface AACStyle {
3
53
  backgroundColor?: string;
4
54
  fontColor?: string;
@@ -35,13 +85,26 @@ export interface AACButton {
35
85
  y?: number;
36
86
  columnSpan?: number;
37
87
  rowSpan?: number;
88
+ /**
89
+ * Scan block number (1-8) for block scanning
90
+ * Buttons with the same scanBlock number are highlighted together
91
+ * @deprecated Use scanBlock instead (singular, not array)
92
+ */
38
93
  scanBlocks?: number[];
94
+ /**
95
+ * Scan block number (1-8) for block scanning
96
+ * Buttons with the same scanBlock number are highlighted together
97
+ * Reduces scanning effort by grouping buttons
98
+ */
99
+ scanBlock?: number;
39
100
  visibility?: 'Visible' | 'Hidden' | 'Disabled' | 'PointerAndTouchOnly' | 'Empty';
40
101
  directActivate?: boolean;
41
102
  audioDescription?: string;
42
103
  parameters?: {
43
104
  [key: string]: any;
44
105
  };
106
+ semantic_id?: string;
107
+ clone_id?: string;
45
108
  }
46
109
  export interface AACPage {
47
110
  id: string;
@@ -54,6 +117,10 @@ export interface AACPage {
54
117
  descriptionHtml?: string;
55
118
  images?: any[];
56
119
  sounds?: any[];
120
+ semantic_ids?: string[];
121
+ clone_ids?: string[];
122
+ scanningConfig?: ScanningConfig;
123
+ scanBlocksConfig?: any[];
57
124
  }
58
125
  export interface AACTree {
59
126
  pages: {
package/dist/types/aac.js CHANGED
@@ -1,2 +1,35 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CellScanningOrder = exports.ScanningSelectionMethod = void 0;
4
+ /**
5
+ * Scanning selection methods for switch access
6
+ * Determines how the scanning advances through items
7
+ */
8
+ var ScanningSelectionMethod;
9
+ (function (ScanningSelectionMethod) {
10
+ /** Automatically advance through items at timed intervals */
11
+ ScanningSelectionMethod["AutoScan"] = "AutoScan";
12
+ /** Automatic scanning with overscan (two-stage scanning) */
13
+ ScanningSelectionMethod["AutoScanWithOverscan"] = "AutoScanWithOverscan";
14
+ /** Hold switch to advance, release to select */
15
+ ScanningSelectionMethod["HoldToAdvance"] = "HoldToAdvance";
16
+ /** Hold to advance with overscan */
17
+ ScanningSelectionMethod["HoldToAdvanceWithOverscan"] = "HoldToAdvanceWithOverscan";
18
+ /** Tap switch to advance, tap again to select */
19
+ ScanningSelectionMethod["TapToAdvance"] = "TapToAdvance";
20
+ })(ScanningSelectionMethod || (exports.ScanningSelectionMethod = ScanningSelectionMethod = {}));
21
+ /**
22
+ * Cell scanning order patterns
23
+ * Determines the sequence in which cells are highlighted
24
+ */
25
+ var CellScanningOrder;
26
+ (function (CellScanningOrder) {
27
+ /** Simple linear scan across rows (left-to-right, top-to-bottom) */
28
+ CellScanningOrder["SimpleScan"] = "SimpleScan";
29
+ /** Simple linear scan down columns (top-to-bottom, left-to-right) */
30
+ CellScanningOrder["SimpleScanColumnsFirst"] = "SimpleScanColumnsFirst";
31
+ /** Row-group scanning: highlight rows first, then cells within selected row */
32
+ CellScanningOrder["RowColumnScan"] = "RowColumnScan";
33
+ /** Column-group scanning: highlight columns first, then cells within selected column */
34
+ CellScanningOrder["ColumnRowScan"] = "ColumnRowScan";
35
+ })(CellScanningOrder || (exports.CellScanningOrder = CellScanningOrder = {}));
@@ -243,6 +243,16 @@ class GridsetValidator extends baseValidator_1.BaseValidator {
243
243
  this.warn(`cell ${cellIdx} on page ${pageIdx} should have a label or image`);
244
244
  }
245
245
  });
246
+ // Validate scan block number (Grid 3 attribute)
247
+ await this.add_check(`page[${pageIdx}]_cell[${cellIdx}]_scanblock`, `cell scan block`, async () => {
248
+ const scanBlock = cell.$.scanBlock || cell.$.ScanBlock;
249
+ if (scanBlock !== undefined) {
250
+ const blockNum = parseInt(scanBlock, 10);
251
+ if (isNaN(blockNum) || blockNum < 1 || blockNum > 8) {
252
+ this.err(`cell ${cellIdx} on page ${pageIdx} has invalid scanBlock value: ${scanBlock} (must be 1-8)`, false);
253
+ }
254
+ }
255
+ });
246
256
  // Check for color attributes
247
257
  const backgroundColor = cell.$.backgroundColor || cell.$.BackgroundColor;
248
258
  const _color = cell.$.color || cell.$.Color;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willwade/aac-processors",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "description": "A comprehensive TypeScript library for processing AAC (Augmentative and Alternative Communication) file formats with translation support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",