create-mendix-widget-gleam 2.0.19 → 2.0.21

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 (65) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/src/i18n.mjs +394 -334
  4. package/src/index.mjs +284 -231
  5. package/src/licenses.mjs +147 -0
  6. package/src/prompts.mjs +247 -142
  7. package/src/scaffold.mjs +108 -97
  8. package/src/templates/claude_md.mjs +3 -3
  9. package/src/templates/readme_md.mjs +10 -10
  10. package/template/gleam.toml +2 -2
  11. package/template/package.json +6 -6
  12. package/template/src/__WidgetName__.xml +1 -1
  13. package/template/src/package.xml +2 -2
  14. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@command.cache +0 -0
  15. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@cursor.cache +0 -0
  16. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@cursor.cache_meta +0 -0
  17. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@event.cache +0 -0
  18. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@internal@consts.cache +0 -0
  19. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@stdout.cache +0 -0
  20. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@style.cache +0 -0
  21. package/tui/build/dev/javascript/etch/_gleam_artefacts/etch@terminal.cache +0 -0
  22. package/tui/build/dev/javascript/etch/etch/event.mjs +36 -30
  23. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@application.cache +0 -0
  24. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@atom.cache +0 -0
  25. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@charlist.cache +0 -0
  26. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@node.cache +0 -0
  27. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@port.cache +0 -0
  28. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@process.cache +0 -0
  29. package/tui/build/dev/javascript/gleam_erlang/_gleam_artefacts/gleam@erlang@reference.cache +0 -0
  30. package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@array.cache +0 -0
  31. package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@promise.cache +0 -0
  32. package/tui/build/dev/javascript/gleam_javascript/_gleam_artefacts/gleam@javascript@symbol.cache +0 -0
  33. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache +0 -0
  34. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache +0 -0
  35. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_inline +0 -0
  36. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache +0 -0
  37. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache +0 -0
  38. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache +0 -0
  39. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache +0 -0
  40. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache_meta +0 -0
  41. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache +0 -0
  42. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache +0 -0
  43. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache +0 -0
  44. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache +0 -0
  45. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache +0 -0
  46. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache +0 -0
  47. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache +0 -0
  48. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache +0 -0
  49. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache +0 -0
  50. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache_inline +0 -0
  51. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache +0 -0
  52. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache +0 -0
  53. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache_meta +0 -0
  54. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache +0 -0
  55. package/tui/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache +0 -0
  56. package/tui/build/dev/javascript/gleam_version +1 -1
  57. package/tui/build/dev/javascript/prelude.mjs +10 -26
  58. package/tui/build/dev/javascript/tui/_gleam_artefacts/tui.cache +0 -0
  59. package/tui/build/dev/javascript/tui/_gleam_artefacts/tui.cache_meta +0 -0
  60. package/tui/build/dev/javascript/tui/_gleam_artefacts/tui@prompt.cache +0 -0
  61. package/tui/build/dev/javascript/tui/_gleam_artefacts/tui@prompt.cache_meta +0 -0
  62. package/tui/build/dev/javascript/tui/tui/prompt.mjs +713 -52
  63. package/tui/build/dev/javascript/tui/tui.mjs +438 -51
  64. package/tui/build/dev/javascript/tui/tui_ffi.mjs +12 -0
  65. package/template/LICENSE +0 -15
package/src/scaffold.mjs CHANGED
@@ -1,97 +1,108 @@
1
- /**
2
- * 파일 복사 + 템플릿 치환
3
- */
4
-
5
- import { readdir, readFile, writeFile, mkdir, copyFile } from "node:fs/promises";
6
- import { join, relative } from "node:path";
7
-
8
- /** 바이너리 판별용 확장자 */
9
- const BINARY_EXTS = new Set([".png", ".jpg", ".gif", ".ico", ".woff", ".woff2", ".ttf", ".eot"]);
10
-
11
- /** 재귀적으로 디렉토리 내 모든 파일 경로를 수집 */
12
- async function walkDir(dir) {
13
- const entries = await readdir(dir, { withFileTypes: true });
14
- const files = [];
15
- for (const entry of entries) {
16
- const fullPath = join(dir, entry.name);
17
- if (entry.isDirectory()) {
18
- files.push(...(await walkDir(fullPath)));
19
- } else {
20
- files.push(fullPath);
21
- }
22
- }
23
- return files;
24
- }
25
-
26
- // npm publish 시 제외되는 dotfile을 언더스코어 접두사로 보관하고 복원
27
- const DOTFILE_MAP = { _gitignore: ".gitignore" };
28
-
29
- /** 파일명에서 플레이스홀더 치환 + dotfile 복원 */
30
- function replaceFileName(name, names) {
31
- if (DOTFILE_MAP[name]) return DOTFILE_MAP[name];
32
- return name
33
- .replace(/__WidgetName__/g, names.pascalCase)
34
- .replace(/__widget_name__/g, names.snakeCase);
35
- }
36
-
37
- /** 파일 내용에서 플레이스홀더 치환 */
38
- function replaceContent(content, names, pmConfig, templateComments) {
39
- let result = content
40
- .replace(/\{\{PASCAL_CASE\}\}/g, names.pascalCase)
41
- .replace(/\{\{SNAKE_CASE\}\}/g, names.snakeCase)
42
- .replace(/\{\{LOWERCASE\}\}/g, names.lowerCase)
43
- .replace(/\{\{DISPLAY_NAME\}\}/g, names.displayName)
44
- .replace(/\{\{KEBAB_CASE\}\}/g, names.kebabCase);
45
-
46
- if (templateComments) {
47
- result = result.replace(/\{\{I18N:(\w+)\}\}/g, (_, key) => {
48
- return templateComments[key] ?? `{{I18N:${key}}}`;
49
- });
50
- }
51
-
52
- return result;
53
- }
54
-
55
- /**
56
- * 템플릿을 대상 디렉토리에 스케폴딩
57
- * @param {string} templateDir - 템플릿 디렉토리 경로
58
- * @param {string} targetDir - 생성할 프로젝트 디렉토리 경로
59
- * @param {object} names - 이름 변환 결과
60
- * @param {object} pmConfig - 패키지 매니저 설정
61
- * @param {object} [templateComments] - i18n 템플릿 주석 ({{I18N:*}} 치환용)
62
- */
63
- export async function scaffold(templateDir, targetDir, names, pmConfig, templateComments) {
64
- const files = await walkDir(templateDir);
65
- const created = [];
66
-
67
- for (const srcPath of files) {
68
- // 템플릿 기준 상대 경로
69
- const relPath = relative(templateDir, srcPath);
70
-
71
- // 경로의 부분에서 파일명 치환
72
- const destRelPath = relPath
73
- .split(/[\\/]/)
74
- .map((part) => replaceFileName(part, names))
75
- .join("/");
76
-
77
- const destPath = join(targetDir, destRelPath);
78
- const ext = srcPath.substring(srcPath.lastIndexOf(".")).toLowerCase();
79
-
80
- // 디렉토리 생성
81
- await mkdir(join(destPath, ".."), { recursive: true });
82
-
83
- if (BINARY_EXTS.has(ext)) {
84
- // 바이너리 파일은 그대로 복사
85
- await copyFile(srcPath, destPath);
86
- } else {
87
- // 텍스트 파일은 내용 치환
88
- const content = await readFile(srcPath, "utf-8");
89
- const replaced = replaceContent(content, names, pmConfig, templateComments);
90
- await writeFile(destPath, replaced, "utf-8");
91
- }
92
-
93
- created.push(destRelPath);
94
- }
95
-
96
- return created;
97
- }
1
+ /**
2
+ * 파일 복사 + 템플릿 치환
3
+ */
4
+
5
+ import { readdir, readFile, writeFile, mkdir, copyFile } from "node:fs/promises";
6
+ import { join, relative } from "node:path";
7
+
8
+ /** 바이너리 판별용 확장자 */
9
+ const BINARY_EXTS = new Set([".png", ".jpg", ".gif", ".ico", ".woff", ".woff2", ".ttf", ".eot"]);
10
+
11
+ /** 재귀적으로 디렉토리 내 모든 파일 경로를 수집 */
12
+ async function walkDir(dir) {
13
+ const entries = await readdir(dir, { withFileTypes: true });
14
+ const files = [];
15
+ for (const entry of entries) {
16
+ const fullPath = join(dir, entry.name);
17
+ if (entry.isDirectory()) {
18
+ files.push(...(await walkDir(fullPath)));
19
+ } else {
20
+ files.push(fullPath);
21
+ }
22
+ }
23
+ return files;
24
+ }
25
+
26
+ // npm publish 시 제외되는 dotfile을 언더스코어 접두사로 보관하고 복원
27
+ const DOTFILE_MAP = { _gitignore: ".gitignore" };
28
+
29
+ /** 파일명에서 플레이스홀더 치환 + dotfile 복원 */
30
+ function replaceFileName(name, names) {
31
+ if (DOTFILE_MAP[name]) return DOTFILE_MAP[name];
32
+ return name
33
+ .replace(/__WidgetName__/g, names.pascalCase)
34
+ .replace(/__widget_name__/g, names.snakeCase);
35
+ }
36
+
37
+ /** 파일 내용에서 플레이스홀더 치환 */
38
+ function replaceContent(content, names, pmConfig, templateComments, options) {
39
+ let result = content
40
+ .replace(/\{\{PASCAL_CASE\}\}/g, names.pascalCase)
41
+ .replace(/\{\{SNAKE_CASE\}\}/g, names.snakeCase)
42
+ .replace(/\{\{LOWERCASE\}\}/g, names.lowerCase)
43
+ .replace(/\{\{DISPLAY_NAME\}\}/g, names.displayName)
44
+ .replace(/\{\{KEBAB_CASE\}\}/g, names.kebabCase);
45
+
46
+ if (options) {
47
+ result = result
48
+ .replace(/\{\{ORGANIZATION\}\}/g, options.organization)
49
+ .replace(/\{\{COPYRIGHT\}\}/g, options.copyright)
50
+ .replace(/\{\{LICENSE_ID\}\}/g, options.license)
51
+ .replace(/\{\{VERSION\}\}/g, options.version)
52
+ .replace(/\{\{AUTHOR\}\}/g, options.author)
53
+ .replace(/\{\{PROJECT_PATH\}\}/g, options.projectPath);
54
+ }
55
+
56
+ if (templateComments) {
57
+ result = result.replace(/\{\{I18N:(\w+)\}\}/g, (_, key) => {
58
+ return templateComments[key] ?? `{{I18N:${key}}}`;
59
+ });
60
+ }
61
+
62
+ return result;
63
+ }
64
+
65
+ /**
66
+ * 템플릿을 대상 디렉토리에 스케폴딩
67
+ * @param {string} templateDir - 템플릿 디렉토리 경로
68
+ * @param {string} targetDir - 생성할 프로젝트 디렉토리 경로
69
+ * @param {object} names - 이름 변환 결과
70
+ * @param {object} pmConfig - 패키지 매니저 설정
71
+ * @param {object} [templateComments] - i18n 템플릿 주석 ({{I18N:*}} 치환용)
72
+ * @param {object} [options] - 추가 옵션 (organization, copyright, license, version, author, projectPath)
73
+ */
74
+ export async function scaffold(templateDir, targetDir, names, pmConfig, templateComments, options) {
75
+ const files = await walkDir(templateDir);
76
+ const created = [];
77
+
78
+ for (const srcPath of files) {
79
+ // 템플릿 기준 상대 경로
80
+ const relPath = relative(templateDir, srcPath);
81
+
82
+ // 경로의 각 부분에서 파일명 치환
83
+ const destRelPath = relPath
84
+ .split(/[\\/]/)
85
+ .map((part) => replaceFileName(part, names))
86
+ .join("/");
87
+
88
+ const destPath = join(targetDir, destRelPath);
89
+ const ext = srcPath.substring(srcPath.lastIndexOf(".")).toLowerCase();
90
+
91
+ // 디렉토리 생성
92
+ await mkdir(join(destPath, ".."), { recursive: true });
93
+
94
+ if (BINARY_EXTS.has(ext)) {
95
+ // 바이너리 파일은 그대로 복사
96
+ await copyFile(srcPath, destPath);
97
+ } else {
98
+ // 텍스트 파일은 내용 치환
99
+ const content = await readFile(srcPath, "utf-8");
100
+ const replaced = replaceContent(content, names, pmConfig, templateComments, options);
101
+ await writeFile(destPath, replaced, "utf-8");
102
+ }
103
+
104
+ created.push(destRelPath);
105
+ }
106
+
107
+ return created;
108
+ }
@@ -9,7 +9,7 @@ const COMMENT_LANG_INSTRUCTIONS = {
9
9
  ja: "Use Japanese comments",
10
10
  };
11
11
 
12
- export function generateClaudeMdContent(lang, names, pm, pmConfig) {
12
+ export function generateClaudeMdContent(lang, names, pm, pmConfig, organization) {
13
13
  const commentInstruction =
14
14
  COMMENT_LANG_INSTRUCTIONS[lang] ?? COMMENT_LANG_INSTRUCTIONS["en"];
15
15
 
@@ -72,8 +72,8 @@ src/*.gleam → gleam build → build/dev/javascript/**/*.mjs → Bridge JS (aut
72
72
 
73
73
  ## Mendix Widget Conventions
74
74
 
75
- - Widget ID: \`mendix.${names.lowerCase}.${names.pascalCase}\`
76
- - \`packagePath: "mendix"\` in \`package.json\` determines the deployment path
75
+ - Widget ID: \`${organization}.${names.lowerCase}.${names.pascalCase}\`
76
+ - \`packagePath: "${organization}"\` in \`package.json\` determines the deployment path
77
77
  - \`needsEntityContext="true"\` → Requires Mendix data context
78
78
  - \`offlineCapable="true"\` → Offline support
79
79
  - \`.mpk\` output: \`dist/\` directory
@@ -2,7 +2,7 @@
2
2
  * README.md template — 3 language versions
3
3
  */
4
4
 
5
- export function generateReadmeContent(lang, names, pm, pmConfig) {
5
+ export function generateReadmeContent(lang, names, pm, pmConfig, license) {
6
6
  const installCmd =
7
7
  pm === "npm"
8
8
  ? "npm install"
@@ -14,11 +14,11 @@ export function generateReadmeContent(lang, names, pm, pmConfig) {
14
14
 
15
15
  switch (lang) {
16
16
  case "ko":
17
- return generateKo(names, pm, installCmd);
17
+ return generateKo(names, pm, installCmd, license);
18
18
  case "ja":
19
- return generateJa(names, pm, installCmd);
19
+ return generateJa(names, pm, installCmd, license);
20
20
  default:
21
- return generateEn(names, pm, installCmd);
21
+ return generateEn(names, pm, installCmd, license);
22
22
  }
23
23
  }
24
24
 
@@ -26,7 +26,7 @@ export function generateReadmeContent(lang, names, pm, pmConfig) {
26
26
  // English
27
27
  // ---------------------------------------------------------------------------
28
28
 
29
- function generateEn(names, pm, installCmd) {
29
+ function generateEn(names, pm, installCmd, license) {
30
30
  return `# ${names.pascalCase}
31
31
 
32
32
  A Mendix Pluggable Widget written in Gleam.
@@ -273,7 +273,7 @@ Widget names use the \`<name>\` value from the \`.mpk\`'s internal XML, and prop
273
273
 
274
274
  ## License
275
275
 
276
- Apache-2.0
276
+ ${license}
277
277
  `;
278
278
  }
279
279
 
@@ -281,7 +281,7 @@ Apache-2.0
281
281
  // Korean
282
282
  // ---------------------------------------------------------------------------
283
283
 
284
- function generateKo(names, pm, installCmd) {
284
+ function generateKo(names, pm, installCmd, license) {
285
285
  return `# ${names.pascalCase}
286
286
 
287
287
  Gleam 언어로 작성된 Mendix Pluggable Widget.
@@ -528,7 +528,7 @@ switch.render(props)
528
528
 
529
529
  ## 라이센스
530
530
 
531
- Apache-2.0
531
+ ${license}
532
532
  `;
533
533
  }
534
534
 
@@ -536,7 +536,7 @@ Apache-2.0
536
536
  // Japanese
537
537
  // ---------------------------------------------------------------------------
538
538
 
539
- function generateJa(names, pm, installCmd) {
539
+ function generateJa(names, pm, installCmd, license) {
540
540
  return `# ${names.pascalCase}
541
541
 
542
542
  Gleam言語で作成されたMendix Pluggable Widget。
@@ -783,6 +783,6 @@ switch.render(props)
783
783
 
784
784
  ## ライセンス
785
785
 
786
- Apache-2.0
786
+ ${license}
787
787
  `;
788
788
  }
@@ -1,5 +1,5 @@
1
1
  name = "{{SNAKE_CASE}}"
2
- version = "1.0.0"
2
+ version = "{{VERSION}}"
3
3
  target = "javascript"
4
4
 
5
5
  [javascript]
@@ -8,4 +8,4 @@ runtime = "node"
8
8
 
9
9
  [dependencies]
10
10
  gleam_stdlib = ">= 0.44.0 and < 2.0.0"
11
- glendix = ">= 2.0.19 and < 3.0.0"
11
+ glendix = ">= 2.0.20 and < 3.0.0"
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "{{LOWERCASE}}",
3
3
  "widgetName": "{{PASCAL_CASE}}",
4
- "version": "1.0.0",
4
+ "version": "{{VERSION}}",
5
5
  "description": "My widget description",
6
- "copyright": "© Mendix Technology BV 2026. All rights reserved.",
7
- "author": "",
6
+ "copyright": "{{COPYRIGHT}}",
7
+ "author": "{{AUTHOR}}",
8
8
  "engines": {
9
9
  "node": ">=16"
10
10
  },
11
- "license": "Apache-2.0",
11
+ "license": "{{LICENSE_ID}}",
12
12
  "config": {
13
- "projectPath": "./tests/testProject",
13
+ "projectPath": "{{PROJECT_PATH}}",
14
14
  "mendixHost": "http://localhost:8080",
15
15
  "developmentPort": 3000
16
16
  },
17
- "packagePath": "mendix",
17
+ "packagePath": "{{ORGANIZATION}}",
18
18
  "scripts": {
19
19
  "prerelease": "echo skipping lint"
20
20
  },
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
- <widget id="mendix.{{LOWERCASE}}.{{PASCAL_CASE}}" pluginWidget="true" needsEntityContext="true" offlineCapable="true"
2
+ <widget id="{{ORGANIZATION}}.{{LOWERCASE}}.{{PASCAL_CASE}}" pluginWidget="true" needsEntityContext="true" offlineCapable="true"
3
3
  supportedPlatform="Web"
4
4
  xmlns="http://www.mendix.com/widget/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5
5
  xsi:schemaLocation="http://www.mendix.com/widget/1.0/ ../node_modules/mendix/custom_widget.xsd">
@@ -1,11 +1,11 @@
1
1
  <?xml version="1.0" encoding="utf-8" ?>
2
2
  <package xmlns="http://www.mendix.com/package/1.0/">
3
- <clientModule name="{{PASCAL_CASE}}" version="1.0.0" xmlns="http://www.mendix.com/clientModule/1.0/">
3
+ <clientModule name="{{PASCAL_CASE}}" version="{{VERSION}}" xmlns="http://www.mendix.com/clientModule/1.0/">
4
4
  <widgetFiles>
5
5
  <widgetFile path="{{PASCAL_CASE}}.xml"/>
6
6
  </widgetFiles>
7
7
  <files>
8
- <file path="mendix/{{LOWERCASE}}"/>
8
+ <file path="{{ORGANIZATION}}/{{LOWERCASE}}"/>
9
9
  </files>
10
10
  </clientModule>
11
11
  </package>
@@ -953,11 +953,13 @@ export function parse_modifier_to_state(modifier_mask) {
953
953
  let state = new KeyEventState(false, false, false);
954
954
  let _block;
955
955
  let $ = modifier_mask - 1;
956
- let n = $;
957
- if (n < 0) {
958
- _block = 0;
959
- } else {
960
- _block = $;
956
+ {
957
+ let n = $;
958
+ if (n < 0) {
959
+ _block = 0;
960
+ } else {
961
+ _block = $;
962
+ }
961
963
  }
962
964
  let mask = _block;
963
965
  let _block$1;
@@ -1123,7 +1125,7 @@ export function parse_cb(code) {
1123
1125
  _block = $result.unwrap(_pipe, 0);
1124
1126
  let code$1 = _block;
1125
1127
  let _block$1;
1126
- let _pipe$1 = $int.bitwise_and(code$1, 0b0011);
1128
+ let _pipe$1 = $int.bitwise_and(code$1, 0b11);
1127
1129
  _block$1 = $int.bitwise_or(
1128
1130
  _pipe$1,
1129
1131
  (() => {
@@ -1411,11 +1413,13 @@ export function parse_sgr_mouse(s) {
1411
1413
  export function parse_modifiers(code) {
1412
1414
  let _block;
1413
1415
  let $ = code - 1;
1414
- let x = $;
1415
- if (x < 0) {
1416
- _block = 0;
1417
- } else {
1418
- _block = $;
1416
+ {
1417
+ let x = $;
1418
+ if (x < 0) {
1419
+ _block = 0;
1420
+ } else {
1421
+ _block = $;
1422
+ }
1419
1423
  }
1420
1424
  let mask = _block;
1421
1425
  return new Modifiers(
@@ -1848,31 +1852,33 @@ export function parse_special_key_code(code) {
1848
1852
  _block$2 = new Ok(new PageDown());
1849
1853
  } else {
1850
1854
  let k = key$1;
1851
- let k$1 = k;
1852
- if ((k$1 >= 11) && (k$1 <= 15)) {
1853
- _block$2 = new Ok(new F(k$1 - 10));
1854
- } else {
1855
+ {
1855
1856
  let k$1 = k;
1856
- if ((k$1 >= 17) && (k$1 <= 21)) {
1857
- _block$2 = new Ok(new F(k$1 - 11));
1857
+ if ((k$1 >= 11) && (k$1 <= 15)) {
1858
+ _block$2 = new Ok(new F(k$1 - 10));
1858
1859
  } else {
1859
1860
  let k$1 = k;
1860
- if ((k$1 >= 23) && (k$1 <= 26)) {
1861
- _block$2 = new Ok(new F(k$1 - 12));
1862
- } else if (k === 28) {
1863
- _block$2 = new Ok(new F(k - 15));
1864
- } else if (k === 29) {
1865
- _block$2 = new Ok(new F(k - 15));
1861
+ if ((k$1 >= 17) && (k$1 <= 21)) {
1862
+ _block$2 = new Ok(new F(k$1 - 11));
1866
1863
  } else {
1867
1864
  let k$1 = k;
1868
- if ((k$1 >= 31) && (k$1 <= 34)) {
1869
- _block$2 = new Ok(new F(k$1 - 17));
1865
+ if ((k$1 >= 23) && (k$1 <= 26)) {
1866
+ _block$2 = new Ok(new F(k$1 - 12));
1867
+ } else if (k === 28) {
1868
+ _block$2 = new Ok(new F(k - 15));
1869
+ } else if (k === 29) {
1870
+ _block$2 = new Ok(new F(k - 15));
1870
1871
  } else {
1871
- _block$2 = new Error(
1872
- new FailedToParseEvent(
1873
- "Failed to parse special key code (CSI <..> ~)",
1874
- ),
1875
- );
1872
+ let k$1 = k;
1873
+ if ((k$1 >= 31) && (k$1 <= 34)) {
1874
+ _block$2 = new Ok(new F(k$1 - 17));
1875
+ } else {
1876
+ _block$2 = new Error(
1877
+ new FailedToParseEvent(
1878
+ "Failed to parse special key code (CSI <..> ~)",
1879
+ ),
1880
+ );
1881
+ }
1876
1882
  }
1877
1883
  }
1878
1884
  }
@@ -1 +1 @@
1
- 1.14.0
1
+ 1.15.1