@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.
Files changed (101) hide show
  1. package/dist/browser/processors/gridset/resolver.js +10 -0
  2. package/dist/browser/processors/gridsetProcessor.js +126 -4
  3. package/dist/processors/gridset/resolver.js +10 -0
  4. package/dist/processors/gridsetProcessor.js +126 -4
  5. package/package.json +1 -3
  6. package/examples/.coverage +0 -0
  7. package/examples/.keep +0 -1
  8. package/examples/README.md +0 -55
  9. package/examples/browser-test.html +0 -331
  10. package/examples/communikate.dot +0 -2637
  11. package/examples/demo.js +0 -143
  12. package/examples/example-images/FileMap.xml +0 -51
  13. package/examples/example-images/Grids/Start/0-1-0-text-0.png +0 -0
  14. package/examples/example-images/Grids/Start/0-2-0-text-0.jpeg +0 -0
  15. package/examples/example-images/Grids/Start/0-3-0-text-0.jpeg +0 -0
  16. package/examples/example-images/Grids/Start/0-4-0-text-0.jpeg +0 -0
  17. package/examples/example-images/Grids/Start/0-5-0-text-0.jpeg +0 -0
  18. package/examples/example-images/Grids/Start/1-1-0-text-0.jpeg +0 -0
  19. package/examples/example-images/Grids/Start/1-2-0-text-0.jpeg +0 -0
  20. package/examples/example-images/Grids/Start/1-3-0-text-0.jpeg +0 -0
  21. package/examples/example-images/Grids/Start/1-4-0-text-0.jpeg +0 -0
  22. package/examples/example-images/Grids/Start/1-5-0-text-0.jpeg +0 -0
  23. package/examples/example-images/Grids/Start/10-3-0-text-0.jpeg +0 -0
  24. package/examples/example-images/Grids/Start/10-4-0-text-0.jpeg +0 -0
  25. package/examples/example-images/Grids/Start/11-3-0-text-0.jpeg +0 -0
  26. package/examples/example-images/Grids/Start/11-4-0-text-0.jpeg +0 -0
  27. package/examples/example-images/Grids/Start/2-1-0-text-0.jpeg +0 -0
  28. package/examples/example-images/Grids/Start/2-2-0-text-0.jpeg +0 -0
  29. package/examples/example-images/Grids/Start/2-3-0-text-0.jpeg +0 -0
  30. package/examples/example-images/Grids/Start/2-4-0-text-0.jpeg +0 -0
  31. package/examples/example-images/Grids/Start/2-5-0-text-0.jpeg +0 -0
  32. package/examples/example-images/Grids/Start/3-1-0-text-0.jpeg +0 -0
  33. package/examples/example-images/Grids/Start/3-3-0-text-0.jpeg +0 -0
  34. package/examples/example-images/Grids/Start/3-4-0-text-0.jpeg +0 -0
  35. package/examples/example-images/Grids/Start/3-5-0-text-0.jpeg +0 -0
  36. package/examples/example-images/Grids/Start/4-1-0-text-0.jpeg +0 -0
  37. package/examples/example-images/Grids/Start/4-3-0-text-0.jpeg +0 -0
  38. package/examples/example-images/Grids/Start/4-4-0-text-0.jpeg +0 -0
  39. package/examples/example-images/Grids/Start/4-5-0-text-0.jpeg +0 -0
  40. package/examples/example-images/Grids/Start/5-4-0-text-0.jpeg +0 -0
  41. package/examples/example-images/Grids/Start/5-5-0-text-0.jpeg +0 -0
  42. package/examples/example-images/Grids/Start/6-3-0-text-0.jpeg +0 -0
  43. package/examples/example-images/Grids/Start/6-4-0-text-0.jpeg +0 -0
  44. package/examples/example-images/Grids/Start/7-1-0-text-0.jpeg +0 -0
  45. package/examples/example-images/Grids/Start/7-2-0-text-0.jpeg +0 -0
  46. package/examples/example-images/Grids/Start/7-3-0-text-0.jpeg +0 -0
  47. package/examples/example-images/Grids/Start/7-4-0-text-0.jpeg +0 -0
  48. package/examples/example-images/Grids/Start/8-1-0-text-0.jpeg +0 -0
  49. package/examples/example-images/Grids/Start/8-2-0-text-0.jpeg +0 -0
  50. package/examples/example-images/Grids/Start/8-3-0-text-0.jpeg +0 -0
  51. package/examples/example-images/Grids/Start/8-4-0-text-0.jpeg +0 -0
  52. package/examples/example-images/Grids/Start/9-1.png +0 -0
  53. package/examples/example-images/Grids/Start/9-2.png +0 -0
  54. package/examples/example-images/Grids/Start/9-3-0-text-0.jpeg +0 -0
  55. package/examples/example-images/Grids/Start/9-4-0-text-0.jpeg +0 -0
  56. package/examples/example-images/Grids/Start/grid.xml +0 -1325
  57. package/examples/example-images/Settings0/Styles/styles.xml +0 -39
  58. package/examples/example-images/Settings0/WebBrowser/webbrowserextensions.xml +0 -3
  59. package/examples/example-images/Settings0/settings.xml +0 -16
  60. package/examples/example-images.gridset +0 -0
  61. package/examples/example-images.zip +0 -0
  62. package/examples/example.ce +0 -0
  63. package/examples/example.dot +0 -14
  64. package/examples/example.grd +0 -1
  65. package/examples/example.gridset +0 -0
  66. package/examples/example.obf +0 -27
  67. package/examples/example.obz +0 -0
  68. package/examples/example.opml +0 -18
  69. package/examples/example.spb +0 -0
  70. package/examples/example.sps +0 -0
  71. package/examples/example2.grd +0 -1
  72. package/examples/obf/aboutme.json +0 -376
  73. package/examples/obf/array.json +0 -6
  74. package/examples/obf/hash.json +0 -4
  75. package/examples/obf/links.obz +0 -0
  76. package/examples/obf/simple.obf +0 -53
  77. package/examples/package-lock.json +0 -1326
  78. package/examples/package.json +0 -10
  79. package/examples/styled-output/converted-snap-to-touchchat.ce +0 -0
  80. package/examples/styled-output/styled-example.ce +0 -0
  81. package/examples/styled-output/styled-example.gridset +0 -0
  82. package/examples/styled-output/styled-example.obf +0 -37
  83. package/examples/styled-output/styled-example.spb +0 -0
  84. package/examples/styling-example.ts +0 -316
  85. package/examples/translate.js +0 -39
  86. package/examples/translate_demo.js +0 -254
  87. package/examples/typescript-demo.ts +0 -251
  88. package/examples/vitedemo/README.md +0 -164
  89. package/examples/vitedemo/index.html +0 -580
  90. package/examples/vitedemo/package-lock.json +0 -1751
  91. package/examples/vitedemo/package.json +0 -24
  92. package/examples/vitedemo/src/main.ts +0 -1001
  93. package/examples/vitedemo/src/vite-env.d.ts +0 -1
  94. package/examples/vitedemo/test-files/example.dot +0 -14
  95. package/examples/vitedemo/test-files/example.grd +0 -1
  96. package/examples/vitedemo/test-files/example.gridset +0 -0
  97. package/examples/vitedemo/test-files/example.obz +0 -0
  98. package/examples/vitedemo/test-files/example.opml +0 -18
  99. package/examples/vitedemo/test-files/simple.obf +0 -53
  100. package/examples/vitedemo/tsconfig.json +0 -24
  101. package/examples/vitedemo/vite.config.ts +0 -57
@@ -1,331 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>AAC Processors - Browser Compatibility Test</title>
7
- <style>
8
- body {
9
- font-family: system-ui, -apple-system, sans-serif;
10
- max-width: 1200px;
11
- margin: 0 auto;
12
- padding: 20px;
13
- background: #f5f5f5;
14
- }
15
- h1 {
16
- color: #333;
17
- border-bottom: 2px solid #007bff;
18
- padding-bottom: 10px;
19
- }
20
- .test-section {
21
- background: white;
22
- border-radius: 8px;
23
- padding: 20px;
24
- margin: 20px 0;
25
- box-shadow: 0 2px 4px rgba(0,0,0,0.1);
26
- }
27
- .file-input {
28
- margin: 10px 0;
29
- }
30
- .file-input label {
31
- display: block;
32
- font-weight: 600;
33
- margin-bottom: 5px;
34
- color: #555;
35
- }
36
- .file-input input {
37
- display: block;
38
- width: 100%;
39
- padding: 8px;
40
- border: 2px solid #ddd;
41
- border-radius: 4px;
42
- }
43
- .test-button {
44
- background: #007bff;
45
- color: white;
46
- border: none;
47
- padding: 10px 20px;
48
- border-radius: 4px;
49
- cursor: pointer;
50
- font-size: 14px;
51
- margin-top: 10px;
52
- }
53
- .test-button:hover {
54
- background: #0056b3;
55
- }
56
- .test-button:disabled {
57
- background: #ccc;
58
- cursor: not-allowed;
59
- }
60
- .result {
61
- margin-top: 15px;
62
- padding: 15px;
63
- border-radius: 4px;
64
- font-family: 'Monaco', 'Menlo', monospace;
65
- font-size: 13px;
66
- white-space: pre-wrap;
67
- word-wrap: break-word;
68
- }
69
- .result.success {
70
- background: #d4edda;
71
- border: 1px solid #c3e6cb;
72
- color: #155724;
73
- }
74
- .result.error {
75
- background: #f8d7da;
76
- border: 1px solid #f5c6cb;
77
- color: #721c24;
78
- }
79
- .result.info {
80
- background: #d1ecf1;
81
- border: 1px solid #bee5eb;
82
- color: #0c5460;
83
- }
84
- .info-box {
85
- background: #fff3cd;
86
- border: 1px solid #ffc107;
87
- border-radius: 4px;
88
- padding: 15px;
89
- margin: 20px 0;
90
- }
91
- .info-box strong {
92
- display: block;
93
- margin-bottom: 5px;
94
- }
95
- .processor-list {
96
- display: grid;
97
- grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
98
- gap: 10px;
99
- margin: 15px 0;
100
- }
101
- .processor-item {
102
- background: #e7f3ff;
103
- padding: 10px;
104
- border-radius: 4px;
105
- border-left: 3px solid #007bff;
106
- }
107
- .processor-item.supported {
108
- border-left-color: #28a745;
109
- background: #d4edda;
110
- }
111
- </style>
112
- </head>
113
- <body>
114
- <h1>🧪 AAC Processors - Browser Compatibility Test</h1>
115
-
116
- <div class="info-box">
117
- <strong>ℹ️ About this test page</strong>
118
- This page tests AACProcessors in a real browser environment. It verifies that processors
119
- can load files using browser APIs (File, Blob, ArrayBuffer) without any Node.js dependencies.
120
- </div>
121
-
122
- <div class="test-section">
123
- <h2>Supported Processors</h2>
124
- <div class="processor-list">
125
- <div class="processor-item supported">✅ DotProcessor (.dot)</div>
126
- <div class="processor-item supported">✅ OpmlProcessor (.opml)</div>
127
- <div class="processor-item supported">✅ ObfProcessor (.obf/.obz)</div>
128
- <div class="processor-item supported">✅ GridsetProcessor (.gridset)</div>
129
- <div class="processor-item supported">✅ ApplePanelsProcessor (.plist)</div>
130
- <div class="processor-item supported">✅ AstericsGridProcessor (.grd)</div>
131
- </div>
132
- <p style="color: #666; font-size: 14px;">
133
- <strong>Note:</strong> SnapProcessor and TouchChatProcessor require Node.js (sqlite).
134
- GridsetProcessor .gridsetx files require Node.js (crypto).
135
- </p>
136
- </div>
137
-
138
- <div class="test-section">
139
- <h2>📁 Load and Test Files</h2>
140
-
141
- <div class="file-input">
142
- <label for="fileInput">Select a file to test:</label>
143
- <input type="file" id="fileInput" accept=".dot,.opml,.obf,.obz,.gridset,.plist,.grd">
144
- </div>
145
-
146
- <button id="testButton" class="test-button" disabled>Test File</button>
147
- <button id="clearButton" class="test-button">Clear Results</button>
148
-
149
- <div id="result" class="result" style="display: none;"></div>
150
- </div>
151
-
152
- <div class="test-section">
153
- <h2>🧪 Automated Tests</h2>
154
- <button id="runAllTests" class="test-button">Run All Browser Tests</button>
155
- <div id="testResults" class="result" style="display: none;"></div>
156
- </div>
157
-
158
- <!-- Note: Using a module loader to handle CommonJS exports -->
159
- <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
160
- <script data-type="module" type="text/babel" data-presets="env">
161
- // Since the build outputs CommonJS, we need to dynamically import the processors
162
- // For now, we'll use a simpler approach with inline test code
163
-
164
- class AACProcessorsTest {
165
- constructor() {
166
- this.processors = {};
167
- this.init();
168
- }
169
-
170
- async init() {
171
- // Initialize processors after DOM is ready
172
- const fileInput = document.getElementById('fileInput');
173
- const testButton = document.getElementById('testButton');
174
- const clearButton = document.getElementById('clearButton');
175
- const runAllTestsButton = document.getElementById('runAllTests');
176
-
177
- fileInput.addEventListener('change', (e) => this.handleFileSelect(e));
178
- testButton.addEventListener('click', () => this.testFile());
179
- clearButton.addEventListener('click', () => this.clearResults());
180
- runAllTestsButton.addEventListener('click', () => this.runAutomatedTests());
181
-
182
- console.log('AAC Processors Browser Test Page Ready');
183
- console.log('Note: This page tests the library structure but cannot run actual processors without a bundler.');
184
- console.log('For actual browser usage, see docs/BROWSER_USAGE.md for bundler setup.');
185
- }
186
-
187
- showMessage(message, type = 'info') {
188
- const resultDiv = document.getElementById('result');
189
- resultDiv.style.display = 'block';
190
- resultDiv.className = `result ${type}`;
191
- resultDiv.textContent = message;
192
- }
193
-
194
- showTestResults(results) {
195
- const testResultsDiv = document.getElementById('testResults');
196
- testResultsDiv.style.display = 'block';
197
- testResultsDiv.className = 'result info';
198
- testResultsDiv.textContent = results;
199
- }
200
-
201
- handleFileSelect(event) {
202
- const file = event.target.files[0];
203
- const testButton = document.getElementById('testButton');
204
-
205
- if (file) {
206
- testButton.disabled = false;
207
- this.showMessage(`Selected: ${file.name} (${file.size} bytes)\n\nNote: Actual processing requires a bundler (webpack/vite/rollup) to bundle the library for browser use.`, 'info');
208
- } else {
209
- testButton.disabled = true;
210
- document.getElementById('result').style.display = 'none';
211
- }
212
- }
213
-
214
- async testFile() {
215
- this.showMessage(
216
- '⚠️ Browser Build Note\n\n' +
217
- 'The current build outputs CommonJS modules which require a bundler.\n\n' +
218
- 'To use AACProcessors in a browser:\n\n' +
219
- '1. Use a bundler (webpack, vite, rollup, etc.)\n' +
220
- '2. Or use a CDN bundle (when available)\n' +
221
- '3. See docs/BROWSER_USAGE.md for complete setup instructions\n\n' +
222
- 'Example with Vite:\n' +
223
- '```js\n' +
224
- 'import { getProcessor } from "aac-processors";\n' +
225
- 'const processor = getProcessor(".obf");\n' +
226
- '```',
227
- 'info'
228
- );
229
- }
230
-
231
- clearResults() {
232
- document.getElementById('result').style.display = 'none';
233
- document.getElementById('testResults').style.display = 'none';
234
- }
235
-
236
- async runAutomatedTests() {
237
- const results = [];
238
- results.push('=== AACProcessors Browser Test ===\n');
239
- results.push('\nℹ️ Library Structure Tests:\n');
240
-
241
- // Test 1: Check if dist files exist
242
- results.push('1. Checking build files...');
243
- try {
244
- const response = await fetch('../dist/index.browser.js');
245
- if (response.ok) {
246
- const content = await response.text();
247
- const hasExports = content.includes('exports.getProcessor') &&
248
- content.includes('exports.GridsetProcessor') &&
249
- content.includes('exports.ObfProcessor');
250
-
251
- if (hasExports) {
252
- results.push(' ✅ PASS: Browser build exists with expected exports');
253
- results.push(` ✅ Size: ${(content.length / 1024).toFixed(2)} KB`);
254
- } else {
255
- results.push(' ⚠️ WARNING: Some exports may be missing');
256
- }
257
- } else {
258
- results.push(' ❌ FAIL: Browser build not found');
259
- }
260
- } catch (error) {
261
- results.push(` ❌ FAIL: ${error.message}`);
262
- }
263
-
264
- // Test 2: Check type definitions
265
- results.push('\n2. Checking TypeScript definitions...');
266
- try {
267
- const response = await fetch('../dist/index.browser.d.ts');
268
- if (response.ok) {
269
- const content = await response.text();
270
- const hasTypes = content.includes('getProcessor') &&
271
- content.includes('DotProcessor') &&
272
- content.includes('GridsetProcessor');
273
-
274
- if (hasTypes) {
275
- results.push(' ✅ PASS: Type definitions exist');
276
- } else {
277
- results.push(' ⚠️ WARNING: Some type definitions may be missing');
278
- }
279
- } else {
280
- results.push(' ❌ FAIL: Type definitions not found');
281
- }
282
- } catch (error) {
283
- results.push(` ❌ FAIL: ${error.message}`);
284
- }
285
-
286
- // Test 3: Processor count
287
- results.push('\n3. Counting processors...');
288
- try {
289
- const response = await fetch('../dist/index.browser.js');
290
- const content = await response.text();
291
- const processorExports = content.match(/exports\.\w+Processor/g);
292
-
293
- if (processorExports) {
294
- const uniqueProcessors = [...new Set(processorExports)];
295
- results.push(` ✅ Found ${uniqueProcessors.length} processor exports:`);
296
- uniqueProcessors.forEach(p => results.push(` - ${p.replace('exports.', '')}`));
297
- }
298
- } catch (error) {
299
- results.push(` ❌ FAIL: ${error.message}`);
300
- }
301
-
302
- results.push('\n=== Setup Instructions ===\n');
303
- results.push('To use AACProcessors in your browser project:\n\n');
304
- results.push('1. Install with npm: npm install @willwade/aac-processors\n');
305
- results.push('2. Use a bundler (Vite example):\n');
306
- results.push(' ```js\n');
307
- results.push(' // vite.config.js\n');
308
- results.push(' export default {\n');
309
- results.push(' resolve: {\n');
310
- results.push(' alias: {\n');
311
- results.push(' "aac-processors": path.resolve(__dirname, "node_modules/@willwade/aac-processors/src/index.browser.ts")\n');
312
- results.push(' }\n');
313
- results.push(' }\n');
314
- results.push(' }\n');
315
- results.push(' ```\n\n');
316
- results.push('3. Or use a CDN bundle (when available)\n\n');
317
- results.push('See docs/BROWSER_USAGE.md for complete guide.');
318
-
319
- this.showTestResults(results.join('\n'));
320
- }
321
- }
322
-
323
- // Initialize when DOM is ready
324
- if (document.readyState === 'loading') {
325
- document.addEventListener('DOMContentLoaded', () => new AACProcessorsTest());
326
- } else {
327
- new AACProcessorsTest();
328
- }
329
- </script>
330
- </body>
331
- </html>