@vibecook/ice 0.16.0 → 0.17.0

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 (52) hide show
  1. package/README.md +10 -5
  2. package/dist/{chunk-ZTY2VRIS.js → chunk-6W2FPXR7.js} +13 -7
  3. package/dist/chunk-6W2FPXR7.js.map +1 -0
  4. package/dist/{chunk-Y7K6CHSF.js → chunk-LAZIY3J7.js} +286 -189
  5. package/dist/chunk-LAZIY3J7.js.map +1 -0
  6. package/dist/{chunk-REJTEK3V.js → chunk-M2HUDENL.js} +288 -318
  7. package/dist/chunk-M2HUDENL.js.map +1 -0
  8. package/dist/{chunk-BH5AFWJX.js → chunk-VZEZ7CYW.js} +9 -13
  9. package/dist/chunk-VZEZ7CYW.js.map +1 -0
  10. package/dist/desk-kit.js +2 -2
  11. package/dist/desk-objects.js +45 -14
  12. package/dist/desk-objects.js.map +1 -1
  13. package/dist/desk.js +3 -3
  14. package/dist/devtools.js +1 -1
  15. package/dist/dom.js +2 -2
  16. package/dist/index.js +7 -1
  17. package/dist/react.js +2 -2
  18. package/dist/types/packages/core/src/canvas/engine-catalog.d.ts +6 -0
  19. package/dist/types/packages/core/src/catalog/desk.d.ts +6 -6
  20. package/dist/types/packages/core/src/catalog/gesture.d.ts +2 -0
  21. package/dist/types/packages/core/src/catalog/selection-presence.d.ts +2 -0
  22. package/dist/types/packages/core/src/catalog/settings-resources.d.ts +8 -4
  23. package/dist/types/packages/core/src/facade/create-canvas-engine.d.ts +11 -5
  24. package/dist/types/packages/core/src/index.d.ts +1 -1
  25. package/dist/types/packages/core/src/ops/selection-drag.d.ts +8 -0
  26. package/dist/types/packages/core/src/settings/defaults.d.ts +2 -0
  27. package/dist/types/packages/core/src/systems/camera-sim.d.ts +13 -0
  28. package/dist/types/packages/core/src/systems/tray.d.ts +5 -4
  29. package/dist/types/packages/core/src/tools/define-tool.d.ts +2 -2
  30. package/dist/types/packages/core/src/widget/define-widget.d.ts +2 -1
  31. package/dist/types/packages/desk/src/ground.d.ts +4 -3
  32. package/dist/types/packages/desk/src/host/layer.d.ts +1 -3
  33. package/dist/types/packages/desk/src/mat/layout.d.ts +45 -5
  34. package/dist/types/packages/desk/src/mat/mat-pass.d.ts +7 -0
  35. package/dist/types/packages/desk/src/mat/ruler-regions.d.ts +17 -0
  36. package/dist/types/packages/desk/src/shaders.gen.d.ts +4 -4
  37. package/dist/types/packages/desk/src/theme.d.ts +0 -15
  38. package/dist/types/packages/desk/src/tray/drawer.d.ts +10 -8
  39. package/dist/types/packages/desk/src/tray/flux.d.ts +2 -3
  40. package/dist/types/packages/desk/src/tray/layout.d.ts +1 -6
  41. package/dist/types/packages/desk/src/tray/look.d.ts +0 -9
  42. package/dist/types/packages/desk/src/tray/pass.d.ts +7 -18
  43. package/dist/types/packages/desk/src/tray/specimens.d.ts +2 -19
  44. package/dist/types/packages/dom/src/pointer-adapter.d.ts +1 -1
  45. package/dist/types/packages/objects/src/minimat/layout.d.ts +1 -1
  46. package/dist/types/packages/objects/src/photo/photo.d.ts +2 -2
  47. package/dist/types/packages/objects/src/preset.d.ts +5 -3
  48. package/package.json +15 -16
  49. package/dist/chunk-BH5AFWJX.js.map +0 -1
  50. package/dist/chunk-REJTEK3V.js.map +0 -1
  51. package/dist/chunk-Y7K6CHSF.js.map +0 -1
  52. package/dist/chunk-ZTY2VRIS.js.map +0 -1
package/dist/desk-kit.js CHANGED
@@ -121,9 +121,9 @@ import {
121
121
  visibleRect,
122
122
  worldBounds,
123
123
  writeChanged
124
- } from "./chunk-BH5AFWJX.js";
124
+ } from "./chunk-VZEZ7CYW.js";
125
125
  import "./chunk-RTBW5AIZ.js";
126
- import "./chunk-Y7K6CHSF.js";
126
+ import "./chunk-LAZIY3J7.js";
127
127
  import "./chunk-RE4GDHFJ.js";
128
128
  export {
129
129
  BLOB_STORE,
@@ -8,7 +8,7 @@ import {
8
8
  rasterPriority,
9
9
  stringProp,
10
10
  writable
11
- } from "./chunk-REJTEK3V.js";
11
+ } from "./chunk-M2HUDENL.js";
12
12
  import "./chunk-BKV4ZEU3.js";
13
13
  import {
14
14
  compile,
@@ -110,7 +110,7 @@ import {
110
110
  unproject,
111
111
  worldBounds,
112
112
  writeChanged
113
- } from "./chunk-BH5AFWJX.js";
113
+ } from "./chunk-VZEZ7CYW.js";
114
114
  import {
115
115
  bindGroup,
116
116
  bindLayout,
@@ -129,6 +129,7 @@ import {
129
129
  Down,
130
130
  DownPart,
131
131
  Drag,
132
+ Drags,
132
133
  Editing,
133
134
  GestureActive,
134
135
  GestureCancelled,
@@ -142,6 +143,7 @@ import {
142
143
  HeldTool,
143
144
  LocalPointer,
144
145
  Locked,
146
+ MovesSelection,
145
147
  Pointer,
146
148
  PointerButtons,
147
149
  PointerPart,
@@ -151,6 +153,7 @@ import {
151
153
  Position,
152
154
  PrefabId,
153
155
  PressWheel,
156
+ RoutedMove,
154
157
  Size,
155
158
  TouchesExact,
156
159
  TransformTween,
@@ -170,7 +173,7 @@ import {
170
173
  setWidgetProps,
171
174
  tools,
172
175
  trayOpen
173
- } from "./chunk-Y7K6CHSF.js";
176
+ } from "./chunk-LAZIY3J7.js";
174
177
  import {
175
178
  clientToScreen
176
179
  } from "./chunk-RE4GDHFJ.js";
@@ -10820,8 +10823,8 @@ var CAST = MAT_COLORS.cast;
10820
10823
  var PHOTO_SPEC = {
10821
10824
  /** The print's long side — a 6×4 at the note's scale. */
10822
10825
  long: 400,
10823
- /** The white border, as a fraction of the short side (a classic bordered print). 0 = borderless. */
10824
- border: 0.05,
10826
+ /** Optional host styling, as a fraction of the short side. Images fill the sheet by default. */
10827
+ border: 0,
10825
10828
  /** The die-cut corner. */
10826
10829
  radius: 2.5,
10827
10830
  /** The paper under the emulsion: a resin-coated white, a touch warm (sRGB), and its fibre ±/255. */
@@ -12230,7 +12233,7 @@ function photoKind(opts = {}) {
12230
12233
  },
12231
12234
  record(G, ctx) {
12232
12235
  const { w, h } = extentOf(ctx);
12233
- const border = borderOf(w / 2, h / 2, { ...law, border: numberProp(ctx.props, "border", law.border) });
12236
+ const border = borderOf(w / 2, h / 2, law);
12234
12237
  const prints = ctx.local;
12235
12238
  const picture = prints?.pictureFor(ctx.entity, stringProp(ctx.props, "blob", ""), numberProp(ctx.props, "width", 0), numberProp(ctx.props, "height", 0)) ?? null;
12236
12239
  return { geometry: G, border, picture };
@@ -12250,11 +12253,13 @@ function printRect(cx, cy, width, height, long = PHOTO.long) {
12250
12253
 
12251
12254
  // ../objects/src/photo/carry.ts
12252
12255
  var pointersQ5 = defineQuery([Pointer, LocalPointer, PointerWorld, PointerButtons]);
12256
+ var coreMovesQ = defineQuery([Drag, RoutedMove, GestureActive]);
12253
12257
  var TWIST_PER_WHEEL = 35e-4;
12254
12258
  function createPhotoCarry(opts) {
12255
12259
  const { world, docs } = opts;
12256
12260
  const defer = opts.defer ?? ((fn) => queueMicrotask(fn));
12257
12261
  const held = /* @__PURE__ */ new Set();
12262
+ const coreMoves = /* @__PURE__ */ new Set();
12258
12263
  const refusing = /* @__PURE__ */ new Set();
12259
12264
  const wheel = /* @__PURE__ */ new Map();
12260
12265
  let cancelStamp = world.resourceStamp(CancelRequest);
@@ -12282,7 +12287,26 @@ function createPhotoCarry(opts) {
12282
12287
  follow(now) {
12283
12288
  const prints = opts.prints();
12284
12289
  if (prints === void 0) return;
12285
- for (const r of prints.rests()) defer(() => prints.settle(r.entity, commit(r.entity, r.x, r.y, r.angle)));
12290
+ for (const rec of coreMoves) if (!world.isAlive(rec) || !world.hasTag(rec, GestureActive)) coreMoves.delete(rec);
12291
+ world.query(coreMovesQ).each((b) => {
12292
+ for (const row of b) {
12293
+ const rec = b.entity(row);
12294
+ if (coreMoves.has(rec)) continue;
12295
+ coreMoves.add(rec);
12296
+ for (const e of world.getRelations(rec, Drags)) {
12297
+ if (!opts.isPrint(e)) continue;
12298
+ prints.settle(e, false);
12299
+ held.delete(e);
12300
+ wheel.delete(e);
12301
+ }
12302
+ }
12303
+ });
12304
+ for (const r of prints.rests()) {
12305
+ if (world.has(r.entity, Grab)) continue;
12306
+ defer(() => {
12307
+ if (!world.has(r.entity, Grab)) prints.settle(r.entity, commit(r.entity, r.x, r.y, r.angle));
12308
+ });
12309
+ }
12286
12310
  const stamp = world.resourceStamp(CancelRequest);
12287
12311
  const cancelled = stamp !== cancelStamp;
12288
12312
  cancelStamp = stamp;
@@ -12293,7 +12317,9 @@ function createPhotoCarry(opts) {
12293
12317
  for (const row of b) {
12294
12318
  const p2 = b.entity(row);
12295
12319
  if ((world.read(p2, PointerButtons).buttons & 1) === 0) continue;
12296
- for (const rec of world.getReverse(p2, Watches)) {
12320
+ const watchers = world.getReverse(p2, Watches);
12321
+ if (watchers.some((rec) => (world.hasTag(rec, MovesSelection) || world.hasTag(rec, RoutedMove)) && !world.hasTag(rec, GestureCancelled) && !world.hasTag(rec, GestureFailed) && !world.hasTag(rec, GestureEnded))) continue;
12322
+ for (const rec of watchers) {
12297
12323
  if (world.hasTag(rec, GestureCancelled) || world.hasTag(rec, GestureFailed) || world.hasTag(rec, GestureEnded)) continue;
12298
12324
  const e = world.getRelation(rec, Captures);
12299
12325
  if (e === void 0 || hands.has(e) || !world.isAlive(e) || !opts.isPrint(e)) continue;
@@ -12357,16 +12383,15 @@ var Photo2 = defineObject({
12357
12383
  blob: p.string({ default: "" }),
12358
12384
  width: p.number({ default: 0 }),
12359
12385
  height: p.number({ default: 0 }),
12386
+ // Legacy saved field: presentation follows the kind's law, borderless by default.
12360
12387
  border: p.number({ default: PHOTO.border }),
12361
12388
  angle: p.number({ default: 0 })
12362
12389
  },
12363
12390
  size: { w: printExtent(0, 0).w, h: printExtent(0, 0).h },
12364
12391
  kind: photoKind(),
12365
- // on the pegboard tray (design-017 §8): a print, clipped
12366
- // …showing the kind's sample picture (K5b, D-K5b.4) through its own pictures (`local`); one taken is blank — it asks for a picture
12367
- tray: { label: "Print", category: "paper", order: 1, props: { blob: SAMPLE_PICTURE, width: SAMPLE_SIZE.w, height: SAMPLE_SIZE.h }, local: true, hang: { w: 150, h: 100, accessory: "clip", pegs: [[0, -0.5]] } },
12392
+ // Created from an image (paste, drop, or a host's card), never as a blank tray specimen.
12368
12393
  // the wheel TURNS a print held in a hand (PHOTO.md; D3t-a — core cedes that pointer's wheel to it, `PressWheel`)
12369
- interaction: { selectable: true, movable: false, resizable: false, snap: "both", wheelTurns: true },
12394
+ interaction: { selectable: true, movable: "selection", resizable: false, snap: "both", wheelTurns: true },
12370
12395
  // it lies on the desk by what it provides (K8a — `DESK_OBJECT`, the desk canvas's one key), as a plugin kind does
12371
12396
  provides: [PHOTO_TYPE, DESK_OBJECT],
12372
12397
  // the prints' CARRY (D3w): the hands onto the photo kind's bodies, each rest ONE transaction out of the frame (D-D7-A.3)
@@ -12380,7 +12405,7 @@ function builtin(id) {
12380
12405
  if (tool === void 0) throw new Error(`desk: missing built-in tool ${id}`);
12381
12406
  return tool;
12382
12407
  }
12383
- var deskSelect = defineTool({ id: "desk.select", shortcut: "v", route: { canvasDrag: "pan", canvasDragShift: "marquee" } });
12408
+ var deskSelect = defineTool({ id: "desk.select", shortcut: "v", route: { canvasDrag: "marquee" } });
12384
12409
  var DESK_TOOLS = [builtin("select"), deskSelect, builtin("pan")];
12385
12410
  var DeskCanvas = defineCanvasType({
12386
12411
  id: "desk.desk",
@@ -12397,7 +12422,13 @@ var DESK_ENGINE = {
12397
12422
  canvasTypes: [DeskCanvas],
12398
12423
  rootCanvas: DeskCanvas,
12399
12424
  presentationFallback: DeskCanvas,
12400
- settings: { zoom: { min: ZOOM_MIN, max: ZOOM_MAX }, gestures: { wheel: "zoom" }, nav: { zoomThrough: { enabled: true } } }
12425
+ settings: {
12426
+ zoom: { min: ZOOM_MIN, max: ZOOM_MAX },
12427
+ // Chromium encodes native pinch scale as deltaY = -100 * log(scale).
12428
+ // exp(-deltaY * 0.01) restores that scale without damping the macOS gesture.
12429
+ gestures: { wheel: "pan", wheelZoomCurve: "exponential", wheelZoomRate: 0.01 },
12430
+ nav: { zoomThrough: { enabled: true } }
12431
+ }
12401
12432
  };
12402
12433
 
12403
12434
  // ../objects/src/palette.ts