@willwade/aac-processors 0.1.11 → 0.1.12
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/dist/browser/processors/gridset/resolver.js +10 -0
- package/dist/browser/processors/gridsetProcessor.js +126 -4
- package/dist/processors/gridset/resolver.js +10 -0
- package/dist/processors/gridsetProcessor.js +126 -4
- package/package.json +1 -3
- package/examples/.coverage +0 -0
- package/examples/.keep +0 -1
- package/examples/README.md +0 -55
- package/examples/browser-test.html +0 -331
- package/examples/communikate.dot +0 -2637
- package/examples/demo.js +0 -143
- package/examples/example-images/FileMap.xml +0 -51
- package/examples/example-images/Grids/Start/0-1-0-text-0.png +0 -0
- package/examples/example-images/Grids/Start/0-2-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/0-3-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/0-4-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/0-5-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/1-1-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/1-2-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/1-3-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/1-4-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/1-5-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/10-3-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/10-4-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/11-3-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/11-4-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/2-1-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/2-2-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/2-3-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/2-4-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/2-5-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/3-1-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/3-3-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/3-4-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/3-5-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/4-1-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/4-3-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/4-4-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/4-5-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/5-4-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/5-5-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/6-3-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/6-4-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/7-1-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/7-2-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/7-3-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/7-4-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/8-1-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/8-2-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/8-3-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/8-4-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/9-1.png +0 -0
- package/examples/example-images/Grids/Start/9-2.png +0 -0
- package/examples/example-images/Grids/Start/9-3-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/9-4-0-text-0.jpeg +0 -0
- package/examples/example-images/Grids/Start/grid.xml +0 -1325
- package/examples/example-images/Settings0/Styles/styles.xml +0 -39
- package/examples/example-images/Settings0/WebBrowser/webbrowserextensions.xml +0 -3
- package/examples/example-images/Settings0/settings.xml +0 -16
- package/examples/example-images.gridset +0 -0
- package/examples/example-images.zip +0 -0
- package/examples/example.ce +0 -0
- package/examples/example.dot +0 -14
- package/examples/example.grd +0 -1
- package/examples/example.gridset +0 -0
- package/examples/example.obf +0 -27
- package/examples/example.obz +0 -0
- package/examples/example.opml +0 -18
- package/examples/example.spb +0 -0
- package/examples/example.sps +0 -0
- package/examples/example2.grd +0 -1
- package/examples/obf/aboutme.json +0 -376
- package/examples/obf/array.json +0 -6
- package/examples/obf/hash.json +0 -4
- package/examples/obf/links.obz +0 -0
- package/examples/obf/simple.obf +0 -53
- package/examples/package-lock.json +0 -1326
- package/examples/package.json +0 -10
- package/examples/styled-output/converted-snap-to-touchchat.ce +0 -0
- package/examples/styled-output/styled-example.ce +0 -0
- package/examples/styled-output/styled-example.gridset +0 -0
- package/examples/styled-output/styled-example.obf +0 -37
- package/examples/styled-output/styled-example.spb +0 -0
- package/examples/styling-example.ts +0 -316
- package/examples/translate.js +0 -39
- package/examples/translate_demo.js +0 -254
- package/examples/typescript-demo.ts +0 -251
- package/examples/vitedemo/README.md +0 -164
- package/examples/vitedemo/index.html +0 -580
- package/examples/vitedemo/package-lock.json +0 -1751
- package/examples/vitedemo/package.json +0 -24
- package/examples/vitedemo/src/main.ts +0 -1001
- package/examples/vitedemo/src/vite-env.d.ts +0 -1
- package/examples/vitedemo/test-files/example.dot +0 -14
- package/examples/vitedemo/test-files/example.grd +0 -1
- package/examples/vitedemo/test-files/example.gridset +0 -0
- package/examples/vitedemo/test-files/example.obz +0 -0
- package/examples/vitedemo/test-files/example.opml +0 -18
- package/examples/vitedemo/test-files/simple.obf +0 -53
- package/examples/vitedemo/tsconfig.json +0 -24
- package/examples/vitedemo/vite.config.ts +0 -57
package/examples/demo.js
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
// AACProcessors Demo: Showcase all engines and features
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
// Import processors
|
|
5
|
-
const { DotProcessor, OpmlProcessor, SnapProcessor, GridsetProcessor, TouchChatProcessor, ApplePanelsProcessor, ObfProcessor } = require('../dist/processors');
|
|
6
|
-
|
|
7
|
-
// Optional: pretty printer
|
|
8
|
-
let prettyPrint;
|
|
9
|
-
try {
|
|
10
|
-
prettyPrint = require('../dist/viewer/prettyPrint');
|
|
11
|
-
} catch {}
|
|
12
|
-
|
|
13
|
-
// Optional: symbol tools
|
|
14
|
-
let symbolTools;
|
|
15
|
-
try {
|
|
16
|
-
symbolTools = require('../dist/optional/symbolTools');
|
|
17
|
-
} catch {}
|
|
18
|
-
|
|
19
|
-
// --- DotProcessor ---
|
|
20
|
-
console.log('\n=== DOT Example ===');
|
|
21
|
-
try {
|
|
22
|
-
const dotFile = path.join(__dirname, 'example.dot');
|
|
23
|
-
const dotProcessor = new DotProcessor();
|
|
24
|
-
const dotTree = dotProcessor.loadIntoTree(dotFile);
|
|
25
|
-
console.log('DOT tree:', dotTree);
|
|
26
|
-
console.log('DOT texts:', dotProcessor.extractTexts ? dotProcessor.extractTexts(dotFile) : '(no extractTexts)');
|
|
27
|
-
if (prettyPrint) prettyPrint.printTree(dotTree, { showNavigation: true });
|
|
28
|
-
} catch (e) {
|
|
29
|
-
console.warn('DOT demo error:', e.message);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// --- OPMLProcessor ---
|
|
33
|
-
console.log('\n=== OPML Example ===');
|
|
34
|
-
try {
|
|
35
|
-
const opmlFile = path.join(__dirname, 'example.opml');
|
|
36
|
-
const opmlProcessor = new OpmlProcessor();
|
|
37
|
-
const opmlTree = opmlProcessor.loadIntoTree(opmlFile);
|
|
38
|
-
console.log('OPML tree:', opmlTree);
|
|
39
|
-
console.log('OPML texts:', opmlProcessor.extractTexts ? opmlProcessor.extractTexts(opmlFile) : '(no extractTexts)');
|
|
40
|
-
if (prettyPrint) prettyPrint.printTree(opmlTree, { showNavigation: true });
|
|
41
|
-
} catch (e) {
|
|
42
|
-
console.warn('OPML demo error:', e.message);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
// --- SnapProcessor (SPB) ---
|
|
48
|
-
console.log('\n=== Snap Example (.spb) ===');
|
|
49
|
-
try {
|
|
50
|
-
const spbFile = path.join(__dirname, 'example.spb');
|
|
51
|
-
const snapProcessor = new SnapProcessor();
|
|
52
|
-
const snapTree = snapProcessor.loadIntoTree(spbFile);
|
|
53
|
-
console.log('Snap tree (.spb):', snapTree);
|
|
54
|
-
console.log('Snap texts (.spb):', snapProcessor.extractTexts(spbFile));
|
|
55
|
-
if (prettyPrint) prettyPrint.printTree(snapTree, { showNavigation: true });
|
|
56
|
-
} catch (e) {
|
|
57
|
-
console.warn('Snap demo error (.spb):', e.message);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// // --- SnapProcessor (SPS) ---
|
|
61
|
-
// console.log('\n=== Snap Example (.sps) ===');
|
|
62
|
-
// try {
|
|
63
|
-
// const spsFile = path.join(__dirname, 'example.sps');
|
|
64
|
-
// const snapProcessor = new SnapProcessor();
|
|
65
|
-
// const snapTree = snapProcessor.loadIntoTree(spsFile);
|
|
66
|
-
// console.log('Snap tree (.sps):', snapTree);
|
|
67
|
-
// console.log('Snap texts (.sps):', snapProcessor.extractTexts(spsFile));
|
|
68
|
-
// if (prettyPrint) prettyPrint.printTree(snapTree, { showNavigation: true });
|
|
69
|
-
// } catch (e) {
|
|
70
|
-
// console.warn('Snap demo error (.sps):', e.message);
|
|
71
|
-
// }
|
|
72
|
-
|
|
73
|
-
// --- GridsetProcessor ---
|
|
74
|
-
console.log('\n=== Gridset Example ===');
|
|
75
|
-
try {
|
|
76
|
-
const gridsetFile = path.join(__dirname, 'example.gridset');
|
|
77
|
-
const gridsetProcessor = new GridsetProcessor();
|
|
78
|
-
const gridTree = gridsetProcessor.loadIntoTree(gridsetFile);
|
|
79
|
-
console.log('Gridset tree:', gridTree);
|
|
80
|
-
console.log('Gridset texts:', gridsetProcessor.extractTexts(gridsetFile));
|
|
81
|
-
if (prettyPrint) prettyPrint.printTree(gridTree, { showNavigation: true });
|
|
82
|
-
} catch (e) {
|
|
83
|
-
console.warn('Gridset demo error:', e.message);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// --- TouchChatProcessor ---
|
|
87
|
-
console.log('\n=== TouchChat Example ===');
|
|
88
|
-
try {
|
|
89
|
-
const touchchatFile = path.join(__dirname, 'example.ce');
|
|
90
|
-
const touchchatProcessor = new TouchChatProcessor();
|
|
91
|
-
const tcTree = touchchatProcessor.loadIntoTree(touchchatFile);
|
|
92
|
-
console.log('TouchChat tree:', tcTree);
|
|
93
|
-
console.log('TouchChat texts:', touchchatProcessor.extractTexts(touchchatFile));
|
|
94
|
-
if (prettyPrint) prettyPrint.printTree(tcTree, { showNavigation: true });
|
|
95
|
-
} catch (e) {
|
|
96
|
-
console.warn('TouchChat demo error:', e.message);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// --- OBF/OBZ Processor ---
|
|
100
|
-
console.log('\n=== OBF/OBZ Example ===');
|
|
101
|
-
try {
|
|
102
|
-
// Use ObfProcessor from dist, matching others
|
|
103
|
-
const obfProcessor = new ObfProcessor();
|
|
104
|
-
const obzFile = path.join(__dirname, 'example.obz');
|
|
105
|
-
// If loadIntoTree is async, use then/catch. If not, call directly.
|
|
106
|
-
let obTree;
|
|
107
|
-
try {
|
|
108
|
-
obTree = obfProcessor.loadIntoTree(obzFile);
|
|
109
|
-
console.log('OBZ tree:', obTree);
|
|
110
|
-
// Try extractTexts if available
|
|
111
|
-
if (obfProcessor.extractTexts) {
|
|
112
|
-
try {
|
|
113
|
-
const texts = obfProcessor.extractTexts(obzFile);
|
|
114
|
-
console.log('OBZ texts:', texts);
|
|
115
|
-
} catch (e) {
|
|
116
|
-
console.warn('OBZ extractTexts error:', e.message);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
if (prettyPrint) prettyPrint.printTree(obTree, { showNavigation: true });
|
|
120
|
-
console.log('\nDemo complete.');
|
|
121
|
-
} catch (e) {
|
|
122
|
-
console.warn('OBZ demo error:', e.message);
|
|
123
|
-
console.log('\nDemo complete.');
|
|
124
|
-
}
|
|
125
|
-
// Return here so the rest of the demo waits for async
|
|
126
|
-
return;
|
|
127
|
-
} catch (e) {
|
|
128
|
-
console.warn('OBZ demo error:', e.message);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// --- ApplePanelsProcessor (if implemented) ---
|
|
132
|
-
// console.log('\n=== Apple Panels Example ===');
|
|
133
|
-
// try {
|
|
134
|
-
// const applePanelsFile = path.join(__dirname, 'example.ascconfig');
|
|
135
|
-
// const applePanelsProcessor = new ApplePanelsProcessor();
|
|
136
|
-
// const apTree = applePanelsProcessor.loadIntoTree(applePanelsFile);
|
|
137
|
-
// console.log('Apple Panels tree:', apTree);
|
|
138
|
-
// if (prettyPrint) prettyPrint.printTree(apTree, { showNavigation: true });
|
|
139
|
-
// } catch (e) {
|
|
140
|
-
// console.warn('Apple Panels demo error:', e.message);
|
|
141
|
-
// }
|
|
142
|
-
|
|
143
|
-
console.log('\nDemo complete.');
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
<FileMap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
2
|
-
<Entries>
|
|
3
|
-
<Entry StaticFile="Grids\Start\grid.xml">
|
|
4
|
-
<DynamicFiles>
|
|
5
|
-
<File>Grids\Start\0-1-0-text-0.png</File>
|
|
6
|
-
<File>Grids\Start\0-2-0-text-0.jpeg</File>
|
|
7
|
-
<File>Grids\Start\0-3-0-text-0.jpeg</File>
|
|
8
|
-
<File>Grids\Start\0-4-0-text-0.jpeg</File>
|
|
9
|
-
<File>Grids\Start\0-5-0-text-0.jpeg</File>
|
|
10
|
-
<File>Grids\Start\1-1-0-text-0.jpeg</File>
|
|
11
|
-
<File>Grids\Start\1-2-0-text-0.jpeg</File>
|
|
12
|
-
<File>Grids\Start\1-3-0-text-0.jpeg</File>
|
|
13
|
-
<File>Grids\Start\1-4-0-text-0.jpeg</File>
|
|
14
|
-
<File>Grids\Start\1-5-0-text-0.jpeg</File>
|
|
15
|
-
<File>Grids\Start\10-3-0-text-0.jpeg</File>
|
|
16
|
-
<File>Grids\Start\10-4-0-text-0.jpeg</File>
|
|
17
|
-
<File>Grids\Start\11-3-0-text-0.jpeg</File>
|
|
18
|
-
<File>Grids\Start\11-4-0-text-0.jpeg</File>
|
|
19
|
-
<File>Grids\Start\2-1-0-text-0.jpeg</File>
|
|
20
|
-
<File>Grids\Start\2-2-0-text-0.jpeg</File>
|
|
21
|
-
<File>Grids\Start\2-3-0-text-0.jpeg</File>
|
|
22
|
-
<File>Grids\Start\2-4-0-text-0.jpeg</File>
|
|
23
|
-
<File>Grids\Start\2-5-0-text-0.jpeg</File>
|
|
24
|
-
<File>Grids\Start\3-1-0-text-0.jpeg</File>
|
|
25
|
-
<File>Grids\Start\3-3-0-text-0.jpeg</File>
|
|
26
|
-
<File>Grids\Start\3-4-0-text-0.jpeg</File>
|
|
27
|
-
<File>Grids\Start\3-5-0-text-0.jpeg</File>
|
|
28
|
-
<File>Grids\Start\4-1-0-text-0.jpeg</File>
|
|
29
|
-
<File>Grids\Start\4-3-0-text-0.jpeg</File>
|
|
30
|
-
<File>Grids\Start\4-4-0-text-0.jpeg</File>
|
|
31
|
-
<File>Grids\Start\4-5-0-text-0.jpeg</File>
|
|
32
|
-
<File>Grids\Start\5-4-0-text-0.jpeg</File>
|
|
33
|
-
<File>Grids\Start\5-5-0-text-0.jpeg</File>
|
|
34
|
-
<File>Grids\Start\6-3-0-text-0.jpeg</File>
|
|
35
|
-
<File>Grids\Start\6-4-0-text-0.jpeg</File>
|
|
36
|
-
<File>Grids\Start\7-1-0-text-0.jpeg</File>
|
|
37
|
-
<File>Grids\Start\7-2-0-text-0.jpeg</File>
|
|
38
|
-
<File>Grids\Start\7-3-0-text-0.jpeg</File>
|
|
39
|
-
<File>Grids\Start\7-4-0-text-0.jpeg</File>
|
|
40
|
-
<File>Grids\Start\8-1-0-text-0.jpeg</File>
|
|
41
|
-
<File>Grids\Start\8-2-0-text-0.jpeg</File>
|
|
42
|
-
<File>Grids\Start\8-3-0-text-0.jpeg</File>
|
|
43
|
-
<File>Grids\Start\8-4-0-text-0.jpeg</File>
|
|
44
|
-
<File>Grids\Start\9-1.png</File>
|
|
45
|
-
<File>Grids\Start\9-2.png</File>
|
|
46
|
-
<File>Grids\Start\9-3-0-text-0.jpeg</File>
|
|
47
|
-
<File>Grids\Start\9-4-0-text-0.jpeg</File>
|
|
48
|
-
</DynamicFiles>
|
|
49
|
-
</Entry>
|
|
50
|
-
</Entries>
|
|
51
|
-
</FileMap>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|