clavarium 0.2.27-next.1 → 0.2.28

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.
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.27-next.1",
3
+ "version": "0.2.28",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "clavarium",
9
- "version": "0.2.27-next.1",
9
+ "version": "0.2.28",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
13
13
  "@xterm/xterm": "^6.0.0",
14
- "clavarium-binder": "0.1.3-next.3",
14
+ "clavarium-binder": "0.1.3-next.4",
15
15
  "clavarium-docket": "0.1.1",
16
16
  "clavarium-parley": "0.17.0-next.1",
17
17
  "mermaid": "11.17.2",
@@ -688,9 +688,9 @@
688
688
  }
689
689
  },
690
690
  "node_modules/clavarium-binder": {
691
- "version": "0.1.3-next.3",
692
- "resolved": "https://registry.npmjs.org/clavarium-binder/-/clavarium-binder-0.1.3-next.3.tgz",
693
- "integrity": "sha512-2dBd5DGT8LjyNqwKRmeiKs5Fg6TemVhJhbItLzktHil7bU61FCIY2b6pdPdBinPYfm2zWSib6mUhVaZdfODo4A==",
691
+ "version": "0.1.3-next.4",
692
+ "resolved": "https://registry.npmjs.org/clavarium-binder/-/clavarium-binder-0.1.3-next.4.tgz",
693
+ "integrity": "sha512-H3cuO8KpFHg7W0vZZjTbpdFxMCYV+t0YHIffgjC8erCFLWE/VBKsAXHXLvqgyIavxQ8fs0eQ/PmwiCKRtC2VEg==",
694
694
  "license": "MIT",
695
695
  "bin": {
696
696
  "binder": "bin/binder.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.27-next.1",
3
+ "version": "0.2.28",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "A conversation is a VM with a terminal in it. Everything else is a folder.",
@@ -44,7 +44,7 @@
44
44
  "dependencies": {
45
45
  "@xterm/addon-fit": "^0.11.0",
46
46
  "@xterm/xterm": "^6.0.0",
47
- "clavarium-binder": "0.1.3-next.3",
47
+ "clavarium-binder": "0.1.3-next.4",
48
48
  "clavarium-docket": "0.1.1",
49
49
  "clavarium-parley": "0.17.0-next.1",
50
50
  "mermaid": "11.17.2",
package/web/app.js CHANGED
@@ -339,29 +339,27 @@
339
339
  width (its far side off the screen), and the list, the menu and the room slide -- transforms, which cost
340
340
  nothing -- so nothing is left blank, and nothing jumps at the end. */
341
341
  const sliders = () => ['list', 'nav'].map((id) => $(id)).filter(Boolean);
342
- const slide = (out, width) => {
343
- /* Quick at first, gentle at the end, both ways (a reversed curve started slowly: it felt late). */
344
- const how = { duration: 220, easing: 'cubic-bezier(.2, .8, .2, 1)' };
345
- const away = [{ transform: 'none' }, { transform: 'translateX(-100%)' }];
346
- const shifted = [{ transform: `translateX(${width}px)` }, { transform: 'none' }];
347
- const moving = sliders().map((e) => e.animate(out ? away : [...away].reverse(), how));
348
- moving.push($('room').animate(out ? shifted : [...shifted].reverse(), how));
349
- return Promise.all(moving.map((a) => a.finished.catch(() => {})));
350
- };
351
342
  const still = () => window.matchMedia?.('(prefers-reduced-motion: reduce)').matches || window.innerWidth <= 700;
352
343
  $('fold').addEventListener('click', async () => {
353
344
  listFolded = !listFolded;
354
345
  try { localStorage.setItem('clavarium-list', listFolded ? 'folded' : 'open'); } catch { /* as above */ }
355
346
  const folded = listFolded;
356
347
  if (still()) { applyFold(folded); fit.fit(); focusTerminal(); return; }
357
- /* Measured once it slides: folded, the list has no width until then (the room did not move, then jumped). */
348
+ /* ONE layout, up front: the final columns and the terminal's new size are set first, while the panel is
349
+ held over the room (.sliding). Only transforms animate then -- the room never changes width mid-slide,
350
+ so nothing is recomputed at the end (the open no longer "catches up" to the panel). */
358
351
  app.classList.add('sliding');
359
352
  const width = $('list').getBoundingClientRect().width;
360
- if (folded) { applyFold(true); fit.fit(); }
361
- await slide(folded, width);
353
+ applyFold(folded); fit.fit();
354
+ const how = { duration: 220, easing: 'cubic-bezier(.2, .8, .2, 1)' };
355
+ const listFrames = folded ? [{ transform: 'none' }, { transform: 'translateX(-100%)' }]
356
+ : [{ transform: 'translateX(-100%)' }, { transform: 'none' }];
357
+ const moving = sliders().map((e) => e.animate(listFrames, how));
358
+ /* Opening: the room starts shifted left over the list's place, then slides right into its final column. */
359
+ if (!folded) moving.push($('room').animate([{ transform: `translateX(${-width}px)` }, { transform: 'none' }], how));
360
+ await Promise.all(moving.map((a) => a.finished.catch(() => {})));
362
361
  app.classList.remove('sliding');
363
362
  if (listFolded !== folded) return;
364
- if (!folded) { applyFold(false); fit.fit(); }
365
363
  focusTerminal();
366
364
  });
367
365