@rulecad/keyboard-layout 0.1.4 → 0.1.5

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.
@@ -51,7 +51,7 @@ export const depth = (layout) => (layout.rows || []).length;
51
51
  // project(layout, fields): only the fields something reads, key by key, so a change to anything else (a legend, when
52
52
  // only positions matter) isn't a change to it. Positions always count.
53
53
  /** Only the fields something reads, key by key (positions always). @param {Layout} layout @param {string[]} [fields] @returns {object[]} */
54
- export const project = (layout, fields = []) => keys(layout).map((k) => Object.fromEntries(['index', 'col', 'u', ...fields].map((f) => [f, k[f] ?? null])));
54
+ export const project = (layout, fields = []) => keys(layout).map((k) => Object.fromEntries(['row', 'index', 'col', 'u', 'x', 'y', ...fields].map((f) => [f, k[f] ?? null]))); // (x and y too: a gap moves the keys after it)
55
55
 
56
56
  /**
57
57
  * A layout from keyboard-layout-editor.com: its JSON download, or the "Raw data" text. Rows, widths and the gaps
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulecad/keyboard-layout",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "A plain JSON keyboard layout format: rows of keys with widths and any per-key properties.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -28,6 +28,10 @@
28
28
  "url": "git+https://github.com/JoniBach/rulecad.git",
29
29
  "directory": "packages/keyboard-layout"
30
30
  },
31
+ "homepage": "https://github.com/JoniBach/rulecad/tree/main/packages/keyboard-layout#readme",
32
+ "bugs": {
33
+ "url": "https://github.com/JoniBach/rulecad/issues"
34
+ },
31
35
  "scripts": {
32
36
  "test": "node --test"
33
37
  },