@selimssevgi/cube-design-angular 0.7.0 → 0.7.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@
4
4
 
5
5
  nothing yet.
6
6
 
7
+ ## 0.7.1 (7 november 2026: a trackpad pinch that starts still or the other way)
8
+
9
+ - **the first real step decides a wheel stream**, where its first event did. a mac's trackpad often begins a pinch with a still event (`deltaY` 0), which took the stream as begun and so ignored the whole pinch, or with the fingers settling the other way (`deltaY` -1), which read a pinch out as a pinch in (selim, 6 november 2026: "zoom out not working sometimes"; cube-screens' `uat/use-cases/gestures.cjs` plays both streams). now a step under `CUBE_WHEEL_STEP` (2) only moves the stream's end and keeps the page zoom away; the first step of at least 2 decides by its own sign, and a slow pinch of small steps decides once they add up to three times that. the rule alone is the pure `wheelWay(deltaY, sum, least)`. still one step a stream. an app changes nothing; the first release from cube-screens.
10
+
7
11
  ## 0.7.0 (7 november 2026: the cube's art, offered as options)
8
12
 
9
13
  - **the cube's art** (`CubeArt`, `CUBE_ARTS`, `isArt`, `DrawnArt`, `drawArt`, `ArtShape`, `ArtDrawing`, `ArtOptions`): five ways to draw the same look, stickers (the first one), blocks, glass, ribbons and dots, from mosaic's todarch head (lang-app-fe #231). `<cube-picture [art]>` draws them, `stickers` by default, so an app that sets nothing is unchanged. cube design's decision of 7 november 2026 (`applications/screens/decisions.md`): every art draws the same look, and the person chooses.
package/README.md CHANGED
@@ -119,8 +119,9 @@ export class Level {
119
119
 
120
120
  - two fingers that end 1.25 times further apart (`CUBE_PINCH_APART`) are `in`, 0.8 times or closer
121
121
  (`CUBE_PINCH_TOGETHER`) are `out`, decided when the first lifts.
122
- - a trackpad's pinch reaches chrome, edge and firefox as a stream of ctrl + wheel events: the first
123
- decides (`deltaY` below 0 is `in`), and the stream is one pinch until the wheel has been quiet
122
+ - a trackpad's pinch reaches chrome, edge and firefox as a stream of ctrl + wheel events: its first
123
+ real step decides (`deltaY` -2 or below is `in`, 2 or above `out`; `CUBE_WHEEL_STEP`, `wheelWay`;
124
+ a still start or fingers settling the other way decide nothing, since 0.7.1), and the stream is one pinch until the wheel has been quiet
124
125
  250 ms (`CUBE_WHEEL_QUIET_MS`). the stream is kept for the whole page, so the level a pinch steps
125
126
  to never takes the rest of it as a second step (two levels out for one pinch on a mac, found in
126
127
  mosaic). `startsWheelGesture(lastAt, now)` is the rule alone. safari's gesture events count too.
@@ -938,13 +938,24 @@ const CUBE_WHEEL_QUIET_MS = 250;
938
938
  function startsWheelGesture(lastAt, now, quietMs = 250) {
939
939
  return now - lastAt >= quietMs;
940
940
  }
941
+ const CUBE_WHEEL_STEP = 2;
942
+ function wheelWay(deltaY, sum, least = 2) {
943
+ const by = Math.abs(deltaY) >= least ? deltaY : Math.abs(sum) >= 3 * least ? sum : 0;
944
+ return by < 0 ? "in" : by > 0 ? "out" : null;
945
+ }
941
946
  const stream = {
942
947
  wheelAt: -Infinity,
943
948
  gestureAt: -Infinity,
944
949
  heard: null,
945
950
  heardAfter: -Infinity,
946
- ownedUntil: -Infinity
951
+ ownedUntil: -Infinity,
952
+ sum: 0,
953
+ decided: false
947
954
  };
955
+ function begin() {
956
+ stream.sum = 0;
957
+ stream.decided = false;
958
+ }
948
959
  let listening = false;
949
960
  function listenToThePage(quietMs) {
950
961
  const w = globalThis.window;
@@ -956,6 +967,7 @@ function listenToThePage(quietMs) {
956
967
  stream.heard = e;
957
968
  stream.heardAfter = stream.wheelAt;
958
969
  stream.wheelAt = now;
970
+ if (now - stream.heardAfter >= quietMs) begin();
959
971
  if (now - stream.heardAfter < quietMs && now < stream.ownedUntil + quietMs) {
960
972
  stream.ownedUntil = now;
961
973
  e.preventDefault();
@@ -1019,12 +1031,15 @@ var CubePinch = class CubePinch {
1019
1031
  if (this.cubePinchDisabled() || !e.ctrlKey) return;
1020
1032
  e.preventDefault();
1021
1033
  const now = performance.now();
1022
- const starts = startsWheelGesture(stream.heard === e ? stream.heardAfter : stream.wheelAt, now, this.cubePinchQuietMs());
1034
+ if (startsWheelGesture(stream.heard === e ? stream.heardAfter : stream.wheelAt, now, this.cubePinchQuietMs())) begin();
1023
1035
  stream.wheelAt = now;
1024
1036
  stream.ownedUntil = now;
1025
- if (!starts || e.deltaY === 0) return;
1026
- if (e.deltaY < 0) this.emit("in", pointAt(e.clientX, e.clientY), "wheel", e);
1027
- else this.emit("out", pointAt(e.clientX, e.clientY), "wheel", e);
1037
+ if (stream.decided) return;
1038
+ stream.sum += e.deltaY;
1039
+ const way = wheelWay(e.deltaY, stream.sum);
1040
+ if (!way) return;
1041
+ stream.decided = true;
1042
+ this.emit(way, pointAt(e.clientX, e.clientY), "wheel", e);
1028
1043
  }
1029
1044
  gestureStart(e) {
1030
1045
  if (this.cubePinchDisabled()) return;
@@ -4317,6 +4332,6 @@ i0.ɵɵngDeclareClassMetadata({
4317
4332
  args: [{ providedIn: "root" }]
4318
4333
  }]
4319
4334
  });
4320
- export { ART_CHOICES_KEY, CONTEXT_CUBE_SOURCE, CONTEXT_CUBE_WORDS, CONTEXT_LAST_PARTS, CONTEXT_PART_ORDER, CUBE_ARTS, CUBE_CARRY_CLASSES, CUBE_CARRY_MOVE, CUBE_DROP_OUT, CUBE_HOLD_MS, CUBE_HOLD_SLOP, CUBE_ICON_NAMES, CUBE_LOADING_COLOURS, CUBE_LOADING_LEVELS, CUBE_LOADING_STEP_MS, CUBE_LOADING_STICKERS, CUBE_LOADING_WAYS, CUBE_LOADING_WIDTH, CUBE_PINCH_APART, CUBE_PINCH_TOGETHER, CUBE_WHEEL_QUIET_MS, CubeArtChoices, CubeCarry, CubeContext, CubeHold, CubeIcon, CubeLoading, CubePicture, CubePinch, CubeSquare, CubeSquareTile, JUST_SAVED_MINUTES, MINE_SORT, PART_ICONS, REPORT_APP, REPORT_INCIDENTS_KEPT, REPORT_INCIDENTS_MS, REPORT_KINDS, ReportClient, ReportDiagnostics, ReportDraft, ReportErrorHandler, SQUARE_LEAST_CELL, SQUARE_LEAST_TALL, SQUARE_LIST_ROW, SQUARE_MAX_SIDE, SQUARE_ROOM_BELOW, TEXT_ORDERS, TURNING_BELOW, TURNING_NUDGE_UNTIL, TURNING_SIDES, VIEW_KEYS, addLevel, artFor, artLevel, bringLevel, bringOf, chooseArt, contextArtWidth, contextIcon, contextLevelFor, contextOf, contextSquare, cubeIconCells, directionWords, drawArt, drawCube, environmentOf, errorLine, findJustSaved, gridFor, hideLevel, insideOf, isArt, isView, loadingStickers, loadingWayFor, moveBefore, namesLevel, orderLevel, orderOf, orderParts, partsLevel, placesOf, provideReportDiagnostics, readArtChoices, refusalOf, reportContext, reportInterceptor, reportRefusal, reportRequest, routePattern, scrubbedPath, sizeFor, sortDirectionsLevel, sortItems, sortLevel, squareGap, squareLayout, squareLeast, squareLevelFor, squareTall, startsWheelGesture, stillStep, technicalLines, tellLevel, turningFront, turningRows, viewLevel, whereLevel, wouldLoop };
4335
+ export { ART_CHOICES_KEY, CONTEXT_CUBE_SOURCE, CONTEXT_CUBE_WORDS, CONTEXT_LAST_PARTS, CONTEXT_PART_ORDER, CUBE_ARTS, CUBE_CARRY_CLASSES, CUBE_CARRY_MOVE, CUBE_DROP_OUT, CUBE_HOLD_MS, CUBE_HOLD_SLOP, CUBE_ICON_NAMES, CUBE_LOADING_COLOURS, CUBE_LOADING_LEVELS, CUBE_LOADING_STEP_MS, CUBE_LOADING_STICKERS, CUBE_LOADING_WAYS, CUBE_LOADING_WIDTH, CUBE_PINCH_APART, CUBE_PINCH_TOGETHER, CUBE_WHEEL_QUIET_MS, CUBE_WHEEL_STEP, CubeArtChoices, CubeCarry, CubeContext, CubeHold, CubeIcon, CubeLoading, CubePicture, CubePinch, CubeSquare, CubeSquareTile, JUST_SAVED_MINUTES, MINE_SORT, PART_ICONS, REPORT_APP, REPORT_INCIDENTS_KEPT, REPORT_INCIDENTS_MS, REPORT_KINDS, ReportClient, ReportDiagnostics, ReportDraft, ReportErrorHandler, SQUARE_LEAST_CELL, SQUARE_LEAST_TALL, SQUARE_LIST_ROW, SQUARE_MAX_SIDE, SQUARE_ROOM_BELOW, TEXT_ORDERS, TURNING_BELOW, TURNING_NUDGE_UNTIL, TURNING_SIDES, VIEW_KEYS, addLevel, artFor, artLevel, bringLevel, bringOf, chooseArt, contextArtWidth, contextIcon, contextLevelFor, contextOf, contextSquare, cubeIconCells, directionWords, drawArt, drawCube, environmentOf, errorLine, findJustSaved, gridFor, hideLevel, insideOf, isArt, isView, loadingStickers, loadingWayFor, moveBefore, namesLevel, orderLevel, orderOf, orderParts, partsLevel, placesOf, provideReportDiagnostics, readArtChoices, refusalOf, reportContext, reportInterceptor, reportRefusal, reportRequest, routePattern, scrubbedPath, sizeFor, sortDirectionsLevel, sortItems, sortLevel, squareGap, squareLayout, squareLeast, squareLevelFor, squareTall, startsWheelGesture, stillStep, technicalLines, tellLevel, turningFront, turningRows, viewLevel, wheelWay, whereLevel, wouldLoop };
4321
4336
 
4322
4337
  //# sourceMappingURL=selimssevgi-cube-design-angular.mjs.map