@keymanapp/common-types 17.0.154-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.
- package/build/src/consts/virtual-key-constants.d.ts +144 -138
- package/build/src/consts/virtual-key-constants.d.ts.map +1 -1
- package/build/src/consts/virtual-key-constants.js +258 -252
- package/build/src/consts/virtual-key-constants.js.map +1 -1
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-reader.d.ts +8 -7
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-reader.d.ts.map +1 -1
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-reader.js +76 -74
- 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 +31 -24
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-writer.d.ts.map +1 -1
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-writer.js +119 -75
- 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 +78 -76
- package/build/src/keyman-touch-layout/keyman-touch-layout-file.d.ts.map +1 -1
- package/build/src/keyman-touch-layout/keyman-touch-layout-file.js +28 -26
- package/build/src/keyman-touch-layout/keyman-touch-layout-file.js.map +1 -1
- package/build/src/kmx/element-string.d.ts +26 -24
- package/build/src/kmx/element-string.d.ts.map +1 -1
- package/build/src/kmx/element-string.js +121 -119
- package/build/src/kmx/element-string.js.map +1 -1
- package/build/src/kmx/keyman-targets.d.ts +23 -0
- package/build/src/kmx/keyman-targets.d.ts.map +1 -0
- package/build/src/kmx/keyman-targets.js +80 -0
- package/build/src/kmx/keyman-targets.js.map +1 -0
- package/build/src/kmx/kmx-builder.d.ts +35 -33
- package/build/src/kmx/kmx-builder.d.ts.map +1 -1
- package/build/src/kmx/kmx-builder.js +190 -188
- package/build/src/kmx/kmx-builder.js.map +1 -1
- package/build/src/kmx/kmx-file-reader.d.ts +16 -7
- package/build/src/kmx/kmx-file-reader.d.ts.map +1 -1
- package/build/src/kmx/kmx-file-reader.js +135 -38
- package/build/src/kmx/kmx-file-reader.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-disp.d.ts +20 -18
- package/build/src/kmx/kmx-plus-builder/build-disp.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-disp.js +27 -25
- package/build/src/kmx/kmx-plus-builder/build-disp.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-elem.d.ts +31 -29
- package/build/src/kmx/kmx-plus-builder/build-elem.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-elem.js +90 -88
- package/build/src/kmx/kmx-plus-builder/build-elem.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-keys.d.ts +60 -58
- package/build/src/kmx/kmx-plus-builder/build-keys.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-keys.js +109 -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 +56 -54
- package/build/src/kmx/kmx-plus-builder/build-layr.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-layr.js +101 -99
- package/build/src/kmx/kmx-plus-builder/build-layr.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-list.d.ts +38 -36
- package/build/src/kmx/kmx-plus-builder/build-list.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-list.js +67 -65
- package/build/src/kmx/kmx-plus-builder/build-list.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-loca.d.ts +14 -12
- package/build/src/kmx/kmx-plus-builder/build-loca.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-loca.js +22 -20
- package/build/src/kmx/kmx-plus-builder/build-loca.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-meta.d.ts +19 -17
- package/build/src/kmx/kmx-plus-builder/build-meta.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-meta.js +23 -21
- package/build/src/kmx/kmx-plus-builder/build-meta.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-name.d.ts +14 -12
- package/build/src/kmx/kmx-plus-builder/build-name.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-name.js +25 -23
- package/build/src/kmx/kmx-plus-builder/build-name.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-sect.d.ts +18 -16
- package/build/src/kmx/kmx-plus-builder/build-sect.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-sect.js +16 -14
- package/build/src/kmx/kmx-plus-builder/build-sect.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-strs.d.ts +25 -23
- package/build/src/kmx/kmx-plus-builder/build-strs.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-strs.js +47 -45
- package/build/src/kmx/kmx-plus-builder/build-strs.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-tran.d.ts +35 -33
- package/build/src/kmx/kmx-plus-builder/build-tran.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-tran.js +70 -68
- package/build/src/kmx/kmx-plus-builder/build-tran.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-uset.d.ts +33 -31
- package/build/src/kmx/kmx-plus-builder/build-uset.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-uset.js +61 -59
- package/build/src/kmx/kmx-plus-builder/build-uset.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-vars.d.ts +24 -22
- package/build/src/kmx/kmx-plus-builder/build-vars.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-vars.js +49 -47
- package/build/src/kmx/kmx-plus-builder/build-vars.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-vkey.d.ts +18 -16
- package/build/src/kmx/kmx-plus-builder/build-vkey.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-vkey.js +25 -23
- package/build/src/kmx/kmx-plus-builder/build-vkey.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/builder-section.d.ts +12 -10
- package/build/src/kmx/kmx-plus-builder/builder-section.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/builder-section.js +5 -3
- package/build/src/kmx/kmx-plus-builder/builder-section.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/kmx-plus-builder.d.ts +49 -47
- package/build/src/kmx/kmx-plus-builder/kmx-plus-builder.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/kmx-plus-builder.js +146 -144
- package/build/src/kmx/kmx-plus-builder/kmx-plus-builder.js.map +1 -1
- package/build/src/kmx/kmx-plus.d.ts +331 -329
- package/build/src/kmx/kmx-plus.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus.js +835 -833
- package/build/src/kmx/kmx-plus.js.map +1 -1
- package/build/src/kmx/kmx.d.ts +235 -209
- package/build/src/kmx/kmx.d.ts.map +1 -1
- package/build/src/kmx/kmx.js +299 -276
- package/build/src/kmx/kmx.js.map +1 -1
- package/build/src/kmx/string-list.d.ts +36 -34
- package/build/src/kmx/string-list.d.ts.map +1 -1
- package/build/src/kmx/string-list.js +85 -83
- package/build/src/kmx/string-list.js.map +1 -1
- package/build/src/kpj/keyman-developer-project.d.ts +74 -63
- package/build/src/kpj/keyman-developer-project.d.ts.map +1 -1
- package/build/src/kpj/keyman-developer-project.js +165 -146
- package/build/src/kpj/keyman-developer-project.js.map +1 -1
- package/build/src/kpj/kpj-file-reader.d.ts +21 -19
- package/build/src/kpj/kpj-file-reader.d.ts.map +1 -1
- package/build/src/kpj/kpj-file-reader.js +110 -96
- package/build/src/kpj/kpj-file-reader.js.map +1 -1
- package/build/src/kpj/kpj-file.d.ts +41 -39
- package/build/src/kpj/kpj-file.d.ts.map +1 -1
- package/build/src/kpj/kpj-file.js +13 -11
- package/build/src/kpj/kpj-file.js.map +1 -1
- package/build/src/kvk/kvk-file-reader.d.ts +7 -5
- package/build/src/kvk/kvk-file-reader.d.ts.map +1 -1
- package/build/src/kvk/kvk-file-reader.js +38 -35
- package/build/src/kvk/kvk-file-reader.js.map +1 -1
- package/build/src/kvk/kvk-file-writer.d.ts +22 -20
- package/build/src/kvk/kvk-file-writer.d.ts.map +1 -1
- package/build/src/kvk/kvk-file-writer.js +78 -67
- package/build/src/kvk/kvk-file-writer.js.map +1 -1
- package/build/src/kvk/kvk-file.d.ts +68 -65
- package/build/src/kvk/kvk-file.d.ts.map +1 -1
- package/build/src/kvk/kvk-file.js +67 -64
- package/build/src/kvk/kvk-file.js.map +1 -1
- package/build/src/kvk/kvks-file-reader.d.ts +26 -23
- package/build/src/kvk/kvks-file-reader.d.ts.map +1 -1
- package/build/src/kvk/kvks-file-reader.js +179 -151
- package/build/src/kvk/kvks-file-reader.js.map +1 -1
- package/build/src/kvk/kvks-file-writer.d.ts +9 -6
- package/build/src/kvk/kvks-file-writer.d.ts.map +1 -1
- package/build/src/kvk/kvks-file-writer.js +107 -98
- package/build/src/kvk/kvks-file-writer.js.map +1 -1
- package/build/src/kvk/kvks-file.d.ts +46 -44
- package/build/src/kvk/kvks-file.d.ts.map +1 -1
- package/build/src/kvk/kvks-file.js +12 -10
- package/build/src/kvk/kvks-file.js.map +1 -1
- package/build/src/kvk/visual-keyboard.d.ts +47 -35
- package/build/src/kvk/visual-keyboard.d.ts.map +1 -1
- package/build/src/kvk/visual-keyboard.js +73 -61
- package/build/src/kvk/visual-keyboard.js.map +1 -1
- package/build/src/ldml-keyboard/ldml-keyboard-testdata-xml.d.ts +58 -56
- package/build/src/ldml-keyboard/ldml-keyboard-testdata-xml.d.ts.map +1 -1
- package/build/src/ldml-keyboard/ldml-keyboard-testdata-xml.js +22 -20
- package/build/src/ldml-keyboard/ldml-keyboard-testdata-xml.js.map +1 -1
- package/build/src/ldml-keyboard/ldml-keyboard-xml-reader.d.ts +97 -95
- package/build/src/ldml-keyboard/ldml-keyboard-xml-reader.d.ts.map +1 -1
- package/build/src/ldml-keyboard/ldml-keyboard-xml-reader.js +387 -385
- package/build/src/ldml-keyboard/ldml-keyboard-xml-reader.js.map +1 -1
- package/build/src/ldml-keyboard/ldml-keyboard-xml.d.ts +163 -161
- package/build/src/ldml-keyboard/ldml-keyboard-xml.d.ts.map +1 -1
- package/build/src/ldml-keyboard/ldml-keyboard-xml.js +41 -39
- package/build/src/ldml-keyboard/ldml-keyboard-xml.js.map +1 -1
- package/build/src/ldml-keyboard/pattern-parser.d.ts +138 -136
- package/build/src/ldml-keyboard/pattern-parser.d.ts.map +1 -1
- package/build/src/ldml-keyboard/pattern-parser.js +245 -243
- package/build/src/ldml-keyboard/pattern-parser.js.map +1 -1
- package/build/src/ldml-keyboard/unicodeset-parser-api.d.ts +40 -38
- package/build/src/ldml-keyboard/unicodeset-parser-api.d.ts.map +1 -1
- package/build/src/ldml-keyboard/unicodeset-parser-api.js +30 -28
- package/build/src/ldml-keyboard/unicodeset-parser-api.js.map +1 -1
- package/build/src/main.d.ts +36 -29
- package/build/src/main.d.ts.map +1 -1
- package/build/src/main.js +35 -28
- package/build/src/main.js.map +1 -1
- package/build/src/osk/osk.d.ts +25 -0
- package/build/src/osk/osk.d.ts.map +1 -0
- package/build/src/osk/osk.js +89 -0
- package/build/src/osk/osk.js.map +1 -0
- package/build/src/package/kmp-json-file.d.ts +69 -68
- package/build/src/package/kmp-json-file.d.ts.map +1 -1
- package/build/src/package/kmp-json-file.js +4 -2
- package/build/src/package/kmp-json-file.js.map +1 -1
- package/build/src/package/kps-file.d.ts +100 -98
- package/build/src/package/kps-file.d.ts.map +1 -1
- package/build/src/package/kps-file.js +18 -16
- package/build/src/package/kps-file.js.map +1 -1
- package/build/src/schemas/displaymap.schema.d.ts +60 -0
- package/build/src/schemas/displaymap.schema.d.ts.map +1 -0
- package/build/src/schemas/displaymap.schema.js +38 -0
- package/build/src/schemas/displaymap.schema.js.map +1 -0
- package/build/src/schemas/keyman-touch-layout.clean.spec.d.ts +230 -0
- package/build/src/schemas/keyman-touch-layout.clean.spec.d.ts.map +1 -0
- package/build/src/schemas/keyman-touch-layout.clean.spec.js +154 -0
- package/build/src/schemas/keyman-touch-layout.clean.spec.js.map +1 -0
- package/build/src/schemas/keyman-touch-layout.spec.d.ts +229 -0
- package/build/src/schemas/keyman-touch-layout.spec.d.ts.map +1 -0
- package/build/src/schemas/keyman-touch-layout.spec.js +142 -0
- package/build/src/schemas/keyman-touch-layout.spec.js.map +1 -0
- package/build/src/schemas/kpj-9.0.schema.d.ts +155 -0
- package/build/src/schemas/kpj-9.0.schema.d.ts.map +1 -0
- package/build/src/schemas/kpj-9.0.schema.js +134 -0
- package/build/src/schemas/kpj-9.0.schema.js.map +1 -0
- package/build/src/schemas/kpj.schema.d.ts +121 -0
- package/build/src/schemas/kpj.schema.d.ts.map +1 -0
- package/build/src/schemas/kpj.schema.js +128 -0
- package/build/src/schemas/kpj.schema.js.map +1 -0
- package/build/src/schemas/kvks.schema.d.ts +163 -0
- package/build/src/schemas/kvks.schema.d.ts.map +1 -0
- package/build/src/schemas/kvks.schema.js +185 -0
- package/build/src/schemas/kvks.schema.js.map +1 -0
- package/build/src/schemas/ldml-keyboard.schema.d.ts +634 -0
- package/build/src/schemas/ldml-keyboard.schema.d.ts.map +1 -0
- package/build/src/schemas/ldml-keyboard.schema.js +705 -0
- package/build/src/schemas/ldml-keyboard.schema.js.map +1 -0
- package/build/src/schemas/ldml-keyboardtest.schema.d.ts +191 -0
- package/build/src/schemas/ldml-keyboardtest.schema.d.ts.map +1 -0
- package/build/src/schemas/ldml-keyboardtest.schema.js +224 -0
- package/build/src/schemas/ldml-keyboardtest.schema.js.map +1 -0
- package/build/src/schemas.d.ts +1757 -0
- package/build/src/schemas.d.ts.map +1 -0
- package/build/src/schemas.js +22 -0
- package/build/src/schemas.js.map +1 -0
- package/build/src/util/common-events.d.ts +51 -49
- package/build/src/util/common-events.d.ts.map +1 -1
- package/build/src/util/common-events.js +31 -29
- package/build/src/util/common-events.js.map +1 -1
- package/build/src/util/compiler-interfaces.d.ts +296 -136
- package/build/src/util/compiler-interfaces.d.ts.map +1 -1
- package/build/src/util/compiler-interfaces.js +294 -104
- package/build/src/util/compiler-interfaces.js.map +1 -1
- package/build/src/util/errors.d.ts +8 -0
- package/build/src/util/errors.d.ts.map +1 -0
- package/build/src/util/errors.js +8 -0
- package/build/src/util/errors.js.map +1 -0
- package/build/src/util/file-types.d.ts +98 -0
- package/build/src/util/file-types.d.ts.map +1 -0
- package/build/src/util/file-types.js +117 -0
- package/build/src/util/file-types.js.map +1 -0
- package/build/src/util/util.d.ts +32 -30
- package/build/src/util/util.d.ts.map +1 -1
- package/build/src/util/util.js +98 -96
- package/build/src/util/util.js.map +1 -1
- package/package.json +23 -4
- package/build/src/keyman-touch-layout.clean.spec.json +0 -170
- package/build/src/kpj.schema.json +0 -127
- package/build/src/kvks.schema.json +0 -182
- package/build/src/ldml-keyboard.schema.json +0 -702
- package/build/src/ldml-keyboardtest.schema.json +0 -221
|
@@ -0,0 +1,117 @@
|
|
|
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]="9edc7a13-988f-5261-959f-f8ef6f004df2")}catch(e){}}();
|
|
2
|
+
;
|
|
3
|
+
/**
|
|
4
|
+
* List of all registered source file types for Keyman. Some of these file types
|
|
5
|
+
* (e.g. .xml) may have multiple uses outside Keyman.
|
|
6
|
+
*/
|
|
7
|
+
export const ALL_SOURCE = [
|
|
8
|
+
".model.ts" /* Source.Model */,
|
|
9
|
+
".kpj" /* Source.Project */,
|
|
10
|
+
".kmn" /* Source.KeymanKeyboard */,
|
|
11
|
+
".xml" /* Source.LdmlKeyboard */,
|
|
12
|
+
".kps" /* Source.Package */,
|
|
13
|
+
".kvks" /* Source.VisualKeyboard */,
|
|
14
|
+
".keyman-touch-layout" /* Source.TouchLayout */,
|
|
15
|
+
".keyboard_info" /* Source.KeyboardInfo */,
|
|
16
|
+
".model_info" /* Source.ModelInfo */,
|
|
17
|
+
];
|
|
18
|
+
/**
|
|
19
|
+
* List of all registered binary file types for Keyman. Some of these file types
|
|
20
|
+
* (e.g. .js) may have multiple uses outside Keyman.
|
|
21
|
+
*/
|
|
22
|
+
export const ALL_BINARY = [
|
|
23
|
+
".model.js" /* Binary.Model */,
|
|
24
|
+
".js" /* Binary.WebKeyboard */,
|
|
25
|
+
".kmx" /* Binary.Keyboard */,
|
|
26
|
+
".kmp" /* Binary.Package */,
|
|
27
|
+
".kvk" /* Binary.VisualKeyboard */,
|
|
28
|
+
".keyboard_info" /* Binary.KeyboardInfo */,
|
|
29
|
+
".model_info" /* Binary.ModelInfo */,
|
|
30
|
+
];
|
|
31
|
+
export const ALL = [...ALL_SOURCE, ...ALL_BINARY];
|
|
32
|
+
/**
|
|
33
|
+
* Gets the file type based on extension, dealing with multi-part file
|
|
34
|
+
* extensions. Does not sniff contents of file or assume file existence. Does
|
|
35
|
+
* transform upper-cased file extensions to lower-case.
|
|
36
|
+
* @param filename
|
|
37
|
+
* @returns file extension, or `""` if no extension. Note that this return value
|
|
38
|
+
* differs from the other, more-specific fromFilename functions below,
|
|
39
|
+
* which return `null` if a supported extension is not found.
|
|
40
|
+
*/
|
|
41
|
+
export function fromFilename(filename) {
|
|
42
|
+
const result = sourceOrBinaryTypeFromFilename(filename) ??
|
|
43
|
+
filename.match(/\.[^\.]+$/)?.[0] ??
|
|
44
|
+
"";
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Gets the file type based on extension, dealing with multi-part file
|
|
49
|
+
* extensions. Does not sniff contents of file or assume file existence.
|
|
50
|
+
* Does transform upper-cased file extensions to lower-case.
|
|
51
|
+
* @param filename
|
|
52
|
+
* @returns file type, or `null` if not found
|
|
53
|
+
*/
|
|
54
|
+
export function sourceOrBinaryTypeFromFilename(filename) {
|
|
55
|
+
filename = filename.toLowerCase();
|
|
56
|
+
const result = ALL_SOURCE.find(type => filename.endsWith(type)) ??
|
|
57
|
+
ALL_BINARY.find(type => filename.endsWith(type)) ??
|
|
58
|
+
null;
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Gets the source file type based on extension, dealing with multi-part file
|
|
63
|
+
* extensions. Does not sniff contents of file or assume file existence. Does
|
|
64
|
+
* transform upper-cased file extensions to lower-case.
|
|
65
|
+
* @param filename
|
|
66
|
+
* @returns file type, or `null` if not found
|
|
67
|
+
*/
|
|
68
|
+
export function sourceTypeFromFilename(filename) {
|
|
69
|
+
filename = filename.toLowerCase();
|
|
70
|
+
const result = ALL_SOURCE.find(type => filename.endsWith(type)) ??
|
|
71
|
+
null;
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Gets the binary file type based on extension, dealing with multi-part file
|
|
76
|
+
* extensions. Does not sniff contents of file or assume file existence. Does
|
|
77
|
+
* transform upper-cased file extensions to lower-case.
|
|
78
|
+
* @param filename
|
|
79
|
+
* @returns file type, or `null` if not found
|
|
80
|
+
*/
|
|
81
|
+
export function binaryTypeFromFilename(filename) {
|
|
82
|
+
filename = filename.toLowerCase();
|
|
83
|
+
const result = ALL_BINARY.find(type => filename.endsWith(type)) ??
|
|
84
|
+
null;
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Returns true if filenmae has a specific file extension. Does transform
|
|
89
|
+
* upper-cased file extensions to lower-case.
|
|
90
|
+
* @param filename
|
|
91
|
+
* @param fileType
|
|
92
|
+
* @returns true if file is of type fileType
|
|
93
|
+
*/
|
|
94
|
+
export function filenameIs(filename, fileType) {
|
|
95
|
+
// Special case for .model.js
|
|
96
|
+
if (fileType == ".js" /* Binary.WebKeyboard */ && filenameIs(filename, ".model.js" /* Binary.Model */)) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
return filename.toLowerCase().endsWith(fileType);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Replaces a filename extension with the new extension. Returns `null` if the
|
|
103
|
+
* filename does not end with oldExtension.
|
|
104
|
+
* @param filename
|
|
105
|
+
* @param oldExtension
|
|
106
|
+
* @param newExtension
|
|
107
|
+
* @returns
|
|
108
|
+
*/
|
|
109
|
+
export function replaceExtension(filename, oldExtension, newExtension) {
|
|
110
|
+
const ext = filename.substring(filename.length - oldExtension.length);
|
|
111
|
+
if (ext !== oldExtension) {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
return filename.substring(0, filename.length - oldExtension.length) + newExtension;
|
|
115
|
+
}
|
|
116
|
+
//# debugId=9edc7a13-988f-5261-959f-f8ef6f004df2
|
|
117
|
+
//# sourceMappingURL=file-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"debug_id":"9edc7a13-988f-5261-959f-f8ef6f004df2","file":"file-types.js","mappings":";AAeC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAA0B;;;;;;;;;;CAUvC,CAAC;AAgBX;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAA0B;;;;;;;;CAStC,CAAC;AAEZ,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,GAAG,UAAU,EAAE,GAAG,UAAU,CAAU,CAAC;AAQ3D;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,MAAM,MAAM,GACV,8BAA8B,CAAC,QAAQ,CAAC;QACxC,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC;QAChC,EAAE,CAAC;IACL,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,8BAA8B,CAAC,QAAgB;IAC7D,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IAClC,MAAM,MAAM,GACV,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAChD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,CAAC;IACP,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAgB;IACrD,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IAClC,MAAM,MAAM,GACV,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,CAAC;IACP,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAgB;IACrD,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IAClC,MAAM,MAAM,GACV,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,CAAC;IACP,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,QAAgB,EAAE,QAAyB;IACpE,6BAA6B;IAC7B,IAAG,QAAQ,kCAAsB,IAAI,UAAU,CAAC,QAAQ,iCAAe,EAAE;QACvE,OAAO,KAAK,CAAC;KACd;IACD,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACnD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAgB,EAAE,YAAoB,EAAE,YAAoB;IAC3F,MAAM,GAAG,GAAG,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IACtE,IAAG,GAAG,KAAK,YAAY,EAAE;QACvB,OAAO,IAAI,CAAC;KACb;IACD,OAAO,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC;AACrF,CAAC","names":[],"sourceRoot":"","sources":["../../../src/util/file-types.ts"],"version":3}
|
package/build/src/util/util.d.ts
CHANGED
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @param
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export declare
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export declare
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* @
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*
|
|
24
|
-
* @
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export declare function
|
|
30
|
-
|
|
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]="2876f5a1-f75a-59b2-b92e-f6f599b6271c")}catch(e){}}();
|
|
2
|
+
/**
|
|
3
|
+
* xml2js will not place single-entry objects into arrays. Easiest way to fix
|
|
4
|
+
* this is to box them ourselves as needed. Ensures that o.x is an array.
|
|
5
|
+
*
|
|
6
|
+
* @param o Object with property to box
|
|
7
|
+
* @param x Name of element to box
|
|
8
|
+
*/
|
|
9
|
+
export declare function boxXmlArray(o: any, x: string): void;
|
|
10
|
+
export declare const MATCH_HEX_ESCAPE: RegExp;
|
|
11
|
+
/** regex for single quad escape such as \u0127 */
|
|
12
|
+
export declare const MATCH_QUAD_ESCAPE: RegExp;
|
|
13
|
+
export declare class UnescapeError extends Error {
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Unescape one single quad string such as \u0127.
|
|
17
|
+
* Throws exception if the string doesn't match MATCH_QUAD_ESCAPE
|
|
18
|
+
* @param s input string
|
|
19
|
+
* @returns output
|
|
20
|
+
*/
|
|
21
|
+
export declare function unescapeOneQuadString(s: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Unescapes a string according to UTS#18§1.1, see <https://www.unicode.org/reports/tr18/#Hex_notation>
|
|
24
|
+
* @param s escaped string
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
export declare function unescapeString(s: string): string;
|
|
28
|
+
/** True if this string *could* be a UTF-32 single char */
|
|
29
|
+
export declare function isOneChar(value: string): boolean;
|
|
30
|
+
export declare function toOneChar(value: string): number;
|
|
31
|
+
//# debugId=2876f5a1-f75a-59b2-b92e-f6f599b6271c
|
|
32
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"debug_id":"2876f5a1-f75a-59b2-b92e-f6f599b6271c","file":"util.d.ts","mappings":";AAAA;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CASnD;AAKD,eAAO,MAAM,gBAAgB,QAA6B,CAAC;AAG3D,kDAAkD;AAClD,eAAO,MAAM,iBAAiB,QAAyB,CAAC;AAExD,qBAAa,aAAc,SAAQ,KAAK;CACvC;AAYD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CASvD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CA0BhD;AAED,0DAA0D;AAC1D,wBACA,SAAS,CAAC,KAAK,EAAE,MAAM,GAAI,OAAO,CAEjC;AAED,wBACA,SAAS,CAAC,KAAK,EAAE,MAAM,GAAI,MAAM,CAKhC","names":[],"sourceRoot":"","sources":["../../../src/util/util.ts"],"version":3}
|
package/build/src/util/util.js
CHANGED
|
@@ -1,96 +1,98 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @param
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
*
|
|
30
|
-
* @
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* @
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
*
|
|
55
|
-
* @
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
*
|
|
65
|
-
* @param
|
|
66
|
-
* @
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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]="b3cedfe7-9879-5934-90b0-7cb43071df24")}catch(e){}}();
|
|
2
|
+
/**
|
|
3
|
+
* xml2js will not place single-entry objects into arrays. Easiest way to fix
|
|
4
|
+
* this is to box them ourselves as needed. Ensures that o.x is an array.
|
|
5
|
+
*
|
|
6
|
+
* @param o Object with property to box
|
|
7
|
+
* @param x Name of element to box
|
|
8
|
+
*/
|
|
9
|
+
export function boxXmlArray(o, x) {
|
|
10
|
+
if (typeof o == 'object' && !Array.isArray(o[x])) {
|
|
11
|
+
if (o[x] === null || o[x] === undefined) {
|
|
12
|
+
o[x] = [];
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
o[x] = [o[x]];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
// TODO-LDML: #7569 the below regex works, but captures more than it should
|
|
20
|
+
// (it would include \u{fffffffffffffffff } which
|
|
21
|
+
// is overlong and has a space at the end.) The second regex does not work yet.
|
|
22
|
+
export const MATCH_HEX_ESCAPE = /\\u{([0-9a-fA-F ]{1,})}/g;
|
|
23
|
+
// const MATCH_HEX_ESCAPE = /\\u{((?:(?:[0-9a-fA-F]{1,5})|(?:10[0-9a-fA-F]{4})(?: (?!}))?)+)}/g;
|
|
24
|
+
/** regex for single quad escape such as \u0127 */
|
|
25
|
+
export const MATCH_QUAD_ESCAPE = /\\u([0-9a-fA-F]{4})/g;
|
|
26
|
+
export class UnescapeError extends Error {
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Unescape one codepoint
|
|
30
|
+
* @param hex one codepoint in hex, such as '0127'
|
|
31
|
+
* @returns the unescaped codepoint
|
|
32
|
+
*/
|
|
33
|
+
function unescapeOne(hex) {
|
|
34
|
+
const codepoint = Number.parseInt(hex, 16);
|
|
35
|
+
return String.fromCodePoint(codepoint);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Unescape one single quad string such as \u0127.
|
|
39
|
+
* Throws exception if the string doesn't match MATCH_QUAD_ESCAPE
|
|
40
|
+
* @param s input string
|
|
41
|
+
* @returns output
|
|
42
|
+
*/
|
|
43
|
+
export function unescapeOneQuadString(s) {
|
|
44
|
+
if (!s || !s.match(MATCH_QUAD_ESCAPE)) {
|
|
45
|
+
throw new UnescapeError(`Not a quad escape: ${s}`);
|
|
46
|
+
}
|
|
47
|
+
function processMatch(str, matched) {
|
|
48
|
+
return unescapeOne(matched);
|
|
49
|
+
}
|
|
50
|
+
s = s.replace(MATCH_QUAD_ESCAPE, processMatch);
|
|
51
|
+
return s;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Unescapes a string according to UTS#18§1.1, see <https://www.unicode.org/reports/tr18/#Hex_notation>
|
|
55
|
+
* @param s escaped string
|
|
56
|
+
* @returns
|
|
57
|
+
*/
|
|
58
|
+
export function unescapeString(s) {
|
|
59
|
+
if (!s) {
|
|
60
|
+
return s;
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
/**
|
|
64
|
+
* process one regex match
|
|
65
|
+
* @param str ignored
|
|
66
|
+
* @param matched the entire match such as '0127' or '22 22'
|
|
67
|
+
* @returns the unescaped match
|
|
68
|
+
*/
|
|
69
|
+
function processMatch(str, matched) {
|
|
70
|
+
const codepoints = matched.split(' ');
|
|
71
|
+
const unescaped = codepoints.map(unescapeOne);
|
|
72
|
+
return unescaped.join('');
|
|
73
|
+
}
|
|
74
|
+
s = s.replaceAll(MATCH_HEX_ESCAPE, processMatch);
|
|
75
|
+
}
|
|
76
|
+
catch (e) {
|
|
77
|
+
if (e instanceof RangeError) {
|
|
78
|
+
throw new UnescapeError(`Out of range while unescaping '${s}': ${e.message}`, { cause: e });
|
|
79
|
+
/* c8 ignore next 3 */
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
throw e; // pass through some other error
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return s;
|
|
86
|
+
}
|
|
87
|
+
/** True if this string *could* be a UTF-32 single char */
|
|
88
|
+
export function isOneChar(value) {
|
|
89
|
+
return [...value].length === 1;
|
|
90
|
+
}
|
|
91
|
+
export function toOneChar(value) {
|
|
92
|
+
if (!isOneChar(value)) {
|
|
93
|
+
throw Error(`Not a single char: ${value}`);
|
|
94
|
+
}
|
|
95
|
+
return value.codePointAt(0);
|
|
96
|
+
}
|
|
97
|
+
//# debugId=b3cedfe7-9879-5934-90b0-7cb43071df24
|
|
98
|
+
//# sourceMappingURL=util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"debug_id":"b3cedfe7-9879-5934-90b0-7cb43071df24","file":"util.js","mappings":";AAAA;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,CAAM,EAAE,CAAS;IAC3C,IAAG,OAAO,CAAC,IAAI,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;QAC/C,IAAG,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE;YACtC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;SACX;aACI;YACH,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACf;KACF;AACH,CAAC;AAED,2EAA2E;AAC3E,iDAAiD;AACjD,+EAA+E;AAC/E,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,gGAAgG;AAEhG,kDAAkD;AAClD,MAAM,CAAC,MAAM,iBAAiB,GAAG,sBAAsB,CAAC;AAExD,MAAM,OAAO,aAAc,SAAQ,KAAK;CACvC;AAED;;;;GAIG;AACH,SAAS,WAAW,CAAC,GAAW;IAC9B,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC3C,OAAO,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;AACzC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,CAAS;IAC7C,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,EAAE;QACrC,MAAM,IAAI,aAAa,CAAC,sBAAsB,CAAC,EAAE,CAAC,CAAC;KACpD;IACD,SAAS,YAAY,CAAC,GAAW,EAAE,OAAe;QAChD,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IACD,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAAC;IAC/C,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,CAAS;IACtC,IAAG,CAAC,CAAC,EAAE;QACL,OAAO,CAAC,CAAC;KACV;IACD,IAAI;QACF;;;;;WAKG;QACH,SAAS,YAAY,CAAC,GAAW,EAAE,OAAe;YAChD,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACtC,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;YAC9C,OAAO,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5B,CAAC;QACD,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;KAClD;IAAC,OAAM,CAAC,EAAE;QACT,IAAI,CAAC,YAAY,UAAU,EAAE;YAC3B,MAAM,IAAI,aAAa,CAAC,kCAAkC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;YAC5F,sBAAsB;SACvB;aAAM;YACL,MAAM,CAAC,CAAC,CAAC,gCAAgC;SAC1C;KACF;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,0DAA0D;AAC1D,MAAM,UACN,SAAS,CAAC,KAAa;IACrB,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UACN,SAAS,CAAC,KAAa;IACrB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;QACrB,MAAM,KAAK,CAAC,sBAAsB,KAAK,EAAE,CAAC,CAAC;KAC5C;IACD,OAAO,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC","names":[],"sourceRoot":"","sources":["../../../src/util/util.ts"],"version":3}
|
package/package.json
CHANGED
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"url": "https://github.com/keymanapp/keyman/issues"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@keymanapp/keyman-version": "17.0.
|
|
29
|
+
"@keymanapp/keyman-version": "17.0.156-alpha",
|
|
30
30
|
"ajv": "^8.11.0",
|
|
31
|
-
"restructure": "git+https://github.com/keymanapp/dependency-restructure.git#
|
|
31
|
+
"restructure": "git+https://github.com/keymanapp/dependency-restructure.git#7a188a1e26f8f36a175d95b67ffece8702363dfc",
|
|
32
32
|
"semver": "^7.5.2",
|
|
33
33
|
"xml2js": "git+https://github.com/keymanapp/dependency-node-xml2js#535fe732dc408d697e0f847c944cc45f0baf0829"
|
|
34
34
|
},
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@types/chai": "^4.1.7",
|
|
37
37
|
"@types/git-diff": "^2.0.3",
|
|
38
38
|
"@types/mocha": "^5.2.7",
|
|
39
|
-
"@types/node": "^
|
|
39
|
+
"@types/node": "^20.4.1",
|
|
40
40
|
"@types/semver": "^7.3.12",
|
|
41
41
|
"@types/xml2js": "^0.4.5",
|
|
42
42
|
"c8": "^7.12.0",
|
|
@@ -58,5 +58,24 @@
|
|
|
58
58
|
"type": "git",
|
|
59
59
|
"url": "git+https://github.com/keymanapp/keyman.git"
|
|
60
60
|
},
|
|
61
|
-
"
|
|
61
|
+
"c8": {
|
|
62
|
+
"all": true,
|
|
63
|
+
"src": [
|
|
64
|
+
"src/"
|
|
65
|
+
],
|
|
66
|
+
"exclude-after-remap": true,
|
|
67
|
+
"exclude": [
|
|
68
|
+
"src/kmx/kmx-plus-builder/",
|
|
69
|
+
"src/kmx/kmx-plus.ts",
|
|
70
|
+
"src/kmx/kmx-builder.ts",
|
|
71
|
+
"src/kmx/element-string.ts",
|
|
72
|
+
"src/kmx/string-list.ts",
|
|
73
|
+
"src/ldml-keyboard/ldml-keyboard-testdata-xml.ts",
|
|
74
|
+
"src/ldml-keyboard/unicodeset-parser-api.ts",
|
|
75
|
+
"src/keyman-touch-layout/keyman-touch-layout-file-writer.ts",
|
|
76
|
+
"src/osk/osk.ts",
|
|
77
|
+
"test/"
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
"version": "17.0.156-alpha"
|
|
62
81
|
}
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema#",
|
|
3
|
-
"$ref": "#/definitions/touch-layout",
|
|
4
|
-
"$comment": "Version: 16.0",
|
|
5
|
-
"description": "A Keyman Touch Layout file, per version 16.0, clean spec, no legacy data or types",
|
|
6
|
-
|
|
7
|
-
"definitions": {
|
|
8
|
-
"touch-layout": {
|
|
9
|
-
"type": "object",
|
|
10
|
-
"properties": {
|
|
11
|
-
"tablet": { "$ref": "#/definitions/platform" },
|
|
12
|
-
"phone": { "$ref": "#/definitions/platform" },
|
|
13
|
-
"desktop": { "$ref": "#/definitions/platform" }
|
|
14
|
-
},
|
|
15
|
-
"minProperties": 1,
|
|
16
|
-
"additionalProperties": false
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
"platform": {
|
|
20
|
-
"type": "object",
|
|
21
|
-
"properties": {
|
|
22
|
-
"font": { "$ref": "#/definitions/font-spec" },
|
|
23
|
-
"fontsize": { "$ref": "#/definitions/fontsize-spec" },
|
|
24
|
-
"layer": { "$ref": "#/definitions/layers" },
|
|
25
|
-
"displayUnderlying": { "type": "boolean" },
|
|
26
|
-
"defaultHint": { "type": "string", "enum": ["none","dot","longpress","multitap","flick","flick-n","flick-ne","flick-e","flick-se","flick-s","flick-sw","flick-w","flick-nw"] }
|
|
27
|
-
},
|
|
28
|
-
"required": ["layer"],
|
|
29
|
-
"additionalProperties": false
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
"layers": {
|
|
33
|
-
"type": "array",
|
|
34
|
-
"items": { "$ref": "#/definitions/layer" },
|
|
35
|
-
"minItems": 1
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
"layer": {
|
|
39
|
-
"type": "object",
|
|
40
|
-
"properties": {
|
|
41
|
-
"id": { "$ref": "#/definitions/layer-id" },
|
|
42
|
-
"row": { "$ref": "#/definitions/rows" }
|
|
43
|
-
},
|
|
44
|
-
"required": ["id", "row"],
|
|
45
|
-
"additionalProperties": false
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
"layer-id": {
|
|
49
|
-
"type": "string",
|
|
50
|
-
"pattern": "^[a-zA-Z0-9_-]+$"
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
"rows": {
|
|
54
|
-
"type": "array",
|
|
55
|
-
"items": { "$ref": "#/definitions/row" },
|
|
56
|
-
"minItems": 1
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
"row": {
|
|
60
|
-
"type": "object",
|
|
61
|
-
"properties": {
|
|
62
|
-
"id": { "$ref": "#/definitions/row-id" },
|
|
63
|
-
"key": { "$ref": "#/definitions/keys" }
|
|
64
|
-
},
|
|
65
|
-
"required": ["id", "key"],
|
|
66
|
-
"additionalProperties": false
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
"row-id": {
|
|
70
|
-
"type": "integer",
|
|
71
|
-
"minimum": 0,
|
|
72
|
-
"maximum": 100
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
"keys": {
|
|
76
|
-
"type": "array",
|
|
77
|
-
"items": { "$ref": "#/definitions/key" },
|
|
78
|
-
"minItems": 1
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
"key": {
|
|
82
|
-
"type": "object",
|
|
83
|
-
"properties": {
|
|
84
|
-
"id": { "$ref": "#/definitions/key-id" },
|
|
85
|
-
"text": { "type": "string" },
|
|
86
|
-
"layer": { "$ref": "#/definitions/layer-id" },
|
|
87
|
-
"nextlayer": { "$ref": "#/definitions/layer-id" },
|
|
88
|
-
"font": { "$ref": "#/definitions/font-spec" },
|
|
89
|
-
"fontsize": { "$ref": "#/definitions/fontsize-spec" },
|
|
90
|
-
"sp": { "$ref": "#/definitions/key-sp" },
|
|
91
|
-
"pad": { "$ref" : "#/definitions/key-pad" },
|
|
92
|
-
"width": { "$ref" : "#/definitions/key-width" },
|
|
93
|
-
"sk": { "$ref": "#/definitions/subkeys" },
|
|
94
|
-
"flick": { "$ref": "#/definitions/flick" },
|
|
95
|
-
"multitap": { "$ref": "#/definitions/subkeys" },
|
|
96
|
-
"hint": { "type": "string" }
|
|
97
|
-
},
|
|
98
|
-
"anyOf": [
|
|
99
|
-
{"required": ["id"]},
|
|
100
|
-
{"required": ["sp"]},
|
|
101
|
-
{"required": ["sk"]},
|
|
102
|
-
{"required": ["flick"]},
|
|
103
|
-
{"required": ["multitap"]}
|
|
104
|
-
],
|
|
105
|
-
"additionalProperties": false
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
"key-id": {
|
|
109
|
-
"type": "string",
|
|
110
|
-
"pattern": "^[TKUtku]_[a-zA-Z0-9_]+$"
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
"key-sp": {
|
|
114
|
-
"type": "integer",
|
|
115
|
-
"enum": [0, 1, 2, 8, 9, 10]
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
"key-pad": {
|
|
119
|
-
"type": "number",
|
|
120
|
-
"minimum": 0,
|
|
121
|
-
"maximum": 100000
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
"key-width": {
|
|
125
|
-
"type": "number",
|
|
126
|
-
"minimum": 0,
|
|
127
|
-
"maximum": 100000
|
|
128
|
-
},
|
|
129
|
-
|
|
130
|
-
"subkeys": {
|
|
131
|
-
"type": "array",
|
|
132
|
-
"items": { "$ref": "#/definitions/subkey" },
|
|
133
|
-
"minItems": 1
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
"subkey": {
|
|
137
|
-
"type": "object",
|
|
138
|
-
"properties": {
|
|
139
|
-
"id": { "$ref": "#/definitions/key-id" },
|
|
140
|
-
"text": { "type": "string" },
|
|
141
|
-
"layer": { "$ref": "#/definitions/layer-id" },
|
|
142
|
-
"nextlayer": { "$ref": "#/definitions/layer-id" },
|
|
143
|
-
"font": { "$ref": "#/definitions/font-spec" },
|
|
144
|
-
"fontsize": { "$ref": "#/definitions/fontsize-spec" },
|
|
145
|
-
"sp": { "$ref": "#/definitions/key-sp" },
|
|
146
|
-
"pad": { "$ref" : "#/definitions/key-pad" },
|
|
147
|
-
"width": { "$ref" : "#/definitions/key-width" }
|
|
148
|
-
},
|
|
149
|
-
"required": ["id"],
|
|
150
|
-
"additionalProperties": false
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
"flick": {
|
|
154
|
-
"type": "object",
|
|
155
|
-
"patternProperties": {
|
|
156
|
-
"^(n|s|e|w|ne|nw|se|sw)$": { "$ref": "#/definitions/subkey" }
|
|
157
|
-
},
|
|
158
|
-
"minProperties": 1,
|
|
159
|
-
"additionalProperties": false
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
"font-spec": {
|
|
163
|
-
"type": "string"
|
|
164
|
-
},
|
|
165
|
-
|
|
166
|
-
"fontsize-spec": {
|
|
167
|
-
"type": "string"
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|