@willwade/aac-processors 0.2.7 → 0.2.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.
|
@@ -1137,9 +1137,11 @@ class GridsetProcessor extends BaseProcessor {
|
|
|
1137
1137
|
}
|
|
1138
1138
|
break;
|
|
1139
1139
|
case 'Jump.ToKeyboard': {
|
|
1140
|
-
//
|
|
1140
|
+
// Prefer explicit keyboard page metadata when available.
|
|
1141
|
+
// Some Gridsets resolve the keyboard page in metadata
|
|
1142
|
+
// without preserving tree.keyboardGridName during parse.
|
|
1141
1143
|
const keyboardGridName = tree.keyboardGridName;
|
|
1142
|
-
const keyboardPageId = gridNameToIdMap.get(keyboardGridName);
|
|
1144
|
+
const keyboardPageId = tree.metadata?.defaultKeyboardPageId || gridNameToIdMap.get(keyboardGridName);
|
|
1143
1145
|
if (keyboardPageId && !navigationTarget) {
|
|
1144
1146
|
navigationTarget = keyboardPageId;
|
|
1145
1147
|
}
|
|
@@ -1699,6 +1701,7 @@ class GridsetProcessor extends BaseProcessor {
|
|
|
1699
1701
|
settingsData?.gridSetSettings?.keyboardGrid ||
|
|
1700
1702
|
settingsData?.GridsetSettings?.KeyboardGrid;
|
|
1701
1703
|
if (keyboardGridName && typeof keyboardGridName === 'string') {
|
|
1704
|
+
tree.keyboardGridName = keyboardGridName;
|
|
1702
1705
|
metadata.defaultKeyboardPageId = gridNameToIdMap.get(keyboardGridName);
|
|
1703
1706
|
}
|
|
1704
1707
|
}
|
|
@@ -1708,6 +1711,22 @@ class GridsetProcessor extends BaseProcessor {
|
|
|
1708
1711
|
}
|
|
1709
1712
|
// Set metadata on tree
|
|
1710
1713
|
tree.metadata = metadata;
|
|
1714
|
+
if (metadata.defaultKeyboardPageId) {
|
|
1715
|
+
Object.values(tree.pages).forEach((page) => {
|
|
1716
|
+
page.buttons.forEach((button) => {
|
|
1717
|
+
if (button?.semanticAction?.platformData?.grid3?.commandId === 'Jump.ToKeyboard' &&
|
|
1718
|
+
!button.targetPageId) {
|
|
1719
|
+
button.targetPageId = metadata.defaultKeyboardPageId;
|
|
1720
|
+
if (button.semanticAction) {
|
|
1721
|
+
button.semanticAction.targetId = metadata.defaultKeyboardPageId;
|
|
1722
|
+
if (button.semanticAction.fallback?.type === 'NAVIGATE') {
|
|
1723
|
+
button.semanticAction.fallback.targetPageId = metadata.defaultKeyboardPageId;
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
});
|
|
1728
|
+
});
|
|
1729
|
+
}
|
|
1711
1730
|
return tree;
|
|
1712
1731
|
}
|
|
1713
1732
|
async processTexts(filePathOrBuffer, translations, outputPath) {
|
|
@@ -1163,9 +1163,11 @@ class GridsetProcessor extends baseProcessor_1.BaseProcessor {
|
|
|
1163
1163
|
}
|
|
1164
1164
|
break;
|
|
1165
1165
|
case 'Jump.ToKeyboard': {
|
|
1166
|
-
//
|
|
1166
|
+
// Prefer explicit keyboard page metadata when available.
|
|
1167
|
+
// Some Gridsets resolve the keyboard page in metadata
|
|
1168
|
+
// without preserving tree.keyboardGridName during parse.
|
|
1167
1169
|
const keyboardGridName = tree.keyboardGridName;
|
|
1168
|
-
const keyboardPageId = gridNameToIdMap.get(keyboardGridName);
|
|
1170
|
+
const keyboardPageId = tree.metadata?.defaultKeyboardPageId || gridNameToIdMap.get(keyboardGridName);
|
|
1169
1171
|
if (keyboardPageId && !navigationTarget) {
|
|
1170
1172
|
navigationTarget = keyboardPageId;
|
|
1171
1173
|
}
|
|
@@ -1725,6 +1727,7 @@ class GridsetProcessor extends baseProcessor_1.BaseProcessor {
|
|
|
1725
1727
|
settingsData?.gridSetSettings?.keyboardGrid ||
|
|
1726
1728
|
settingsData?.GridsetSettings?.KeyboardGrid;
|
|
1727
1729
|
if (keyboardGridName && typeof keyboardGridName === 'string') {
|
|
1730
|
+
tree.keyboardGridName = keyboardGridName;
|
|
1728
1731
|
metadata.defaultKeyboardPageId = gridNameToIdMap.get(keyboardGridName);
|
|
1729
1732
|
}
|
|
1730
1733
|
}
|
|
@@ -1734,6 +1737,22 @@ class GridsetProcessor extends baseProcessor_1.BaseProcessor {
|
|
|
1734
1737
|
}
|
|
1735
1738
|
// Set metadata on tree
|
|
1736
1739
|
tree.metadata = metadata;
|
|
1740
|
+
if (metadata.defaultKeyboardPageId) {
|
|
1741
|
+
Object.values(tree.pages).forEach((page) => {
|
|
1742
|
+
page.buttons.forEach((button) => {
|
|
1743
|
+
if (button?.semanticAction?.platformData?.grid3?.commandId === 'Jump.ToKeyboard' &&
|
|
1744
|
+
!button.targetPageId) {
|
|
1745
|
+
button.targetPageId = metadata.defaultKeyboardPageId;
|
|
1746
|
+
if (button.semanticAction) {
|
|
1747
|
+
button.semanticAction.targetId = metadata.defaultKeyboardPageId;
|
|
1748
|
+
if (button.semanticAction.fallback?.type === 'NAVIGATE') {
|
|
1749
|
+
button.semanticAction.fallback.targetPageId = metadata.defaultKeyboardPageId;
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
});
|
|
1754
|
+
});
|
|
1755
|
+
}
|
|
1737
1756
|
return tree;
|
|
1738
1757
|
}
|
|
1739
1758
|
async processTexts(filePathOrBuffer, translations, outputPath) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willwade/aac-processors",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
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
|
"browser": "dist/browser/index.browser.js",
|