zimjs 17.2.8 → 17.2.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": "17.2.8",
3
+ "version": "17.2.9",
4
4
  "type": "module",
5
5
  "main": "./src/zim.js",
6
6
  "types": "./ts-src/typings/zim",
package/src/zim.js CHANGED
@@ -28956,8 +28956,10 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
28956
28956
  stageEvent = stage.on("stagemousemove", function (e) {
28957
28957
  // that.windowMouseX = e.stageX/zim.scaX;
28958
28958
  // that.windowMouseY = e.stageY/zim.scaY;
28959
- that.windowMouseX = stage.frame.mouseX;
28960
- that.windowMouseY = stage.frame.mouseY;
28959
+ if (stage && stage.frame) {
28960
+ that.windowMouseX = stage.frame.mouseX;
28961
+ that.windowMouseY = stage.frame.mouseY;
28962
+ }
28961
28963
  });
28962
28964
  });
28963
28965
 
@@ -31400,7 +31402,7 @@ zim.TextInput = function(width, height, placeholder, text, size, font, color, ba
31400
31402
  // that.dispatchEvent(e);
31401
31403
  });
31402
31404
  that.label.on("blinker", function () {
31403
-
31405
+
31404
31406
  // Pettis Brandon code '23
31405
31407
  var thatX = that.localToGlobal(0,0).x; // Get the global X of that.
31406
31408
  var thatFull = thatX + width-paddingH-label.blinker.width; // Get the global coordinates of the far right corner.
@@ -31669,6 +31671,7 @@ zim.TextInput.LabelInput = function(text, size, maxLength, password, selectionCo
31669
31671
  this.hiddenInput.pattern = "[^(0-9).\-+*/%$]*";
31670
31672
  this.hiddenInput.inputmode = "numeric";
31671
31673
  }
31674
+ var that = this;
31672
31675
 
31673
31676
  if (maxLength > 0) this.hiddenInput.maxLength = maxLength;
31674
31677
  this.hiddenInput.autocapitalize = "off";
@@ -31786,14 +31789,18 @@ zim.TextInput.LabelInput = function(text, size, maxLength, password, selectionCo
31786
31789
  this.hiddenInput.select();
31787
31790
  this.positionBlinkerAndSelection();
31788
31791
  }
31792
+ this.hiddenInput.addEventListener("paste", function() {
31793
+ setTimeout(function() {
31794
+ that.hiddenInput.setSelectionRange(that.hiddenInput.selectionStart, that.hiddenInput.selectionEnd, rtl?"forward":"backward");
31795
+ }, 50);
31796
+ });
31789
31797
  this.positionBlinkerAndSelection = function() {
31790
31798
  // ZIM NFT 01 Patch any le or rtl
31791
31799
  var le = this.text.length;
31792
31800
  if (this.focus) {
31793
31801
  var paddingH = this.backing || this.background ? this.paddingH : 0;
31794
31802
  var paddingV = this.backing || this.background ? this.paddingV : 0;
31795
-
31796
- if (this.hiddenInput.selectionStart !== this.hiddenInput.selectionEnd || le == 0) {
31803
+ if (this.hiddenInput.selectionStart !== this.hiddenInput.selectionEnd || le == 0) {
31797
31804
  var startX, endX;
31798
31805
  if (rtl) {
31799
31806
  startX = this.textWidthArray[le-this.hiddenInput.selectionStart]
@@ -95751,4 +95758,4 @@ export let Ticker = zim.Ticker;
95751
95758
  export let Style = zim.Style;
95752
95759
  export let assets = zim.assets;
95753
95760
  export let assetIDs = zim.assetIDs;
95754
- export let ZIMON = zim.ZIMON;
95761
+ export let ZIMON = zim.ZIMON;
@@ -3202,8 +3202,8 @@ declare namespace zim {
3202
3202
  constructor()
3203
3203
  }
3204
3204
  export class Layout extends createjs.EventDispatcher {
3205
- constructor(config_or_holder: Stage | Container, regions: {}[], lastMargin?: number | string, lastMarginMin?: number, backgroundColor?: color, vertical?: boolean, regionShape?: boolean, scalingObject?: Stage | Container, hideKey?: string, style?: boolean, group?: string, inherit?: {})
3206
- constructor(config: { holder: Stage | Container, regions: {}[], lastMargin?: number | string, lastMarginMin?: number, backgroundColor?: color, vertical?: boolean, regionShape?: boolean, scalingObject?: Stage | Container, hideKey?: string, style?: boolean, group?: string, inherit?: {} })
3205
+ constructor(config_or_holder: Stage | Container, regions: {}[], lastMargin?: number | string, lastMarginMin?: number, backgroundColor?: color, vertical?: boolean, showRegions?: boolean, scalingObject?: Stage | Container, hideKey?: string, style?: boolean, group?: string, inherit?: {})
3206
+ constructor(config: { holder: Stage | Container, regions: {}[], lastMargin?: number | string, lastMarginMin?: number, backgroundColor?: color, vertical?: boolean, showRegions?: boolean, scalingObject?: Stage | Container, hideKey?: string, style?: boolean, group?: string, inherit?: {} })
3207
3207
  resize(): void
3208
3208
  dispose(): boolean
3209
3209
  addShape(shape: Shape): void