@leapfrog/interactive-canvas 2.0.22-beta-8 → 2.0.22-beta-9

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.
@@ -1,7 +1,6 @@
1
1
  import _, { round, each, values, reduce, clone, max, isEqual } from 'lodash';
2
2
  import { BehaviorSubject, Subject } from 'rxjs';
3
3
  import * as fabric from 'fabric';
4
- import { JSDOM } from 'jsdom';
5
4
 
6
5
  const PIXELS_PER_MM$2 = 3.937;
7
6
  class MillimeterDimensions {
@@ -3736,20 +3735,7 @@ class SelectionData {
3736
3735
 
3737
3736
  class HeadlessInteractiveCanvas extends AbstractInteractiveCanvas {
3738
3737
  constructor() {
3739
- if (typeof window === "undefined") {
3740
- const { window } = new JSDOM('<!DOCTYPE html><html><body></body></html>');
3741
- global.window = window;
3742
- global.document = window.document;
3743
- global.HTMLElement = window.HTMLElement;
3744
- global.HTMLCanvasElement = window.HTMLCanvasElement;
3745
- global.window.requestAnimationFrame = (callback) => {
3746
- return setTimeout(() => callback(Date.now()), 16);
3747
- };
3748
- global.window.cancelAnimationFrame = (id) => {
3749
- clearTimeout(id);
3750
- };
3751
- }
3752
- super(fabric, new fabric.StaticCanvas(undefined, { width: 640, height: 480 }), 1);
3738
+ super(fabric, new fabric.StaticCanvas(undefined, { width: 640, height: 480 }), 0);
3753
3739
  this.headless = true;
3754
3740
  }
3755
3741
  /**
@@ -3,7 +3,6 @@
3
3
  var _ = require('lodash');
4
4
  var rxjs = require('rxjs');
5
5
  var fabric = require('fabric');
6
- var jsdom = require('jsdom');
7
6
 
8
7
  function _interopNamespaceDefault(e) {
9
8
  var n = Object.create(null);
@@ -3757,20 +3756,7 @@ class SelectionData {
3757
3756
 
3758
3757
  class HeadlessInteractiveCanvas extends AbstractInteractiveCanvas {
3759
3758
  constructor() {
3760
- if (typeof window === "undefined") {
3761
- const { window } = new jsdom.JSDOM('<!DOCTYPE html><html><body></body></html>');
3762
- global.window = window;
3763
- global.document = window.document;
3764
- global.HTMLElement = window.HTMLElement;
3765
- global.HTMLCanvasElement = window.HTMLCanvasElement;
3766
- global.window.requestAnimationFrame = (callback) => {
3767
- return setTimeout(() => callback(Date.now()), 16);
3768
- };
3769
- global.window.cancelAnimationFrame = (id) => {
3770
- clearTimeout(id);
3771
- };
3772
- }
3773
- super(fabric__namespace, new fabric__namespace.StaticCanvas(undefined, { width: 640, height: 480 }), 1);
3759
+ super(fabric__namespace, new fabric__namespace.StaticCanvas(undefined, { width: 640, height: 480 }), 0);
3774
3760
  this.headless = true;
3775
3761
  }
3776
3762
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leapfrog/interactive-canvas",
3
- "version": "2.0.22-beta-8",
3
+ "version": "2.0.22-beta-9",
4
4
  "description": "Leapfrog interactive canvas",
5
5
  "files": [
6
6
  "dist"
@@ -14,13 +14,11 @@
14
14
  "prepublishOnly": "npm run build"
15
15
  },
16
16
  "devDependencies": {
17
- "@types/jsdom": "^28.0.3",
18
17
  "@types/lodash": "^4.17.23",
19
18
  "typescript": "^6.0.3"
20
19
  },
21
20
  "dependencies": {
22
21
  "fabric": "^7.2.0",
23
- "jsdom": "^29.0.2",
24
22
  "lodash": "^4.18.1",
25
23
  "rollup": "^4.60.3",
26
24
  "rollup-plugin-typescript2": "^0.37.0",