@keymanapp/common-types 18.0.41-alpha → 18.0.46-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/consts/virtual-key-constants.d.ts +191 -191
- package/build/src/consts/virtual-key-constants.js +221 -221
- package/build/src/consts/virtual-key-constants.js.map +1 -1
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-reader.d.ts +5 -5
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-reader.js +72 -72
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-reader.js.map +1 -1
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-writer.d.ts +28 -28
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-writer.js +120 -120
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-writer.js.map +1 -1
- package/build/src/keyman-touch-layout/keyman-touch-layout-file.d.ts +95 -95
- package/build/src/keyman-touch-layout/keyman-touch-layout-file.js +52 -52
- package/build/src/kmx/element-string.d.ts +23 -23
- package/build/src/kmx/element-string.js +125 -125
- package/build/src/kmx/element-string.js.map +1 -1
- package/build/src/kmx/keyman-targets.d.ts +20 -20
- package/build/src/kmx/keyman-targets.js +79 -79
- package/build/src/kmx/keyman-targets.js.map +1 -1
- package/build/src/kmx/kmx-builder.d.ts +32 -32
- package/build/src/kmx/kmx-builder.js +189 -189
- package/build/src/kmx/kmx-builder.js.map +1 -1
- package/build/src/kmx/kmx-file-reader.d.ts +13 -13
- package/build/src/kmx/kmx-file-reader.js +134 -134
- package/build/src/kmx/kmx-file-reader.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-disp.d.ts +18 -18
- package/build/src/kmx/kmx-plus-builder/build-disp.js +27 -27
- package/build/src/kmx/kmx-plus-builder/build-disp.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-elem.d.ts +28 -28
- package/build/src/kmx/kmx-plus-builder/build-elem.js +89 -89
- package/build/src/kmx/kmx-plus-builder/build-elem.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-keys.d.ts +56 -56
- package/build/src/kmx/kmx-plus-builder/build-keys.js +107 -107
- package/build/src/kmx/kmx-plus-builder/build-keys.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-layr.d.ts +53 -53
- package/build/src/kmx/kmx-plus-builder/build-layr.js +101 -101
- package/build/src/kmx/kmx-plus-builder/build-layr.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-list.d.ts +35 -35
- package/build/src/kmx/kmx-plus-builder/build-list.js +66 -66
- package/build/src/kmx/kmx-plus-builder/build-list.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-loca.d.ts +11 -11
- package/build/src/kmx/kmx-plus-builder/build-loca.js +21 -21
- package/build/src/kmx/kmx-plus-builder/build-loca.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-meta.d.ts +16 -16
- package/build/src/kmx/kmx-plus-builder/build-meta.js +20 -20
- package/build/src/kmx/kmx-plus-builder/build-sect.d.ts +15 -15
- package/build/src/kmx/kmx-plus-builder/build-sect.js +15 -15
- package/build/src/kmx/kmx-plus-builder/build-sect.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-strs.d.ts +22 -22
- package/build/src/kmx/kmx-plus-builder/build-strs.js +46 -46
- package/build/src/kmx/kmx-plus-builder/build-strs.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-tran.d.ts +32 -32
- package/build/src/kmx/kmx-plus-builder/build-tran.js +69 -69
- package/build/src/kmx/kmx-plus-builder/build-tran.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-uset.d.ts +30 -30
- package/build/src/kmx/kmx-plus-builder/build-uset.js +60 -60
- package/build/src/kmx/kmx-plus-builder/build-uset.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-vars.d.ts +21 -21
- package/build/src/kmx/kmx-plus-builder/build-vars.js +48 -48
- package/build/src/kmx/kmx-plus-builder/build-vars.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/builder-section.d.ts +9 -9
- package/build/src/kmx/kmx-plus-builder/builder-section.js +2 -2
- package/build/src/kmx/kmx-plus-builder/kmx-plus-builder.d.ts +42 -42
- package/build/src/kmx/kmx-plus-builder/kmx-plus-builder.js +137 -137
- package/build/src/kmx/kmx-plus-builder/kmx-plus-builder.js.map +1 -1
- package/build/src/kmx/kmx-plus.d.ts +322 -322
- package/build/src/kmx/kmx-plus.js +830 -830
- package/build/src/kmx/kmx-plus.js.map +1 -1
- package/build/src/kmx/kmx.d.ts +233 -233
- package/build/src/kmx/kmx.js +302 -302
- package/build/src/kmx/kmx.js.map +1 -1
- package/build/src/kmx/string-list.d.ts +35 -35
- package/build/src/kmx/string-list.js +88 -88
- package/build/src/kmx/string-list.js.map +1 -1
- package/build/src/kpj/keyman-developer-project.d.ts +78 -78
- package/build/src/kpj/keyman-developer-project.js +195 -195
- package/build/src/kpj/keyman-developer-project.js.map +1 -1
- package/build/src/kpj/kpj-file-reader.d.ts +18 -18
- package/build/src/kpj/kpj-file-reader.js +119 -119
- package/build/src/kpj/kpj-file-reader.js.map +1 -1
- package/build/src/kpj/kpj-file.d.ts +39 -39
- package/build/src/kpj/kpj-file.js +10 -10
- package/build/src/kvk/kvk-file-reader.d.ts +4 -4
- package/build/src/kvk/kvk-file-reader.js +37 -37
- package/build/src/kvk/kvk-file-reader.js.map +1 -1
- package/build/src/kvk/kvk-file-writer.d.ts +19 -19
- package/build/src/kvk/kvk-file-writer.js +77 -77
- package/build/src/kvk/kvk-file-writer.js.map +1 -1
- package/build/src/kvk/kvk-file.d.ts +66 -66
- package/build/src/kvk/kvk-file.d.ts.map +1 -1
- package/build/src/kvk/kvk-file.js +90 -90
- package/build/src/kvk/kvk-file.js.map +1 -1
- package/build/src/kvk/kvks-file-reader.d.ts +23 -23
- package/build/src/kvk/kvks-file-reader.js +175 -175
- package/build/src/kvk/kvks-file-reader.js.map +1 -1
- package/build/src/kvk/kvks-file-writer.d.ts +6 -6
- package/build/src/kvk/kvks-file-writer.js +106 -106
- package/build/src/kvk/kvks-file-writer.js.map +1 -1
- package/build/src/kvk/kvks-file.d.ts +43 -43
- package/build/src/kvk/kvks-file.js +9 -9
- package/build/src/kvk/visual-keyboard.d.ts +44 -44
- package/build/src/kvk/visual-keyboard.js +75 -75
- package/build/src/kvk/visual-keyboard.js.map +1 -1
- package/build/src/ldml-keyboard/ldml-keyboard-testdata-xml.d.ts +60 -60
- package/build/src/ldml-keyboard/ldml-keyboard-testdata-xml.js +19 -19
- package/build/src/ldml-keyboard/ldml-keyboard-xml-reader.d.ts +95 -95
- package/build/src/ldml-keyboard/ldml-keyboard-xml-reader.js +409 -409
- package/build/src/ldml-keyboard/ldml-keyboard-xml-reader.js.map +1 -1
- package/build/src/ldml-keyboard/ldml-keyboard-xml.d.ts +170 -170
- package/build/src/ldml-keyboard/ldml-keyboard-xml.js +55 -55
- package/build/src/ldml-keyboard/pattern-parser.d.ts +201 -201
- package/build/src/ldml-keyboard/pattern-parser.js +490 -490
- package/build/src/ldml-keyboard/pattern-parser.js.map +1 -1
- package/build/src/ldml-keyboard/unicodeset-parser-api.d.ts +37 -37
- package/build/src/ldml-keyboard/unicodeset-parser-api.js +27 -27
- package/build/src/main.d.ts +33 -33
- package/build/src/main.js +32 -32
- package/build/src/package/kmp-json-file.d.ts +115 -115
- package/build/src/package/kmp-json-file.js +1 -1
- package/build/src/package/kps-file.d.ts +175 -175
- package/build/src/package/kps-file.js +15 -15
- package/build/src/schema-validators.d.ts +13 -13
- package/build/src/schema-validators.js +25 -25
- package/build/src/schemas/displaymap.schema.d.ts +57 -57
- package/build/src/schemas/displaymap.schema.js +35 -35
- package/build/src/schemas/displaymap.schema.validator.d.mts +2 -2
- package/build/src/schemas/displaymap.schema.validator.mjs +266 -266
- package/build/src/schemas/displaymap.schema.validator.mjs.map +1 -1
- package/build/src/schemas/keyboard_info.schema.d.ts +209 -209
- package/build/src/schemas/keyboard_info.schema.js +98 -98
- package/build/src/schemas/keyboard_info.schema.validator.d.mts +2 -2
- package/build/src/schemas/keyboard_info.schema.validator.mjs +1160 -1160
- package/build/src/schemas/keyboard_info.schema.validator.mjs.map +1 -1
- package/build/src/schemas/keyman-touch-layout.clean.spec.d.ts +227 -227
- package/build/src/schemas/keyman-touch-layout.clean.spec.js +151 -151
- package/build/src/schemas/keyman-touch-layout.clean.spec.validator.d.mts +2 -2
- package/build/src/schemas/keyman-touch-layout.clean.spec.validator.mjs +1094 -1094
- package/build/src/schemas/keyman-touch-layout.clean.spec.validator.mjs.map +1 -1
- package/build/src/schemas/keyman-touch-layout.spec.d.ts +229 -229
- package/build/src/schemas/keyman-touch-layout.spec.js +140 -140
- package/build/src/schemas/keyman-touch-layout.spec.validator.d.mts +2 -2
- package/build/src/schemas/keyman-touch-layout.spec.validator.mjs +1436 -1436
- package/build/src/schemas/keyman-touch-layout.spec.validator.mjs.map +1 -1
- package/build/src/schemas/kmp.schema.d.ts +324 -324
- package/build/src/schemas/kmp.schema.js +353 -353
- package/build/src/schemas/kmp.schema.validator.d.mts +2 -2
- package/build/src/schemas/kmp.schema.validator.mjs +1627 -1627
- package/build/src/schemas/kmp.schema.validator.mjs.map +1 -1
- package/build/src/schemas/kpj-9.0.schema.d.ts +152 -152
- package/build/src/schemas/kpj-9.0.schema.js +131 -131
- package/build/src/schemas/kpj-9.0.schema.validator.d.mts +2 -2
- package/build/src/schemas/kpj-9.0.schema.validator.mjs +655 -655
- package/build/src/schemas/kpj-9.0.schema.validator.mjs.map +1 -1
- package/build/src/schemas/kpj.schema.d.ts +122 -122
- package/build/src/schemas/kpj.schema.js +129 -129
- package/build/src/schemas/kpj.schema.validator.d.mts +2 -2
- package/build/src/schemas/kpj.schema.validator.mjs +515 -515
- package/build/src/schemas/kpj.schema.validator.mjs.map +1 -1
- package/build/src/schemas/kvks.schema.d.ts +160 -160
- package/build/src/schemas/kvks.schema.js +182 -182
- package/build/src/schemas/kvks.schema.validator.d.mts +2 -2
- package/build/src/schemas/kvks.schema.validator.mjs +625 -625
- package/build/src/schemas/kvks.schema.validator.mjs.map +1 -1
- package/build/src/schemas/ldml-keyboard3.schema.d.ts +635 -635
- package/build/src/schemas/ldml-keyboard3.schema.js +696 -696
- package/build/src/schemas/ldml-keyboard3.schema.validator.d.mts +2 -2
- package/build/src/schemas/ldml-keyboard3.schema.validator.mjs +3117 -3117
- package/build/src/schemas/ldml-keyboard3.schema.validator.mjs.map +1 -1
- package/build/src/schemas/ldml-keyboardtest3.schema.d.ts +192 -192
- package/build/src/schemas/ldml-keyboardtest3.schema.js +225 -225
- package/build/src/schemas/ldml-keyboardtest3.schema.validator.d.mts +2 -2
- package/build/src/schemas/ldml-keyboardtest3.schema.validator.mjs +744 -744
- package/build/src/schemas/ldml-keyboardtest3.schema.validator.mjs.map +1 -1
- package/build/src/schemas.d.ts +2300 -2300
- package/build/src/schemas.js +23 -23
- package/build/src/util/common-events.d.ts +44 -44
- package/build/src/util/common-events.js +26 -26
- package/build/src/util/compiler-interfaces.d.ts +371 -371
- package/build/src/util/compiler-interfaces.d.ts.map +1 -1
- package/build/src/util/compiler-interfaces.js +380 -380
- package/build/src/util/compiler-interfaces.js.map +1 -1
- package/build/src/util/errors.d.ts +5 -5
- package/build/src/util/errors.js +5 -5
- package/build/src/util/file-types.d.ts +93 -93
- package/build/src/util/file-types.d.ts.map +1 -1
- package/build/src/util/file-types.js +142 -142
- package/build/src/util/file-types.js.map +1 -1
- package/build/src/util/util.d.ts +98 -98
- package/build/src/util/util.js +368 -368
- package/build/src/util/util.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { TouchLayoutFile } from "./keyman-touch-layout-file.js";
|
|
2
|
-
export interface TouchLayoutFileWriterOptions {
|
|
3
|
-
formatted?: boolean;
|
|
4
|
-
}
|
|
5
|
-
export declare class TouchLayoutFileWriter {
|
|
6
|
-
options: TouchLayoutFileWriterOptions;
|
|
7
|
-
constructor(options?: TouchLayoutFileWriterOptions);
|
|
8
|
-
/**
|
|
9
|
-
* Writes the touch layout to a .keyman-touch-layout JSON file
|
|
10
|
-
* @param source TouchLayoutFile
|
|
11
|
-
* @returns Uint8Array, the .keyman-touch-layout file
|
|
12
|
-
*/
|
|
13
|
-
write(source: TouchLayoutFile): Uint8Array;
|
|
14
|
-
/**
|
|
15
|
-
* Gets the output as a JSON string
|
|
16
|
-
*/
|
|
17
|
-
toJSONString(source: TouchLayoutFile): string;
|
|
18
|
-
/**
|
|
19
|
-
* Compiles the touch layout file into a KeymanWeb-compatible JSON-style
|
|
20
|
-
* object string. In the future, this may be optimized to remove unnecessary
|
|
21
|
-
* quoting of property names, and remove unused properties, as this string
|
|
22
|
-
* is embedded into .js code.
|
|
23
|
-
* @param source
|
|
24
|
-
* @returns string
|
|
25
|
-
*/
|
|
26
|
-
compile(source: TouchLayoutFile): string;
|
|
27
|
-
fixup(source: TouchLayoutFile): TouchLayoutFile;
|
|
28
|
-
}
|
|
1
|
+
import { TouchLayoutFile } from "./keyman-touch-layout-file.js";
|
|
2
|
+
export interface TouchLayoutFileWriterOptions {
|
|
3
|
+
formatted?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare class TouchLayoutFileWriter {
|
|
6
|
+
options: TouchLayoutFileWriterOptions;
|
|
7
|
+
constructor(options?: TouchLayoutFileWriterOptions);
|
|
8
|
+
/**
|
|
9
|
+
* Writes the touch layout to a .keyman-touch-layout JSON file
|
|
10
|
+
* @param source TouchLayoutFile
|
|
11
|
+
* @returns Uint8Array, the .keyman-touch-layout file
|
|
12
|
+
*/
|
|
13
|
+
write(source: TouchLayoutFile): Uint8Array;
|
|
14
|
+
/**
|
|
15
|
+
* Gets the output as a JSON string
|
|
16
|
+
*/
|
|
17
|
+
toJSONString(source: TouchLayoutFile): string;
|
|
18
|
+
/**
|
|
19
|
+
* Compiles the touch layout file into a KeymanWeb-compatible JSON-style
|
|
20
|
+
* object string. In the future, this may be optimized to remove unnecessary
|
|
21
|
+
* quoting of property names, and remove unused properties, as this string
|
|
22
|
+
* is embedded into .js code.
|
|
23
|
+
* @param source
|
|
24
|
+
* @returns string
|
|
25
|
+
*/
|
|
26
|
+
compile(source: TouchLayoutFile): string;
|
|
27
|
+
fixup(source: TouchLayoutFile): TouchLayoutFile;
|
|
28
|
+
}
|
|
29
29
|
//# sourceMappingURL=keyman-touch-layout-file-writer.d.ts.map
|
|
@@ -1,122 +1,122 @@
|
|
|
1
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]="
|
|
3
|
-
;
|
|
4
|
-
export class TouchLayoutFileWriter {
|
|
5
|
-
options;
|
|
6
|
-
constructor(options) {
|
|
7
|
-
this.options = { ...options };
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Writes the touch layout to a .keyman-touch-layout JSON file
|
|
11
|
-
* @param source TouchLayoutFile
|
|
12
|
-
* @returns Uint8Array, the .keyman-touch-layout file
|
|
13
|
-
*/
|
|
14
|
-
write(source) {
|
|
15
|
-
const output = this.toJSONString(source);
|
|
16
|
-
const encoder = new TextEncoder();
|
|
17
|
-
return encoder.encode(output);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Gets the output as a JSON string
|
|
21
|
-
*/
|
|
22
|
-
toJSONString(source) {
|
|
23
|
-
return JSON.stringify(source, null, this.options?.formatted ? 2 : undefined);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Compiles the touch layout file into a KeymanWeb-compatible JSON-style
|
|
27
|
-
* object string. In the future, this may be optimized to remove unnecessary
|
|
28
|
-
* quoting of property names, and remove unused properties, as this string
|
|
29
|
-
* is embedded into .js code.
|
|
30
|
-
* @param source
|
|
31
|
-
* @returns string
|
|
32
|
-
*/
|
|
33
|
-
compile(source) {
|
|
34
|
-
return this.toJSONString(this.fixup(source));
|
|
35
|
-
}
|
|
36
|
-
fixup(source) {
|
|
37
|
-
// Deep copy the source
|
|
38
|
-
source = JSON.parse(JSON.stringify(source));
|
|
39
|
-
// Fixup pad, width and sp to string types, as that's what KeymanWeb
|
|
40
|
-
// currently expects
|
|
41
|
-
const fixupKey = (key) => {
|
|
42
|
-
if (Object.hasOwn(key, 'pad')) {
|
|
43
|
-
if (key.pad == 0) {
|
|
44
|
-
delete key.pad;
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
key.pad = key.pad.toString();
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
if (Object.hasOwn(key, 'sp')) {
|
|
51
|
-
if (key.sp == 0) {
|
|
52
|
-
delete key.sp;
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
key.sp = key.sp.toString();
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
if (Object.hasOwn(key, 'width')) {
|
|
59
|
-
if (key.width == 0) {
|
|
60
|
-
delete key.width;
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
key.width = key.width.toString();
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
if (Object.hasOwn(key, 'text') && key.text === '')
|
|
67
|
-
delete key.text;
|
|
68
|
-
if (Object.hasOwn(key, 'id') && key.id === '')
|
|
69
|
-
delete key.id;
|
|
70
|
-
if (Object.hasOwn(key, 'hint') && key.hint === '')
|
|
71
|
-
delete key.hint;
|
|
72
|
-
if (Object.hasOwn(key, 'default') && key.default === false)
|
|
73
|
-
delete key.default;
|
|
74
|
-
};
|
|
75
|
-
const fixupPlatform = (platform) => {
|
|
76
|
-
// font and fontsize are eliminated if nullish:
|
|
77
|
-
if (Object.hasOwn(platform, 'font') && platform.font == '')
|
|
78
|
-
delete platform.font;
|
|
79
|
-
if (Object.hasOwn(platform, 'fontsize') && platform.fontsize == '')
|
|
80
|
-
delete platform.fontsize;
|
|
81
|
-
// displayUnderlying is always written out by kmcomp, so we do the same for kmc:
|
|
82
|
-
platform.displayUnderlying = !!platform.displayUnderlying;
|
|
83
|
-
for (let layer of platform.layer) {
|
|
84
|
-
for (let row of layer.row) {
|
|
85
|
-
// this matches the old spec for touch layout files
|
|
86
|
-
row.id = row.id.toString();
|
|
87
|
-
for (let key of row.key) {
|
|
88
|
-
fixupKey(key);
|
|
89
|
-
if (key.sk) {
|
|
90
|
-
for (let sk of key.sk) {
|
|
91
|
-
fixupKey(sk);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
if (key.multitap) {
|
|
95
|
-
for (let sk of key.multitap) {
|
|
96
|
-
fixupKey(sk);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
if (key.flick) {
|
|
100
|
-
for (let id of Object.keys(key.flick)) {
|
|
101
|
-
fixupKey(key.flick[id]);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
if (source.desktop) {
|
|
109
|
-
fixupPlatform(source.desktop);
|
|
110
|
-
}
|
|
111
|
-
if (source.phone) {
|
|
112
|
-
fixupPlatform(source.phone);
|
|
113
|
-
}
|
|
114
|
-
if (source.tablet) {
|
|
115
|
-
fixupPlatform(source.tablet);
|
|
116
|
-
}
|
|
117
|
-
return source;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
;
|
|
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]="472101aa-620e-5db6-8b9e-08cc5b08cb17")}catch(e){}}();
|
|
3
|
+
;
|
|
4
|
+
export class TouchLayoutFileWriter {
|
|
5
|
+
options;
|
|
6
|
+
constructor(options) {
|
|
7
|
+
this.options = { ...options };
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Writes the touch layout to a .keyman-touch-layout JSON file
|
|
11
|
+
* @param source TouchLayoutFile
|
|
12
|
+
* @returns Uint8Array, the .keyman-touch-layout file
|
|
13
|
+
*/
|
|
14
|
+
write(source) {
|
|
15
|
+
const output = this.toJSONString(source);
|
|
16
|
+
const encoder = new TextEncoder();
|
|
17
|
+
return encoder.encode(output);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Gets the output as a JSON string
|
|
21
|
+
*/
|
|
22
|
+
toJSONString(source) {
|
|
23
|
+
return JSON.stringify(source, null, this.options?.formatted ? 2 : undefined);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Compiles the touch layout file into a KeymanWeb-compatible JSON-style
|
|
27
|
+
* object string. In the future, this may be optimized to remove unnecessary
|
|
28
|
+
* quoting of property names, and remove unused properties, as this string
|
|
29
|
+
* is embedded into .js code.
|
|
30
|
+
* @param source
|
|
31
|
+
* @returns string
|
|
32
|
+
*/
|
|
33
|
+
compile(source) {
|
|
34
|
+
return this.toJSONString(this.fixup(source));
|
|
35
|
+
}
|
|
36
|
+
fixup(source) {
|
|
37
|
+
// Deep copy the source
|
|
38
|
+
source = JSON.parse(JSON.stringify(source));
|
|
39
|
+
// Fixup pad, width and sp to string types, as that's what KeymanWeb
|
|
40
|
+
// currently expects
|
|
41
|
+
const fixupKey = (key) => {
|
|
42
|
+
if (Object.hasOwn(key, 'pad')) {
|
|
43
|
+
if (key.pad == 0) {
|
|
44
|
+
delete key.pad;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
key.pad = key.pad.toString();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (Object.hasOwn(key, 'sp')) {
|
|
51
|
+
if (key.sp == 0) {
|
|
52
|
+
delete key.sp;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
key.sp = key.sp.toString();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (Object.hasOwn(key, 'width')) {
|
|
59
|
+
if (key.width == 0) {
|
|
60
|
+
delete key.width;
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
key.width = key.width.toString();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (Object.hasOwn(key, 'text') && key.text === '')
|
|
67
|
+
delete key.text;
|
|
68
|
+
if (Object.hasOwn(key, 'id') && key.id === '')
|
|
69
|
+
delete key.id;
|
|
70
|
+
if (Object.hasOwn(key, 'hint') && key.hint === '')
|
|
71
|
+
delete key.hint;
|
|
72
|
+
if (Object.hasOwn(key, 'default') && key.default === false)
|
|
73
|
+
delete key.default;
|
|
74
|
+
};
|
|
75
|
+
const fixupPlatform = (platform) => {
|
|
76
|
+
// font and fontsize are eliminated if nullish:
|
|
77
|
+
if (Object.hasOwn(platform, 'font') && platform.font == '')
|
|
78
|
+
delete platform.font;
|
|
79
|
+
if (Object.hasOwn(platform, 'fontsize') && platform.fontsize == '')
|
|
80
|
+
delete platform.fontsize;
|
|
81
|
+
// displayUnderlying is always written out by kmcomp, so we do the same for kmc:
|
|
82
|
+
platform.displayUnderlying = !!platform.displayUnderlying;
|
|
83
|
+
for (let layer of platform.layer) {
|
|
84
|
+
for (let row of layer.row) {
|
|
85
|
+
// this matches the old spec for touch layout files
|
|
86
|
+
row.id = row.id.toString();
|
|
87
|
+
for (let key of row.key) {
|
|
88
|
+
fixupKey(key);
|
|
89
|
+
if (key.sk) {
|
|
90
|
+
for (let sk of key.sk) {
|
|
91
|
+
fixupKey(sk);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (key.multitap) {
|
|
95
|
+
for (let sk of key.multitap) {
|
|
96
|
+
fixupKey(sk);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (key.flick) {
|
|
100
|
+
for (let id of Object.keys(key.flick)) {
|
|
101
|
+
fixupKey(key.flick[id]);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
if (source.desktop) {
|
|
109
|
+
fixupPlatform(source.desktop);
|
|
110
|
+
}
|
|
111
|
+
if (source.phone) {
|
|
112
|
+
fixupPlatform(source.phone);
|
|
113
|
+
}
|
|
114
|
+
if (source.tablet) {
|
|
115
|
+
fixupPlatform(source.tablet);
|
|
116
|
+
}
|
|
117
|
+
return source;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
;
|
|
121
121
|
//# sourceMappingURL=keyman-touch-layout-file-writer.js.map
|
|
122
|
-
//# debugId=
|
|
122
|
+
//# debugId=472101aa-620e-5db6-8b9e-08cc5b08cb17
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyman-touch-layout-file-writer.js","sources":["../../../src/keyman-touch-layout/keyman-touch-layout-file-writer.ts"],"sourceRoot":"","names":[],"mappings":";;AAIC,CAAC;AAEF,MAAM,OAAO,qBAAqB;IAEhC,OAAO,CAA+B;IAEtC,YAAY,OAAsC;QAChD,IAAI,CAAC,OAAO,GAAG,EAAC,GAAG,OAAO,EAAC,CAAC;IAC9B,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,MAAuB;QAClC,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;QAClC,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED;;OAEG;IACI,YAAY,CAAC,MAAuB;QACzC,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;OAOG;IACI,OAAO,CAAC,MAAuB;QACpC,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/C,CAAC;IAEM,KAAK,CAAC,MAAuB;QAClC,uBAAuB;QACvB,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;QAE5C,oEAAoE;QACpE,oBAAoB;QAEpB,MAAM,QAAQ,GAAG,CAAC,GAAuC,EAAE,EAAE;YAC3D,IAAG,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"keyman-touch-layout-file-writer.js","sources":["../../../src/keyman-touch-layout/keyman-touch-layout-file-writer.ts"],"sourceRoot":"","names":[],"mappings":"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","debug_id":"472101aa-620e-5db6-8b9e-08cc5b08cb17"}
|
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
export interface TouchLayoutFile {
|
|
2
|
-
tablet?: TouchLayoutPlatform;
|
|
3
|
-
phone?: TouchLayoutPlatform;
|
|
4
|
-
desktop?: TouchLayoutPlatform;
|
|
5
|
-
}
|
|
6
|
-
export type TouchLayoutFont = string;
|
|
7
|
-
export type TouchLayoutFontSize = string;
|
|
8
|
-
export type TouchLayoutDefaultHint = "none" | "dot" | "longpress" | "multitap" | "flick" | "flick-n" | "flick-ne" | "flick-e" | "flick-se" | "flick-s" | "flick-sw" | "flick-w" | "flick-nw";
|
|
9
|
-
export interface TouchLayoutPlatform {
|
|
10
|
-
font?: TouchLayoutFont;
|
|
11
|
-
fontsize?: TouchLayoutFontSize;
|
|
12
|
-
layer: TouchLayoutLayer[];
|
|
13
|
-
displayUnderlying?: boolean;
|
|
14
|
-
defaultHint: TouchLayoutDefaultHint;
|
|
15
|
-
}
|
|
16
|
-
export type TouchLayoutLayerId = string;
|
|
17
|
-
export interface TouchLayoutLayer {
|
|
18
|
-
id: TouchLayoutLayerId;
|
|
19
|
-
row: TouchLayoutRow[];
|
|
20
|
-
}
|
|
21
|
-
export type TouchLayoutRowId = number;
|
|
22
|
-
export interface TouchLayoutRow {
|
|
23
|
-
id: TouchLayoutRowId;
|
|
24
|
-
key: TouchLayoutKey[];
|
|
25
|
-
}
|
|
26
|
-
type Key_Type = 'T' | 'K' | 'U' | 't' | 'k' | 'u';
|
|
27
|
-
type Key_Id = string;
|
|
28
|
-
export type TouchLayoutKeyId = `${Key_Type}_${Key_Id}`;
|
|
29
|
-
/**
|
|
30
|
-
* Denotes private-use identifiers that should be considered 'reserved'.
|
|
31
|
-
*/
|
|
32
|
-
export declare const PRIVATE_USE_IDS: readonly ["T_*_MT_SHIFT_TO_SHIFT", "T_*_MT_SHIFT_TO_CAPS", "T_*_MT_SHIFT_TO_DEFAULT"];
|
|
33
|
-
export interface TouchLayoutKey {
|
|
34
|
-
id?: TouchLayoutKeyId;
|
|
35
|
-
text?: string;
|
|
36
|
-
layer?: TouchLayoutLayerId;
|
|
37
|
-
nextlayer?: TouchLayoutLayerId;
|
|
38
|
-
font?: TouchLayoutFont;
|
|
39
|
-
fontsize?: TouchLayoutFontSize;
|
|
40
|
-
sp?: TouchLayoutKeySp;
|
|
41
|
-
pad?: TouchLayoutKeyPad;
|
|
42
|
-
width?: TouchLayoutKeyWidth;
|
|
43
|
-
sk?: TouchLayoutSubKey[];
|
|
44
|
-
flick?: TouchLayoutFlick;
|
|
45
|
-
multitap?: TouchLayoutSubKey[];
|
|
46
|
-
hint?: string;
|
|
47
|
-
}
|
|
48
|
-
export declare const enum TouchLayoutKeySp {
|
|
49
|
-
normal = 0,
|
|
50
|
-
/** A 'frame' key, such as Shift or Enter, which is styled accordingly; uses
|
|
51
|
-
* the 'KeymanwebOsk' font on KeymanWeb */
|
|
52
|
-
special = 1,
|
|
53
|
-
/** A 'frame' key, such as Shift or Enter, which is styled accordingly and is
|
|
54
|
-
* highlighted to indicate it is active, such as the shift key on a shift
|
|
55
|
-
* layer; uses the 'KeymanwebOsk' font on KeymanWeb */
|
|
56
|
-
specialActive = 2,
|
|
57
|
-
/** **KeymanWeb runtime private use:** a variant of `special` with the
|
|
58
|
-
* keyboard font rather than 'KeymanwebOsk' font */
|
|
59
|
-
customSpecial = 3,
|
|
60
|
-
/** **KeymanWeb runtime private use:** a variant of `specialActive` with the
|
|
61
|
-
* keyboard font rather than 'KeymanwebOsk' font. */
|
|
62
|
-
customSpecialActive = 4,
|
|
63
|
-
/** A styling signal to indicate that the key may have 'deadkey' type
|
|
64
|
-
* behaviour. */
|
|
65
|
-
deadkey = 8,
|
|
66
|
-
/** A key which is rendered as a blank keycap, blocks any interaction */
|
|
67
|
-
blank = 9,
|
|
68
|
-
/** Renders the key only as a gap or spacer, blocks any interaction */
|
|
69
|
-
spacer = 10
|
|
70
|
-
}
|
|
71
|
-
export type TouchLayoutKeyPad = number;
|
|
72
|
-
export type TouchLayoutKeyWidth = number;
|
|
73
|
-
export interface TouchLayoutSubKey {
|
|
74
|
-
id: TouchLayoutKeyId;
|
|
75
|
-
text?: string;
|
|
76
|
-
layer?: TouchLayoutLayerId;
|
|
77
|
-
nextlayer?: TouchLayoutLayerId;
|
|
78
|
-
font?: TouchLayoutFont;
|
|
79
|
-
fontsize?: TouchLayoutFontSize;
|
|
80
|
-
sp?: TouchLayoutKeySp;
|
|
81
|
-
pad?: TouchLayoutKeyPad;
|
|
82
|
-
width?: TouchLayoutKeyWidth;
|
|
83
|
-
default?: boolean;
|
|
84
|
-
}
|
|
85
|
-
export interface TouchLayoutFlick {
|
|
86
|
-
n?: TouchLayoutSubKey;
|
|
87
|
-
s?: TouchLayoutSubKey;
|
|
88
|
-
e?: TouchLayoutSubKey;
|
|
89
|
-
w?: TouchLayoutSubKey;
|
|
90
|
-
ne?: TouchLayoutSubKey;
|
|
91
|
-
nw?: TouchLayoutSubKey;
|
|
92
|
-
se?: TouchLayoutSubKey;
|
|
93
|
-
sw?: TouchLayoutSubKey;
|
|
94
|
-
}
|
|
95
|
-
export {};
|
|
1
|
+
export interface TouchLayoutFile {
|
|
2
|
+
tablet?: TouchLayoutPlatform;
|
|
3
|
+
phone?: TouchLayoutPlatform;
|
|
4
|
+
desktop?: TouchLayoutPlatform;
|
|
5
|
+
}
|
|
6
|
+
export type TouchLayoutFont = string;
|
|
7
|
+
export type TouchLayoutFontSize = string;
|
|
8
|
+
export type TouchLayoutDefaultHint = "none" | "dot" | "longpress" | "multitap" | "flick" | "flick-n" | "flick-ne" | "flick-e" | "flick-se" | "flick-s" | "flick-sw" | "flick-w" | "flick-nw";
|
|
9
|
+
export interface TouchLayoutPlatform {
|
|
10
|
+
font?: TouchLayoutFont;
|
|
11
|
+
fontsize?: TouchLayoutFontSize;
|
|
12
|
+
layer: TouchLayoutLayer[];
|
|
13
|
+
displayUnderlying?: boolean;
|
|
14
|
+
defaultHint: TouchLayoutDefaultHint;
|
|
15
|
+
}
|
|
16
|
+
export type TouchLayoutLayerId = string;
|
|
17
|
+
export interface TouchLayoutLayer {
|
|
18
|
+
id: TouchLayoutLayerId;
|
|
19
|
+
row: TouchLayoutRow[];
|
|
20
|
+
}
|
|
21
|
+
export type TouchLayoutRowId = number;
|
|
22
|
+
export interface TouchLayoutRow {
|
|
23
|
+
id: TouchLayoutRowId;
|
|
24
|
+
key: TouchLayoutKey[];
|
|
25
|
+
}
|
|
26
|
+
type Key_Type = 'T' | 'K' | 'U' | 't' | 'k' | 'u';
|
|
27
|
+
type Key_Id = string;
|
|
28
|
+
export type TouchLayoutKeyId = `${Key_Type}_${Key_Id}`;
|
|
29
|
+
/**
|
|
30
|
+
* Denotes private-use identifiers that should be considered 'reserved'.
|
|
31
|
+
*/
|
|
32
|
+
export declare const PRIVATE_USE_IDS: readonly ["T_*_MT_SHIFT_TO_SHIFT", "T_*_MT_SHIFT_TO_CAPS", "T_*_MT_SHIFT_TO_DEFAULT"];
|
|
33
|
+
export interface TouchLayoutKey {
|
|
34
|
+
id?: TouchLayoutKeyId;
|
|
35
|
+
text?: string;
|
|
36
|
+
layer?: TouchLayoutLayerId;
|
|
37
|
+
nextlayer?: TouchLayoutLayerId;
|
|
38
|
+
font?: TouchLayoutFont;
|
|
39
|
+
fontsize?: TouchLayoutFontSize;
|
|
40
|
+
sp?: TouchLayoutKeySp;
|
|
41
|
+
pad?: TouchLayoutKeyPad;
|
|
42
|
+
width?: TouchLayoutKeyWidth;
|
|
43
|
+
sk?: TouchLayoutSubKey[];
|
|
44
|
+
flick?: TouchLayoutFlick;
|
|
45
|
+
multitap?: TouchLayoutSubKey[];
|
|
46
|
+
hint?: string;
|
|
47
|
+
}
|
|
48
|
+
export declare const enum TouchLayoutKeySp {
|
|
49
|
+
normal = 0,
|
|
50
|
+
/** A 'frame' key, such as Shift or Enter, which is styled accordingly; uses
|
|
51
|
+
* the 'KeymanwebOsk' font on KeymanWeb */
|
|
52
|
+
special = 1,
|
|
53
|
+
/** A 'frame' key, such as Shift or Enter, which is styled accordingly and is
|
|
54
|
+
* highlighted to indicate it is active, such as the shift key on a shift
|
|
55
|
+
* layer; uses the 'KeymanwebOsk' font on KeymanWeb */
|
|
56
|
+
specialActive = 2,
|
|
57
|
+
/** **KeymanWeb runtime private use:** a variant of `special` with the
|
|
58
|
+
* keyboard font rather than 'KeymanwebOsk' font */
|
|
59
|
+
customSpecial = 3,
|
|
60
|
+
/** **KeymanWeb runtime private use:** a variant of `specialActive` with the
|
|
61
|
+
* keyboard font rather than 'KeymanwebOsk' font. */
|
|
62
|
+
customSpecialActive = 4,
|
|
63
|
+
/** A styling signal to indicate that the key may have 'deadkey' type
|
|
64
|
+
* behaviour. */
|
|
65
|
+
deadkey = 8,
|
|
66
|
+
/** A key which is rendered as a blank keycap, blocks any interaction */
|
|
67
|
+
blank = 9,
|
|
68
|
+
/** Renders the key only as a gap or spacer, blocks any interaction */
|
|
69
|
+
spacer = 10
|
|
70
|
+
}
|
|
71
|
+
export type TouchLayoutKeyPad = number;
|
|
72
|
+
export type TouchLayoutKeyWidth = number;
|
|
73
|
+
export interface TouchLayoutSubKey {
|
|
74
|
+
id: TouchLayoutKeyId;
|
|
75
|
+
text?: string;
|
|
76
|
+
layer?: TouchLayoutLayerId;
|
|
77
|
+
nextlayer?: TouchLayoutLayerId;
|
|
78
|
+
font?: TouchLayoutFont;
|
|
79
|
+
fontsize?: TouchLayoutFontSize;
|
|
80
|
+
sp?: TouchLayoutKeySp;
|
|
81
|
+
pad?: TouchLayoutKeyPad;
|
|
82
|
+
width?: TouchLayoutKeyWidth;
|
|
83
|
+
default?: boolean;
|
|
84
|
+
}
|
|
85
|
+
export interface TouchLayoutFlick {
|
|
86
|
+
n?: TouchLayoutSubKey;
|
|
87
|
+
s?: TouchLayoutSubKey;
|
|
88
|
+
e?: TouchLayoutSubKey;
|
|
89
|
+
w?: TouchLayoutSubKey;
|
|
90
|
+
ne?: TouchLayoutSubKey;
|
|
91
|
+
nw?: TouchLayoutSubKey;
|
|
92
|
+
se?: TouchLayoutSubKey;
|
|
93
|
+
sw?: TouchLayoutSubKey;
|
|
94
|
+
}
|
|
95
|
+
export {};
|
|
96
96
|
//# sourceMappingURL=keyman-touch-layout-file.d.ts.map
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
//
|
|
2
|
-
// .keyman-touch-layout JSON format
|
|
3
|
-
//
|
|
4
|
-
// Follows /common/schemas/keyman-touch-layout/keyman-touch-layout.spec.json for
|
|
5
|
-
// reading and
|
|
6
|
-
// /common/schemas/keyman-touch-layout/keyman-touch-layout.clean.spec.json for
|
|
7
|
-
// writing
|
|
8
|
-
//
|
|
1
|
+
//
|
|
2
|
+
// .keyman-touch-layout JSON format
|
|
3
|
+
//
|
|
4
|
+
// Follows /common/schemas/keyman-touch-layout/keyman-touch-layout.spec.json for
|
|
5
|
+
// reading and
|
|
6
|
+
// /common/schemas/keyman-touch-layout/keyman-touch-layout.clean.spec.json for
|
|
7
|
+
// writing
|
|
8
|
+
//
|
|
9
9
|
|
|
10
10
|
!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]="b4c48ff5-d670-5b0e-9950-0650d8df58d8")}catch(e){}}();
|
|
11
|
-
;
|
|
12
|
-
;
|
|
13
|
-
;
|
|
14
|
-
;
|
|
15
|
-
/**
|
|
16
|
-
* Denotes private-use identifiers that should be considered 'reserved'.
|
|
17
|
-
*/
|
|
18
|
-
export const PRIVATE_USE_IDS = [
|
|
19
|
-
/**
|
|
20
|
-
* Private-use identifiers used by KeymanWeb for the default multitap-into-caps-layer key
|
|
21
|
-
* for keyboards with a caps layer while not defining multitaps on shift.
|
|
22
|
-
*/
|
|
23
|
-
'T_*_MT_SHIFT_TO_SHIFT',
|
|
24
|
-
'T_*_MT_SHIFT_TO_CAPS',
|
|
25
|
-
'T_*_MT_SHIFT_TO_DEFAULT'
|
|
26
|
-
];
|
|
27
|
-
;
|
|
28
|
-
export var TouchLayoutKeySp;
|
|
29
|
-
(function (TouchLayoutKeySp) {
|
|
30
|
-
TouchLayoutKeySp[TouchLayoutKeySp["normal"] = 0] = "normal";
|
|
31
|
-
/** A 'frame' key, such as Shift or Enter, which is styled accordingly; uses
|
|
32
|
-
* the 'KeymanwebOsk' font on KeymanWeb */
|
|
33
|
-
TouchLayoutKeySp[TouchLayoutKeySp["special"] = 1] = "special";
|
|
34
|
-
/** A 'frame' key, such as Shift or Enter, which is styled accordingly and is
|
|
35
|
-
* highlighted to indicate it is active, such as the shift key on a shift
|
|
36
|
-
* layer; uses the 'KeymanwebOsk' font on KeymanWeb */
|
|
37
|
-
TouchLayoutKeySp[TouchLayoutKeySp["specialActive"] = 2] = "specialActive";
|
|
38
|
-
/** **KeymanWeb runtime private use:** a variant of `special` with the
|
|
39
|
-
* keyboard font rather than 'KeymanwebOsk' font */
|
|
40
|
-
TouchLayoutKeySp[TouchLayoutKeySp["customSpecial"] = 3] = "customSpecial";
|
|
41
|
-
/** **KeymanWeb runtime private use:** a variant of `specialActive` with the
|
|
42
|
-
* keyboard font rather than 'KeymanwebOsk' font. */
|
|
43
|
-
TouchLayoutKeySp[TouchLayoutKeySp["customSpecialActive"] = 4] = "customSpecialActive";
|
|
44
|
-
/** A styling signal to indicate that the key may have 'deadkey' type
|
|
45
|
-
* behaviour. */
|
|
46
|
-
TouchLayoutKeySp[TouchLayoutKeySp["deadkey"] = 8] = "deadkey";
|
|
47
|
-
/** A key which is rendered as a blank keycap, blocks any interaction */
|
|
48
|
-
TouchLayoutKeySp[TouchLayoutKeySp["blank"] = 9] = "blank";
|
|
49
|
-
/** Renders the key only as a gap or spacer, blocks any interaction */
|
|
50
|
-
TouchLayoutKeySp[TouchLayoutKeySp["spacer"] = 10] = "spacer";
|
|
51
|
-
})(TouchLayoutKeySp || (TouchLayoutKeySp = {}));
|
|
52
|
-
;
|
|
53
|
-
;
|
|
54
|
-
;
|
|
11
|
+
;
|
|
12
|
+
;
|
|
13
|
+
;
|
|
14
|
+
;
|
|
15
|
+
/**
|
|
16
|
+
* Denotes private-use identifiers that should be considered 'reserved'.
|
|
17
|
+
*/
|
|
18
|
+
export const PRIVATE_USE_IDS = [
|
|
19
|
+
/**
|
|
20
|
+
* Private-use identifiers used by KeymanWeb for the default multitap-into-caps-layer key
|
|
21
|
+
* for keyboards with a caps layer while not defining multitaps on shift.
|
|
22
|
+
*/
|
|
23
|
+
'T_*_MT_SHIFT_TO_SHIFT',
|
|
24
|
+
'T_*_MT_SHIFT_TO_CAPS',
|
|
25
|
+
'T_*_MT_SHIFT_TO_DEFAULT'
|
|
26
|
+
];
|
|
27
|
+
;
|
|
28
|
+
export var TouchLayoutKeySp;
|
|
29
|
+
(function (TouchLayoutKeySp) {
|
|
30
|
+
TouchLayoutKeySp[TouchLayoutKeySp["normal"] = 0] = "normal";
|
|
31
|
+
/** A 'frame' key, such as Shift or Enter, which is styled accordingly; uses
|
|
32
|
+
* the 'KeymanwebOsk' font on KeymanWeb */
|
|
33
|
+
TouchLayoutKeySp[TouchLayoutKeySp["special"] = 1] = "special";
|
|
34
|
+
/** A 'frame' key, such as Shift or Enter, which is styled accordingly and is
|
|
35
|
+
* highlighted to indicate it is active, such as the shift key on a shift
|
|
36
|
+
* layer; uses the 'KeymanwebOsk' font on KeymanWeb */
|
|
37
|
+
TouchLayoutKeySp[TouchLayoutKeySp["specialActive"] = 2] = "specialActive";
|
|
38
|
+
/** **KeymanWeb runtime private use:** a variant of `special` with the
|
|
39
|
+
* keyboard font rather than 'KeymanwebOsk' font */
|
|
40
|
+
TouchLayoutKeySp[TouchLayoutKeySp["customSpecial"] = 3] = "customSpecial";
|
|
41
|
+
/** **KeymanWeb runtime private use:** a variant of `specialActive` with the
|
|
42
|
+
* keyboard font rather than 'KeymanwebOsk' font. */
|
|
43
|
+
TouchLayoutKeySp[TouchLayoutKeySp["customSpecialActive"] = 4] = "customSpecialActive";
|
|
44
|
+
/** A styling signal to indicate that the key may have 'deadkey' type
|
|
45
|
+
* behaviour. */
|
|
46
|
+
TouchLayoutKeySp[TouchLayoutKeySp["deadkey"] = 8] = "deadkey";
|
|
47
|
+
/** A key which is rendered as a blank keycap, blocks any interaction */
|
|
48
|
+
TouchLayoutKeySp[TouchLayoutKeySp["blank"] = 9] = "blank";
|
|
49
|
+
/** Renders the key only as a gap or spacer, blocks any interaction */
|
|
50
|
+
TouchLayoutKeySp[TouchLayoutKeySp["spacer"] = 10] = "spacer";
|
|
51
|
+
})(TouchLayoutKeySp || (TouchLayoutKeySp = {}));
|
|
52
|
+
;
|
|
53
|
+
;
|
|
54
|
+
;
|
|
55
55
|
//# sourceMappingURL=keyman-touch-layout-file.js.map
|
|
56
56
|
//# debugId=b4c48ff5-d670-5b0e-9950-0650d8df58d8
|