@keymanapp/ldml-keyboard-constants 17.0.186-alpha → 17.0.190-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.
@@ -1,502 +1,502 @@
1
- /*
2
- Copyright: Copyright (C) 2022 SIL International.
3
- Authors: srl295, mcdurdin
4
- This file provides constants for the KMX Plus (LDML support) binary format,
5
- to be shared between TypeScript and C++ via the generator (below)
6
- */
7
- // TODO-LDML: namespace com.keyman.core.ldml {
8
- /**
9
- * Constants for the KMXPlus data format
10
- * These are shared between the data access layer and the compiler.
11
- * Note that the section IDs (section_keys etc.) are 32 bit hex
12
- * values that are designed to appear as text when written in little endian
13
- * format, so 0x7379656b = 'keys'
14
- */
15
- var Constants = /** @class */ (function () {
16
- function Constants() {
17
- /**
18
- * The version of the LDML processor
19
- */
20
- this.version = '1.0';
21
- /**
22
- * The techpreview CLDR version
23
- */
24
- this.cldr_version_techpreview = 'techpreview';
25
- /**
26
- * The latest CLDR version
27
- */
28
- this.cldr_version_latest = this.cldr_version_techpreview;
29
- /**
30
- * import base
31
- */
32
- this.cldr_import_base = 'cldr';
33
- /**
34
- * implied keys file
35
- */
36
- this.cldr_implied_keys_import = "".concat(this.cldr_version_techpreview, "/keys-Latn-implied.xml");
37
- /**
38
- * implied scancodes file
39
- */
40
- this.cldr_implied_forms_import = "".concat(this.cldr_version_techpreview, "/scanCodes-implied.xml");
41
- /**
42
- * Length of a raw section header, in bytes
43
- */
44
- this.length_header = 8;
45
- /* ------------------------------------------------------------------
46
- * sect section
47
- ------------------------------------------------------------------ */
48
- /**
49
- * Minimum length of the 'sect' section, not including entries
50
- */
51
- this.length_sect = 16;
52
- /**
53
- * Length of each item in the 'sect' section variable part
54
- */
55
- this.length_sect_item = 8;
56
- /* ------------------------------------------------------------------
57
- * bksp section
58
- ------------------------------------------------------------------ */
59
- /**
60
- * Minimum length of the 'bksp' section, not including entries
61
- */
62
- this.length_bksp = 12;
63
- /**
64
- * Length of each item in the 'bksp' section variable part
65
- */
66
- this.length_bksp_item = 16;
67
- /**
68
- * bitwise or value for error="fail" in transform
69
- */
70
- this.bksp_flags_error = 0x0001;
71
- /* ------------------------------------------------------------------
72
- * disp section
73
- ------------------------------------------------------------------ */
74
- /**
75
- * Minimum length of the 'disp' section, not including entries
76
- */
77
- this.length_disp = 16;
78
- /**
79
- * Length of each entry in the 'disp' variable part
80
- */
81
- this.length_disp_item = 12;
82
- /* ------------------------------------------------------------------
83
- * elem section
84
- ------------------------------------------------------------------ */
85
- /**
86
- * Minimum length of the 'elem' section, not including entries
87
- */
88
- this.length_elem = 12;
89
- /**
90
- * Length of each elem string in the 'elem' section variable part
91
- */
92
- this.length_elem_item = 8;
93
- /**
94
- * Length of each element in an elem string
95
- */
96
- this.length_elem_item_element = 8;
97
- /**
98
- * bitwise or value for type in elem[elemstr][element].flags.
99
- * If bits are 00b, then 'element' is a UTF-32LE codepoint.
100
- * If bits are 01b, then 'element' is a string index.
101
- * If bits are 10b (2), then 'element' is a uset index.
102
- *
103
- * `type = flags & elem_flags_type`
104
- */
105
- this.elem_flags_type = 0x00000003;
106
- this.elem_flags_type_char = 0x00000000;
107
- this.elem_flags_type_str = 0x00000001;
108
- this.elem_flags_type_uset = 0x00000002;
109
- /**
110
- * bitwise or value for tertiary_base in elem[elemstr][element].flags.
111
- * If bit is 1, then tertiary_base is true.
112
- * If bit is 0, then tertiary_base is false.
113
- *
114
- * Used only for `ordr`-type element strings.
115
- *
116
- * `tertiary_base = flags & elem_flags_tertiary_base`
117
- */
118
- this.elem_flags_tertiary_base = 0x00000004;
119
- /**
120
- * bitwise or value for tertiary_base in elem[elemstr][element].flags.
121
- * If bit is 1, then prebase is true.
122
- * If bit is 0, then prebase is false.
123
- *
124
- * Used only for `ordr`-type element strings.
125
- *
126
- * `prebase = flags & elem_flags_prebase`
127
- */
128
- this.elem_flags_prebase = 0x00000008;
129
- /**
130
- * bitwise mask for order in elem[elemstr][element].flags.
131
- *
132
- * Used only for `ordr`-type element strings. 1 byte signed integer.
133
- *
134
- * `order = (flags & elem_flags_order_mask) >> elem_flags_order_bitshift`
135
- */
136
- this.elem_flags_order_mask = 0x00FF0000;
137
- /**
138
- * bit shift for order in elem[elemstr][element].flags.
139
- *
140
- * Used only for `ordr`-type element strings.
141
- *
142
- * `order = (flags & elem_flags_order_mask) >> elem_flags_order_bitshift`
143
- */
144
- this.elem_flags_order_bitshift = 16;
145
- /**
146
- * bitwise mask for tertiary sort in elem[elemstr][element].flags.
147
- *
148
- * Used only for `ordr`-type element strings. 1 byte signed integer.
149
- *
150
- * `tertiary = (flags & elem_flags_tertiary_mask) >> elem_flags_tertiary_bitshift`
151
- */
152
- this.elem_flags_tertiary_mask = 0xFF000000;
153
- /**
154
- * bit shift for tertiary sort in elem[elemstr][element].flags.
155
- *
156
- * Used only for `ordr`-type element strings. 1 byte signed integer.
157
- *
158
- * `order = (flags & elem_flags_tertiary_mask) >> elem_flags_tertiary_bitshift`
159
- */
160
- this.elem_flags_tertiary_bitshift = 24;
161
- /* ------------------------------------------------------------------
162
- * finl section
163
- ------------------------------------------------------------------ */
164
- /**
165
- * Minimum length of the 'finl' section, not including entries
166
- */
167
- this.length_finl = 8;
168
- /**
169
- * Length of each item in the 'finl' section variable part
170
- */
171
- this.length_finl_item = 16;
172
- /**
173
- * bitwise or value for error="fail" in transform
174
- */
175
- this.finl_flags_error = 0x0001;
176
- /* ------------------------------------------------------------------
177
- * keys section is now keys.kmap
178
- ------------------------------------------------------------------ */
179
- /**
180
- * Constant for no modifiers
181
- */
182
- this.keys_mod_none = 0x0000;
183
- /**
184
- * bitmask for Left Alt modifier key
185
- */
186
- this.keys_mod_altL = 0x0004;
187
- /**
188
- * bitmask for Right Alt (AltGr) modifier key
189
- */
190
- this.keys_mod_altR = 0x0008;
191
- /**
192
- * bitmask for either Alt (Windows) or Option (Apple) modifier keys
193
- */
194
- this.keys_mod_alt = 0x0040;
195
- /**
196
- * bitmask for Caps modifier key
197
- */
198
- this.keys_mod_caps = 0x0100;
199
- /**
200
- * bitmask for Left control modifier key
201
- */
202
- this.keys_mod_ctrlL = 0x0001;
203
- /**
204
- * bitmask for Right control modifier key
205
- */
206
- this.keys_mod_ctrlR = 0x0002;
207
- /**
208
- * bitmask for either Control modifier key
209
- */
210
- this.keys_mod_ctrl = 0x0020;
211
- /**
212
- * bitmask for either shift.
213
- */
214
- this.keys_mod_shift = 0x0010;
215
- /**
216
- * Convenience map for modifiers
217
- */
218
- this.keys_mod_map = new Map([
219
- ["none", this.keys_mod_none],
220
- ["alt", this.keys_mod_alt],
221
- ["altL", this.keys_mod_altL],
222
- ["altR", this.keys_mod_altR],
223
- ["caps", this.keys_mod_caps],
224
- ["ctrl", this.keys_mod_ctrl],
225
- ["ctrlL", this.keys_mod_ctrlL],
226
- ["ctrlR", this.keys_mod_ctrlR],
227
- ["shift", this.keys_mod_shift],
228
- ]);
229
- /**
230
- * a mask combining all valid modifier bits
231
- */
232
- this.keys_mod_all = Array.from(this.keys_mod_map.values()).reduce(function (p, v) { return (p | v); }, this.keys_mod_none);
233
- /* ------------------------------------------------------------------
234
- * keys section
235
- ------------------------------------------------------------------ */
236
- /**
237
- * Minimum length of the 'keys' section not including variable parts
238
- */
239
- this.length_keys = 24;
240
- /**
241
- * Length of each item in the 'keys' keys sub-table
242
- */
243
- this.length_keys_key = 36;
244
- /**
245
- * Length of each item in the 'keys' flick lists sub-table
246
- */
247
- this.length_keys_flick_list = 12;
248
- /**
249
- * Length of each item in the 'keys' flick elements sub-table
250
- */
251
- this.length_keys_flick_element = 12;
252
- /**
253
- * Length of each item in the 'keys.kmap' key map subtable
254
- */
255
- this.length_keys_kmap = 12;
256
- /**
257
- * 0 if to is a char, 1 if it is a string
258
- */
259
- this.keys_key_flags_extend = 0x00000001;
260
- /**
261
- * 1 if the key is a gap
262
- */
263
- this.keys_key_flags_gap = 0x00000002;
264
- /**
265
- * 1 if the key is transform=no
266
- */
267
- this.keys_key_flags_notransform = 0x00000004;
268
- /**
269
- * 0 if to is a char, 1 if it is a string
270
- */
271
- this.keys_flick_flags_extend = 0x00000001;
272
- /* ------------------------------------------------------------------
273
- * layr section
274
- ------------------------------------------------------------------ */
275
- /**
276
- * Minimum length of the 'layr' section not including variable parts
277
- */
278
- this.length_layr = 24;
279
- /**
280
- * Length of each layer list in the 'layr' section variable part
281
- */
282
- this.length_layr_list = 16;
283
- /**
284
- * for the 'hardware' field indicating a touch keyboard, non-hardware
285
- */
286
- this.layr_list_hardware_touch = 'touch';
287
- /**
288
- * Length of each layer entry in the 'layr' section variable part
289
- */
290
- this.length_layr_entry = 16;
291
- /**
292
- * Length of each row entry in the 'layr' section variable part
293
- */
294
- this.length_layr_row = 8;
295
- /**
296
- * Length of each key entry in the 'layr' section variable part
297
- */
298
- this.length_layr_key = 4;
299
- /* ------------------------------------------------------------------
300
- * list section
301
- ------------------------------------------------------------------ */
302
- /**
303
- * Minimum length of the 'list' section not including variable parts
304
- */
305
- this.length_list = 16;
306
- /**
307
- * Length of each list item in the 'list' list section variable part
308
- */
309
- this.length_list_item = 8;
310
- /**
311
- * Length of each list item in the 'list' indices section variable part
312
- */
313
- this.length_list_index = 4;
314
- /* ------------------------------------------------------------------
315
- * loca section
316
- ------------------------------------------------------------------ */
317
- /**
318
- * Minimum length of the 'loca' section not including variable parts
319
- */
320
- this.length_loca = 12;
321
- /**
322
- * Length of each item in the 'loca' section variable part
323
- */
324
- this.length_loca_item = 4;
325
- /* ------------------------------------------------------------------
326
- * meta section
327
- ------------------------------------------------------------------ */
328
- /**
329
- * length of the 'meta' section
330
- */
331
- this.length_meta = 36;
332
- /**
333
- * bitwise or value for fallback=omit in meta.settings
334
- */
335
- this.meta_settings_fallback_omit = 1;
336
- /**
337
- * bitwise or value for transformFailure=omit in meta.settings
338
- */
339
- this.meta_settings_transformFailure_omit = 2;
340
- /**
341
- * bitwise or value for transformPartial=hide in meta.settings
342
- */
343
- this.meta_settings_transformPartial_hide = 4;
344
- /* ------------------------------------------------------------------
345
- * name section
346
- ------------------------------------------------------------------ */
347
- /**
348
- * Minimum length of the 'name' section not including variable parts
349
- */
350
- this.length_name = 12;
351
- /**
352
- * Length of each item in the 'name' section variable part
353
- */
354
- this.length_name_item = 4;
355
- /* ------------------------------------------------------------------
356
- * strs section
357
- ------------------------------------------------------------------ */
358
- /**
359
- * Minimum length of the 'strs' section not including variable parts
360
- */
361
- this.length_strs = 12;
362
- /**
363
- * Length of each item in the 'strs' section variable part
364
- */
365
- this.length_strs_item = 8;
366
- /* ------------------------------------------------------------------
367
- * tran section
368
- ------------------------------------------------------------------ */
369
- /**
370
- * Minimum length of the 'tran' section, not including entries
371
- */
372
- this.length_tran = 20;
373
- /**
374
- * Length of each transform group item
375
- */
376
- this.length_tran_group = 12;
377
- /**
378
- * Length of each transform item
379
- */
380
- this.length_tran_transform = 16;
381
- /**
382
- * Length of each reorder subtable item
383
- */
384
- this.length_tran_reorder = 8;
385
- /**
386
- * bitwise or value for error="fail" in transform
387
- */
388
- this.tran_flags_error = 0x0001;
389
- /**
390
- * this group is full of transform items
391
- */
392
- this.tran_group_type_transform = 0;
393
- /**
394
- * this group is full of reorder items
395
- */
396
- this.tran_group_type_reorder = 1;
397
- /* ------------------------------------------------------------------
398
- * vars section
399
- * ------------------------------------------------------------------ */
400
- /**
401
- * Minimum length of the 'vars' section not including variable parts
402
- */
403
- this.length_vars = 16;
404
- /**
405
- * Length of each item in the 'vars' section variable part
406
- */
407
- this.length_vars_item = 16;
408
- /**
409
- * String variable
410
- */
411
- this.vars_entry_type_string = 0;
412
- /**
413
- * Set variable
414
- */
415
- this.vars_entry_type_set = 1;
416
- /**
417
- * unicodeSet variable
418
- */
419
- this.vars_entry_type_unicodeSet = 2;
420
- /* ------------------------------------------------------------------
421
- * uset section
422
- * ------------------------------------------------------------------ */
423
- /*
424
- * Minimum length of the 'uset' section not including variable parts
425
- */
426
- this.length_uset = 16;
427
- /**
428
- * Length of each entry in the uset.usets subtable
429
- */
430
- this.length_uset_uset = 12;
431
- /**
432
- * Length of each entry in the uset.ranges subtable
433
- */
434
- this.length_uset_range = 8;
435
- /**
436
- * All section IDs.
437
- */
438
- this.section = {
439
- // keep this sorted
440
- bksp: 'bksp',
441
- disp: 'disp',
442
- elem: 'elem',
443
- keys: 'keys',
444
- layr: 'layr',
445
- list: 'list',
446
- loca: 'loca',
447
- meta: 'meta',
448
- name: 'name',
449
- sect: 'sect',
450
- strs: 'strs',
451
- tran: 'tran',
452
- uset: 'uset',
453
- vars: 'vars'
454
- };
455
- // ---- marker stuff ----
456
- /** == kmx_file.UC_SENTINEL, always followed by `marker_code`, marker index 0x0001-0xfffe */
457
- this.uc_sentinel = 0xFFFF;
458
- /** == kmx_file.CODE_DEADKEY */
459
- this.marker_code = 0x0008;
460
- /** minimum usable marker index */
461
- this.marker_min_index = 0x0001;
462
- /** index value referring to the 'any' marker match */
463
- this.marker_any_index = 0xD7FF;
464
- /** maximum marker index prior to the 'any' value */
465
- this.marker_max_index = this.marker_any_index - 1;
466
- /** maximum count of markers (not including 'any') */
467
- this.marker_max_count = this.marker_max_index - this.marker_min_index + 1;
468
- }
469
- /**
470
- * Use to convert 4-char string into hex
471
- * @param id section id such as 'sect'
472
- * @returns hex ID such as 0x74636573
473
- */
474
- Constants.prototype.hex_section_id = function (id) {
475
- if (!id || typeof id !== 'string' || !id.match(/^[a-z0-9]{4}$/)) {
476
- throw Error("hex_section_id(".concat(id, ") - need a 4-character alphanumeric lower-case string"));
477
- }
478
- var r = 0;
479
- for (var i = 3; i >= 0; i--) {
480
- r = (r << 8 | id.charCodeAt(i));
481
- }
482
- return r;
483
- };
484
- ;
485
- /**
486
- * Use to convert hex into 4-char string
487
- * @param hex section ID such as 0x74636573
488
- * @returns string such as 'sect'
489
- */
490
- Constants.prototype.str_section_id = function (hex) {
491
- var chars = [];
492
- for (var i = 3; i >= 0; i--) {
493
- chars.push(String.fromCharCode(hex & 0xFF));
494
- hex >>= 8;
495
- }
496
- return chars.join('');
497
- };
498
- return Constants;
499
- }());
500
- ;
501
- export var constants = new Constants();
502
- // }
1
+ !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]="778200e4-3b46-5997-85f8-4bb8df2aa435")}catch(e){}}();
2
+ /*
3
+ Copyright: Copyright (C) 2022 SIL International.
4
+ Authors: srl295, mcdurdin
5
+ This file provides constants for the KMX Plus (LDML support) binary format,
6
+ to be shared between TypeScript and C++ via the generator (below)
7
+ */
8
+ // TODO-LDML: namespace com.keyman.core.ldml {
9
+ /**
10
+ * Constants for the KMXPlus data format
11
+ * These are shared between the data access layer and the compiler.
12
+ * Note that the section IDs (section_keys etc.) are 32 bit hex
13
+ * values that are designed to appear as text when written in little endian
14
+ * format, so 0x7379656b = 'keys'
15
+ */
16
+ class Constants {
17
+ /**
18
+ * The version of the LDML processor
19
+ */
20
+ version = '1.0';
21
+ /**
22
+ * The techpreview CLDR version
23
+ */
24
+ cldr_version_techpreview = 'techpreview';
25
+ /**
26
+ * The latest CLDR version
27
+ */
28
+ cldr_version_latest = this.cldr_version_techpreview;
29
+ /**
30
+ * import base
31
+ */
32
+ cldr_import_base = 'cldr';
33
+ /**
34
+ * implied keys file
35
+ */
36
+ cldr_implied_keys_import = `${this.cldr_version_techpreview}/keys-Latn-implied.xml`;
37
+ /**
38
+ * implied scancodes file
39
+ */
40
+ cldr_implied_forms_import = `${this.cldr_version_techpreview}/scanCodes-implied.xml`;
41
+ /**
42
+ * Length of a raw section header, in bytes
43
+ */
44
+ length_header = 8;
45
+ /* ------------------------------------------------------------------
46
+ * sect section
47
+ ------------------------------------------------------------------ */
48
+ /**
49
+ * Minimum length of the 'sect' section, not including entries
50
+ */
51
+ length_sect = 16;
52
+ /**
53
+ * Length of each item in the 'sect' section variable part
54
+ */
55
+ length_sect_item = 8;
56
+ /* ------------------------------------------------------------------
57
+ * bksp section
58
+ ------------------------------------------------------------------ */
59
+ /**
60
+ * Minimum length of the 'bksp' section, not including entries
61
+ */
62
+ length_bksp = 12;
63
+ /**
64
+ * Length of each item in the 'bksp' section variable part
65
+ */
66
+ length_bksp_item = 16;
67
+ /**
68
+ * bitwise or value for error="fail" in transform
69
+ */
70
+ bksp_flags_error = 0x0001;
71
+ /* ------------------------------------------------------------------
72
+ * disp section
73
+ ------------------------------------------------------------------ */
74
+ /**
75
+ * Minimum length of the 'disp' section, not including entries
76
+ */
77
+ length_disp = 16;
78
+ /**
79
+ * Length of each entry in the 'disp' variable part
80
+ */
81
+ length_disp_item = 12;
82
+ /* ------------------------------------------------------------------
83
+ * elem section
84
+ ------------------------------------------------------------------ */
85
+ /**
86
+ * Minimum length of the 'elem' section, not including entries
87
+ */
88
+ length_elem = 12;
89
+ /**
90
+ * Length of each elem string in the 'elem' section variable part
91
+ */
92
+ length_elem_item = 8;
93
+ /**
94
+ * Length of each element in an elem string
95
+ */
96
+ length_elem_item_element = 8;
97
+ /**
98
+ * bitwise or value for type in elem[elemstr][element].flags.
99
+ * If bits are 00b, then 'element' is a UTF-32LE codepoint.
100
+ * If bits are 01b, then 'element' is a string index.
101
+ * If bits are 10b (2), then 'element' is a uset index.
102
+ *
103
+ * `type = flags & elem_flags_type`
104
+ */
105
+ elem_flags_type = 0x00000003;
106
+ elem_flags_type_char = 0x00000000;
107
+ elem_flags_type_str = 0x00000001;
108
+ elem_flags_type_uset = 0x00000002;
109
+ /**
110
+ * bitwise or value for tertiary_base in elem[elemstr][element].flags.
111
+ * If bit is 1, then tertiary_base is true.
112
+ * If bit is 0, then tertiary_base is false.
113
+ *
114
+ * Used only for `ordr`-type element strings.
115
+ *
116
+ * `tertiary_base = flags & elem_flags_tertiary_base`
117
+ */
118
+ elem_flags_tertiary_base = 0x00000004;
119
+ /**
120
+ * bitwise or value for tertiary_base in elem[elemstr][element].flags.
121
+ * If bit is 1, then prebase is true.
122
+ * If bit is 0, then prebase is false.
123
+ *
124
+ * Used only for `ordr`-type element strings.
125
+ *
126
+ * `prebase = flags & elem_flags_prebase`
127
+ */
128
+ elem_flags_prebase = 0x00000008;
129
+ /**
130
+ * bitwise mask for order in elem[elemstr][element].flags.
131
+ *
132
+ * Used only for `ordr`-type element strings. 1 byte signed integer.
133
+ *
134
+ * `order = (flags & elem_flags_order_mask) >> elem_flags_order_bitshift`
135
+ */
136
+ elem_flags_order_mask = 0x00FF0000;
137
+ /**
138
+ * bit shift for order in elem[elemstr][element].flags.
139
+ *
140
+ * Used only for `ordr`-type element strings.
141
+ *
142
+ * `order = (flags & elem_flags_order_mask) >> elem_flags_order_bitshift`
143
+ */
144
+ elem_flags_order_bitshift = 16;
145
+ /**
146
+ * bitwise mask for tertiary sort in elem[elemstr][element].flags.
147
+ *
148
+ * Used only for `ordr`-type element strings. 1 byte signed integer.
149
+ *
150
+ * `tertiary = (flags & elem_flags_tertiary_mask) >> elem_flags_tertiary_bitshift`
151
+ */
152
+ elem_flags_tertiary_mask = 0xFF000000;
153
+ /**
154
+ * bit shift for tertiary sort in elem[elemstr][element].flags.
155
+ *
156
+ * Used only for `ordr`-type element strings. 1 byte signed integer.
157
+ *
158
+ * `order = (flags & elem_flags_tertiary_mask) >> elem_flags_tertiary_bitshift`
159
+ */
160
+ elem_flags_tertiary_bitshift = 24;
161
+ /* ------------------------------------------------------------------
162
+ * finl section
163
+ ------------------------------------------------------------------ */
164
+ /**
165
+ * Minimum length of the 'finl' section, not including entries
166
+ */
167
+ length_finl = 8;
168
+ /**
169
+ * Length of each item in the 'finl' section variable part
170
+ */
171
+ length_finl_item = 16;
172
+ /**
173
+ * bitwise or value for error="fail" in transform
174
+ */
175
+ finl_flags_error = 0x0001;
176
+ /* ------------------------------------------------------------------
177
+ * keys section is now keys.kmap
178
+ ------------------------------------------------------------------ */
179
+ /**
180
+ * Constant for no modifiers
181
+ */
182
+ keys_mod_none = 0x0000;
183
+ /**
184
+ * bitmask for Left Alt modifier key
185
+ */
186
+ keys_mod_altL = 0x0004;
187
+ /**
188
+ * bitmask for Right Alt (AltGr) modifier key
189
+ */
190
+ keys_mod_altR = 0x0008;
191
+ /**
192
+ * bitmask for either Alt (Windows) or Option (Apple) modifier keys
193
+ */
194
+ keys_mod_alt = 0x0040;
195
+ /**
196
+ * bitmask for Caps modifier key
197
+ */
198
+ keys_mod_caps = 0x0100;
199
+ /**
200
+ * bitmask for Left control modifier key
201
+ */
202
+ keys_mod_ctrlL = 0x0001;
203
+ /**
204
+ * bitmask for Right control modifier key
205
+ */
206
+ keys_mod_ctrlR = 0x0002;
207
+ /**
208
+ * bitmask for either Control modifier key
209
+ */
210
+ keys_mod_ctrl = 0x0020;
211
+ /**
212
+ * bitmask for either shift.
213
+ */
214
+ keys_mod_shift = 0x0010;
215
+ /**
216
+ * Convenience map for modifiers
217
+ */
218
+ keys_mod_map = new Map([
219
+ ["none", this.keys_mod_none],
220
+ ["alt", this.keys_mod_alt],
221
+ ["altL", this.keys_mod_altL],
222
+ ["altR", this.keys_mod_altR],
223
+ ["caps", this.keys_mod_caps],
224
+ ["ctrl", this.keys_mod_ctrl],
225
+ ["ctrlL", this.keys_mod_ctrlL],
226
+ ["ctrlR", this.keys_mod_ctrlR],
227
+ ["shift", this.keys_mod_shift],
228
+ ]);
229
+ /**
230
+ * a mask combining all valid modifier bits
231
+ */
232
+ keys_mod_all = Array.from(this.keys_mod_map.values()).reduce((p, v) => (p | v), this.keys_mod_none);
233
+ /* ------------------------------------------------------------------
234
+ * keys section
235
+ ------------------------------------------------------------------ */
236
+ /**
237
+ * Minimum length of the 'keys' section not including variable parts
238
+ */
239
+ length_keys = 24;
240
+ /**
241
+ * Length of each item in the 'keys' keys sub-table
242
+ */
243
+ length_keys_key = 36;
244
+ /**
245
+ * Length of each item in the 'keys' flick lists sub-table
246
+ */
247
+ length_keys_flick_list = 12;
248
+ /**
249
+ * Length of each item in the 'keys' flick elements sub-table
250
+ */
251
+ length_keys_flick_element = 12;
252
+ /**
253
+ * Length of each item in the 'keys.kmap' key map subtable
254
+ */
255
+ length_keys_kmap = 12;
256
+ /**
257
+ * 0 if to is a char, 1 if it is a string
258
+ */
259
+ keys_key_flags_extend = 0x00000001;
260
+ /**
261
+ * 1 if the key is a gap
262
+ */
263
+ keys_key_flags_gap = 0x00000002;
264
+ /**
265
+ * 1 if the key is transform=no
266
+ */
267
+ keys_key_flags_notransform = 0x00000004;
268
+ /**
269
+ * 0 if to is a char, 1 if it is a string
270
+ */
271
+ keys_flick_flags_extend = 0x00000001;
272
+ /* ------------------------------------------------------------------
273
+ * layr section
274
+ ------------------------------------------------------------------ */
275
+ /**
276
+ * Minimum length of the 'layr' section not including variable parts
277
+ */
278
+ length_layr = 24;
279
+ /**
280
+ * Length of each layer list in the 'layr' section variable part
281
+ */
282
+ length_layr_list = 16;
283
+ /**
284
+ * for the 'hardware' field indicating a touch keyboard, non-hardware
285
+ */
286
+ layr_list_hardware_touch = 'touch';
287
+ /**
288
+ * Length of each layer entry in the 'layr' section variable part
289
+ */
290
+ length_layr_entry = 16;
291
+ /**
292
+ * Length of each row entry in the 'layr' section variable part
293
+ */
294
+ length_layr_row = 8;
295
+ /**
296
+ * Length of each key entry in the 'layr' section variable part
297
+ */
298
+ length_layr_key = 4;
299
+ /* ------------------------------------------------------------------
300
+ * list section
301
+ ------------------------------------------------------------------ */
302
+ /**
303
+ * Minimum length of the 'list' section not including variable parts
304
+ */
305
+ length_list = 16;
306
+ /**
307
+ * Length of each list item in the 'list' list section variable part
308
+ */
309
+ length_list_item = 8;
310
+ /**
311
+ * Length of each list item in the 'list' indices section variable part
312
+ */
313
+ length_list_index = 4;
314
+ /* ------------------------------------------------------------------
315
+ * loca section
316
+ ------------------------------------------------------------------ */
317
+ /**
318
+ * Minimum length of the 'loca' section not including variable parts
319
+ */
320
+ length_loca = 12;
321
+ /**
322
+ * Length of each item in the 'loca' section variable part
323
+ */
324
+ length_loca_item = 4;
325
+ /* ------------------------------------------------------------------
326
+ * meta section
327
+ ------------------------------------------------------------------ */
328
+ /**
329
+ * length of the 'meta' section
330
+ */
331
+ length_meta = 36;
332
+ /**
333
+ * bitwise or value for fallback=omit in meta.settings
334
+ */
335
+ meta_settings_fallback_omit = 1;
336
+ /**
337
+ * bitwise or value for transformFailure=omit in meta.settings
338
+ */
339
+ meta_settings_transformFailure_omit = 2;
340
+ /**
341
+ * bitwise or value for transformPartial=hide in meta.settings
342
+ */
343
+ meta_settings_transformPartial_hide = 4;
344
+ /* ------------------------------------------------------------------
345
+ * name section
346
+ ------------------------------------------------------------------ */
347
+ /**
348
+ * Minimum length of the 'name' section not including variable parts
349
+ */
350
+ length_name = 12;
351
+ /**
352
+ * Length of each item in the 'name' section variable part
353
+ */
354
+ length_name_item = 4;
355
+ /* ------------------------------------------------------------------
356
+ * strs section
357
+ ------------------------------------------------------------------ */
358
+ /**
359
+ * Minimum length of the 'strs' section not including variable parts
360
+ */
361
+ length_strs = 12;
362
+ /**
363
+ * Length of each item in the 'strs' section variable part
364
+ */
365
+ length_strs_item = 8;
366
+ /* ------------------------------------------------------------------
367
+ * tran section
368
+ ------------------------------------------------------------------ */
369
+ /**
370
+ * Minimum length of the 'tran' section, not including entries
371
+ */
372
+ length_tran = 20;
373
+ /**
374
+ * Length of each transform group item
375
+ */
376
+ length_tran_group = 12;
377
+ /**
378
+ * Length of each transform item
379
+ */
380
+ length_tran_transform = 16;
381
+ /**
382
+ * Length of each reorder subtable item
383
+ */
384
+ length_tran_reorder = 8;
385
+ /**
386
+ * bitwise or value for error="fail" in transform
387
+ */
388
+ tran_flags_error = 0x0001;
389
+ /**
390
+ * this group is full of transform items
391
+ */
392
+ tran_group_type_transform = 0;
393
+ /**
394
+ * this group is full of reorder items
395
+ */
396
+ tran_group_type_reorder = 1;
397
+ /* ------------------------------------------------------------------
398
+ * vars section
399
+ * ------------------------------------------------------------------ */
400
+ /**
401
+ * Minimum length of the 'vars' section not including variable parts
402
+ */
403
+ length_vars = 16;
404
+ /**
405
+ * Length of each item in the 'vars' section variable part
406
+ */
407
+ length_vars_item = 16;
408
+ /**
409
+ * String variable
410
+ */
411
+ vars_entry_type_string = 0;
412
+ /**
413
+ * Set variable
414
+ */
415
+ vars_entry_type_set = 1;
416
+ /**
417
+ * unicodeSet variable
418
+ */
419
+ vars_entry_type_unicodeSet = 2;
420
+ /* ------------------------------------------------------------------
421
+ * uset section
422
+ * ------------------------------------------------------------------ */
423
+ /*
424
+ * Minimum length of the 'uset' section not including variable parts
425
+ */
426
+ length_uset = 16;
427
+ /**
428
+ * Length of each entry in the uset.usets subtable
429
+ */
430
+ length_uset_uset = 12;
431
+ /**
432
+ * Length of each entry in the uset.ranges subtable
433
+ */
434
+ length_uset_range = 8;
435
+ /**
436
+ * All section IDs.
437
+ */
438
+ section = {
439
+ // keep this sorted
440
+ bksp: 'bksp',
441
+ disp: 'disp',
442
+ elem: 'elem',
443
+ keys: 'keys',
444
+ layr: 'layr',
445
+ list: 'list',
446
+ loca: 'loca',
447
+ meta: 'meta',
448
+ name: 'name',
449
+ sect: 'sect',
450
+ strs: 'strs',
451
+ tran: 'tran',
452
+ uset: 'uset',
453
+ vars: 'vars',
454
+ };
455
+ /**
456
+ * Use to convert 4-char string into hex
457
+ * @param id section id such as 'sect'
458
+ * @returns hex ID such as 0x74636573
459
+ */
460
+ hex_section_id(id) {
461
+ if (!id || typeof id !== 'string' || !id.match(/^[a-z0-9]{4}$/)) {
462
+ throw Error(`hex_section_id(${id}) - need a 4-character alphanumeric lower-case string`);
463
+ }
464
+ let r = 0;
465
+ for (let i = 3; i >= 0; i--) {
466
+ r = (r << 8 | id.charCodeAt(i));
467
+ }
468
+ return r;
469
+ }
470
+ ;
471
+ /**
472
+ * Use to convert hex into 4-char string
473
+ * @param hex section ID such as 0x74636573
474
+ * @returns string such as 'sect'
475
+ */
476
+ str_section_id(hex) {
477
+ const chars = [];
478
+ for (let i = 3; i >= 0; i--) {
479
+ chars.push(String.fromCharCode(hex & 0xFF));
480
+ hex >>= 8;
481
+ }
482
+ return chars.join('');
483
+ }
484
+ // ---- marker stuff ----
485
+ /** == kmx_file.UC_SENTINEL, always followed by `marker_code`, marker index 0x0001-0xfffe */
486
+ uc_sentinel = 0xFFFF;
487
+ /** == kmx_file.CODE_DEADKEY */
488
+ marker_code = 0x0008;
489
+ /** minimum usable marker index */
490
+ marker_min_index = 0x0001;
491
+ /** index value referring to the 'any' marker match */
492
+ marker_any_index = 0xD7FF;
493
+ /** maximum marker index prior to the 'any' value */
494
+ marker_max_index = this.marker_any_index - 1;
495
+ /** maximum count of markers (not including 'any') */
496
+ marker_max_count = this.marker_max_index - this.marker_min_index + 1;
497
+ }
498
+ ;
499
+ export const constants = new Constants();
500
+ // }
501
+ //# debugId=778200e4-3b46-5997-85f8-4bb8df2aa435
502
+ //# sourceMappingURL=keyboardprocessor_ldml.js.map
@@ -0,0 +1 @@
1
+ {"debug_id":"778200e4-3b46-5997-85f8-4bb8df2aa435","file":"keyboardprocessor_ldml.js","mappings":";AAAA;;;;;EAKE;AAyCF,8CAA8C;AAC9C;;;;;;GAMG;AACH,MAAM,SAAS;IACb;;OAEG;IACM,OAAO,GAAG,KAAK,CAAC;IACzB;;OAEG;IACM,wBAAwB,GAAG,aAAa,CAAC;IAClD;;OAEG;IACM,mBAAmB,GAAG,IAAI,CAAC,wBAAwB,CAAC;IAC7D;;OAEG;IACM,gBAAgB,GAAG,MAAM,CAAC;IACnC;;OAEG;IACM,wBAAwB,GAAG,GAAG,IAAI,CAAC,wBAAwB,wBAAwB,CAAC;IAC7F;;OAEG;IACM,yBAAyB,GAAG,GAAG,IAAI,CAAC,wBAAwB,wBAAwB,CAAC;IAC9F;;OAEG;IACM,aAAa,GAAG,CAAC,CAAC;IAE3B;;6EAEyE;IAEzE;;OAEG;IACM,WAAW,GAAG,EAAE,CAAC;IAC1B;;OAEG;IACM,gBAAgB,GAAG,CAAC,CAAC;IAE9B;;6EAEyE;IAEzE;;OAEG;IACM,WAAW,GAAG,EAAE,CAAC;IAC1B;;OAEG;IACM,gBAAgB,GAAG,EAAE,CAAC;IAC/B;;OAEG;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AC;SACnC;QACD,OAAO,CAAC,CAAC;IACb,CAAC;IAAA,CAAC;IAEF;;;;OAIG;IACH,cAAc,CAAC,GAAU;QACvB,MAAM,KAAK,GAAc,EAAE,CAAC;QAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAE,CAAC,EAAE,CAAC,EAAE,EAAE;YACzB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC;YAC5C,GAAG,KAAK,CAAC,CAAC;SACX;QACD,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxB,CAAC;IAED,yBAAyB;IACzB,4FAA4F;IACnF,WAAW,GAAW,MAAM,CAAC;IACtC,+BAA+B;IACtB,WAAW,GAAW,MAAM,CAAC;IACtC,kCAAkC;IACzB,gBAAgB,GAAM,MAAM,CAAC;IACtC,sDAAsD;IAC7C,gBAAgB,GAAM,MAAM,CAAC;IACtC,oDAAoD;IAC3C,gBAAgB,GAAM,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;IACzD,qDAAqD;IAC5C,gBAAgB,GAAM,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;CAElF;AAAA,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;AAEzC,IAAI","names":[],"sourceRoot":"","sources":["../keyboardprocessor_ldml.ts"],"version":3}
package/package.json CHANGED
@@ -17,5 +17,5 @@
17
17
  "type": "git",
18
18
  "url": "git+https://github.com/keymanapp/keyman.git"
19
19
  },
20
- "version": "17.0.186-alpha"
20
+ "version": "17.0.190-alpha"
21
21
  }