zimjs 18.1.3 → 18.1.5
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 +1 -1
- package/src/zim.js +27 -15
package/package.json
CHANGED
package/src/zim.js
CHANGED
|
@@ -26688,7 +26688,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
26688
26688
|
//-56
|
|
26689
26689
|
|
|
26690
26690
|
/*--
|
|
26691
|
-
zim.RadioButtons = function(size, buttons, vertical, color, backgroundColor, spacing, margin, always, indicatorColor, index, rtl, selectedIndex, style, group, inherit)
|
|
26691
|
+
zim.RadioButtons = function(size, buttons, vertical, color, backgroundColor, borderColor, borderWidth, spacing, margin, always, indicatorColor, index, rtl, selectedIndex, style, group, inherit)
|
|
26692
26692
|
|
|
26693
26693
|
RadioButtons
|
|
26694
26694
|
zim class - extends a zim.Container which extends a createjs.Container
|
|
@@ -51581,6 +51581,7 @@ To give a more responsive single tap it reduces the default dblTime value
|
|
|
51581
51581
|
|
|
51582
51582
|
NOTE: tap() ignores List titleBar and organizer as to not conflict with tapping on actual list
|
|
51583
51583
|
NOTE: set an object's noTap property to true to avoid activating a hold on an object
|
|
51584
|
+
NOTE: use mobileUp:true for tapping to use Speech talk() as Apple currently does not talk on mousedown - sigh.
|
|
51584
51585
|
|
|
51585
51586
|
SEE: noTap() as well
|
|
51586
51587
|
|
|
@@ -57280,7 +57281,7 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
|
|
|
57280
57281
|
loopWait = zim.Pick.choose(loopWait);
|
|
57281
57282
|
rewind = zim.Pick.choose(rewind);
|
|
57282
57283
|
rewindWait = zim.Pick.choose(rewindWait);
|
|
57283
|
-
if (zot(rewindTime)) rewindTime = time;
|
|
57284
|
+
if (rewind && zot(rewindTime)) rewindTime = time;
|
|
57284
57285
|
else rewindTime = zim.Pick.choose(rewindTime);
|
|
57285
57286
|
sequenceReverse = zim.Pick.choose(sequenceReverse);
|
|
57286
57287
|
from = zim.Pick.choose(from);
|
|
@@ -57400,6 +57401,7 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
|
|
|
57400
57401
|
var extraTypes = ["extra", "zoom", "speed", "layer", "fade"];
|
|
57401
57402
|
var extraLookup = {zoom:target.type=="Pen"?"size":"scale", speed:"percentSpeed", layer:"layer", fade:"alpha"};
|
|
57402
57403
|
|
|
57404
|
+
|
|
57403
57405
|
if (target instanceof Array) {
|
|
57404
57406
|
if (sequenceReverse) target.reverse();
|
|
57405
57407
|
|
|
@@ -57439,7 +57441,7 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
|
|
|
57439
57441
|
var seqTime = i*sequence;
|
|
57440
57442
|
if (i==0 && sequence!=0) seqTime = timeType=="s"?.02:20; // patched in 10.7.0 and 10.7.1
|
|
57441
57443
|
|
|
57442
|
-
// zim.animate(tar, tar.zimObj, time, ease, (i==target.length-1?call:null), (i==target.length-1?params:null)
|
|
57444
|
+
// zim.animate(tar, tar.zimObj, time, ease, (i==target.length-1?call:null), (i==target.length-1?params:null)
|
|
57443
57445
|
zim.animate(tar, tar.zimObj, time, ease, (i==target.length-1?sequenceDone:null), null, wait, waitedCall, waitedParams, null, null, null, null, null, null, null, loopPick, null, null, null, null, null, null, rewindTime, rewindEase, startCall, startParams, animateCall, animateParams, null, sequenceCall, sequenceParams, null, null, ticker, zim.copy(cjsProps), css, protect, override, null, set, id, events, sequenceTarget, dynamic, drag, clamp, startPaused, clean, obj, seriesWait, seqTime, rrr, pauseOnBlur, easeAmount, easeFrequency, timeUnit, timeCheck, noAnimateCall, pathDamp, rewindPick); // do not send from!
|
|
57444
57446
|
|
|
57445
57447
|
}
|
|
@@ -66604,9 +66606,10 @@ note: the item is not the event object target - as that is the tile
|
|
|
66604
66606
|
that.rows = rows = Math.round(rows);
|
|
66605
66607
|
that.squeezeH = squeezeH;
|
|
66606
66608
|
that.squeezeV = squeezeV;
|
|
66607
|
-
var VEEAlign = (
|
|
66608
|
-
var VEEVAlign = (
|
|
66609
|
-
|
|
66609
|
+
var VEEAlign = zim.isPick(align)
|
|
66610
|
+
var VEEVAlign = zim.isPick(valign);
|
|
66611
|
+
|
|
66612
|
+
// these two are used only for not ZIM VEE - as VEE with Squeeze is not supported
|
|
66610
66613
|
that.align = VEEAlign?"left":align;
|
|
66611
66614
|
that.valign = VEEVAlign?"top":valign;
|
|
66612
66615
|
that.mirrorH = mirrorH;
|
|
@@ -66728,6 +66731,7 @@ note: the item is not the event object target - as that is the tile
|
|
|
66728
66731
|
scalesX[j].push(tile.scaleX);
|
|
66729
66732
|
scalesY[j].push(tile.scaleY);
|
|
66730
66733
|
if (colSize&&zot(width)) w = zim.Pick.choose(colSize);
|
|
66734
|
+
|
|
66731
66735
|
if (j==0) finalAlign.push(zim.Pick.choose(align));
|
|
66732
66736
|
|
|
66733
66737
|
// needs projected width and height on the tile
|
|
@@ -66907,7 +66911,7 @@ note: the item is not the event object target - as that is the tile
|
|
|
66907
66911
|
}
|
|
66908
66912
|
tile.pos(colTotal, null);
|
|
66909
66913
|
|
|
66910
|
-
if (!that.squeezeH && VEEAlign) {
|
|
66914
|
+
if (!that.squeezeH && VEEAlign) {
|
|
66911
66915
|
if (zot(width) && (align=="center" || align=="middle")) {
|
|
66912
66916
|
tile.x += (widthMax[i]-tile.fW)/2;
|
|
66913
66917
|
} else if (zot(width) && align=="right") {
|
|
@@ -90858,14 +90862,18 @@ SEE: https://zimjs.com/016/speech.html
|
|
|
90858
90862
|
|
|
90859
90863
|
NOTE: The listen() method is currently not supported by Apple iOS Web - only Native apps (grr)
|
|
90860
90864
|
But the talk() method works on iOS and Android Web - however, there seems to be one voice.
|
|
90865
|
+
NOTE: The talk() method on iOS currently does not work on mousedown - so use mobileUp:true on tap() or a pressup event
|
|
90861
90866
|
|
|
90862
90867
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
90863
90868
|
|
|
90864
90869
|
EXAMPLE
|
|
90865
90870
|
const speech = new Speech();
|
|
90866
90871
|
// interact at least once before talking
|
|
90867
|
-
new Button({label:"TALK"}).center().tap(
|
|
90868
|
-
|
|
90872
|
+
new Button({label:"TALK"}).center().tap({
|
|
90873
|
+
call:()=>{
|
|
90874
|
+
speech.talk("Hello World");
|
|
90875
|
+
},
|
|
90876
|
+
mobileUp:true // talk() on iOS does not seem to work on mousedown - or use pressup event on Button
|
|
90869
90877
|
});
|
|
90870
90878
|
END EXAMPLE
|
|
90871
90879
|
|
|
@@ -90873,8 +90881,11 @@ EXAMPLE
|
|
|
90873
90881
|
// let user pick a voice
|
|
90874
90882
|
const speech = new Speech();
|
|
90875
90883
|
// interact at least once before talking
|
|
90876
|
-
new Button({label:"TALK"}).center().mov(0,-120).tap(
|
|
90877
|
-
|
|
90884
|
+
new Button({label:"TALK"}).center().mov(0,-120).tap({
|
|
90885
|
+
call:()=>{
|
|
90886
|
+
speech.talk("Hello World!", list?list.text:null);
|
|
90887
|
+
},
|
|
90888
|
+
mobileUp:true // talk() on iOS does not seem to work on mousedown - or use pressup event on Button
|
|
90878
90889
|
});
|
|
90879
90890
|
let list;
|
|
90880
90891
|
speech.on("voiceschanged", ()=>{ // must wait for voices to be loaded
|
|
@@ -90900,6 +90911,7 @@ END EXAMPLE
|
|
|
90900
90911
|
METHODS
|
|
90901
90912
|
talk(text, voice, volume, lang, rate, pitch) - the computer will say the words
|
|
90902
90913
|
returns an utterance object on which all these parameter can be dynamically set including the words
|
|
90914
|
+
note: currently, talk() does not work on mousedown on iOS so use pressup events or set tap to mobileUp:true
|
|
90903
90915
|
text - the text to say (or see Web Speech API for special formats)
|
|
90904
90916
|
voice (default "Microsoft David - English (United States)") - the voice
|
|
90905
90917
|
also see "voiceschanged" event at which point speech.voices will be a list
|
|
@@ -90938,7 +90950,8 @@ dispatches "result" when either as each word is spoken if listen() is used (inte
|
|
|
90938
90950
|
and a confidence property that is a ratio (0-1) for confidence in the result
|
|
90939
90951
|
Note: iOS (at this time) does not support the listen() and result event
|
|
90940
90952
|
dispatches "speechend" events when listen() has detected an end to the talking
|
|
90941
|
-
dispatches "start"
|
|
90953
|
+
dispatches "start" event when reading
|
|
90954
|
+
dispatches "end" event when reading
|
|
90942
90955
|
dispatches a "boundary" event between words
|
|
90943
90956
|
dispatches an "error" event if no words are spoken, etc. the event object has an error property with the error message
|
|
90944
90957
|
Note: there are more features to the Web Speech API - see the HTML docs
|
|
@@ -92606,9 +92619,9 @@ function zimify(obj, a, b, c, d, list) {
|
|
|
92606
92619
|
sca:function(scale, scaleY) {
|
|
92607
92620
|
return zim.sca(this, scale, scaleY);
|
|
92608
92621
|
},
|
|
92609
|
-
scaleTo:function(boundObj, percentX, percentY, type, boundsOnly) {
|
|
92622
|
+
scaleTo:function(boundObj, percentX, percentY, type, boundsOnly, simple) {
|
|
92610
92623
|
if (isDUO(arguments)) {arguments[0].obj = this; return zim.scaleTo(arguments[0]);}
|
|
92611
|
-
else {return zim.scaleTo(this, boundObj, percentX, percentY, type, boundsOnly);}
|
|
92624
|
+
else {return zim.scaleTo(this, boundObj, percentX, percentY, type, boundsOnly, simple);}
|
|
92612
92625
|
},
|
|
92613
92626
|
fit:function(left, top, width, height, type) {
|
|
92614
92627
|
if (isDUO(arguments)) {arguments[0].obj = this; return zim.fit(arguments[0]);}
|
|
@@ -98349,4 +98362,3 @@ export let Style = zim.Style;
|
|
|
98349
98362
|
export let assets = zim.assets;
|
|
98350
98363
|
export let assetIDs = zim.assetIDs;
|
|
98351
98364
|
export let ZIMON = zim.ZIMON;
|
|
98352
|
-
|