@social-mail/social-mail-client 1.2.454 → 1.2.455

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.
@@ -18185,7 +18185,7 @@ System.register(["@web-atoms/core/dist/style/styled"], function (_export, _conte
18185
18185
  System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dist/core/BindableProperty", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/dist/web/controls/AtomControl", "./styles/zoom-view-style"], function (_export, _context) {
18186
18186
  "use strict";
18187
18187
 
18188
- var __decorate, __metadata, Bind, BindableProperty, XNode, AtomControl, ZoomView, center, distance;
18188
+ var __decorate, __metadata, Bind, BindableProperty, XNode, AtomControl, ZoomView, center, distance, findLargestDistance;
18189
18189
  _export("default", void 0);
18190
18190
  return {
18191
18191
  setters: [function (_tslib) {
@@ -18217,6 +18217,32 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
18217
18217
  distance = (first, second) => {
18218
18218
  return Math.hypot(first.pageX - second.pageX, first.pageY - second.pageY);
18219
18219
  };
18220
+ findLargestDistance = touches => {
18221
+ let pair = null;
18222
+ for (let i = 0; i < touches.length; i++) {
18223
+ const t1 = touches[i];
18224
+ for (let j = i + 1; j < touches.length; j++) {
18225
+ const t2 = touches[j];
18226
+ const distance = Math.hypot(t1.pageX - t2.pageX, t1.pageY - t2.pageY);
18227
+ if (pair === null) {
18228
+ pair = {
18229
+ t1,
18230
+ t2,
18231
+ distance
18232
+ };
18233
+ continue;
18234
+ }
18235
+ if (pair.distance < distance) {
18236
+ pair = {
18237
+ t1,
18238
+ t2,
18239
+ distance
18240
+ };
18241
+ }
18242
+ }
18243
+ }
18244
+ return pair;
18245
+ };
18220
18246
  _export("default", ZoomView = class ZoomView extends AtomControl {
18221
18247
  preCreate() {
18222
18248
  this.element.title = "Use mouse wheel to zoom";
@@ -18265,15 +18291,14 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
18265
18291
  anchorY,
18266
18292
  scale
18267
18293
  } = this.zoom;
18268
- if (ev.touches.length === 2) {
18294
+ if (ev.touches.length > 1) {
18269
18295
  ev.preventDefault();
18270
18296
  ev.stopImmediatePropagation();
18271
18297
  const rect = this.element.getBoundingClientRect();
18272
- const first = ev.touches[0];
18273
- const second = ev.touches[1];
18274
- anchorX = (first.clientX + second.clientX) / 2 - rect.left;
18275
- anchorY = (first.clientY + second.clientY) / 2 - rect.top;
18276
- const newScale = distance(first, second);
18298
+ const ld = findLargestDistance(ev.touches);
18299
+ const first = ld.t1;
18300
+ const second = ld.t2;
18301
+ const newScale = ld.distance;
18277
18302
  if (previousDistance === void 0) {
18278
18303
  previousDistance = newScale;
18279
18304
  return;
@@ -18281,6 +18306,8 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
18281
18306
  if (previousDistance === newScale) {
18282
18307
  return;
18283
18308
  }
18309
+ anchorX = (first.clientX + second.clientX) / 2 - rect.left;
18310
+ anchorY = (first.clientY + second.clientY) / 2 - rect.top;
18284
18311
  scale += newScale - previousDistance;
18285
18312
  previousDistance = newScale;
18286
18313
  this.updateZoom({