@keymanapp/kmc-analyze 18.0.17-alpha → 18.0.19-alpha
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/build/src/index.js +10 -9
- package/build/src/index.js.map +1 -1
- package/build/src/messages.js +24 -23
- package/build/src/messages.js.map +1 -1
- package/build/src/osk-character-use/index.js +283 -282
- package/build/src/osk-character-use/index.js.map +1 -1
- package/build/src/osk-rewrite-pua/index.js +131 -130
- package/build/src/osk-rewrite-pua/index.js.map +1 -1
- package/build/src/util/get-osk-from-kmn-file.js +32 -31
- package/build/src/util/get-osk-from-kmn-file.js.map +1 -1
- package/package.json +5 -5
package/build/src/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* kmc-analyze - keyboard analysis classes, including tools for `&displayMap`.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d57ffaf0-e420-5344-91d2-a3515a8e86eb")}catch(e){}}();
|
|
7
|
+
export { AnalyzeOskCharacterUse } from './osk-character-use/index.js';
|
|
8
|
+
export { AnalyzeOskRewritePua } from './osk-rewrite-pua/index.js';
|
|
9
|
+
export { AnalyzerMessages } from './messages.js';
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
11
|
+
//# debugId=d57ffaf0-e420-5344-91d2-a3515a8e86eb
|
package/build/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourceRoot":"","names":[],"mappings":"AAAA;;;GAGG;;;AAEH,OAAO,EAAE,sBAAsB,EAAiC,MAAM,8BAA8B,CAAC;AACrG,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC","debug_id":"d57ffaf0-e420-5344-91d2-a3515a8e86eb"}
|
package/build/src/messages.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
// const
|
|
8
|
-
// const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
static
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
static
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7aed8e9d-a764-5bbe-bb3d-137414d2b44f")}catch(e){}}();
|
|
3
|
+
import { CompilerErrorNamespace, CompilerErrorSeverity, CompilerMessageSpec as m, CompilerMessageDef as def, CompilerMessageSpecWithException } from "@keymanapp/common-types";
|
|
4
|
+
import { KeymanUrls } from "@keymanapp/developer-utils";
|
|
5
|
+
const Namespace = CompilerErrorNamespace.Analyzer;
|
|
6
|
+
const SevInfo = CompilerErrorSeverity.Info | Namespace;
|
|
7
|
+
// const SevHint = CompilerErrorSeverity.Hint | Namespace;
|
|
8
|
+
// const SevWarn = CompilerErrorSeverity.Warn | Namespace;
|
|
9
|
+
// const SevError = CompilerErrorSeverity.Error | Namespace;
|
|
10
|
+
const SevFatal = CompilerErrorSeverity.Fatal | Namespace;
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
* Compiler messages for `kmc analyze`
|
|
14
|
+
*/
|
|
15
|
+
export class AnalyzerMessages {
|
|
16
|
+
static FATAL_UnexpectedException = SevFatal | 0x0001;
|
|
17
|
+
static Fatal_UnexpectedException = (o) => CompilerMessageSpecWithException(this.FATAL_UnexpectedException, null, o.e ?? 'unknown error', `Raised when an analysis components has an internal error. If you
|
|
18
|
+
experience this error, it should be reported to the Keyman team for
|
|
19
|
+
resolution via ${KeymanUrls.NEW_KEYMAN_ISSUE()}`);
|
|
20
|
+
static INFO_ScanningFile = SevInfo | 0x0002;
|
|
21
|
+
static Info_ScanningFile = (o) => m(this.INFO_ScanningFile, `Scanning ${def(o.type)} file ${def(o.name)}`, `Informative message reporting on the current file being scanned`);
|
|
22
|
+
}
|
|
23
|
+
;
|
|
24
24
|
//# sourceMappingURL=messages.js.map
|
|
25
|
+
//# debugId=7aed8e9d-a764-5bbe-bb3d-137414d2b44f
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"version":3,"file":"messages.js","sources":["../../src/messages.ts"],"sourceRoot":"","names":[],"mappings":";;AAAA,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,mBAAmB,IAAI,CAAC,EAAE,kBAAkB,IAAI,GAAG,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;AAC/K,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,MAAM,SAAS,GAAG,sBAAsB,CAAC,QAAQ,CAAC;AAClD,MAAM,OAAO,GAAG,qBAAqB,CAAC,IAAI,GAAG,SAAS,CAAC;AACvD,0DAA0D;AAC1D,0DAA0D;AAC1D,4DAA4D;AAC5D,MAAM,QAAQ,GAAG,qBAAqB,CAAC,KAAK,GAAG,SAAS,CAAC;AAEzD;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IAC3B,MAAM,CAAU,yBAAyB,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC9D,MAAM,CAAU,yBAAyB,GAAG,C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54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
//
|
|
72
|
-
//
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
//
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
//
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
//
|
|
125
|
-
//
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
scanPlatform(source.
|
|
190
|
-
scanPlatform(source.
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
//
|
|
195
|
-
//
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
let
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
* @
|
|
232
|
-
*
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
//
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
lines
|
|
259
|
-
lines.push('
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f9a7a0ad-0a19-5873-822c-07a700ee3287")}catch(e){}}();
|
|
3
|
+
import { KeymanFileTypes, KvksFileReader, TouchLayoutFileReader } from "@keymanapp/common-types";
|
|
4
|
+
import { CompilerMessages } from '@keymanapp/kmc-kmn';
|
|
5
|
+
import { escapeMarkdownChar } from '@keymanapp/developer-utils';
|
|
6
|
+
import { getOskFromKmnFile } from "../util/get-osk-from-kmn-file.js";
|
|
7
|
+
import { AnalyzerMessages } from "../messages.js";
|
|
8
|
+
const defaultOptions = {
|
|
9
|
+
puaBase: 0xF100,
|
|
10
|
+
stripDottedCircle: false,
|
|
11
|
+
includeCounts: false,
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* @public
|
|
15
|
+
* Analyze the characters used in On Screen Keyboard files (.kvks,
|
|
16
|
+
* .keyman-touch-layout) for use with `&displayMap`.
|
|
17
|
+
*/
|
|
18
|
+
export class AnalyzeOskCharacterUse {
|
|
19
|
+
callbacks;
|
|
20
|
+
_strings = {};
|
|
21
|
+
options;
|
|
22
|
+
constructor(callbacks, options) {
|
|
23
|
+
this.callbacks = callbacks;
|
|
24
|
+
this.options = { ...defaultOptions, ...options };
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Clears analysis data collected from previous calls to
|
|
28
|
+
* {@link AnalyzeOskCharacterUse.analyze}
|
|
29
|
+
*/
|
|
30
|
+
clear() {
|
|
31
|
+
this._strings = {};
|
|
32
|
+
}
|
|
33
|
+
//
|
|
34
|
+
// Analyze a single file
|
|
35
|
+
//
|
|
36
|
+
/**
|
|
37
|
+
* Analyzes a single source file for Unicode character usage. Can parse .kmn,
|
|
38
|
+
* .kvks, .keyman-touch-layout file formats. Can be called multiple times to
|
|
39
|
+
* collect results from more than one file. Use
|
|
40
|
+
* {@link AnalyzeOskCharacterUse.getStrings} to retrieve results.
|
|
41
|
+
*
|
|
42
|
+
* Note: `analyze()` collects key cap data, so calling this for a .kmn file
|
|
43
|
+
* will retrieve the key caps from the .kvks and .keyman-touch-layout files
|
|
44
|
+
* that it references, rather than key cap data from the .kmn file itself.
|
|
45
|
+
*
|
|
46
|
+
* @param file - relative or absolute path to a Keyman source file
|
|
47
|
+
* @returns true if the file is successfully loaded and parsed
|
|
48
|
+
*/
|
|
49
|
+
async analyze(file) {
|
|
50
|
+
switch (KeymanFileTypes.sourceTypeFromFilename(file)) {
|
|
51
|
+
case ".kvks" /* KeymanFileTypes.Source.VisualKeyboard */: {
|
|
52
|
+
let strings = this.scanVisualKeyboard(file);
|
|
53
|
+
if (!strings) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
this.addStrings(strings, file);
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
case ".keyman-touch-layout" /* KeymanFileTypes.Source.TouchLayout */: {
|
|
60
|
+
let strings = this.scanTouchLayout(file);
|
|
61
|
+
if (!strings) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
this.addStrings(strings, file);
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
case ".kpj" /* KeymanFileTypes.Source.Project */:
|
|
68
|
+
throw new Error('Passing a project to analyze is not permitted');
|
|
69
|
+
break;
|
|
70
|
+
case ".kmn" /* KeymanFileTypes.Source.KeymanKeyboard */:
|
|
71
|
+
// The cleanest way to do this is to compile the .kmn to find the .kvks
|
|
72
|
+
// and .keyman-touch-layout from the &VISUALKEYBOARD and &LAYOUTFILE
|
|
73
|
+
// system stores
|
|
74
|
+
if (!await this.analyzeKmnKeyboard(file)) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
break;
|
|
78
|
+
case ".xml" /* KeymanFileTypes.Source.LdmlKeyboard */:
|
|
79
|
+
// TODO: await this.analyzeLdmlKeyboard(file);
|
|
80
|
+
// note, will need to skip .xml files that are not ldml keyboards
|
|
81
|
+
break;
|
|
82
|
+
default:
|
|
83
|
+
// Ignore any other file types; this way we can analyze project files/folders
|
|
84
|
+
// easily also
|
|
85
|
+
}
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
async analyzeKmnKeyboard(filename) {
|
|
89
|
+
this.callbacks.reportMessage(AnalyzerMessages.Info_ScanningFile({ type: 'keyboard source', name: filename }));
|
|
90
|
+
let osk = await getOskFromKmnFile(this.callbacks, filename);
|
|
91
|
+
if (osk.kvksFilename) {
|
|
92
|
+
let strings = this.scanVisualKeyboard(osk.kvksFilename);
|
|
93
|
+
if (!strings) {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
this.addStrings(strings, osk.kvksFilename);
|
|
97
|
+
}
|
|
98
|
+
if (osk.touchLayoutFilename) {
|
|
99
|
+
let strings = this.scanTouchLayout(osk.touchLayoutFilename);
|
|
100
|
+
if (!strings) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
this.addStrings(strings, osk.touchLayoutFilename);
|
|
104
|
+
}
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
addStrings(strings, filename) {
|
|
108
|
+
// Reduce all references to get usage count per file
|
|
109
|
+
let reducedStrings = [...new Set(strings)].map(e => ({
|
|
110
|
+
str: e,
|
|
111
|
+
usages: [{ filename: this.callbacks.path.basename(filename), count: strings.filter(n => n === e).length }]
|
|
112
|
+
}));
|
|
113
|
+
// Merge result with existing found strings
|
|
114
|
+
for (let e of reducedStrings) {
|
|
115
|
+
this._strings[e.str] = [].concat(this._strings[e.str] ?? [], ...e.usages);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
cleanString(s) {
|
|
119
|
+
if (this.options.stripDottedCircle) {
|
|
120
|
+
s = s.replace(/\u25cc/g, '');
|
|
121
|
+
}
|
|
122
|
+
return s.trim();
|
|
123
|
+
}
|
|
124
|
+
//
|
|
125
|
+
// On Screen Keyboard file scanning
|
|
126
|
+
//
|
|
127
|
+
scanVisualKeyboard(filename) {
|
|
128
|
+
this.callbacks.reportMessage(AnalyzerMessages.Info_ScanningFile({ type: 'visual keyboard', name: filename }));
|
|
129
|
+
let strings = [];
|
|
130
|
+
const reader = new KvksFileReader();
|
|
131
|
+
let source;
|
|
132
|
+
try {
|
|
133
|
+
source = reader.read(this.callbacks.loadFile(filename));
|
|
134
|
+
}
|
|
135
|
+
catch (e) {
|
|
136
|
+
this.callbacks.reportMessage(CompilerMessages.Error_InvalidKvksFile({ filename, e }));
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
let invalidKeys = [];
|
|
140
|
+
const vk = reader.transform(source, invalidKeys);
|
|
141
|
+
if (!vk) {
|
|
142
|
+
this.callbacks.reportMessage(CompilerMessages.Error_InvalidKvksFile({ filename, e: null }));
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
for (let key of vk.keys) {
|
|
146
|
+
if (key.text) {
|
|
147
|
+
strings.push(this.cleanString(key.text));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return strings;
|
|
151
|
+
}
|
|
152
|
+
scanTouchLayout(filename) {
|
|
153
|
+
this.callbacks.reportMessage(AnalyzerMessages.Info_ScanningFile({ type: 'touch layout', name: filename }));
|
|
154
|
+
let strings = [];
|
|
155
|
+
const reader = new TouchLayoutFileReader();
|
|
156
|
+
const source = reader.read(this.callbacks.loadFile(filename));
|
|
157
|
+
const scanKey = (key) => {
|
|
158
|
+
if (!key.text) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
if (key.text.length > 2 && key.text[0] == '*' && key.text[key.text.length - 1] == '*') {
|
|
162
|
+
// Don't add '*special*' key captions
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
strings.push(this.cleanString(key.text));
|
|
166
|
+
};
|
|
167
|
+
const scanPlatform = (platform) => {
|
|
168
|
+
if (!platform) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
for (let layer of platform.layer) {
|
|
172
|
+
for (let row of layer.row) {
|
|
173
|
+
for (let key of row.key) {
|
|
174
|
+
scanKey(key);
|
|
175
|
+
let f;
|
|
176
|
+
for (f in key.flick ?? {}) {
|
|
177
|
+
scanKey(key.flick[f]);
|
|
178
|
+
}
|
|
179
|
+
for (let sk of key.sk ?? []) {
|
|
180
|
+
scanKey(sk);
|
|
181
|
+
}
|
|
182
|
+
for (let mt of key.multitap ?? []) {
|
|
183
|
+
scanKey(mt);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
scanPlatform(source.desktop);
|
|
190
|
+
scanPlatform(source.phone);
|
|
191
|
+
scanPlatform(source.tablet);
|
|
192
|
+
return strings;
|
|
193
|
+
}
|
|
194
|
+
//
|
|
195
|
+
// Results reporting
|
|
196
|
+
//
|
|
197
|
+
prepareResults(strings) {
|
|
198
|
+
let result = [];
|
|
199
|
+
let pua = this.options.puaBase;
|
|
200
|
+
for (let str of Object.keys(strings)) {
|
|
201
|
+
result.push({
|
|
202
|
+
pua: pua.toString(16).toUpperCase(),
|
|
203
|
+
str,
|
|
204
|
+
unicode: AnalyzeOskCharacterUse.stringToUnicodeSequence(str, false),
|
|
205
|
+
usages: this.options.includeCounts ? strings[str] : strings[str].map(item => item.filename)
|
|
206
|
+
});
|
|
207
|
+
pua++;
|
|
208
|
+
}
|
|
209
|
+
return result;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Returns the collected results from earlier calls to
|
|
213
|
+
* {@link AnalyzeOskCharacterUse.analyze}. This generates a mapping from a key
|
|
214
|
+
* cap (one or more characters) to a PUA code, for use with `&displayMap`.
|
|
215
|
+
*
|
|
216
|
+
* Three output formats are supported:
|
|
217
|
+
*
|
|
218
|
+
* - .txt: tab-separated string format, with three columns: PUA, Key Cap, and
|
|
219
|
+
* plain string. The PUA and Key Cap columns are formatted as Unicode Scalar
|
|
220
|
+
* Values, e.g. U+0061, and the plain string is the original key cap string.
|
|
221
|
+
*
|
|
222
|
+
* - .md: formatted for documentation purposes. Generates a Markdown table
|
|
223
|
+
* (GFM) with PUA, Key Cap, and plain string. The PUA and Key Cap columns
|
|
224
|
+
* are formatted as Unicode Scalar Values, e.g. U+0061, and the plain string
|
|
225
|
+
* is the original key cap string.
|
|
226
|
+
*
|
|
227
|
+
* - .json: returns the final aggregated data as an array of strings, which
|
|
228
|
+
* can be joined to form a JSON blob of an object with a single member,
|
|
229
|
+
* `map`, which is an array of {@link Osk.StringResult} objects.
|
|
230
|
+
*
|
|
231
|
+
* @param format - file format to return - can be '.txt', '.md', or '.json'
|
|
232
|
+
* @returns an array of strings, formatted according to the `format`
|
|
233
|
+
* parameter.
|
|
234
|
+
*/
|
|
235
|
+
getStrings(format) {
|
|
236
|
+
const final = this.prepareResults(this._strings);
|
|
237
|
+
switch (format) {
|
|
238
|
+
case '.md':
|
|
239
|
+
return AnalyzeOskCharacterUse.getStringsAsMarkdown(final);
|
|
240
|
+
case '.json':
|
|
241
|
+
return AnalyzeOskCharacterUse.getStringsAsJson(final);
|
|
242
|
+
}
|
|
243
|
+
return AnalyzeOskCharacterUse.getStringsAsText(final);
|
|
244
|
+
}
|
|
245
|
+
// Following functions are static so that we can keep them pure
|
|
246
|
+
// and potentially refactor into separate reporting class later
|
|
247
|
+
static getStringsAsText(strings) {
|
|
248
|
+
// Text result only returns PUA, unicode sequence, and plain string
|
|
249
|
+
let lines = [];
|
|
250
|
+
for (let s of strings) {
|
|
251
|
+
const ux = this.stringToUnicodeSequence(s.str);
|
|
252
|
+
lines.push('U+' + s.pua + '\t' + ux + '\t' + s.str);
|
|
253
|
+
}
|
|
254
|
+
return lines;
|
|
255
|
+
}
|
|
256
|
+
static getStringsAsMarkdown(strings) {
|
|
257
|
+
// Markdown result only returns PUA, unicode sequence, and plain string
|
|
258
|
+
let lines = [];
|
|
259
|
+
lines.push('PUA | Code Points | Key Caps');
|
|
260
|
+
lines.push('-------|-------------|---------');
|
|
261
|
+
for (let s of strings) {
|
|
262
|
+
const ux = this.stringToUnicodeSequence(s.str);
|
|
263
|
+
lines.push('U+' + s.pua + ' | ' + ux + ' | ' + escapeMarkdownChar(s.str, true));
|
|
264
|
+
}
|
|
265
|
+
return lines;
|
|
266
|
+
}
|
|
267
|
+
static getStringsAsJson(strings) {
|
|
268
|
+
// For future expansion, we wrap the array in a 'map' property
|
|
269
|
+
let map = { "map": strings };
|
|
270
|
+
return JSON.stringify(map, null, 2).split('\n');
|
|
271
|
+
}
|
|
272
|
+
static stringToUnicodeSequence(s, addUPlusPrefix = true) {
|
|
273
|
+
let result = [];
|
|
274
|
+
for (let ch of s) {
|
|
275
|
+
let c = ch.codePointAt(0).toString(16).toUpperCase();
|
|
276
|
+
if (c.length < 4)
|
|
277
|
+
c = '0'.repeat(4 - c.length) + c;
|
|
278
|
+
result.push((addUPlusPrefix ? 'U+' : '') + c);
|
|
279
|
+
}
|
|
280
|
+
return result.join(' ');
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
283
|
//# sourceMappingURL=index.js.map
|
|
284
|
+
//# debugId=f9a7a0ad-0a19-5873-822c-07a700ee3287
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/osk-character-use/index.ts"],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
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
//
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
* with
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
//
|
|
89
|
-
//
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="afce4aa9-23fc-5726-a96d-3716c9c177a6")}catch(e){}}();
|
|
3
|
+
import { KeymanFileTypes, KvksFileReader, KvksFileWriter, TouchLayoutFileReader, TouchLayoutFileWriter } from "@keymanapp/common-types";
|
|
4
|
+
import { CompilerMessages, Osk } from '@keymanapp/kmc-kmn';
|
|
5
|
+
import { getOskFromKmnFile } from "../util/get-osk-from-kmn-file.js";
|
|
6
|
+
import { AnalyzerMessages } from "../messages.js";
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
* Rewrite On Screen Keyboard files (.kvks, .keyman-touch-layout) with PUA
|
|
10
|
+
* codepoints, based on analysis provided by {@link AnalyzeOskCharacterUse}
|
|
11
|
+
* class.
|
|
12
|
+
*/
|
|
13
|
+
export class AnalyzeOskRewritePua {
|
|
14
|
+
callbacks;
|
|
15
|
+
_data = {};
|
|
16
|
+
constructor(callbacks) {
|
|
17
|
+
this.callbacks = callbacks;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Clears data collected from previous calls to
|
|
21
|
+
* {@link AnalyzeOskRewritePua.analyze}
|
|
22
|
+
*/
|
|
23
|
+
clear() {
|
|
24
|
+
this._data = {};
|
|
25
|
+
}
|
|
26
|
+
//
|
|
27
|
+
// Analyze a single file
|
|
28
|
+
//
|
|
29
|
+
/**
|
|
30
|
+
* Analyze a keyboard file or files, and provide a remapped output. Accepts a
|
|
31
|
+
* .kmn, .kvks, .keyman-touch-layout file formats. For .kmn, will rewrite
|
|
32
|
+
* associated On Screen Keyboard file formats. Can be called multiple times to
|
|
33
|
+
* rewrite multiple files. Use the {@link AnalyzeOskRewritePua.data} property
|
|
34
|
+
* to retrieve the output file content for writing. This does not modify the
|
|
35
|
+
* source file.
|
|
36
|
+
* @param file - relative or absolute path to a Keyman source file
|
|
37
|
+
* @param mapping - OSK keycap map provided by {@link AnalyzeOskCharacterUse}
|
|
38
|
+
* @returns true if the file is successfully loaded and rewritten
|
|
39
|
+
*/
|
|
40
|
+
async analyze(file, mapping) {
|
|
41
|
+
let map = Osk.parseMapping(mapping);
|
|
42
|
+
switch (KeymanFileTypes.sourceTypeFromFilename(file)) {
|
|
43
|
+
case ".kvks" /* KeymanFileTypes.Source.VisualKeyboard */:
|
|
44
|
+
this._data[file] = this.analyzeVisualKeyboard(file, map);
|
|
45
|
+
break;
|
|
46
|
+
case ".keyman-touch-layout" /* KeymanFileTypes.Source.TouchLayout */:
|
|
47
|
+
this._data[file] = this.analyzeTouchLayout(file, map);
|
|
48
|
+
break;
|
|
49
|
+
case ".kpj" /* KeymanFileTypes.Source.Project */:
|
|
50
|
+
throw new Error('Passing a project to analyze is not permitted');
|
|
51
|
+
break;
|
|
52
|
+
case ".kmn" /* KeymanFileTypes.Source.KeymanKeyboard */:
|
|
53
|
+
// The cleanest way to do this is to compile the .kmn to find the .kvks
|
|
54
|
+
// and .keyman-touch-layout from the &VISUALKEYBOARD and &LAYOUTFILE
|
|
55
|
+
// system stores
|
|
56
|
+
if (!await this.analyzeKmnKeyboard(file, map)) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
60
|
+
case ".xml" /* KeymanFileTypes.Source.LdmlKeyboard */:
|
|
61
|
+
// TODO: await this.analyzeLdmlKeyboard(file);
|
|
62
|
+
// note, will need to skip .xml files that are not ldml keyboards
|
|
63
|
+
break;
|
|
64
|
+
default:
|
|
65
|
+
// Ignore any other file types; this way we can analyze project files/folders
|
|
66
|
+
// easily also
|
|
67
|
+
}
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Returns the file data for OSK files rewritten with PUA characters, for use
|
|
72
|
+
* with `&displayMap`.
|
|
73
|
+
*/
|
|
74
|
+
get data() {
|
|
75
|
+
return this._data;
|
|
76
|
+
}
|
|
77
|
+
async analyzeKmnKeyboard(filename, map) {
|
|
78
|
+
this.callbacks.reportMessage(AnalyzerMessages.Info_ScanningFile({ type: 'keyboard source', name: filename }));
|
|
79
|
+
let osk = await getOskFromKmnFile(this.callbacks, filename);
|
|
80
|
+
if (osk.kvksFilename) {
|
|
81
|
+
this._data[osk.kvksFilename] = this.analyzeVisualKeyboard(osk.kvksFilename, map);
|
|
82
|
+
}
|
|
83
|
+
if (osk.touchLayoutFilename) {
|
|
84
|
+
this._data[osk.touchLayoutFilename] = this.analyzeTouchLayout(osk.touchLayoutFilename, map);
|
|
85
|
+
}
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
//
|
|
89
|
+
// On Screen Keyboard file scanning
|
|
90
|
+
//
|
|
91
|
+
analyzeVisualKeyboard(filename, map) {
|
|
92
|
+
this.callbacks.reportMessage(AnalyzerMessages.Info_ScanningFile({ type: 'visual keyboard', name: filename }));
|
|
93
|
+
const reader = new KvksFileReader();
|
|
94
|
+
let source;
|
|
95
|
+
try {
|
|
96
|
+
source = reader.read(this.callbacks.loadFile(filename));
|
|
97
|
+
}
|
|
98
|
+
catch (e) {
|
|
99
|
+
this.callbacks.reportMessage(CompilerMessages.Error_InvalidKvksFile({ filename, e }));
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
let invalidKeys = [];
|
|
103
|
+
const vk = reader.transform(source, invalidKeys);
|
|
104
|
+
if (!vk) {
|
|
105
|
+
this.callbacks.reportMessage(CompilerMessages.Error_InvalidKvksFile({ filename, e: null }));
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
const dirty = Osk.remapVisualKeyboard(vk, map);
|
|
109
|
+
if (!dirty) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
const writer = new KvksFileWriter();
|
|
113
|
+
const data = writer.write(vk);
|
|
114
|
+
// TODO: the encoder probably needs to go into KvksFileWRiter
|
|
115
|
+
const enc = new TextEncoder();
|
|
116
|
+
return enc.encode(data);
|
|
117
|
+
}
|
|
118
|
+
analyzeTouchLayout(filename, map) {
|
|
119
|
+
this.callbacks.reportMessage(AnalyzerMessages.Info_ScanningFile({ type: 'touch layout', name: filename }));
|
|
120
|
+
const reader = new TouchLayoutFileReader();
|
|
121
|
+
const source = reader.read(this.callbacks.loadFile(filename));
|
|
122
|
+
let dirty = Osk.remapTouchLayout(source, map);
|
|
123
|
+
if (!dirty) {
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
const writer = new TouchLayoutFileWriter({ formatted: true });
|
|
127
|
+
const data = writer.write(source);
|
|
128
|
+
return data;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
131
|
//# sourceMappingURL=index.js.map
|
|
132
|
+
//# debugId=afce4aa9-23fc-5726-a96d-3716c9c177a6
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/osk-rewrite-pua/index.ts"],"sourceRoot":"","names":[],"mappings":";;AAAA,OAAO,EAAqB,eAAe,EAAY,cAAc,EAAE,cAAc,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrK,OAAO,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,OAAO,oBAAoB;IAGX;IAFZ,KAAK,GAAiC,EAAE,CAAC;IAEjD,YAAoB,SAA4B;QAA5B,cAAS,GAAT,SAAS,CAAmB;IAChD,CAAC;IAED;;;OAGG;IACI,KAAK;QACV,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IAClB,CAAC;IAED,EAAE;IACF,wBAAwB;IACxB,EAAE;IAEF;;;;;;;;;;OAUG;IACI,KAAK,CAAC,OAAO,CAAC,IAAY,EAAE,OAA2B;QAC5D,IAAI,GAAG,GAAe,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAEhD,QAAO,eAAe,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE;YACnD;gBACE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|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a10b6c66-188f-52d4-9055-0f3fbda8317c")}catch(e){}}();
|
|
3
|
+
import { KMX, KmxFileReader } from "@keymanapp/common-types";
|
|
4
|
+
import { KmnCompiler } from "@keymanapp/kmc-kmn";
|
|
5
|
+
export async function getOskFromKmnFile(callbacks, filename) {
|
|
6
|
+
let kvksFilename;
|
|
7
|
+
let touchLayoutFilename;
|
|
8
|
+
const kmnCompiler = new KmnCompiler();
|
|
9
|
+
if (!await kmnCompiler.init(callbacks, {
|
|
10
|
+
shouldAddCompilerVersion: false,
|
|
11
|
+
saveDebug: false,
|
|
12
|
+
})) {
|
|
13
|
+
// kmnCompiler will report errors
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
let result = await kmnCompiler.run(filename, null);
|
|
17
|
+
if (!result) {
|
|
18
|
+
// kmnCompiler will report any errors
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
if (result.extra.kvksFilename) {
|
|
22
|
+
kvksFilename = callbacks.resolveFilename(filename, result.extra.kvksFilename);
|
|
23
|
+
}
|
|
24
|
+
const reader = new KmxFileReader();
|
|
25
|
+
const keyboard = reader.read(result.artifacts.kmx.data);
|
|
26
|
+
const touchLayoutStore = keyboard.stores.find(store => store.dwSystemID == KMX.KMXFile.TSS_LAYOUTFILE);
|
|
27
|
+
if (touchLayoutStore) {
|
|
28
|
+
touchLayoutFilename = callbacks.resolveFilename(filename, touchLayoutStore.dpString);
|
|
29
|
+
}
|
|
30
|
+
return { kvksFilename, touchLayoutFilename };
|
|
31
|
+
}
|
|
32
32
|
//# sourceMappingURL=get-osk-from-kmn-file.js.map
|
|
33
|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C,cAAc,CAAC,CAAC;IAEvG,IAAG,gBAAgB,EAAE;QACnB,mBAAmB,GAAG,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;KACtF;IAED,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,CAAA;AAC9C,CAAC","debug_id":"a10b6c66-188f-52d4-9055-0f3fbda8317c"}
|
package/package.json
CHANGED
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"build/src/"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@keymanapp/common-types": "18.0.
|
|
27
|
-
"@keymanapp/developer-utils": "18.0.
|
|
28
|
-
"@keymanapp/kmc-kmn": "18.0.
|
|
26
|
+
"@keymanapp/common-types": "18.0.19-alpha",
|
|
27
|
+
"@keymanapp/developer-utils": "18.0.19-alpha",
|
|
28
|
+
"@keymanapp/kmc-kmn": "18.0.19-alpha"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@keymanapp/resources-gosh": "18.0.
|
|
31
|
+
"@keymanapp/resources-gosh": "18.0.19-alpha",
|
|
32
32
|
"@types/chai": "^4.1.7",
|
|
33
33
|
"@types/mocha": "^5.2.7",
|
|
34
34
|
"@types/node": "^20.4.1",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"type": "git",
|
|
44
44
|
"url": "git+https://github.com/keymanapp/keyman.git"
|
|
45
45
|
},
|
|
46
|
-
"version": "18.0.
|
|
46
|
+
"version": "18.0.19-alpha"
|
|
47
47
|
}
|