zimjs 15.0.8 → 15.0.10

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,21 +1,15 @@
1
1
  {
2
2
  "name": "zimjs",
3
- "version": "15.0.8",
3
+ "version": "15.0.10",
4
4
  "type": "module",
5
- "main": "./dist/zim.js",
6
- "types": "./dist/typings/zim",
7
- "scripts": {
8
- "dev": "tsup --watch",
9
- "build": "tsup",
10
- "web": "esbuild src/zim.js --minify --bundle --target=chrome58,firefox57,safari11,edge16 --outfile=combined/zim.js"
11
- },
5
+ "main": "./src/zim.js",
6
+ "types": "./ts-src/typings/zim",
7
+ "scripts": {},
12
8
  "devDependencies": {
13
- "tsup": "^7.2.0",
14
- "typescript": "^4.5.2",
15
- "esbuild": "0.19.2"
9
+ "typescript": "^4.5.2"
16
10
  },
17
11
  "dependencies": {
18
- "@danzen/createjs": "^1.4.1"
12
+ "@danzen/createjs": "^1.4.1"
19
13
  },
20
14
  "repository": {
21
15
  "type": "git",
package/src/zim.js CHANGED
@@ -4501,7 +4501,7 @@ zim.sortObject = function(obj,property,reverse) {
4501
4501
  });
4502
4502
  var map = new Map(sortedEntries);
4503
4503
  var sorted = {};
4504
- map.forEach((v,k) => {sorted[k] = v});
4504
+ map.forEach(function(v,k) {sorted[k] = v});
4505
4505
  return sorted;
4506
4506
  };//-12.1
4507
4507
 
@@ -16420,7 +16420,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
16420
16420
  points = [];
16421
16421
  var fp = zim.copy(shape.points);
16422
16422
  var lastP = {x:null,y:null};
16423
- zim.loop(fp, (p, i)=>{
16423
+ zim.loop(fp, function(p, i) {
16424
16424
  var px = Math.round(p.x);
16425
16425
  var py = Math.round(p.y);
16426
16426
  if (px==lastP.x && py==lastP.y) return;
@@ -25550,7 +25550,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
25550
25550
 
25551
25551
  if (!scrollBarActive && optimize) {
25552
25552
  if (that.zDE) content.off(that.zDE);
25553
- that.zDE = content.on("mousedown", ()=>{
25553
+ that.zDE = content.on("mousedown", function() {
25554
25554
  if (that.zTI) zim.Ticker.remove(testContent);
25555
25555
  });
25556
25556
  if (that.zME) content.off(that.zME);
@@ -40703,7 +40703,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
40703
40703
  if (zot(repeatNum)) repeatNum = 0;
40704
40704
  if (zot(recycle)) recycle = cycleTime*2;
40705
40705
  if (zot(rtl)) rtl = ((WW.DIR && WW.DIR=="rtl") || (!WW.DIR && zim.DIR=="rtl"));
40706
- let dir = rtl?-1:1;
40706
+ var dir = rtl?-1:1;
40707
40707
  if (that.cycleInterval) that.cycleInterval.clear();
40708
40708
  if (recycle && recycle != -1) {
40709
40709
  if (that.recycleEvent) that.off("cyclecleared", that.recycleEvent);
@@ -50542,7 +50542,7 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
50542
50542
  return 0;
50543
50543
  }
50544
50544
  },
50545
- set: function(value) {
50545
+ set: function(value) {
50546
50546
  if (this.zimTween) {
50547
50547
  // STICK ON PATH BEFORE DRAG FIX
50548
50548
  immediateCheck = true;
@@ -51941,11 +51941,17 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
51941
51941
  if (paused == tween.zimPaused) return;
51942
51942
  tween.zimPaused = paused;
51943
51943
  if (paused) {
51944
+ target.zimPauseTime=Date.now();
51944
51945
  if (tween.zimTicker) tween.zimAnimateTimeout = setTimeout(function(){zim.Ticker.remove(tween.zimTicker);},200);
51945
51946
  // if (target.zimZoomTicker) zim.Ticker.remove(target.zimZoomTicker);
51946
51947
  } else {
51947
51948
  tween.startPaused = false;
51948
51949
  clearTimeout(tween.zimAnimateTimeout);
51950
+ if (target.zimPauseTime) {
51951
+ var nt = Date.now();
51952
+ target.tweenStartTime+=(nt-target.zimPauseTime);
51953
+ target.tweenEndTime+=(nt-target.zimPauseTime);
51954
+ }
51949
51955
  if (tween.zimTicker) tween.zimTicker = zim.Ticker.add(tween.zimTicker, stage);
51950
51956
  // if (target.zimZoomTicker) target.zimZoomTicker = zim.Ticker.add(target.zimZoomTicker, stage);
51951
51957
  }
@@ -52043,7 +52049,7 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
52043
52049
  return target;
52044
52050
  };
52045
52051
  target.stopAnimate.real = true; // record this as real method instead of empty method
52046
- target.pauseAnimate = function(paused, ids, include, ignoreDynamic) {
52052
+ target.pauseAnimate = function(paused, ids, include, ignoreDynamic) {
52047
52053
  var id;
52048
52054
  if (ids=="pauseOnBlur") {
52049
52055
  ids = null;
@@ -52062,7 +52068,7 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
52062
52068
  if (zot(ids)) { // want all ids
52063
52069
  // added in ZIM NFT 00 patch - not sure about it...
52064
52070
  // it matches what we do when not dynamic
52065
- // works but jumps to new value to quickly in speed?
52071
+ // works but jumps to new value too quickly in speed?
52066
52072
  // due to extra tickers?
52067
52073
  for (id in target.zimTweens) {pauseTicker(id, paused);}
52068
52074
  } else {
@@ -62628,7 +62634,7 @@ var that = this;
62628
62634
  if (!zim.TAM) {
62629
62635
  zim.TAM = new zim.TextureActivesManager(stage, toggleKey, damp);
62630
62636
  // seems to be needed to let certain interactions happen like ZIM TextInput
62631
- if (renderer && renderer.domElement) renderer.domElement.addEventListener("mousedown", (e)=>{
62637
+ if (renderer && renderer.domElement) renderer.domElement.addEventListener("mousedown", function(e) {
62632
62638
  e.preventDefault();
62633
62639
  });
62634
62640
  }
@@ -62733,12 +62739,12 @@ function apply () {
62733
62739
  that.XR = WW.XR = false;
62734
62740
  var tempMatrix = new threejs.Matrix4();
62735
62741
 
62736
- const controller1 = that.controllerLeft = renderer.xr.getController(0);
62742
+ var controller1 = that.controllerLeft = renderer.xr.getController(0);
62737
62743
  controller1.addEventListener('selectstart', doLcDown); // ignoring select
62738
62744
  controller1.addEventListener('selectend', doLcUp);
62739
62745
  controller1.addEventListener('move', doLcMove);
62740
62746
 
62741
- const controller2 = that.controllerRight = renderer.xr.getController(1);
62747
+ var controller2 = that.controllerRight = renderer.xr.getController(1);
62742
62748
  controller2.addEventListener('selectstart', doRcDown); // ignoring select
62743
62749
  controller2.addEventListener('selectend', doRcUp);
62744
62750
  controller2.addEventListener('move', doRcMove);
@@ -62915,7 +62921,7 @@ function apply () {
62915
62921
  var active = false;
62916
62922
  var obj, i, material;
62917
62923
  if (currentDown) {
62918
- const intersects = raycaster.intersectObject(currentDown);
62924
+ var intersects = raycaster.intersectObject(currentDown);
62919
62925
  if (intersects.length > 0) {
62920
62926
  obj = currentDown;
62921
62927
  if (obj.material && Array.isArray(obj.material)) {
@@ -80213,7 +80219,7 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
80213
80219
  message.animate({
80214
80220
  props:{alpha:0},
80215
80221
  wait:1,
80216
- call:()=>{message.dispose(); message=null;}
80222
+ call:function() {message.dispose(); message=null;}
80217
80223
  });
80218
80224
  that.stage.update();
80219
80225
  }
@@ -87509,36 +87515,37 @@ https://codepen.io/zimjs/pen/ZqNYxX
87509
87515
  } (zim || {});
87510
87516
 
87511
87517
  var globalFunctions = [
87512
- ["zog", zog],
87513
- ["zid", zid],
87514
- ["zss", zss],
87515
- ["zgo", zgo],
87516
- ["zum", zum],
87517
- ["zot", zot],
87518
- ["zop", zop],
87519
- ["zil", zil],
87520
- ["zet", zet],
87521
- ["zob", zob],
87522
- ["zik", zik],
87523
- ["zta", zta],
87524
- ["zor", zor],
87525
- ["zogg", zogg],
87526
- ["zogp", zogp],
87527
- ["zogb", zogb],
87528
- ["zogr", zogr],
87529
- ["zogy", zogy],
87530
- ["zogo", zogo],
87531
- ["zogl", zogl],
87532
- ["zogd", zogd],
87533
- ["zimplify", zimplify],
87534
- ["zimify", zimify]
87518
+ ["zog", zog],
87519
+ ["zid", zid],
87520
+ ["zss", zss],
87521
+ ["zgo", zgo],
87522
+ ["zum", zum],
87523
+ ["zot", zot],
87524
+ ["zop", zop],
87525
+ ["zil", zil],
87526
+ ["zet", zet],
87527
+ ["zob", zob],
87528
+ ["zik", zik],
87529
+ ["zta", zta],
87530
+ ["zor", zor],
87531
+ ["zogg", zogg],
87532
+ ["zogp", zogp],
87533
+ ["zogb", zogb],
87534
+ ["zogr", zogr],
87535
+ ["zogy", zogy],
87536
+ ["zogo", zogo],
87537
+ ["zogl", zogl],
87538
+ ["zogd", zogd],
87539
+ ["zimplify", zimplify],
87540
+ ["zimify", zimify]
87535
87541
  ];
87536
87542
 
87537
87543
  for (z_i = 0; z_i < globalFunctions.length; z_i++) {
87538
- var pair = globalFunctions[z_i];
87539
- WW[pair[0]] = zim[pair[0]] = pair[1];
87544
+ var pair = globalFunctions[z_i];
87545
+ WW[pair[0]] = zim[pair[0]] = pair[1];
87540
87546
  }
87541
87547
 
87548
+
87542
87549
  // these are global regardless
87543
87550
  var globalsConstants = [
87544
87551
  ["FIT", zim.FIT],
@@ -87583,16 +87590,16 @@ var globalsConstants = [
87583
87590
  ["DEG", zim.DEG],
87584
87591
  ["RAD", zim.RAD],
87585
87592
  ["PHI", zim.PHI],
87586
- ];
87587
-
87588
- for (z_i = 0; z_i < globalsConstants.length; z_i++) {
87593
+ ];
87594
+
87595
+ for (z_i = 0; z_i < globalsConstants.length; z_i++) {
87589
87596
  var pair = globalsConstants[z_i];
87590
87597
  WW[pair[0]] = pair[1];
87591
- }
87592
-
87593
- for (z_i = 0; z_i < zim.colors.length; z_i++) {
87598
+ }
87599
+
87600
+ for (z_i = 0; z_i < zim.colors.length; z_i++) {
87594
87601
  WW[zim.colors[z_i]] = zim.colorsHex[z_i];
87595
- }
87602
+ }
87596
87603
 
87597
87604
 
87598
87605
  WW.zim = zim;
@@ -87900,4 +87907,4 @@ export let getLatestVersions = zim.getLatestVersions;
87900
87907
  export let PWA = zim.PWA;
87901
87908
  export let QR = zim.QR;
87902
87909
  export let GIF = zim.GIF;
87903
- export let THEME = zim.THEME;
87910
+ export let THEME = zim.THEME;