zimjs 17.2.1 → 17.2.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.
@@ -1,6 +1,6 @@
1
1
  # These are supported funding model platforms
2
2
 
3
- github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
3
+ github: [danzen]
4
4
  patreon: zimjs
5
5
  open_collective: # Replace with a single Open Collective username
6
6
  ko_fi: # Replace with a single Ko-fi username
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zimjs",
3
- "version": "17.2.1",
3
+ "version": "17.2.3",
4
4
  "type": "module",
5
5
  "main": "./src/zim.js",
6
6
  "types": "./ts-src/typings/zim",
package/src/zim.js CHANGED
@@ -10816,16 +10816,16 @@ NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set
10816
10816
 
10817
10817
  EXAMPLE
10818
10818
  // slice a pic in four at 25% from the edges, scale the middle and keep the sides and corners not scaled.
10819
- new SlicedBitmap(1600, pic.height, pic, [0.25,0.75],[0.25,0.75]], [[0,1,0],[0,1,0])
10819
+ new SlicedBitmap(1600, pic.height, pic, [[0.25,0.75],[0.25,0.75]], [[0,1,0],[0,1,0]])
10820
10820
  .center()
10821
10821
  .transform({minScaleX:.05, minScaleY:.05});
10822
10822
  END EXAMPLE
10823
10823
 
10824
10824
  EXAMPLE
10825
10825
  // slice a pic in four at 25% from the edges, scale the middle and keep the sides and corners not scaled.
10826
- const pic = new Pic("car.png"); // preload this in Frame() or loadAssets()
10827
- const startSlices = [0.25,0.75],[0.25,0.75]];
10828
- const startTypes = [[0,2,0],[0,1,0]; // middle is tiled horizontally and stretched vertically
10826
+ const pic = new Pic("pic.png"); // preload this in Frame() or loadAssets()
10827
+ const startSlices = [[0.25,0.75],[0.25,0.75]];
10828
+ const startTypes = [[0,2,0],[0,1,0]]; // middle is tiled horizontally and stretched vertically
10829
10829
  const slicer = new Slicer({
10830
10830
  obj:pic.clone(), // slicer will adjust obj so clone the pic so can use it unaffected later
10831
10831
  scale:.5,
@@ -17592,36 +17592,35 @@ Note the points property has been split into points and pointObjects (and there
17592
17592
  };
17593
17593
 
17594
17594
  // squiggle
17595
- if (that.interactive) {
17596
- if (move) shape.drag({onTop:false});
17597
- moveDownEvent = shape.on("mousedown", function(e) {
17598
- stage = e.target.stage;
17599
- startPosition = {x:shape.x, y:shape.y};
17600
- if (that.selectPoints) that.keyFocus = true;
17601
- upTop();
17602
- });
17603
- movePressEvent = shape.on("pressmove", function() {
17604
- sets.x = shape.x;
17605
- sets.y = shape.y;
17606
- sticks.x = shape.x;
17607
- sticks.y = shape.y;
17608
- });
17609
- moveUpEvent = shape.on("pressup", function() {
17610
- var moveControlCheck = (shape.x != startPosition.x || shape.y != startPosition.y);
17611
- var movePoint = shape.localToLocal(that.regX,that.regY,that.parent);
17612
- that.x = movePoint.x;
17613
- that.y = movePoint.y;
17614
- sets.x = sets.y = sticks.x = sticks.y = shape.x = shape.y = 0;
17615
- if (moveControlCheck) {
17616
- var ev = new createjs.Event("change");
17617
- ev.controlType = "move";
17618
- that.dispatchEvent(ev);
17619
- }
17620
- if (stage) stage.update();
17621
- });
17595
+ if (that.interactive && move) shape.drag({onTop:false});
17596
+ moveDownEvent = shape.on("mousedown", function(e) {
17597
+ stage = e.target.stage;
17598
+ startPosition = {x:shape.x, y:shape.y};
17599
+ if (that.selectPoints) that.keyFocus = true;
17600
+ upTop();
17601
+ });
17602
+ movePressEvent = shape.on("pressmove", function() {
17603
+ sets.x = shape.x;
17604
+ sets.y = shape.y;
17605
+ sticks.x = shape.x;
17606
+ sticks.y = shape.y;
17607
+ });
17608
+ moveUpEvent = shape.on("pressup", function() {
17609
+ var moveControlCheck = (shape.x != startPosition.x || shape.y != startPosition.y);
17610
+ var movePoint = shape.localToLocal(that.regX,that.regY,that.parent);
17611
+ that.x = movePoint.x;
17612
+ that.y = movePoint.y;
17613
+ sets.x = sets.y = sticks.x = sticks.y = shape.x = shape.y = 0;
17614
+ if (moveControlCheck) {
17615
+ var ev = new createjs.Event("change");
17616
+ ev.controlType = "move";
17617
+ that.dispatchEvent(ev);
17618
+ }
17619
+ if (stage) stage.update();
17620
+ });
17622
17621
 
17623
- if (!that.move) stopDragging(true); // true is first time
17624
- }
17622
+ if (!that.move) stopDragging(true); // true is first time
17623
+
17625
17624
 
17626
17625
  function upTop() {
17627
17626
  if (that.onTop) {
@@ -27649,7 +27648,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
27649
27648
  if (replace) that.contentContainer.removeAllChildren();
27650
27649
  if (center) obj.center(that.contentContainer, index);
27651
27650
  else obj.addTo(that.contentContainer, index);
27652
- addHTML(that.contentContainer);
27651
+ // addHTML(that.contentContainer);
27653
27652
  return that;
27654
27653
  }
27655
27654
 
@@ -31527,10 +31526,10 @@ zim.TextInput = function(width, height, placeholder, text, size, font, color, ba
31527
31526
  },
31528
31527
  set: function(value) {
31529
31528
  readOnly = value;
31530
- that.htmlTag.setAttribute("readonly", readOnly);
31529
+ that.htmlTag.readOnly = readOnly;
31531
31530
  }
31532
31531
  });
31533
- if (readOnly) that.readOnly = true;
31532
+ if (readOnly) that.htmlTag.readOnly = true;
31534
31533
 
31535
31534
  Object.defineProperty(that, 'focus', {
31536
31535
  get: function() {
@@ -32145,9 +32144,10 @@ list - (default Options 1-30) an array of strings, numbers or zim Label objects
32145
32144
  note: the Accordion List is currently incompatible with the Organizer, addTo() and removeFrom()
32146
32145
  viewNum - (default 5) how many items to show in the width and height provided
32147
32146
  adjusting this number will also change the overall scale of custom items for horizontal lists
32148
- (this does not affect vertical lists due to the way vertical tabs are optimized)
32147
+ (this does not affect vertical lists due to the way vertical tabs are optimized)
32149
32148
  or see the noScale parameter to avoid scaling custom items in horizontal lists
32150
32149
  if no items are provided to start but rather added with addAt() then choose a viewNum that roughly matches how many items will fit in the view
32150
+ Note - the items will not be scaled larger by a viewNum setting... only scaled smaller.
32151
32151
  vertical - (default true) set to false to make a horizontal list
32152
32152
  currentSelected - (default false) set to true to show the current selection as highlighted
32153
32153
  align - (default CENTER) horizontal align
@@ -32172,8 +32172,8 @@ borderColor - (default silver) border color
32172
32172
  borderWidth - (default 1) the thickness of the border
32173
32173
  padding - (default 0) places the content in from edges of border (see paddingH and paddingV)
32174
32174
  corner - (default 0) is the rounded corner of the list (does not accept corner array - scrollBars are too complicated)
32175
- swipe - (default auto/true) the direction for swiping set to none / false for no swiping
32176
- also can set swipe to just vertical or horizontal
32175
+ swipe - (default AUTO/true) the direction for swiping set to NONE / false for no swiping
32176
+ also can set swipe to just VERTICAL or HORIZONTAL
32177
32177
  scrollBarActive - (default true) shows scrollBar (set to false to not)
32178
32178
  scrollBarDrag - (default true) set to false to not be able to drag the scrollBar
32179
32179
  scrollBarColor - (default borderColor) the color of the scrollBar
@@ -34085,18 +34085,23 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
34085
34085
 
34086
34086
  if (zot(align)) align = DS.align!=null?DS.align:"center";
34087
34087
  if (zot(spacing)) spacing = DS.spacing!=null?DS.spacing:2;
34088
- if (zot(backgroundColor)) backgroundColor = DS.backgroundColor!=null?DS.backgroundColor:zim.tin;
34088
+ if (zot(backgroundColor)) backgroundColor = DS.backgroundColor!=null?DS.backgroundColor:zim.tin;
34089
34089
  if (zot(rollBackgroundColor)) rollBackgroundColor = DS.rollBackgroundColor!=null?DS.rollBackgroundColor:zim.grey;
34090
34090
  if (zot(selectedBackgroundColor)) selectedBackgroundColor = DS.selectedBackgroundColor!=null?DS.selectedBackgroundColor:zim.charcoal;
34091
34091
  if (zot(selectedRollBackgroundColor)) selectedRollBackgroundColor = DS.selectedRollBackgroundColor!=null?DS.selectedRollBackgroundColor:zim.grey;
34092
- if (zot(color)) color = DS.color!=null?DS.color:zim.white;
34092
+ if (zot(color)) color = DS.color!=null?DS.color:zim.white;
34093
34093
  if (zot(rollColor)) rollColor = DS.rollColor!=null?DS.rollColor:color;
34094
34094
  if (zot(selectedColor)) selectedColor = DS.selectedColor!=null?DS.selectedColor:color;
34095
34095
  if (zot(selectedRollColor)) selectedRollColor = DS.selectedRollColor!=null?DS.selectedRollColor:rollColor;
34096
34096
 
34097
34097
  var c = new zim.Container();
34098
34098
  c.type = "CheckItem";
34099
- c.checkBox = new zim.CheckBox({size:size, label:label, color:color, tap:true}),
34099
+ label = zik(label);
34100
+ rollColor = zik(rollColor);
34101
+ selectedColor = zik(selectedColor);
34102
+ rollBackgroundColor = zik(rollBackgroundColor);
34103
+
34104
+ c.checkBox = new zim.CheckBox({size:size, label:label, color:color, tap:true});
34100
34105
  c.backing = new zim.Rectangle(width-spacing*2, c.checkBox.height+paddingV*2, backgroundColor).addTo(c);
34101
34106
  c.checkBox.center(c);
34102
34107
  if (align != "center" && align != "middle") c.checkBox.pos(paddingH,null,align=="right");
@@ -36411,7 +36416,7 @@ NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set
36411
36416
 
36412
36417
  EXAMPLE
36413
36418
  // slice a pic in four at 25% from the edges, scale the middle and keep the sides and corners not scaled.
36414
- const pic = new Pic("car.png"); // preload this in Frame() or loadAssets()
36419
+ const pic = new Pic("pic.png"); // preload this in Frame() or loadAssets()
36415
36420
  const slicer = new Slicer({
36416
36421
  obj:pic.clone(), // slicer will adjust obj so clone the pic so can use it unaffected later
36417
36422
  scale:.5,
@@ -36422,7 +36427,7 @@ const slicer = new Slicer({
36422
36427
 
36423
36428
  slicer.on("loaded", ()=>{
36424
36429
  if (preview) preview.dispose();
36425
- preview = new zim.SlicedBitmap(1600, 600, slicer.obj.clone(), slicer.slices, slicer.types, 2, .5)
36430
+ preview = new SlicedBitmap(1600, 600, slicer.obj.clone(), slicer.slices, slicer.types, 2, .5)
36426
36431
  .pos(0,100,CENTER,BOTTOM)
36427
36432
  .transform({minScaleX:.05, minScaleY:.05});
36428
36433
  });
@@ -36948,6 +36953,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
36948
36953
  loader.resize();
36949
36954
  }
36950
36955
  adjustBoxes();
36956
+
36951
36957
  if (obj.width) {
36952
36958
  obj.scaleTo(that.box,100,100).loc(0,0,sc,0);
36953
36959
  that.stage.update();
@@ -36956,7 +36962,8 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
36956
36962
  obj.scaleTo(that.box,100,100).loc(0,0,sc,0);
36957
36963
  that.stage.update();
36958
36964
  }, 50);
36959
- }
36965
+ }
36966
+
36960
36967
  }
36961
36968
  if (resize) {
36962
36969
  that.resizeHandle.on("pressup", function() {
@@ -37158,7 +37165,7 @@ NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set
37158
37165
 
37159
37166
  EXAMPLE
37160
37167
  // slice a pic in four at 25% from the edges, scale the middle and keep the sides and corners not scaled.
37161
- const pic = new Pic("car.png"); // preload this in Frame() or loadAssets()
37168
+ const pic = new Pic("pic.png"); // preload this in Frame() or loadAssets()
37162
37169
  const slicer = new Slicer({
37163
37170
  obj:pic.clone(), // slicer will adjust obj so clone the pic so can use it unaffected later
37164
37171
  scale:.5,
@@ -51215,6 +51222,8 @@ RETURNS obj for chaining
51215
51222
  target.addAt(placeObject, target.dropReticleIndex);
51216
51223
 
51217
51224
  target.dropItem = dragObject;
51225
+ dragObject.droppedTarget = target;
51226
+ dragObject.dropTarget = target;
51218
51227
  target.dropList = target;
51219
51228
  target.dropNewIndex = target.dropReticleIndex;
51220
51229
  target.dropReticleIndex = null;
@@ -51239,6 +51248,7 @@ RETURNS obj for chaining
51239
51248
  else placeObject.mouse();
51240
51249
  if (dropFull) target.dropFull = true;
51241
51250
  placeObject.droppedTarget = target;
51251
+ placeObject.dropTarget = target;
51242
51252
  return false;
51243
51253
  }
51244
51254
  }
@@ -53913,7 +53923,7 @@ Dynamically changes or adds a boundary rectangle to the object being dragged wit
53913
53923
 
53914
53924
  EXAMPLE
53915
53925
  const boundary = new Boundary(100,100,500,400); // x,y,w,h
53916
- circle.gestureBoundary(boundary);
53926
+ new Circle().center().gestureBoundary(boundary);
53917
53927
  END EXAMPLE
53918
53928
 
53919
53929
  PARAMETERS
@@ -93300,9 +93310,11 @@ Or, the Three class can be used to help show ZIM in threejs
93300
93310
  as an interactive and animated canavs texture.
93301
93311
  See also TextureActive and TextureActives in the main ZIM docs.
93302
93312
 
93313
+ See: https://zimjs.com/three - for the mini-site with three.js
93314
+
93303
93315
  three.js examples - with three.js inside ZIM
93304
93316
  https://zimjs.com/bits/view/three.html
93305
- https://zimjs.com/three/
93317
+ https://zimjs.com/capture/three/
93306
93318
  https://codepen.io/zimjs/pen/abzXeZX
93307
93319
  https://codepen.io/zimjs/pen/qGPVqO
93308
93320