zimjs 19.0.7 → 19.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zimjs",
3
- "version": "19.0.7",
3
+ "version": "19.0.9",
4
4
  "type": "module",
5
5
  "main": "./src/zim.js",
6
6
  "types": "./ts-src/typings/zim",
package/src/zim.js CHANGED
@@ -28529,6 +28529,8 @@ content - (default " ") optional content to be centered in one of three formats:
28529
28529
  spacingV - vertical space between the content areas
28530
28530
  align - default CENTER, or use LEFT or RIGHT
28531
28531
  backgroundColor - (default white) a css color for the background of the Pane
28532
+ to set the backgroundColor after the Pane is made, use the backing property
28533
+ pane.backing.backgroundColor = red;
28532
28534
  color - (default black) a css color for the text color of the Pane
28533
28535
  width - (default AUTO) width of pane - AUTO will matches content width - see also autoPadding and autoPaddingH
28534
28536
  height - (default AUTO) height of pane - AUTO will matches content width - see also autoPadding and autoPaddingV
@@ -28608,6 +28610,8 @@ type - holds the class name as a String
28608
28610
  closeCall - a function to call when the pane closes (see also call parameter of show method)
28609
28611
  closeParams - an object to pass to the closeCall (see also params parameter of show method)
28610
28612
  backing - or display - reference to the pane box
28613
+ use this to set the color, border, etc. afterwards
28614
+ pane.backing.color = red;
28611
28615
  contentContainer - ZIM Container used to hold added content (formerly the content property)
28612
28616
  use the add() method or add directly to the contentContainer property of the pane
28613
28617
  content - gives access to the content provided as a parameter to the Pane()
@@ -58985,6 +58989,8 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
58985
58989
 
58986
58990
  if (zot(o.props) && !zot(o.obj)) o.props = o.obj;
58987
58991
  o.obj = o.props;
58992
+ if (o.loopCall || o.loopWait || o.loopPick || o.loopCount) o.loop = true;
58993
+ if (o.rewindCall || o.rewindWait || o.rewindPick || o.rewindTime || o.rewindEase) o.rewind = true;
58988
58994
  if (o.loop && (zot(o.loopCount) || o.loopCount <= 0)) {
58989
58995
  o.loopCount = 0;
58990
58996
  // this object is looping forever so no point in keeping any next objects
@@ -63723,8 +63729,11 @@ PATH
63723
63729
  zim global variable
63724
63730
 
63725
63731
  DESCRIPTION
63726
- PATH is used by lazy-loaded assets (not using Frame assets parameter or loadAssets() method).
63727
- This will be set by default to the latest path parameter in Frame or in loadAssets().
63732
+ PATH can be used to set the URL path to assets for Pic(), Aud(), etc.
63733
+ This only works with lazy-loaded assets so assets not using the Frame() or loadAssets() assets and path parameter.
63734
+ PATH is set by default to the latest path parameter in Frame or in loadAssets().
63735
+
63736
+ NOTE: this is NOT paths for ZIM Blobs and Squiggles https://zimjs.com/paths - that is something else.
63728
63737
 
63729
63738
  NOTE: if an lazy-loaded asset has a path in it (as in a /) then the PATH will be ignored.
63730
63739
 
@@ -63735,7 +63744,7 @@ EXAMPLE
63735
63744
  new Pic("image.png").center(); // will look in local directory
63736
63745
  new Pic("images/image.png").center(); // will look in images/ directory
63737
63746
 
63738
- PATH = "assets/";
63747
+ PATH = "assets/"; // or could be an absolute URL like "https://zimjs.org/assets/"
63739
63748
  new Pic("image.png").center(); // will look in assets/ directory
63740
63749
  new Pic("sound.mp3").play(); // will look in assets/ directory
63741
63750
  new Pic("test/image.png").center(); // will look in test/ directory
@@ -67872,8 +67881,7 @@ setSpacing(h,v) - set spacings for Tile - h and v are horizontal and vertical sp
67872
67881
  ZIM Tile() makes spacing arrays for horizontal and vertical spacing based on ZIM VEE calculations from the spacingH and spacingV parameters
67873
67882
  to change spacing afterwards, new arrays can be provided to setSpacing()
67874
67883
  the arrays must have col-1 and row-1 items - although h or v can be left null or undefined to keep existing spacing
67875
- remake(items, newSpacingH, newSpacingV, newCount) - pass in an array of items to tile - see items property for editing current list - returns tile for chaining
67876
- can also change rows and cols and remake()
67884
+ remake(items, newSpacingH, newSpacingV, newCount, newCols, newRows) - pass in an array of items to tile - see items property for editing current list - returns tile for chaining
67877
67885
  optionally pass in new spacing parameters (these accept ZIM VEE values) and/or a newCount
67878
67886
  Note: if the items length is different than the previous items length then the count will be automatically made cols*rows - unless newCount is provided
67879
67887
  resize(width, height) - resize the tile with new width and/or height if the width and/or height parameters were set - returns tile for chaining
@@ -67913,8 +67921,7 @@ These properties can be changed by calling remake()
67913
67921
  items - an array of items the tile uses
67914
67922
  modify this and pass in to remake(items) to update the Tile with new items
67915
67923
  cannot modify count - count will become the length of the array passed to remake()
67916
- cols - number of columns - can modify - need to call remake() to see changes
67917
- rows - number of rows - can modify - need to call remake() to see changes
67924
+ cols / rows - (read only) use newCols and newRows parameter of remake()
67918
67925
  These properties can be changed by calling resize(width, height) - set width or height to 0 for no spreading
67919
67926
  squeezeH - horizontal compression - can modify - need to call resize() to see changes
67920
67927
  squeezeV - vertical compression - can modify - need to call resize() to see changes
@@ -67979,6 +67986,11 @@ note: the item is not the event object target - as that is the tile
67979
67986
  if (zot(count)) count = DS.count!=null?DS.count:(unique&&Array.isArray(obj))?obj.length:null;
67980
67987
  if (count === 0) {count = null; if (zon) {zogy("ZIM Tile() - count parameter of 0 is ignored - see docs");}}
67981
67988
 
67989
+ // Added ZIM 019 Patch
67990
+
67991
+ var colsO = cols;
67992
+ var rowsO = rows;
67993
+
67982
67994
  // Added ZIM 018
67983
67995
 
67984
67996
  var spacingHList = [];
@@ -68461,14 +68473,32 @@ note: the item is not the event object target - as that is the tile
68461
68473
  return that.items2D[ro][co];
68462
68474
  };
68463
68475
 
68464
- this.remake = function(items, newSpacingH, newSpacingV, newCount) {
68476
+ this.remake = function(items, newSpacingH, newSpacingV, newCount, newCols, newRows) {
68465
68477
 
68466
68478
  // a little complicated so we just remake the spacings if provided or items length has gotten bigger
68467
68479
  // if items length is different we create a new count - can override with newCount
68468
68480
  if (zot(items)) items = that.items
68469
68481
  if (zot(newCount) && items.length != that.items.length) count = that.cols*that.rows;
68470
- if (!zot(newSpacingH) || !zot(newSpacingV) || items.length > that.items.length) {
68482
+ if (
68483
+ !zot(newSpacingH) ||
68484
+ !zot(newSpacingV) ||
68485
+ items.length > that.items.length ||
68486
+ (!zot(newCols) && newCols != that.cols) ||
68487
+ (!zot(newRows) && newRows != that.rows)
68488
+ ) {
68471
68489
 
68490
+ if (!zot(newCols)) colsO = newCols;
68491
+ if (!zot(newRows)) rowsO = newRows;
68492
+ if (colsO <= 0) colsO = 1;
68493
+ if (rowsO <= 0) rowsO = 1;
68494
+
68495
+ if (!zot(newCount)) count = newCount
68496
+ else count = items.length;
68497
+
68498
+ if (count > colsO) that.cols = colsO;
68499
+ else that.cols = count;
68500
+ that.rows = Math.ceil(count/that.cols);
68501
+
68472
68502
  if (!zot(newSpacingH)) spacingH = newSpacingH;
68473
68503
  if (!zot(newSpacingV)) spacingV = newSpacingV;
68474
68504
 
@@ -68667,7 +68697,7 @@ note: the item is not the event object target - as that is the tile
68667
68697
  if (!resize && backing) backings = [];
68668
68698
 
68669
68699
  var lastX = (colSize?(spacingHOList[0]?spacingHOList[0]:0):0)/2;
68670
- var lastY = (rowSize?(spacingHOList[0]?spacingHOList[0]:0):0)/2;
68700
+ var lastY = (rowSize?(spacingVOList[0]?spacingVOList[0]:0):0)/2; // updated to VO from HO - ZIM 019 patch
68671
68701
 
68672
68702
  var rect;
68673
68703
  var cou = 0;
@@ -90766,9 +90796,9 @@ leftMouseDown - read only value as to whether the left mouse button is down
90766
90796
  mousedownEvent - a reference to the frame "stagemousedown" event - can set F.off("stagemousedown", F.mousedownEvent)
90767
90797
  mousemoveEvent - a reference to the frame "stagemousemove" event - can set F.off("stagemousemove", F.mousemoveEvent)
90768
90798
  orientation - VERTICAL or HORIZONTAL (updated live with orientation change)
90769
- visibleLeft, visibleTop, visibleRight, visibleBottom - in "fill" scale mode these give window edge locations relative to the stage
90799
+ visibleLeft, visibleTop, visibleRight, visibleBottom - in FILL scale mode these give window edge locations relative to the stage
90770
90800
  can be used to position items like navigation relative to window as the frame resize event is fired
90771
- in all scale modes other than "fill", the values are 0, W, 0, H
90801
+ in all scale modes other than FILL, the values are 0, W, 0, H
90772
90802
  zil - reference to zil events that stop canvas from shifting or scrolling - also see allowDefault parameter
90773
90803
  can set allowDefault property to false then allow specific defaults by removing zil events - see zil global function
90774
90804
  example: window.removeEventListener("keydown", F.zil[0]); removes keydown preventions (for page up, page down, home, end, etc)
@@ -90778,10 +90808,10 @@ touch - get or set the touch setting - setting to false will not allow touch on
90778
90808
  singleTouch - get or set the singleTouch setting - set to true to turn on single touch and false to turn on multitouch
90779
90809
  setting either true or false will set the touch property to true
90780
90810
  also see the touch and singleTouch parameters and touch property
90781
- followBoundary - update with a ZIM Boundary for follow() if "full" mode Frame "resize" event happens, etc.
90811
+ followBoundary - update with a ZIM Boundary for follow() if FULL mode Frame "resize" event happens, etc.
90782
90812
  altKey - true if the alt key is being pressed otherwise false
90783
90813
  ctrlKey - true if the ctrl key is being pressed otherwise false
90784
- metaKey - true if the meta key (⌘ command on Mac or ⊞ windows key) is being pressed otherwise false
90814
+ metaKey - true if the meta key (command on Mac or windows key) is being pressed otherwise false
90785
90815
  shiftKey - true if the shift key is being pressed otherwise false
90786
90816
  loadFailObj - the object that shows if images are broken - will be given a type property of "EmptyAsset"
90787
90817
  startTime - datestamp of when frame was made - used internally
@@ -102619,6 +102649,8 @@ spacingH - (default 0) a spacing between columns
102619
102649
  spacingV - (default 0) a spacing between rows
102620
102650
  interval - (default 0) the time to animate in s
102621
102651
  for pixels, noise, dots and bling this is the time between showing different patterns
102652
+ Note: if using a series() for color, this will only animate if the total number of cols x rows
102653
+ is NOT divisable equally by the number of colors in the series
102622
102654
  for stripes, slants, hatch, plaid this is the time to move the pattern to the right
102623
102655
  different patterns may seem to move at different speeds due to the pattern repeat distance
102624
102656
  startPaused - (default false) set to true to start the interval for animation to paused
@@ -102781,6 +102813,7 @@ for (z_i = 0; z_i < globalFunctions.length; z_i++) {
102781
102813
  ["END", zim.END],
102782
102814
  ["TOP", zim.TOP],
102783
102815
  ["BOTTOM", zim.BOTTOM],
102816
+ ["BOT", zim.BOT],
102784
102817
  ["OVER", zim.OVER],
102785
102818
  ["UNDER", zim.UNDER],
102786
102819
  ["HORIZONTAL", zim.HORIZONTAL],
@@ -103163,3 +103196,4 @@ export let Style = zim.Style;
103163
103196
  export let assets = zim.assets;
103164
103197
  export let assetIDs = zim.assetIDs;
103165
103198
  export let ZIMON = zim.ZIMON;
103199
+
@@ -3380,7 +3380,7 @@ declare namespace zim {
3380
3380
  export class Tile extends Container {
3381
3381
  constructor(config_or_obj: DisplayObject | zimVee, cols?: number, rows?: number, spacingH?: number, spacingV?: number, unique?: boolean, width?: number, height?: number, squeezeH?: boolean, squeezeV?: boolean, colSize?: number | zimVee, rowSize?: number | zimVee, align?: string | zimVee, valign?: string | zimVee, count?: number, mirrorH?: boolean, mirrorV?: boolean, snapToPixel?: boolean, clone?: boolean, events?: boolean, exact?: boolean, scaleToH?: number | zimVee, scaleToV?: number | zimVee, scaleToType?: string | zimVee, backgroundColor?: color | zimVee, backing?: DisplayObject | zimVee, backdropColor?: color | zimVee, backdropPadding?: number, backdropPaddingH?: number, backdropPaddingV?: number, mat?: DisplayObject, style?: boolean, group?: string, inherit?: {})
3382
3382
  constructor(config: { obj: DisplayObject | zimVee, cols?: number, rows?: number, spacingH?: number, spacingV?: number, unique?: boolean, width?: number, height?: number, squeezeH?: boolean, squeezeV?: boolean, colSize?: number | zimVee, rowSize?: number | zimVee, align?: string | zimVee, valign?: string | zimVee, count?: number, mirrorH?: boolean, mirrorV?: boolean, snapToPixel?: boolean, clone?: boolean, events?: boolean, exact?: boolean, scaleToH?: number | zimVee, scaleToV?: number | zimVee, scaleToType?: string | zimVee, backgroundColor?: color | zimVee, backing?: DisplayObject | zimVee, backdropColor?: color | zimVee, backdropPadding?: number, backdropPaddingH?: number, backdropPaddingV?: number, mat?: DisplayObject, style?: boolean, group?: string, inherit?: {} })
3383
- remake(items?: any[]): this
3383
+ remake(items?: any[], newSpacingH?: number, newSpacingV?: number, newCount?: number, newCols?: number, newRows?: number): this
3384
3384
  resize(width?: number, height?: number): this
3385
3385
  setProps(obj: [], props: {}): this
3386
3386
  itemUnderPoint(x: number, y: number, ignoreSpacing?: boolean): DisplayObject
@@ -3391,8 +3391,8 @@ declare namespace zim {
3391
3391
  readonly current: any[]
3392
3392
  readonly current2D: any[]
3393
3393
  readonly current2DCols: any[]
3394
- cols: number
3395
- rows: number
3394
+ readonly cols: number
3395
+ readonly rows: number
3396
3396
  spacingH: number
3397
3397
  spacingV: number
3398
3398
  squeezeH: boolean