@willwade/aac-processors 0.0.24 → 0.0.26

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.
@@ -145,9 +145,10 @@ export declare class AACButton implements IAACButton {
145
145
  parameters?: {
146
146
  [key: string]: any;
147
147
  };
148
+ predictions?: string[];
148
149
  semantic_id?: string;
149
150
  clone_id?: string;
150
- constructor({ id, label, message, targetPageId, semanticAction, audioRecording, style, contentType, contentSubType, image, resolvedImageEntry, symbolLibrary, symbolPath, x, y, columnSpan, rowSpan, scanBlocks, scanBlock, visibility, directActivate, parameters, semantic_id, clone_id, type, action, }: {
151
+ constructor({ id, label, message, targetPageId, semanticAction, audioRecording, style, contentType, contentSubType, image, resolvedImageEntry, symbolLibrary, symbolPath, x, y, columnSpan, rowSpan, scanBlocks, scanBlock, visibility, directActivate, parameters, predictions, semantic_id, clone_id, type, action, }: {
151
152
  id: string;
152
153
  label?: string;
153
154
  message?: string;
@@ -177,6 +178,7 @@ export declare class AACButton implements IAACButton {
177
178
  parameters?: {
178
179
  [key: string]: any;
179
180
  };
181
+ predictions?: string[];
180
182
  semantic_id?: string;
181
183
  clone_id?: string;
182
184
  type?: 'SPEAK' | 'NAVIGATE' | 'ACTION';
@@ -57,7 +57,7 @@ var AACScanType;
57
57
  AACScanType["BLOCK_COLUMN_ROW"] = "block-column-row";
58
58
  })(AACScanType || (exports.AACScanType = AACScanType = {}));
59
59
  class AACButton {
60
- constructor({ id, label = '', message = '', targetPageId, semanticAction, audioRecording, style, contentType, contentSubType, image, resolvedImageEntry, symbolLibrary, symbolPath, x, y, columnSpan, rowSpan, scanBlocks, scanBlock, visibility, directActivate, parameters, semantic_id, clone_id,
60
+ constructor({ id, label = '', message = '', targetPageId, semanticAction, audioRecording, style, contentType, contentSubType, image, resolvedImageEntry, symbolLibrary, symbolPath, x, y, columnSpan, rowSpan, scanBlocks, scanBlock, visibility, directActivate, parameters, predictions, semantic_id, clone_id,
61
61
  // Legacy input support
62
62
  type, action, }) {
63
63
  this.id = id;
@@ -82,6 +82,7 @@ class AACButton {
82
82
  this.visibility = visibility;
83
83
  this.directActivate = directActivate;
84
84
  this.parameters = parameters;
85
+ this.predictions = predictions;
85
86
  this.semantic_id = semantic_id;
86
87
  this.clone_id = clone_id;
87
88
  // Legacy mapping: if no semanticAction provided, derive from legacy `action` first
@@ -659,13 +659,21 @@ class GridsetProcessor extends baseProcessor_1.BaseProcessor {
659
659
  const message = label; // Use caption as message
660
660
  // Detect plugin cell type (Workspace, LiveCell, AutoContent)
661
661
  const pluginMetadata = (0, pluginTypes_1.detectPluginCellType)(content);
662
- // Default labels for prediction cells so they don't render blank
662
+ // Friendly labels for workspace/prediction cells when captions are missing
663
+ if (pluginMetadata.cellType === pluginTypes_1.Grid3CellType.Workspace) {
664
+ if (!label || label.startsWith('Cell_')) {
665
+ label =
666
+ pluginMetadata.displayName ||
667
+ pluginMetadata.subType ||
668
+ pluginMetadata.pluginId ||
669
+ 'Workspace';
670
+ }
671
+ }
663
672
  if (pluginMetadata.cellType === pluginTypes_1.Grid3CellType.AutoContent &&
664
673
  pluginMetadata.autoContentType === 'Prediction') {
665
674
  predictionCellCounter += 1;
666
- if (!label) {
667
- label = `Prediction ${predictionCellCounter}`;
668
- }
675
+ // Always surface a friendly label for predictions even if a placeholder exists
676
+ label = `Prediction ${predictionCellCounter}`;
669
677
  }
670
678
  // Parse all command types from Grid3 and create semantic actions
671
679
  let semanticAction;
@@ -1218,6 +1226,12 @@ class GridsetProcessor extends baseProcessor_1.BaseProcessor {
1218
1226
  ...cellStyle,
1219
1227
  ...inlineStyle, // Inline styles override referenced styles
1220
1228
  },
1229
+ // Store predictions directly on button for easy access
1230
+ predictions: predictionWords?.length
1231
+ ? [...predictionWords]
1232
+ : gridPredictionWords.length > 0
1233
+ ? [...gridPredictionWords]
1234
+ : undefined,
1221
1235
  parameters: {
1222
1236
  pluginMetadata: pluginMetadata, // Store full plugin metadata for future use
1223
1237
  grid3Commands: detectedCommands, // Store detected command metadata
@@ -113,6 +113,7 @@ export interface AACButton {
113
113
  parameters?: {
114
114
  [key: string]: any;
115
115
  };
116
+ predictions?: string[];
116
117
  semantic_id?: string;
117
118
  clone_id?: string;
118
119
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willwade/aac-processors",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
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",