@mxtommy/kip 3.0.0-alpha.29 → 3.0.0-alpha.31

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mxtommy/kip",
3
- "version": "3.0.0-alpha.29",
3
+ "version": "3.0.0-alpha.31",
4
4
  "description": "An advanced and versatile marine instrumentation package to display Signal K data.",
5
5
  "license": "MIT",
6
6
  "author": {
package/public/main.js CHANGED
@@ -125255,10 +125255,25 @@ var WidgetFreeboardskComponent = class _WidgetFreeboardskComponent extends BaseW
125255
125255
  if (!event.data || !event.data.gesture)
125256
125256
  return;
125257
125257
  console.log("Received iframe gesture:", event.data.gesture);
125258
- const swipeEvent = new CustomEvent(event.data.gesture, { detail: event.data, bubbles: true, cancelable: true });
125259
- window.dispatchEvent(swipeEvent);
125260
- document.body.dispatchEvent(swipeEvent);
125258
+ this.triggerSwipe("down");
125261
125259
  };
125260
+ triggerSwipe(direction) {
125261
+ const eventTarget = document;
125262
+ const swipeEvent = new CustomEvent("swipe", {
125263
+ detail: {
125264
+ type: "swipe",
125265
+ deltaX: direction === "left" ? -100 : direction === "right" ? 100 : 0,
125266
+ deltaY: direction === "up" ? -100 : direction === "down" ? 100 : 0,
125267
+ velocityX: direction === "left" ? -1 : direction === "right" ? 1 : 0,
125268
+ velocityY: direction === "up" ? -1 : direction === "down" ? 1 : 0,
125269
+ direction: direction === "left" ? 2 : direction === "right" ? 4 : direction === "up" ? 8 : 16,
125270
+ center: { x: window.innerWidth / 2, y: window.innerHeight / 2 }
125271
+ },
125272
+ bubbles: true,
125273
+ cancelable: true
125274
+ });
125275
+ eventTarget.dispatchEvent(swipeEvent);
125276
+ }
125262
125277
  injectHammerJS() {
125263
125278
  const iframeWindow = this.iframe().nativeElement.contentWindow;
125264
125279
  const iframeDocument = this.iframe().nativeElement.contentDocument;
@@ -125327,7 +125342,19 @@ var WidgetFreeboardskComponent = class _WidgetFreeboardskComponent extends BaseW
125327
125342
 
125328
125343
  hammer.on('swipeup', (ev) => {
125329
125344
  const eventData = {
125330
- ...ev
125345
+ type: ev.type,
125346
+ deltaX: ev.deltaX,
125347
+ deltaY: ev.deltaY,
125348
+ velocityX: ev.velocityX,
125349
+ velocityY: ev.velocityY,
125350
+ direction: ev.direction,
125351
+ distance: ev.distance,
125352
+ angle: ev.angle,
125353
+ center: ev.center,
125354
+ offsetDirection: ev.offsetDirection,
125355
+ scale: ev.scale,
125356
+ rotation: ev.rotation,
125357
+ isFinal: ev.isFinal
125331
125358
  };
125332
125359
  window.parent.postMessage({ gesture: 'swipeup', eventData: eventData }, '*');
125333
125360
  });