@neta-art/cohub-cli 10.17.0 → 10.17.1

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.
@@ -42166,6 +42166,18 @@ const STATE_CHANNELS = {
42166
42166
  };
42167
42167
  //#endregion
42168
42168
  //#region ../sdk/src/board/editor/copy.ts
42169
+ /** How much of a paste beside its copy must show for that spot to count as the one in view. */
42170
+ const IN_PLACE_VISIBLE_SHARE = .9;
42171
+ function axisShare(start, length, viewStart, viewLength) {
42172
+ const overlap = Math.min(start + length, viewStart + viewLength) - Math.max(start, viewStart);
42173
+ if (overlap < 0) return 0;
42174
+ const span = Math.min(length, viewLength);
42175
+ return span > 0 ? overlap / span : 1;
42176
+ }
42177
+ /** Share of `rect` inside `view`, measured against the view when the rect outgrows it. */
42178
+ function visibleShare(rect, view) {
42179
+ return axisShare(rect.x, rect.width, view.x, view.width) * axisShare(rect.y, rect.height, view.y, view.height);
42180
+ }
42169
42181
  function createCopyModule(ctx) {
42170
42182
  const { state, options } = ctx;
42171
42183
  let internalClipboard = null;
@@ -42284,11 +42296,13 @@ function createCopyModule(ctx) {
42284
42296
  });
42285
42297
  const bounds = unionRects(probe.items.map((item) => ctx.query.boundsOf(item, probe)));
42286
42298
  if (!bounds) return next;
42299
+ if (visibleShare({
42300
+ x: bounds.x + next.x,
42301
+ y: bounds.y + next.y,
42302
+ width: bounds.width,
42303
+ height: bounds.height
42304
+ }, view) >= IN_PLACE_VISIBLE_SHARE) return next;
42287
42305
  const middle = rectCenter(bounds);
42288
- if (rectContainsPoint(view, {
42289
- x: next.x + middle.x,
42290
- y: next.y + middle.y
42291
- })) return next;
42292
42306
  const center = rectCenter(view);
42293
42307
  return {
42294
42308
  x: center.x - middle.x,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neta-art/cohub-cli",
3
- "version": "10.17.0",
3
+ "version": "10.17.1",
4
4
  "description": "CLI for Cohub — spaces, sessions, and agent collaboration.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -18,8 +18,8 @@
18
18
  "NOTICE"
19
19
  ],
20
20
  "dependencies": {
21
- "@neta-art/cohub": "13.7.0",
22
- "@neta-art/generation": "0.2.10",
21
+ "@neta-art/cohub": "13.8.0",
22
+ "@neta-art/generation": "0.2.15",
23
23
  "commander": "^15.0.0",
24
24
  "sharp": "^0.35.4",
25
25
  "ws": "^8.21.3"