@bun-native/core 0.33.3 → 0.33.6

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/README.md CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  The public TypeScript API of the Bun Native desktop framework.
4
4
 
5
- Part of [Bun Native](https://github.com/0xPlayerOne/bun-native), an experimental developer preview. Version 0.33.3 was built from [bf02b4420333](https://github.com/0xPlayerOne/bun-native/tree/bf02b44203336646cf156e369cd57b84496a3a7d) and published from GitHub Actions with npm provenance. Use the Bun revision pinned in that commit's toolchain.json. Start with the [getting-started guide](https://github.com/0xPlayerOne/bun-native/blob/bf02b44203336646cf156e369cd57b84496a3a7d/docs/getting-started.md); `bun-native host install` fetches the matching release host. The license notice is in LICENSE.
5
+ Part of [Bun Native](https://github.com/AndrewM-F/bun-native), an experimental developer preview. Version 0.33.6 was built from [b30ffd3749f0](https://github.com/AndrewM-F/bun-native/tree/b30ffd3749f0126ea7b2ad52919e623a566bbcb4) and published from GitHub Actions with npm provenance. Use the Bun revision pinned in that commit's toolchain.json. Start with the [getting-started guide](https://github.com/AndrewM-F/bun-native/blob/b30ffd3749f0126ea7b2ad52919e623a566bbcb4/docs/getting-started.md); `bun-native host install` fetches the matching release host. The license notice is in LICENSE.
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "commit": "bf02b44203336646cf156e369cd57b84496a3a7d",
4
- "tree": "5943b16183fcc166a5694a7da25bd1d33a3788d4",
3
+ "commit": "b30ffd3749f0126ea7b2ad52919e623a566bbcb4",
4
+ "tree": "c5ff99a51b677487e66e9c4e9408d6deca55e4d2",
5
5
  "files": {
6
6
  "package.json": {
7
- "bytes": 2258,
8
- "sha256": "52d4fbfcecc45b4c0da143af60977d68491559283dc78ee31ce720e51d001106"
7
+ "bytes": 2259,
8
+ "sha256": "8c174d65e4f5a831e19f8a550ca0bd43968915c11adbbe0450d66f0e3ebe5bc5"
9
9
  },
10
10
  "packages/core/package.json": {
11
11
  "bytes": 282,
@@ -92,8 +92,8 @@
92
92
  "sha256": "c460c4e1a2e9d337e79294bce333e53896381529af8f7e35b23e207c6e132b85"
93
93
  },
94
94
  "packages/core/src/tree.ts": {
95
- "bytes": 27068,
96
- "sha256": "1fd82709389a24a22748d578a98b973e522d8ea60618bfb5e09611add9e8f5d0"
95
+ "bytes": 27909,
96
+ "sha256": "51e2edcc0f1e6d5d92e1f7edf79c6dc6bc5c2f5acc8bffa20b211523f3971bb8"
97
97
  },
98
98
  "packages/core/src/types.ts": {
99
99
  "bytes": 14315,
@@ -109,7 +109,7 @@
109
109
  "sha256": "9f4d9362cb4cc38c0f4e705295789a0cbfec46ffdd007e0541b9441a7c3003a7"
110
110
  },
111
111
  "dependencyLock": {
112
- "bytes": 28430,
113
- "sha256": "9d321f65b9224958ec99286628d652232a16e3242ea9536a396bceaf72892460"
112
+ "bytes": 28710,
113
+ "sha256": "b7993fb97886c3112d05a745d535bbd76448036e1db348105e817c787f6b6257"
114
114
  }
115
115
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bun-native/core",
3
- "version": "0.33.3",
3
+ "version": "0.33.6",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -18,16 +18,16 @@
18
18
  },
19
19
  "description": "The public TypeScript API of the Bun Native desktop framework.",
20
20
  "dependencies": {
21
- "@bun-native/protocol": "0.33.3",
22
- "@bun-native/runtime": "0.33.3"
21
+ "@bun-native/protocol": "0.33.6",
22
+ "@bun-native/runtime": "0.33.6"
23
23
  },
24
24
  "repository": {
25
25
  "type": "git",
26
- "url": "git+https://github.com/0xPlayerOne/bun-native.git",
26
+ "url": "git+https://github.com/AndrewM-F/bun-native.git",
27
27
  "directory": "packages/core"
28
28
  },
29
- "homepage": "https://github.com/0xPlayerOne/bun-native#readme",
30
- "bugs": "https://github.com/0xPlayerOne/bun-native/issues",
29
+ "homepage": "https://github.com/AndrewM-F/bun-native#readme",
30
+ "bugs": "https://github.com/AndrewM-F/bun-native/issues",
31
31
  "publishConfig": {
32
32
  "access": "public",
33
33
  "provenance": true
package/src/tree.ts CHANGED
@@ -473,8 +473,29 @@ export class Transaction implements NativeBatch {
473
473
  throw new NativeStateError('invalid_state', 'Child insertion index is out of range')
474
474
  child = this.writable(child)
475
475
  if (child.parent !== undefined) {
476
- const previous = this.writable(this.nodes.get(child.parent)!)
477
- previous.children.splice(previous.children.indexOf(child.id), 1)
476
+ const siblings = this.writable(this.nodes.get(child.parent)!).children
477
+ if (child.parent === parent.id) {
478
+ const from =
479
+ siblings[siblings.length - 1] === child.id
480
+ ? siblings.length - 1
481
+ : siblings.indexOf(child.id)
482
+ // Adjacent moves swap two entries; a no-op still emits an insert.
483
+ if (Math.abs(from - index) === 1) {
484
+ siblings[from] = siblings[index]!
485
+ siblings[index] = child.id
486
+ } else if (from === 0 && index > 0 && index === siblings.length - 1) {
487
+ siblings.shift()
488
+ siblings.push(child.id)
489
+ } else if (from !== index) {
490
+ siblings.splice(from, 1)
491
+ siblings.splice(index, 0, child.id)
492
+ }
493
+ this.attached.push(child.id)
494
+ this.operations.insert(parent.id, child.id, index)
495
+ return
496
+ }
497
+ if (siblings[siblings.length - 1] === child.id) siblings.pop()
498
+ else siblings.splice(siblings.indexOf(child.id), 1)
478
499
  }
479
500
  parent = this.writable(parent)
480
501
  parent.children.splice(index, 0, child.id)