@keymanapp/kmc-ldml 17.0.155-alpha → 17.0.156-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.
Files changed (93) hide show
  1. package/build/src/compiler/compiler.d.ts +57 -55
  2. package/build/src/compiler/compiler.d.ts.map +1 -1
  3. package/build/src/compiler/compiler.js +198 -198
  4. package/build/src/compiler/compiler.js.map +1 -1
  5. package/build/src/compiler/disp.d.ts +14 -12
  6. package/build/src/compiler/disp.d.ts.map +1 -1
  7. package/build/src/compiler/disp.js +45 -43
  8. package/build/src/compiler/disp.js.map +1 -1
  9. package/build/src/compiler/empty-compiler.d.ts +39 -37
  10. package/build/src/compiler/empty-compiler.d.ts.map +1 -1
  11. package/build/src/compiler/empty-compiler.js +71 -69
  12. package/build/src/compiler/empty-compiler.js.map +1 -1
  13. package/build/src/compiler/keymanweb-compiler.d.ts +16 -16
  14. package/build/src/compiler/keymanweb-compiler.d.ts.map +1 -1
  15. package/build/src/compiler/keymanweb-compiler.js +97 -96
  16. package/build/src/compiler/keymanweb-compiler.js.map +1 -1
  17. package/build/src/compiler/keys.d.ts +30 -28
  18. package/build/src/compiler/keys.d.ts.map +1 -1
  19. package/build/src/compiler/keys.js +240 -238
  20. package/build/src/compiler/keys.js.map +1 -1
  21. package/build/src/compiler/layr.d.ts +12 -10
  22. package/build/src/compiler/layr.d.ts.map +1 -1
  23. package/build/src/compiler/layr.js +83 -81
  24. package/build/src/compiler/layr.js.map +1 -1
  25. package/build/src/compiler/ldml-compiler-options.d.ts +10 -0
  26. package/build/src/compiler/ldml-compiler-options.d.ts.map +1 -0
  27. package/build/src/compiler/ldml-compiler-options.js +5 -0
  28. package/build/src/compiler/ldml-compiler-options.js.map +1 -0
  29. package/build/src/compiler/loca.d.ts +18 -16
  30. package/build/src/compiler/loca.d.ts.map +1 -1
  31. package/build/src/compiler/loca.js +61 -59
  32. package/build/src/compiler/loca.js.map +1 -1
  33. package/build/src/compiler/marker-tracker.d.ts +36 -34
  34. package/build/src/compiler/marker-tracker.d.ts.map +1 -1
  35. package/build/src/compiler/marker-tracker.js +75 -73
  36. package/build/src/compiler/marker-tracker.js.map +1 -1
  37. package/build/src/compiler/messages.d.ts +135 -133
  38. package/build/src/compiler/messages.d.ts.map +1 -1
  39. package/build/src/compiler/messages.js +79 -77
  40. package/build/src/compiler/messages.js.map +1 -1
  41. package/build/src/compiler/meta.d.ts +14 -12
  42. package/build/src/compiler/meta.d.ts.map +1 -1
  43. package/build/src/compiler/meta.js +60 -58
  44. package/build/src/compiler/meta.js.map +1 -1
  45. package/build/src/compiler/metadata-compiler.d.ts +15 -13
  46. package/build/src/compiler/metadata-compiler.d.ts.map +1 -1
  47. package/build/src/compiler/metadata-compiler.js +49 -47
  48. package/build/src/compiler/metadata-compiler.js.map +1 -1
  49. package/build/src/compiler/name.d.ts +12 -10
  50. package/build/src/compiler/name.d.ts.map +1 -1
  51. package/build/src/compiler/name.js +22 -20
  52. package/build/src/compiler/name.js.map +1 -1
  53. package/build/src/compiler/section-compiler.d.ts +18 -16
  54. package/build/src/compiler/section-compiler.d.ts.map +1 -1
  55. package/build/src/compiler/section-compiler.js +36 -34
  56. package/build/src/compiler/section-compiler.js.map +1 -1
  57. package/build/src/compiler/touch-layout-compiler.d.ts +10 -8
  58. package/build/src/compiler/touch-layout-compiler.d.ts.map +1 -1
  59. package/build/src/compiler/touch-layout-compiler.js +89 -87
  60. package/build/src/compiler/touch-layout-compiler.js.map +1 -1
  61. package/build/src/compiler/tran.d.ts +39 -37
  62. package/build/src/compiler/tran.d.ts.map +1 -1
  63. package/build/src/compiler/tran.js +187 -185
  64. package/build/src/compiler/tran.js.map +1 -1
  65. package/build/src/compiler/vars.d.ts +23 -21
  66. package/build/src/compiler/vars.d.ts.map +1 -1
  67. package/build/src/compiler/vars.js +221 -219
  68. package/build/src/compiler/vars.js.map +1 -1
  69. package/build/src/compiler/visual-keyboard-compiler.d.ts +9 -7
  70. package/build/src/compiler/visual-keyboard-compiler.d.ts.map +1 -1
  71. package/build/src/compiler/visual-keyboard-compiler.js +52 -54
  72. package/build/src/compiler/visual-keyboard-compiler.js.map +1 -1
  73. package/build/src/compiler/vkey.d.ts +11 -9
  74. package/build/src/compiler/vkey.d.ts.map +1 -1
  75. package/build/src/compiler/vkey.js +61 -59
  76. package/build/src/compiler/vkey.js.map +1 -1
  77. package/build/src/main.d.ts +11 -9
  78. package/build/src/main.d.ts.map +1 -1
  79. package/build/src/main.js +10 -8
  80. package/build/src/main.js.map +1 -1
  81. package/build/src/util/util.d.ts +44 -42
  82. package/build/src/util/util.d.ts.map +1 -1
  83. package/build/src/util/util.js +122 -120
  84. package/build/src/util/util.js.map +1 -1
  85. package/package.json +8 -8
  86. package/build/src/compiler/compiler-options.d.ts +0 -16
  87. package/build/src/compiler/compiler-options.d.ts.map +0 -1
  88. package/build/src/compiler/compiler-options.js +0 -6
  89. package/build/src/compiler/compiler-options.js.map +0 -1
  90. package/build/src/kpj.schema.json +0 -127
  91. package/build/src/kvks.schema.json +0 -182
  92. package/build/src/ldml-keyboard.schema.json +0 -702
  93. package/build/src/ldml-keyboardtest.schema.json +0 -221
@@ -1,54 +1,52 @@
1
- import { Constants, VisualKeyboard } from "@keymanapp/common-types";
2
- export class LdmlKeyboardVisualKeyboardCompiler {
3
- compile(source) {
4
- let result = new VisualKeyboard.VisualKeyboard();
5
- /* TODO-LDML: consider VisualKeyboardHeaderFlags.kvkhUseUnderlying kvkhDisplayUnderlying kvkhAltGr kvkh102 */
6
- result.header.flags = 0;
7
- result.header.version = 0x0600;
8
- /* TODO-LDML: consider font, associatedKeyboard */
9
- result.header.associatedKeyboard = '';
10
- result.header.ansiFont.name = 'Arial';
11
- result.header.ansiFont.size = 10;
12
- result.header.ansiFont.color = 0;
13
- result.header.unicodeFont.name = 'Arial';
14
- result.header.unicodeFont.size = 10;
15
- result.header.unicodeFont.color = 0;
16
- for (let layers of source.keyboard.layers) {
17
- for (let layer of layers.layer) {
18
- this.compileHardwareLayer(source, result, layer);
19
- }
20
- }
21
- return result;
22
- }
23
- compileHardwareLayer(source, vk, layer) {
24
- // TODO-LDML: consider consolidation with keys.ts?
25
- const shift = this.translateLayerIdToVisualKeyboardShift(layer.id);
26
- let y = -1;
27
- for (let row of layer.row) {
28
- y++;
29
- const keys = row.keys.split(' ');
30
- let x = -1;
31
- for (let key of keys) {
32
- x++;
33
- let keydef = source.keyboard.keys?.key?.find(x => x.id == key);
34
- if (!keydef) {
35
- throw Error(`Internal Error: could not find key id="${key}" in layer "${layer.id || '<none>'}", row "${y}"`);
36
- }
37
- vk.keys.push({
38
- flags: 2 /* VisualKeyboard.VisualKeyboardKeyFlags.kvkkUnicode */,
39
- shift: shift,
40
- text: keydef.to,
41
- vkey: Constants.USVirtualKeyMap[y][x] // TODO-LDML: #7965 US-only
42
- });
43
- }
44
- }
45
- }
46
- translateLayerIdToVisualKeyboardShift(id) {
47
- if (id == 'base') {
48
- return 0;
49
- }
50
- // TODO-LDML: other modifiers
51
- return 0;
52
- }
53
- }
54
- //# sourceMappingURL=visual-keyboard-compiler.js.map
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]="678c7f8e-da72-5dbc-932b-bfe3ed75b9be")}catch(e){}}();
2
+ import { Constants, VisualKeyboard } from "@keymanapp/common-types";
3
+ export class LdmlKeyboardVisualKeyboardCompiler {
4
+ compile(source) {
5
+ let result = new VisualKeyboard.VisualKeyboard();
6
+ /* TODO-LDML: consider VisualKeyboardHeaderFlags.kvkhUseUnderlying kvkhDisplayUnderlying kvkhAltGr kvkh102 */
7
+ result.header.flags = 0;
8
+ result.header.version = 0x0600;
9
+ /* TODO-LDML: consider associatedKeyboard: this _must_ be set to id (aka basename sans ext) of keyboard .kmx file */
10
+ result.header.associatedKeyboard = '';
11
+ result.header.ansiFont = { ...VisualKeyboard.DEFAULT_KVK_FONT };
12
+ result.header.unicodeFont = { ...VisualKeyboard.DEFAULT_KVK_FONT };
13
+ for (let layers of source.keyboard.layers) {
14
+ for (let layer of layers.layer) {
15
+ this.compileHardwareLayer(source, result, layer);
16
+ }
17
+ }
18
+ return result;
19
+ }
20
+ compileHardwareLayer(source, vk, layer) {
21
+ // TODO-LDML: consider consolidation with keys.ts?
22
+ const shift = this.translateLayerIdToVisualKeyboardShift(layer.id);
23
+ let y = -1;
24
+ for (let row of layer.row) {
25
+ y++;
26
+ const keys = row.keys.split(' ');
27
+ let x = -1;
28
+ for (let key of keys) {
29
+ x++;
30
+ let keydef = source.keyboard.keys?.key?.find(x => x.id == key);
31
+ if (!keydef) {
32
+ throw Error(`Internal Error: could not find key id="${key}" in layer "${layer.id || '<none>'}", row "${y}"`);
33
+ }
34
+ vk.keys.push({
35
+ flags: 2 /* VisualKeyboard.VisualKeyboardKeyFlags.kvkkUnicode */,
36
+ shift: shift,
37
+ text: keydef.to,
38
+ vkey: Constants.USVirtualKeyMap[y][x] // TODO-LDML: #7965 US-only
39
+ });
40
+ }
41
+ }
42
+ }
43
+ translateLayerIdToVisualKeyboardShift(id) {
44
+ if (id == 'base') {
45
+ return 0;
46
+ }
47
+ // TODO-LDML: other modifiers
48
+ return 0;
49
+ }
50
+ }
51
+ //# debugId=678c7f8e-da72-5dbc-932b-bfe3ed75b9be
52
+ //# sourceMappingURL=visual-keyboard-compiler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"visual-keyboard-compiler.js","sourceRoot":"","sources":["../../../src/compiler/visual-keyboard-compiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAgB,MAAM,yBAAyB,CAAC;AAElF,MAAM,OAAO,kCAAkC;IACtC,OAAO,CAAC,MAA8C;QAC3D,IAAI,MAAM,GAAG,IAAI,cAAc,CAAC,cAAc,EAAE,CAAC;QAEjD,6GAA6G;QAC7G,MAAM,CAAC,MAAM,CAAC,KAAK,GAAG,CA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AAE;oBACf,IAAI,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,4BAA4B;iBACnE,CAAC,CAAC;aACJ;SACF;IACH,CAAC;IAEO,qCAAqC,CAAC,EAAU;QACtD,IAAG,EAAE,IAAI,MAAM,EAAE;YACf,OAAO,CAAC,CAAC;SACV;QACD,6BAA6B;QAC7B,OAAO,CAAC,CAAC;IACX,CAAC;CACF","names":[],"sourceRoot":"","sources":["../../../src/compiler/visual-keyboard-compiler.ts"],"version":3}
@@ -1,9 +1,11 @@
1
- import { KMXPlus } from '@keymanapp/common-types';
2
- import { SectionCompiler } from "./section-compiler.js";
3
- import Vkey = KMXPlus.Vkey;
4
- export declare class VkeyCompiler extends SectionCompiler {
5
- get id(): import("@keymanapp/ldml-keyboard-constants").SectionIdent;
6
- validate(): boolean;
7
- compile(): Vkey;
8
- }
9
- //# sourceMappingURL=vkey.d.ts.map
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]="74359acc-a72c-5f70-b2ec-95aa0f5539b4")}catch(e){}}();
2
+ import { KMXPlus } from '@keymanapp/common-types';
3
+ import { SectionCompiler } from "./section-compiler.js";
4
+ import Vkey = KMXPlus.Vkey;
5
+ export declare class VkeyCompiler extends SectionCompiler {
6
+ get id(): import("@keymanapp/ldml-keyboard-constants").SectionIdent;
7
+ validate(): boolean;
8
+ compile(): Vkey;
9
+ }
10
+ //# debugId=74359acc-a72c-5f70-b2ec-95aa0f5539b4
11
+ //# sourceMappingURL=vkey.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vkey.d.ts","sourceRoot":"","sources":["../../../src/compiler/vkey.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAa,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;AAG3B,qBAAa,YAAa,SAAQ,eAAe;IAE/C,IAAW,EAAE,8DAEZ;IAEM,QAAQ,IAAI,OAAO;IAqCnB,OAAO,IAAI,IAAI;CAiBvB"}
1
+ {"debug_id":"74359acc-a72c-5f70-b2ec-95aa0f5539b4","file":"vkey.d.ts","mappings":";AACA,OAAO,EAAE,OAAO,EAAa,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;AAG3B,qBAAa,YAAa,SAAQ,eAAe;IAE/C,IAAW,EAAE,8DAEZ;IAEM,QAAQ,IAAI,OAAO;IAqCnB,OAAO,IAAI,IAAI;CAiBvB","names":[],"sourceRoot":"","sources":["../../../src/compiler/vkey.ts"],"version":3}
@@ -1,59 +1,61 @@
1
- import { constants } from "@keymanapp/ldml-keyboard-constants";
2
- import { KMXPlus, Constants } from '@keymanapp/common-types';
3
- import { CompilerMessages } from "./messages.js";
4
- import { SectionCompiler } from "./section-compiler.js";
5
- var Vkey = KMXPlus.Vkey;
6
- var LdmlVkeyNames = Constants.LdmlVkeyNames;
7
- export class VkeyCompiler extends SectionCompiler {
8
- get id() {
9
- return constants.section.vkey;
10
- }
11
- validate() {
12
- let valid = true;
13
- if (this.keyboard.vkeys) {
14
- let from = [], to = [];
15
- this.keyboard.vkeys.vkey.forEach(vk => {
16
- if (LdmlVkeyNames[vk.from] === undefined) {
17
- // TODO-LDML: When we do #7135 this may need to change back to an error.
18
- this.callbacks.reportMessage(CompilerMessages.Hint_VkeyIsNotValid({ vkey: vk.from }));
19
- return;
20
- }
21
- if (LdmlVkeyNames[vk.to] === undefined) {
22
- // TODO-LDML: When we do #7135 this may need to change back to an error.
23
- this.callbacks.reportMessage(CompilerMessages.Hint_VkeyIsNotValid({ vkey: vk.to }));
24
- return;
25
- }
26
- if (vk.from == vk.to) {
27
- this.callbacks.reportMessage(CompilerMessages.Hint_VkeyIsRedundant({ vkey: vk.from }));
28
- }
29
- if (from.find(svk => svk == vk.from)) {
30
- this.callbacks.reportMessage(CompilerMessages.Error_VkeyIsRepeated({ vkey: vk.from }));
31
- valid = false;
32
- }
33
- from.push(vk.from);
34
- if (to.find(svk => svk == vk.to)) {
35
- this.callbacks.reportMessage(CompilerMessages.Info_MultipleVkeysHaveSameTarget({ vkey: vk.to }));
36
- }
37
- to.push(vk.to);
38
- });
39
- }
40
- return valid;
41
- }
42
- compile() {
43
- let result = new Vkey();
44
- if (!this.keyboard.vkeys) {
45
- /* c8 ignore next 2 */
46
- return result; // not hit due to boxing
47
- }
48
- result.vkeys = this.keyboard.vkeys?.vkey.map(vk => {
49
- return {
50
- vkey: LdmlVkeyNames[vk.from],
51
- target: LdmlVkeyNames[vk.to]
52
- };
53
- });
54
- // Sort according to vkey binary order, per C7043
55
- result.vkeys.sort((a, b) => a.vkey - b.vkey);
56
- return result;
57
- }
58
- }
59
- //# sourceMappingURL=vkey.js.map
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]="34e6bacf-0614-5be7-b0fa-f7b3d46aa0ac")}catch(e){}}();
2
+ import { constants } from "@keymanapp/ldml-keyboard-constants";
3
+ import { KMXPlus, Constants } from '@keymanapp/common-types';
4
+ import { CompilerMessages } from "./messages.js";
5
+ import { SectionCompiler } from "./section-compiler.js";
6
+ var Vkey = KMXPlus.Vkey;
7
+ var LdmlVkeyNames = Constants.LdmlVkeyNames;
8
+ export class VkeyCompiler extends SectionCompiler {
9
+ get id() {
10
+ return constants.section.vkey;
11
+ }
12
+ validate() {
13
+ let valid = true;
14
+ if (this.keyboard.vkeys) {
15
+ let from = [], to = [];
16
+ this.keyboard.vkeys.vkey.forEach(vk => {
17
+ if (LdmlVkeyNames[vk.from] === undefined) {
18
+ // TODO-LDML: When we do #7135 this may need to change back to an error.
19
+ this.callbacks.reportMessage(CompilerMessages.Hint_VkeyIsNotValid({ vkey: vk.from }));
20
+ return;
21
+ }
22
+ if (LdmlVkeyNames[vk.to] === undefined) {
23
+ // TODO-LDML: When we do #7135 this may need to change back to an error.
24
+ this.callbacks.reportMessage(CompilerMessages.Hint_VkeyIsNotValid({ vkey: vk.to }));
25
+ return;
26
+ }
27
+ if (vk.from == vk.to) {
28
+ this.callbacks.reportMessage(CompilerMessages.Hint_VkeyIsRedundant({ vkey: vk.from }));
29
+ }
30
+ if (from.find(svk => svk == vk.from)) {
31
+ this.callbacks.reportMessage(CompilerMessages.Error_VkeyIsRepeated({ vkey: vk.from }));
32
+ valid = false;
33
+ }
34
+ from.push(vk.from);
35
+ if (to.find(svk => svk == vk.to)) {
36
+ this.callbacks.reportMessage(CompilerMessages.Info_MultipleVkeysHaveSameTarget({ vkey: vk.to }));
37
+ }
38
+ to.push(vk.to);
39
+ });
40
+ }
41
+ return valid;
42
+ }
43
+ compile() {
44
+ let result = new Vkey();
45
+ if (!this.keyboard.vkeys) {
46
+ /* c8 ignore next 2 */
47
+ return result; // not hit due to boxing
48
+ }
49
+ result.vkeys = this.keyboard.vkeys?.vkey.map(vk => {
50
+ return {
51
+ vkey: LdmlVkeyNames[vk.from],
52
+ target: LdmlVkeyNames[vk.to]
53
+ };
54
+ });
55
+ // Sort according to vkey binary order, per C7043
56
+ result.vkeys.sort((a, b) => a.vkey - b.vkey);
57
+ return result;
58
+ }
59
+ }
60
+ //# debugId=34e6bacf-0614-5be7-b0fa-f7b3d46aa0ac
61
+ //# sourceMappingURL=vkey.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"vkey.js","sourceRoot":"","sources":["../../../src/compiler/vkey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,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IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;YAChD,OAAO;gBACL,IAAI,EAAE,aAAa,CAAC,EAAE,CAAC,IAAI,CAAC;gBAC5B,MAAM,EAAE,aAAa,CAAC,EAAE,CAAC,EAAE,CAAC;aAC7B,CAAC;QACJ,CAAC,CAAC,CAAC;QACH,iDAAiD;QACjD,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;QAC5C,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","names":[],"sourceRoot":"","sources":["../../../src/compiler/vkey.ts"],"version":3}
@@ -1,9 +1,11 @@
1
- export { LdmlKeyboardCompiler } from './compiler/compiler.js';
2
- export { LdmlKeyboardKeymanWebCompiler } from './compiler/keymanweb-compiler.js';
3
- export { LdmlKeyboardVisualKeyboardCompiler } from './compiler/visual-keyboard-compiler.js';
4
- export { TouchLayoutCompiler } from './compiler/touch-layout-compiler.js';
5
- export { CompilerOptions } from './compiler/compiler-options.js';
6
- export { CompilerMessages } from './compiler/messages.js';
7
- export { KMXPlusMetadataCompiler } from './compiler/metadata-compiler.js';
8
- export { KMXBuilder } from "@keymanapp/common-types";
9
- //# sourceMappingURL=main.d.ts.map
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]="fa6c2db3-b403-5b39-b892-f84d79a89da7")}catch(e){}}();
2
+ export { LdmlKeyboardCompiler } from './compiler/compiler.js';
3
+ export { LdmlKeyboardKeymanWebCompiler } from './compiler/keymanweb-compiler.js';
4
+ export { LdmlKeyboardVisualKeyboardCompiler } from './compiler/visual-keyboard-compiler.js';
5
+ export { TouchLayoutCompiler } from './compiler/touch-layout-compiler.js';
6
+ export { LdmlCompilerOptions } from './compiler/ldml-compiler-options.js';
7
+ export { CompilerMessages } from './compiler/messages.js';
8
+ export { KMXPlusMetadataCompiler } from './compiler/metadata-compiler.js';
9
+ export { KMXBuilder } from "@keymanapp/common-types";
10
+ //# debugId=fa6c2db3-b403-5b39-b892-f84d79a89da7
11
+ //# sourceMappingURL=main.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,kCAAkC,EAAE,MAAM,wCAAwC,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE1E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"debug_id":"fa6c2db3-b403-5b39-b892-f84d79a89da7","file":"main.d.ts","mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,kCAAkC,EAAE,MAAM,wCAAwC,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE1E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC","names":[],"sourceRoot":"","sources":["../../src/main.ts"],"version":3}
package/build/src/main.js CHANGED
@@ -1,8 +1,10 @@
1
- export { LdmlKeyboardCompiler } from './compiler/compiler.js';
2
- export { LdmlKeyboardKeymanWebCompiler } from './compiler/keymanweb-compiler.js';
3
- export { LdmlKeyboardVisualKeyboardCompiler } from './compiler/visual-keyboard-compiler.js';
4
- export { TouchLayoutCompiler } from './compiler/touch-layout-compiler.js';
5
- export { CompilerMessages } from './compiler/messages.js';
6
- export { KMXPlusMetadataCompiler } from './compiler/metadata-compiler.js';
7
- export { KMXBuilder } from "@keymanapp/common-types";
8
- //# sourceMappingURL=main.js.map
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]="6b543fea-aa1e-514c-b117-bc4c0b47be50")}catch(e){}}();
2
+ export { LdmlKeyboardCompiler } from './compiler/compiler.js';
3
+ export { LdmlKeyboardKeymanWebCompiler } from './compiler/keymanweb-compiler.js';
4
+ export { LdmlKeyboardVisualKeyboardCompiler } from './compiler/visual-keyboard-compiler.js';
5
+ export { TouchLayoutCompiler } from './compiler/touch-layout-compiler.js';
6
+ export { CompilerMessages } from './compiler/messages.js';
7
+ export { KMXPlusMetadataCompiler } from './compiler/metadata-compiler.js';
8
+ export { KMXBuilder } from "@keymanapp/common-types";
9
+ //# debugId=6b543fea-aa1e-514c-b117-bc4c0b47be50
10
+ //# sourceMappingURL=main.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,kCAAkC,EAAE,MAAM,wCAAwC,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE1E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"debug_id":"6b543fea-aa1e-514c-b117-bc4c0b47be50","file":"main.js","mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,kCAAkC,EAAE,MAAM,wCAAwC,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE1E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC","names":[],"sourceRoot":"","sources":["../../src/main.ts"],"version":3}
@@ -1,42 +1,44 @@
1
- import { LDMLKeyboard } from "@keymanapp/common-types";
2
- /**
3
- * Verifies that value is an item in the enumeration.
4
- */
5
- export declare function isValidEnumValue<T extends {
6
- [key: number]: string | number;
7
- }>(enu: T, value: string): boolean;
8
- /**
9
- * Returns unique LKKeys only, preserving later ones
10
- * in case of conflict. (i.e. later overrides)
11
- * @param keys list of keys to consider. (mutated)
12
- * @returns Array of unique keys. Order is not specified.
13
- */
14
- export declare function calculateUniqueKeys(keys?: LDMLKeyboard.LKKey[]): LDMLKeyboard.LKKey[];
15
- /**
16
- *
17
- * @param layersList list of layers elements, from `keyboard?.layers`
18
- * @returns set of key IDs
19
- */
20
- export declare function allUsedKeyIdsInLayers(layersList: LDMLKeyboard.LKLayers[] | null): Set<string>;
21
- /**
22
- * Helper function for validating child elements. Written for the convenience of message passing functions.
23
- *
24
- * @param values array of values to check
25
- * @param onDuplicate callback with array of duplicate values, deduped
26
- * @param allowed optional set of valid values
27
- * @param onInvalid callback with array of invalid values, deduped
28
- * @returns true if all OK
29
- */
30
- export declare function verifyValidAndUnique(values: string[], onDuplicate: (duplicates: string[]) => void, allowed?: Set<string>, onInvalid?: (invalids: string[]) => void): boolean;
31
- /**
32
- * Determine modifier from layer info
33
- * @param layer layer obj
34
- * @returns modifier
35
- */
36
- export declare function translateLayerAttrToModifier(layer: LDMLKeyboard.LKLayer): number;
37
- /**
38
- * @param modifier modifier sequence such as undefined, "none", "shift altR" etc
39
- * @returns true if valid
40
- */
41
- export declare function validModifier(modifier?: string): boolean;
42
- //# sourceMappingURL=util.d.ts.map
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]="77f2c1ea-2052-5b2c-91ef-e04e70cec57c")}catch(e){}}();
2
+ import { LDMLKeyboard } from "@keymanapp/common-types";
3
+ /**
4
+ * Verifies that value is an item in the enumeration.
5
+ */
6
+ export declare function isValidEnumValue<T extends {
7
+ [key: number]: string | number;
8
+ }>(enu: T, value: string): boolean;
9
+ /**
10
+ * Returns unique LKKeys only, preserving later ones
11
+ * in case of conflict. (i.e. later overrides)
12
+ * @param keys list of keys to consider. (mutated)
13
+ * @returns Array of unique keys. Order is not specified.
14
+ */
15
+ export declare function calculateUniqueKeys(keys?: LDMLKeyboard.LKKey[]): LDMLKeyboard.LKKey[];
16
+ /**
17
+ *
18
+ * @param layersList list of layers elements, from `keyboard?.layers`
19
+ * @returns set of key IDs
20
+ */
21
+ export declare function allUsedKeyIdsInLayers(layersList: LDMLKeyboard.LKLayers[] | null): Set<string>;
22
+ /**
23
+ * Helper function for validating child elements. Written for the convenience of message passing functions.
24
+ *
25
+ * @param values array of values to check
26
+ * @param onDuplicate callback with array of duplicate values, deduped
27
+ * @param allowed optional set of valid values
28
+ * @param onInvalid callback with array of invalid values, deduped
29
+ * @returns true if all OK
30
+ */
31
+ export declare function verifyValidAndUnique(values: string[], onDuplicate: (duplicates: string[]) => void, allowed?: Set<string>, onInvalid?: (invalids: string[]) => void): boolean;
32
+ /**
33
+ * Determine modifier from layer info
34
+ * @param layer layer obj
35
+ * @returns modifier
36
+ */
37
+ export declare function translateLayerAttrToModifier(layer: LDMLKeyboard.LKLayer): number;
38
+ /**
39
+ * @param modifier modifier sequence such as undefined, "none", "shift altR" etc
40
+ * @returns true if valid
41
+ */
42
+ export declare function validModifier(modifier?: string): boolean;
43
+ //# debugId=77f2c1ea-2052-5b2c-91ef-e04e70cec57c
44
+ //# sourceMappingURL=util.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/util/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,WAEjG;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC,KAAK,EAAE,GAAG,YAAY,CAAC,KAAK,EAAE,CAiBrF;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAG,YAAY,CAAC,QAAQ,EAAE,GAAG,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,CAgB9F;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EAAE,EAChB,WAAW,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,IAAI,EAC3C,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EACrB,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,GACtC,OAAO,CA0BV;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,KA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