@keymanapp/kmc-ldml 18.0.40-alpha → 18.0.45-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/compiler/compiler.d.ts +123 -123
- package/build/src/compiler/compiler.js +307 -310
- package/build/src/compiler/compiler.js.map +1 -1
- package/build/src/compiler/disp.d.ts +11 -11
- package/build/src/compiler/disp.js +82 -85
- package/build/src/compiler/disp.js.map +1 -1
- package/build/src/compiler/empty-compiler.d.ts +37 -37
- package/build/src/compiler/empty-compiler.js +114 -117
- package/build/src/compiler/empty-compiler.js.map +1 -1
- package/build/src/compiler/keymanweb-compiler.d.ts +13 -13
- package/build/src/compiler/keymanweb-compiler.js +95 -98
- package/build/src/compiler/keymanweb-compiler.js.map +1 -1
- package/build/src/compiler/keys.d.ts +53 -53
- package/build/src/compiler/keys.js +417 -420
- package/build/src/compiler/keys.js.map +1 -1
- package/build/src/compiler/layr.d.ts +9 -9
- package/build/src/compiler/layr.js +81 -84
- package/build/src/compiler/layr.js.map +1 -1
- package/build/src/compiler/ldml-compiler-options.d.ts +11 -11
- package/build/src/compiler/ldml-compiler-options.js +3 -6
- package/build/src/compiler/ldml-compiler-options.js.map +1 -1
- package/build/src/compiler/loca.d.ts +15 -15
- package/build/src/compiler/loca.js +59 -62
- package/build/src/compiler/loca.js.map +1 -1
- package/build/src/compiler/messages.d.ts +186 -186
- package/build/src/compiler/messages.js +122 -125
- package/build/src/compiler/messages.js.map +1 -1
- package/build/src/compiler/meta.d.ts +13 -13
- package/build/src/compiler/meta.js +55 -58
- package/build/src/compiler/meta.js.map +1 -1
- package/build/src/compiler/metadata-compiler.d.ts +12 -12
- package/build/src/compiler/metadata-compiler.js +47 -50
- package/build/src/compiler/metadata-compiler.js.map +1 -1
- package/build/src/compiler/section-compiler.d.ts +35 -35
- package/build/src/compiler/section-compiler.js +40 -43
- package/build/src/compiler/section-compiler.js.map +1 -1
- package/build/src/compiler/substitution-tracker.d.ts +47 -47
- package/build/src/compiler/substitution-tracker.js +103 -106
- package/build/src/compiler/substitution-tracker.js.map +1 -1
- package/build/src/compiler/touch-layout-compiler.d.ts +7 -7
- package/build/src/compiler/touch-layout-compiler.js +91 -94
- package/build/src/compiler/touch-layout-compiler.js.map +1 -1
- package/build/src/compiler/tran.d.ts +57 -57
- package/build/src/compiler/tran.js +388 -391
- package/build/src/compiler/tran.js.map +1 -1
- package/build/src/compiler/vars.d.ts +21 -21
- package/build/src/compiler/vars.js +234 -237
- package/build/src/compiler/vars.js.map +1 -1
- package/build/src/compiler/visual-keyboard-compiler.d.ts +8 -8
- package/build/src/compiler/visual-keyboard-compiler.js +68 -71
- package/build/src/compiler/visual-keyboard-compiler.js.map +1 -1
- package/build/src/main.d.ts +3 -3
- package/build/src/main.js +3 -6
- package/build/src/main.js.map +1 -1
- package/build/src/util/util.d.ts +49 -49
- package/build/src/util/util.js +183 -186
- package/build/src/util/util.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,98 +1,95 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
`${tab}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
`${tab}
|
|
58
|
-
`}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
`${tab}this.
|
|
65
|
-
`${tab}this.
|
|
66
|
-
`${tab}this.
|
|
67
|
-
`${tab}this.
|
|
68
|
-
`${tab}this.
|
|
69
|
-
`${tab}this.
|
|
70
|
-
`${tab}this.
|
|
71
|
-
|
|
72
|
-
`${tab}this.
|
|
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
|
-
//# sourceMappingURL=keymanweb-compiler.js.map
|
|
98
|
-
//# debugId=f6d80ce6-7f87-5261-8e0f-80ada550e59e
|
|
1
|
+
import { VisualKeyboard, TouchLayoutFileWriter } from "@keymanapp/common-types";
|
|
2
|
+
import { TouchLayoutCompiler } from "./touch-layout-compiler.js";
|
|
3
|
+
import { LdmlKeyboardVisualKeyboardCompiler } from "./visual-keyboard-compiler.js";
|
|
4
|
+
const MINIMUM_KMW_VERSION = '16.0';
|
|
5
|
+
export class LdmlKeyboardKeymanWebCompiler {
|
|
6
|
+
callbacks;
|
|
7
|
+
options;
|
|
8
|
+
nl;
|
|
9
|
+
tab;
|
|
10
|
+
constructor(callbacks, options) {
|
|
11
|
+
this.callbacks = callbacks;
|
|
12
|
+
this.options = { ...options };
|
|
13
|
+
this.nl = this.options.saveDebug ? "\n" : '';
|
|
14
|
+
this.tab = this.options.saveDebug ? " " : '';
|
|
15
|
+
}
|
|
16
|
+
compileVisualKeyboard(source) {
|
|
17
|
+
const nl = this.nl, tab = this.tab;
|
|
18
|
+
const vkc = new LdmlKeyboardVisualKeyboardCompiler(this.callbacks);
|
|
19
|
+
const vk = vkc.compile(source);
|
|
20
|
+
let result = `{F: ' 1em ${JSON.stringify(vk.header.unicodeFont.name)}', ` +
|
|
21
|
+
`K102: ${vk.header.flags & 1 /* VisualKeyboard.VisualKeyboardHeaderFlags.kvkh102 */ ? 1 : 0}};${nl}` + // TODO-LDML: escape ' and " in font name correctly
|
|
22
|
+
`${tab}this.KV.KLS={${nl}` +
|
|
23
|
+
`${tab}${tab}TODO_LDML: ${vk.keys.length}${nl}` +
|
|
24
|
+
// TODO-LDML: fill in KLS
|
|
25
|
+
`${tab}}`;
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
compileTouchLayout(source) {
|
|
29
|
+
const tlcompiler = new TouchLayoutCompiler();
|
|
30
|
+
const layout = tlcompiler.compileToJavascript(source);
|
|
31
|
+
const writer = new TouchLayoutFileWriter({ formatted: this.options.saveDebug });
|
|
32
|
+
return writer.compile(layout);
|
|
33
|
+
}
|
|
34
|
+
cleanName(name) {
|
|
35
|
+
let result = this.callbacks.path.basename(name, ".xml" /* KeymanFileTypes.Source.LdmlKeyboard */);
|
|
36
|
+
if (!result) {
|
|
37
|
+
throw new Error(`Invalid file name ${name}`);
|
|
38
|
+
}
|
|
39
|
+
result = result.replaceAll(/[^a-z0-9]/g, '_');
|
|
40
|
+
if (result.match(/^[0-9]/)) {
|
|
41
|
+
// Can't have a digit as initial
|
|
42
|
+
result = '_' + result;
|
|
43
|
+
}
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
46
|
+
compile(name, source) {
|
|
47
|
+
const nl = this.nl, tab = this.tab;
|
|
48
|
+
const sName = 'Keyboard_' + this.cleanName(name);
|
|
49
|
+
const displayUnderlying = true; // TODO-LDML
|
|
50
|
+
const modifierBitmask = 0; // TODO-LDML: define the modifiers used by this keyboard
|
|
51
|
+
const vkDictionary = ''; // TODO-LDML: vk dictionary for touch keys
|
|
52
|
+
const hasSupplementaryPlaneChars = false; // TODO-LDML
|
|
53
|
+
const isRTL = false; // TODO-LDML
|
|
54
|
+
let result = `if(typeof keyman === 'undefined') {${nl}` +
|
|
55
|
+
`${tab}console.error('Keyboard requires KeymanWeb ${MINIMUM_KMW_VERSION} or later');${nl}` +
|
|
56
|
+
`} else {${nl}` +
|
|
57
|
+
`${tab}KeymanWeb.KR(new ${sName}());${nl}` +
|
|
58
|
+
`}${nl}` +
|
|
59
|
+
`function ${sName}() {${nl}` +
|
|
60
|
+
// `${tab}${this.setupDebug()}${nl}` + ? we may use this for modifierBitmask in future
|
|
61
|
+
// `${tab}this._v=(typeof keyman!="undefined"&&typeof keyman.version=="string")?parseInt(keyman.version,10):9;${nl}` + ? we probably don't need this, it's for back-compat
|
|
62
|
+
`${tab}this.KI="${sName}";${nl}` +
|
|
63
|
+
`${tab}this.KN=${JSON.stringify(source.keyboard3.info.name)};${nl}` +
|
|
64
|
+
`${tab}this.KMINVER=${JSON.stringify(MINIMUM_KMW_VERSION)};${nl}` +
|
|
65
|
+
`${tab}this.KV=${this.compileVisualKeyboard(source)};${nl}` +
|
|
66
|
+
`${tab}this.KDU=${displayUnderlying ? '1' : '0'};${nl}` +
|
|
67
|
+
`${tab}this.KH="";${nl}` + // TODO-LDML: help text not supported
|
|
68
|
+
`${tab}this.KM=0;${nl}` + // TODO-LDML: mnemonic layout not supported for LDML keyboards
|
|
69
|
+
`${tab}this.KBVER=${JSON.stringify(source.keyboard3.version?.number || '0.0')};${nl}` +
|
|
70
|
+
`${tab}this.KMBM=${modifierBitmask};${nl}`;
|
|
71
|
+
if (isRTL) {
|
|
72
|
+
result += `${tab}this.KRTL=1;${nl}`;
|
|
73
|
+
}
|
|
74
|
+
if (hasSupplementaryPlaneChars) {
|
|
75
|
+
result += `${tab}this.KS=1;${nl}`;
|
|
76
|
+
}
|
|
77
|
+
if (vkDictionary != '') {
|
|
78
|
+
result += `${tab}this.KVKD=${JSON.stringify(vkDictionary)};${nl}`;
|
|
79
|
+
}
|
|
80
|
+
let layoutFile = this.compileTouchLayout(source);
|
|
81
|
+
if (layoutFile != '') {
|
|
82
|
+
result += `${tab}this.KVKL=${layoutFile};${nl}`;
|
|
83
|
+
}
|
|
84
|
+
// TODO-LDML: KCSS not supported
|
|
85
|
+
// TODO-LDML: embed binary keyboard for loading into Core
|
|
86
|
+
// A LDML keyboard has a no-op for its gs() (begin Unicode) function,
|
|
87
|
+
// because the functionality is embedded in Keyman Core
|
|
88
|
+
result += `${tab}this.gs=function(t,e){${nl}` +
|
|
89
|
+
`${tab}${tab}return 0;${nl}` + // TODO-LDML: we will start by embedding call into Keyman Core here
|
|
90
|
+
`${tab}};${nl}`;
|
|
91
|
+
result += `}${nl}`;
|
|
92
|
+
return result;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=keymanweb-compiler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keymanweb-compiler.js","sources":["../../../src/compiler/keymanweb-compiler.ts"],"
|
|
1
|
+
{"version":3,"file":"keymanweb-compiler.js","sourceRoot":"","sources":["../../../src/compiler/keymanweb-compiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,cAAc,EAAgB,qBAAqB,EAAmB,MAAM,yBAAyB,CAAC;AAElI,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,kCAAkC,EAAE,MAAM,+BAA+B,CAAC;AAEnF,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAEnC,MAAM,OAAO,6BAA6B;IAIpB;IAHH,OAAO,CAAsB;IAC7B,EAAE,CAAS;IACX,GAAG,CAAS;IAC7B,YAAoB,SAA4B,EAAE,OAA6B;QAA3D,cAAS,GAAT,SAAS,CAAmB;QAC9C,IAAI,CAAC,OAAO,GAAG,EA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AAE,EAAE,CAAC;QAClD,CAAC;QACD,gCAAgC;QAEhC,yDAAyD;QAEzD,qEAAqE;QACrE,uDAAuD;QACvD,MAAM,IAAI,GAAG,GAAG,yBAAyB,EAAE,EAAE;YACnC,GAAG,GAAG,GAAG,GAAG,YAAY,EAAE,EAAE,GAAE,mEAAmE;YACjG,GAAG,GAAG,KAAK,EAAE,EAAE,CAAC;QAE1B,MAAM,IAAI,IAAI,EAAE,EAAE,CAAC;QACnB,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { SectionIdent } from '@keymanapp/ldml-keyboard-constants';
|
|
2
|
-
import { LDMLKeyboard, KMXPlus, Constants } from '@keymanapp/common-types';
|
|
3
|
-
import { SectionCompiler } from "./section-compiler.js";
|
|
4
|
-
import DependencySections = KMXPlus.DependencySections;
|
|
5
|
-
import Keys = KMXPlus.Keys;
|
|
6
|
-
import KeysKeys = KMXPlus.KeysKeys;
|
|
7
|
-
import { Substitutions } from './substitution-tracker.js';
|
|
8
|
-
export declare class KeysCompiler extends SectionCompiler {
|
|
9
|
-
static validateSubstitutions(keyboard: LDMLKeyboard.LKKeyboard, st: Substitutions): boolean;
|
|
10
|
-
get id(): SectionIdent;
|
|
11
|
-
get dependencies(): Set<SectionIdent>;
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
* @returns just the non-touch layers.
|
|
15
|
-
*/
|
|
16
|
-
hardwareLayers(): LDMLKeyboard.LKLayers[];
|
|
17
|
-
validate(): boolean;
|
|
18
|
-
static addKeysFromFlicks(usedFlicks: Set<string>, flickHash: Map<string, LDMLKeyboard.LKFlick>, usedKeys: Set<string>): void;
|
|
19
|
-
private getFlicks;
|
|
20
|
-
/** a set with all key ids used in all layers */
|
|
21
|
-
private getLayerKeyIds;
|
|
22
|
-
/** the entire keybag (used or unused) as a hash */
|
|
23
|
-
private getKeyBag;
|
|
24
|
-
compile(sections: DependencySections): Keys;
|
|
25
|
-
/** list of reserved keys, for tests */
|
|
26
|
-
static readonly reserved_keys: string[];
|
|
27
|
-
/** count of reserved keys, for tests */
|
|
28
|
-
static readonly reserved_count: number;
|
|
29
|
-
/** load up all reserved keys */
|
|
30
|
-
getReservedKeys(sections: KMXPlus.DependencySections): Map<String, KeysKeys>;
|
|
31
|
-
static addUsedGestureKeys(layerKeyIds: string[], keyBag: Map<string, LDMLKeyboard.LKKey>, usedKeys: Set<string>): void;
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
* @param keyBag the keybag as a hash
|
|
35
|
-
* @param layerKeyIds list of keys from the layer, to extract used flicks
|
|
36
|
-
* @param usedKeys will be populated with keys used in the flick
|
|
37
|
-
*/
|
|
38
|
-
loadFlicks(sections: DependencySections, sect: Keys, keyBag: Map<string, LDMLKeyboard.LKKey>, layerKeyIds: string[], usedKeys: Set<string>): void;
|
|
39
|
-
static getUsedFlicks(layerKeyIds: string[], keyBag: Map<string, LDMLKeyboard.LKKey>): Set<string>;
|
|
40
|
-
loadKeys(sections: DependencySections, sect: Keys, keyBag: Map<string, LDMLKeyboard.LKKey>, layerKeyIds: string[], usedKeys: Set<string>): void;
|
|
41
|
-
private getKeymapFromForm;
|
|
42
|
-
static getKeymapFromForms(forms: LDMLKeyboard.LKForm[], hardware: string, badScans?: Set<number>): Constants.KeyMap;
|
|
43
|
-
static getKeymapFromScancodes(ldmlForm: LDMLKeyboard.LKForm, badScans?: Set<number>): Constants.KeyMap;
|
|
44
|
-
/**
|
|
45
|
-
* Validate for purpose of kmap
|
|
46
|
-
* @param hardware the 'form' parameter
|
|
47
|
-
* @param layer
|
|
48
|
-
* @param keyHash the keybag's hash
|
|
49
|
-
* @returns true if valid
|
|
50
|
-
*/
|
|
51
|
-
private validateHardwareLayerForKmap;
|
|
52
|
-
private compileHardwareLayerToKmap;
|
|
53
|
-
}
|
|
1
|
+
import { SectionIdent } from '@keymanapp/ldml-keyboard-constants';
|
|
2
|
+
import { LDMLKeyboard, KMXPlus, Constants } from '@keymanapp/common-types';
|
|
3
|
+
import { SectionCompiler } from "./section-compiler.js";
|
|
4
|
+
import DependencySections = KMXPlus.DependencySections;
|
|
5
|
+
import Keys = KMXPlus.Keys;
|
|
6
|
+
import KeysKeys = KMXPlus.KeysKeys;
|
|
7
|
+
import { Substitutions } from './substitution-tracker.js';
|
|
8
|
+
export declare class KeysCompiler extends SectionCompiler {
|
|
9
|
+
static validateSubstitutions(keyboard: LDMLKeyboard.LKKeyboard, st: Substitutions): boolean;
|
|
10
|
+
get id(): SectionIdent;
|
|
11
|
+
get dependencies(): Set<SectionIdent>;
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @returns just the non-touch layers.
|
|
15
|
+
*/
|
|
16
|
+
hardwareLayers(): LDMLKeyboard.LKLayers[];
|
|
17
|
+
validate(): boolean;
|
|
18
|
+
static addKeysFromFlicks(usedFlicks: Set<string>, flickHash: Map<string, LDMLKeyboard.LKFlick>, usedKeys: Set<string>): void;
|
|
19
|
+
private getFlicks;
|
|
20
|
+
/** a set with all key ids used in all layers */
|
|
21
|
+
private getLayerKeyIds;
|
|
22
|
+
/** the entire keybag (used or unused) as a hash */
|
|
23
|
+
private getKeyBag;
|
|
24
|
+
compile(sections: DependencySections): Keys;
|
|
25
|
+
/** list of reserved keys, for tests */
|
|
26
|
+
static readonly reserved_keys: string[];
|
|
27
|
+
/** count of reserved keys, for tests */
|
|
28
|
+
static readonly reserved_count: number;
|
|
29
|
+
/** load up all reserved keys */
|
|
30
|
+
getReservedKeys(sections: KMXPlus.DependencySections): Map<String, KeysKeys>;
|
|
31
|
+
static addUsedGestureKeys(layerKeyIds: string[], keyBag: Map<string, LDMLKeyboard.LKKey>, usedKeys: Set<string>): void;
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @param keyBag the keybag as a hash
|
|
35
|
+
* @param layerKeyIds list of keys from the layer, to extract used flicks
|
|
36
|
+
* @param usedKeys will be populated with keys used in the flick
|
|
37
|
+
*/
|
|
38
|
+
loadFlicks(sections: DependencySections, sect: Keys, keyBag: Map<string, LDMLKeyboard.LKKey>, layerKeyIds: string[], usedKeys: Set<string>): void;
|
|
39
|
+
static getUsedFlicks(layerKeyIds: string[], keyBag: Map<string, LDMLKeyboard.LKKey>): Set<string>;
|
|
40
|
+
loadKeys(sections: DependencySections, sect: Keys, keyBag: Map<string, LDMLKeyboard.LKKey>, layerKeyIds: string[], usedKeys: Set<string>): void;
|
|
41
|
+
private getKeymapFromForm;
|
|
42
|
+
static getKeymapFromForms(forms: LDMLKeyboard.LKForm[], hardware: string, badScans?: Set<number>): Constants.KeyMap;
|
|
43
|
+
static getKeymapFromScancodes(ldmlForm: LDMLKeyboard.LKForm, badScans?: Set<number>): Constants.KeyMap;
|
|
44
|
+
/**
|
|
45
|
+
* Validate for purpose of kmap
|
|
46
|
+
* @param hardware the 'form' parameter
|
|
47
|
+
* @param layer
|
|
48
|
+
* @param keyHash the keybag's hash
|
|
49
|
+
* @returns true if valid
|
|
50
|
+
*/
|
|
51
|
+
private validateHardwareLayerForKmap;
|
|
52
|
+
private compileHardwareLayerToKmap;
|
|
53
|
+
}
|
|
54
54
|
//# sourceMappingURL=keys.d.ts.map
|