zimjs 19.1.1 → 19.1.3

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": "zimjs",
3
- "version": "19.1.1",
3
+ "version": "19.1.3",
4
4
  "type": "module",
5
5
  "main": "./src/zim.js",
6
6
  "types": "./ts-src/typings/zim",
package/src/zim.js CHANGED
@@ -10166,8 +10166,8 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
10166
10166
  this.sortBy = function(prop, inverse) {
10167
10167
  if (zot(prop)) return this;
10168
10168
  var sortFunction = function(obj1, obj2, options) {
10169
- if (obj1[prop] > obj2[prop]) { return inverse?-1:1; }
10170
- if (obj1[prop] < obj2[prop]) { return inverse?1:-1; }
10169
+ if (Number(obj1[prop]) > Number(obj2[prop])) { return inverse?-1:1; }
10170
+ if (Number(obj1[prop]) < Number(obj2[prop])) { return inverse?1:-1; }
10171
10171
  return 0;
10172
10172
  }
10173
10173
  this.sortChildren(sortFunction);
@@ -49098,7 +49098,7 @@ zim.extend(zim.Carousel3D, zim.Container, ["clone", "dispose"], "zimContainer",
49098
49098
  //-67.47
49099
49099
 
49100
49100
  /*--
49101
- zim.Loader = function(width, height, label, type, backgroundColor, rollBackgroundColor, color, rollColor, borderColor, borderWidth, corner, shadowColor, shadowBlur, hitPadding, gradient, gloss, dashed, backing, rollBacking, rollPersist, icon, rollIcon, toggle, toggleBacking, rollToggleBacking, toggleIcon, rollToggleIcon, toggleEvent, frame, multiple, accept, style, group, inherit)
49101
+ zim.Loader = function(width, height, label, type, backgroundColor, rollBackgroundColor, color, rollColor, borderColor, rollBorderColor, borderWidth, corner, shadowColor, shadowBlur, hitPadding, gradient, gloss, dashed, backing, rollBacking, rollPersist, icon, rollIcon, toggle, toggleBacking, rollToggleBacking, toggleIcon, rollToggleIcon, toggleEvent, frame, multiple, accept, style, group, inherit)
49102
49102
 
49103
49103
  Loader
49104
49104
  zim class - extends a zim.Button which extends a zim.Container
@@ -80733,10 +80733,10 @@ obj - (default ZIM makeIcon({box:black})) the object to glitch.
80733
80733
  this will be put in a holder Container inside the object in the Glitch and then passed as channel0 to a Shader.
80734
80734
  the Shader will be placed on top of the holder and can have its alpha and blendmode set with parameters.
80735
80735
  if dragging the object, make sure to set glitch.drag({all:true}) to drag all of the Glitch rather than just its parts.
80736
- glitchType - (default "tv") the type of glitch
80736
+ glitchType - (default "chunk") the type of glitch
80737
+ "chunk" - jitters and slides chunks out the side adds interlace
80737
80738
  "tv" - jitters the object and applies green lines
80738
80739
  "scan" - jitters and makes scan glitch
80739
- "chunk" - jitters and slides chunks out the side adds interlace
80740
80740
  "halftone" - adds dots - looks better on animated or video objects
80741
80741
  NOTE: these are just a few examples of shader effects. See Shader to apply any shader (fragment / vertex) to any objects (through channels)
80742
80742
  alpha - (default 1) set the alpha of the Shader which sits above the original - this will lessen the glitch effect
@@ -85340,6 +85340,7 @@ zim.Emitter = function(obj, width, height, interval, num, life, fade, shrink, wa
85340
85340
  poolList = [];
85341
85341
  };
85342
85342
 
85343
+
85343
85344
  if (!that.startEmitterPaused) this.emitterPaused = false; // do not set to false - as it will be done below if needed
85344
85345
  this.pauseEmitter = function(state, restart, freeze, immediate) {
85345
85346
 
@@ -85348,12 +85349,12 @@ zim.Emitter = function(obj, width, height, interval, num, life, fade, shrink, wa
85348
85349
  if (zot(restart)) restart = false;
85349
85350
  if (zot(freeze)) freeze = false;
85350
85351
  if (state) { // pausing
85351
- if (that.emitterPaused) return that;
85352
- if (freeze) {
85353
- if (emitterTicker) zim.Ticker.remove(emitterTicker, mID, that);
85354
- zim.loop(that.particles, function(particle) {
85355
- particle.pauseAnimate();
85356
- if (particle.trace) particle.getChildAt(0).pauseAnimate();
85352
+ if (that.emitterPaused) return that;
85353
+ if (freeze) {
85354
+ if (emitterTicker) zim.Ticker.remove(emitterTicker, mID, that);
85355
+ zim.loop(that.particles, function(particle) {
85356
+ particle.pauseAnimate();
85357
+ if (particle.trace) particle.getChildAt(0).pauseAnimate();
85357
85358
  if (particle.timeOut) {
85358
85359
  particle.timeOut.pause();
85359
85360
  }
@@ -85384,6 +85385,8 @@ zim.Emitter = function(obj, width, height, interval, num, life, fade, shrink, wa
85384
85385
  that.emitterPaused = false;
85385
85386
  if (cache) stage.snapToPixelEnabled = true;
85386
85387
  }
85388
+
85389
+ if (that.zimInterval) that.zimInterval.pauseOnBlurPaused = state; // ZIM 019 Patch - in case being paused when tab not active
85387
85390
  return that;
85388
85391
  };
85389
85392
 
@@ -98006,6 +98009,7 @@ zim.setBlurDetect = function() {
98006
98009
  obj = zim.pauseOnBlur[i];
98007
98010
  obj.pauseOnBlurPaused = obj.paused;
98008
98011
  obj.pause(true);
98012
+ zogr(obj.type, obj.special, obj.pauseOnBlurPaused)
98009
98013
  }
98010
98014
  }
98011
98015
  if (zim.pauseAnimateOnBlur && zim.animatedObjects) {
@@ -100744,6 +100748,10 @@ NOTE if zns=true is used to force the namespace then various three.js controls w
100744
100748
  import {OrbitControls} from "https://zimjs.org/cdn/019/zim_three";
100745
100749
  Similarily for: FirstPersonControls, PointerLockControls, GLTFLoader, ObjectControls, VRButton
100746
100750
 
100751
+ NOTE if using a glb (the binary version of gltf) then set Blob = document.Blob
100752
+ so the ZIM Blob does not conflict with the JS Blob - then use zim.Blob() for the ZIM blob.
100753
+ Or see zimplify() for other alternatives.
100754
+
100747
100755
  EXAMPLE
100748
100756
  // up top after import zim from "https://zimjs.org/cdn/019/zim_three"; // or the latest
100749
100757
 
@@ -2996,8 +2996,8 @@ declare namespace zim {
2996
2996
  readonly holder: Container
2997
2997
  }
2998
2998
  export class Loader extends Button implements zimComponent {
2999
- constructor(config_or_width?: number | string, height?: number | string, label?: string | Label, type?: string, backgroundColor?: color, rollBackgroundColor?: color, color?: color, rollColor?: color, borderColor?: color, borderWidth?: number, corner?: number | any[], shadowColor?: color, shadowBlur?: number, hitPadding?: number, gradient?: number, gloss?: number, dashed?: boolean | [number], backing?: DisplayObject, rollBacking?: DisplayObject, rollPersist?: boolean, icon?: DisplayObject, rollIcon?: DisplayObject, toggle?: string, rollToggle?: DisplayObject, toggleEvent?: string, frame?: Frame, multiple?: boolean, accept?: [any], style?: boolean, group?: string, inherit?: {})
3000
- constructor(config: { width?: number | string, height?: number | string, label?: string | Label, type?: string, backgroundColor?: color, rollBackgroundColor?: color, color?: color, rollColor?: color, borderColor?: color, borderWidth?: number, corner?: number | any[], shadowColor?: color, shadowBlur?: number, hitPadding?: number, gradient?: number, gloss?: number, dashed?: boolean | [number], backing?: DisplayObject, rollBacking?: DisplayObject, rollPersist?: boolean, icon?: DisplayObject, rollIcon?: DisplayObject, toggle?: string, rollToggle?: DisplayObject, toggleEvent?: string, frame?: Frame, multiple?: boolean, accept?: [any], style?: boolean, group?: string, inherit?: {} })
2999
+ constructor(config_or_width?: number | string, height?: number | string, label?: string | Label, type?: string, backgroundColor?: color, rollBackgroundColor?: color, color?: color, rollColor?: color, borderColor?: color, rollBorderColor?: color, borderWidth?: number, corner?: number | any[], shadowColor?: color, shadowBlur?: number, hitPadding?: number, gradient?: number, gloss?: number, dashed?: boolean | [number], backing?: DisplayObject, rollBacking?: DisplayObject, rollPersist?: boolean, icon?: DisplayObject, rollIcon?: DisplayObject, toggle?: string, rollToggle?: DisplayObject, toggleEvent?: string, frame?: Frame, multiple?: boolean, accept?: [any], style?: boolean, group?: string, inherit?: {})
3000
+ constructor(config: { width?: number | string, height?: number | string, label?: string | Label, type?: string, backgroundColor?: color, rollBackgroundColor?: color, color?: color, rollColor?: color, borderColor?: color, rollBorderColor?: color, borderWidth?: number, corner?: number | any[], shadowColor?: color, shadowBlur?: number, hitPadding?: number, gradient?: number, gloss?: number, dashed?: boolean | [number], backing?: DisplayObject, rollBacking?: DisplayObject, rollPersist?: boolean, icon?: DisplayObject, rollIcon?: DisplayObject, toggle?: string, rollToggle?: DisplayObject, toggleEvent?: string, frame?: Frame, multiple?: boolean, accept?: [any], style?: boolean, group?: string, inherit?: {} })
3001
3001
  // ZIM Component Interface
3002
3002
  // dispose():boolean // now added to Container, etc.
3003
3003
  enabled: boolean