zimjs 16.3.7 → 16.3.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 +1 -1
- package/src/zim.js +55 -31
package/package.json
CHANGED
package/src/zim.js
CHANGED
|
@@ -15580,7 +15580,8 @@ The Squiggle is set by default to show and hide controls when clicked
|
|
|
15580
15580
|
It is also draggable by default when the controls are showing
|
|
15581
15581
|
It can be set to copy with a shift click
|
|
15582
15582
|
|
|
15583
|
-
SEE:https://www.youtube.com/watch?v=P2hDe5JCINY for Blob and Squiggle Basics
|
|
15583
|
+
SEE: https://www.youtube.com/watch?v=P2hDe5JCINY for Blob and Squiggle Basics
|
|
15584
|
+
SEE: https://zimjs.com/paths/ to make points for Blob and Squiggle
|
|
15584
15585
|
|
|
15585
15586
|
MULTIPLE SELECT
|
|
15586
15587
|
Multiple points can be selected with the CTRL key held and then dragged
|
|
@@ -15592,29 +15593,31 @@ NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set
|
|
|
15592
15593
|
|
|
15593
15594
|
EXAMPLE
|
|
15594
15595
|
new Squiggle().center(); // makes a line with default 4 points with Bezier controls
|
|
15596
|
+
END EXAMPLE
|
|
15597
|
+
|
|
15598
|
+
EXAMPLE
|
|
15595
15599
|
new Squiggle({points:2, controlType:"none"}).pos(100,100); // makes a diagonal straight line that is editable
|
|
15596
15600
|
END EXAMPLE
|
|
15597
15601
|
|
|
15598
15602
|
EXAMPLE
|
|
15599
15603
|
// Animate along a Squiggle
|
|
15600
15604
|
// see https://zimjs.com/explore/squiggleAnimate.html for more
|
|
15601
|
-
const
|
|
15602
|
-
new Circle(10, red).addTo().animate({path:
|
|
15605
|
+
const path = new Squiggle().center();
|
|
15606
|
+
new Circle(10, red).addTo().animate({path:path}, 1);
|
|
15603
15607
|
END EXAMPLE
|
|
15604
15608
|
|
|
15605
15609
|
EXAMPLE
|
|
15606
15610
|
// there are so many examples for Blob and Squiggle
|
|
15607
15611
|
// see https://www.youtube.com/watch?v=P2hDe5JCINY
|
|
15608
|
-
// In this set of examples we show editing which is new in ZIM NFT
|
|
15609
15612
|
|
|
15610
15613
|
// Add a new second smaller part to the Squiggle
|
|
15611
15614
|
// reverse points from right to left and animate along Squiggle
|
|
15612
|
-
const
|
|
15615
|
+
const s1 = new Squiggle({showControls:false}).center();
|
|
15613
15616
|
const s2 = new Squiggle()
|
|
15614
15617
|
.transformPoints("scale", .5)
|
|
15615
|
-
.transformPoints("x",
|
|
15618
|
+
.transformPoints("x", s1.width);
|
|
15616
15619
|
s.appendPoints(s2.points).reversePoints();
|
|
15617
|
-
new Circle(10).addTo().animate({path:
|
|
15620
|
+
new Circle(10).addTo().animate({path:s1}, 5);
|
|
15618
15621
|
END EXAMPLE
|
|
15619
15622
|
|
|
15620
15623
|
EXAMPLE
|
|
@@ -15650,7 +15653,7 @@ color - |ZIM VEE| (default green) the line color as any CSS color including "rgb
|
|
|
15650
15653
|
thickness - (default 2) the thickness of the line in pixels
|
|
15651
15654
|
points - (default 5) a number of points to start with to make the shape
|
|
15652
15655
|
OR an SVG path like: points:"M0,129.5c22,0,40-31,40-41c0-8-3.2-13-10-13" etc. (also see SVGContainer)
|
|
15653
|
-
OR an array of points as follows
|
|
15656
|
+
OR an array of points as follows - https://zimjs.com/paths has a tool to make points in this format
|
|
15654
15657
|
[[controlX, controlY, circleX, circleY, rect1X, rect1Y, rect2X, rect2Y, controlType], [etc]]
|
|
15655
15658
|
controlX and controlY - the x and y location of the control Container which holds the point circle and the two control rectangles
|
|
15656
15659
|
rect1X, rect1Y, rect2X, rect2Y - (default based on controlLength) the x and y location of the control rectangles relative to the control location
|
|
@@ -17677,6 +17680,9 @@ The shape of the Blob can be recorded with the recordData() method and recreated
|
|
|
17677
17680
|
The Blob is set by default to show and hide controls when clicked
|
|
17678
17681
|
It is also draggable by default when the controls are showing
|
|
17679
17682
|
|
|
17683
|
+
SEE https://zimjs.com/paths for a tool to make Blob and Squiggle shapes
|
|
17684
|
+
SEE https://www.youtube.com/watch?v=P2hDe5JCINY for Basics Video
|
|
17685
|
+
|
|
17680
17686
|
MULTIPLE SELECT
|
|
17681
17687
|
Multiple points can be selected with the CTRL key held and then dragged
|
|
17682
17688
|
or moved with the keyboard arrows (moves 10 pixels with shift key down)
|
|
@@ -17688,11 +17694,15 @@ NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set
|
|
|
17688
17694
|
|
|
17689
17695
|
EXAMPLE
|
|
17690
17696
|
new Blob().center(); // makes a circle with default 4 points with Bezier controls
|
|
17697
|
+
END EXAMPLE
|
|
17691
17698
|
|
|
17699
|
+
EXAMPLE
|
|
17692
17700
|
new Blob({
|
|
17693
17701
|
points:12, // 12 points for more complex shape
|
|
17694
17702
|
}).center();
|
|
17703
|
+
END EXAMPLE
|
|
17695
17704
|
|
|
17705
|
+
EXAMPLE
|
|
17696
17706
|
new Blob({
|
|
17697
17707
|
color:purple,
|
|
17698
17708
|
controlType:"free", // free will be default control type (rather than "straight")
|
|
@@ -17791,7 +17801,7 @@ points - (default 4) a number of points to start with to make the shape
|
|
|
17791
17801
|
OR a shape string of "circle", "rectangle" or "triangle"
|
|
17792
17802
|
OR a ZIM Circle, Rectangle, Triangle or Flare with any dimensions that will be matched
|
|
17793
17803
|
OR an SVG path like: points:"M0,129.5c22,0,40-31,40-41c0-8-3.2-13-10-13" etc. (also see SVGContainer)
|
|
17794
|
-
OR an array of points as follows:
|
|
17804
|
+
OR an array of points as follows - see https://zimjs.com/paths for a tool to make points in this format:
|
|
17795
17805
|
[[controlX, controlY, circleX, circleY, rect1X, rect1Y, rect2X, rect2Y, controlType], [etc]]
|
|
17796
17806
|
controlX and controlY - the x and y location of the control Container which holds the point circle and the two control rectangles
|
|
17797
17807
|
circleX and circleY - (default 0) the x and y location of the circle relative to the control location (usually 0, 0)
|
|
@@ -23512,9 +23522,9 @@ height - (default 60) the height of the button or AUTO to fit height to label (s
|
|
|
23512
23522
|
label - (default "CLICK" or "" if icon or backing) ZIM Label or plain text with default settings (white)
|
|
23513
23523
|
---------- NORMAL MODE
|
|
23514
23524
|
backgroundColor - |ZIM VEE| (default purple) background color of button (any CSS color)
|
|
23515
|
-
also as of ZIM ZIM 01 any backgroundColor can be written as bgColor
|
|
23525
|
+
also as of ZIM ZIM 01 any backgroundColor parameter can be written as bgColor
|
|
23516
23526
|
rollBackgroundColor - |ZIM VEE| (default backgroundColor.lighten(.2)) rollover background color of button
|
|
23517
|
-
also as of ZIM ZIM 01 any backgroundColor can be written as bgColor - so rollBgColor works, etc.
|
|
23527
|
+
also as of ZIM ZIM 01 any backgroundColor parameter can be written as bgColor - so rollBgColor works, etc.
|
|
23518
23528
|
downBackgroundColor - |ZIM VEE| (default null) pressing down background color of button
|
|
23519
23529
|
color - |ZIM VEE| (default white) label color of button (any CSS color) unless a custom Label is set
|
|
23520
23530
|
rollColor - |ZIM VEE| (default white) rollover label color of button
|
|
@@ -23799,7 +23809,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
23799
23809
|
this.mouseChildren = false;
|
|
23800
23810
|
this.cur("pointer");
|
|
23801
23811
|
that.focus = false;
|
|
23802
|
-
that.rolled = false;
|
|
23812
|
+
that.rolled = false;
|
|
23803
23813
|
|
|
23804
23814
|
timeType = getTIME(waitTime);
|
|
23805
23815
|
|
|
@@ -24107,7 +24117,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
24107
24117
|
function buttonOn() {
|
|
24108
24118
|
that.rolled = true;
|
|
24109
24119
|
reallyOn = true;
|
|
24110
|
-
|
|
24120
|
+
|
|
24111
24121
|
// specific to each setting
|
|
24112
24122
|
// so can have a rollover backing even without a backing
|
|
24113
24123
|
// also... if no rollWaitBacking or rollToggleBacking
|
|
@@ -24171,8 +24181,8 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
24171
24181
|
} else {
|
|
24172
24182
|
if (zot(backing) && that.backing) {
|
|
24173
24183
|
that.backing.color = rollBackgroundColor;
|
|
24174
|
-
if (willBeWaiting) that.backing.color =
|
|
24175
|
-
else if (that.toggled) that.backing.color =
|
|
24184
|
+
if (willBeWaiting) that.backing.color = rollWaitBackgroundColor;
|
|
24185
|
+
else if (that.toggled) that.backing.color = rollToggleBackgroundColor;
|
|
24176
24186
|
else that.backing.color = rollBackgroundColor;
|
|
24177
24187
|
} else if (backing && !zot(backing.mask) && that.backing) that.backing.mask.color = rollBackgroundColor;
|
|
24178
24188
|
}
|
|
@@ -24994,8 +25004,10 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
24994
25004
|
if (!selectedCheck) {
|
|
24995
25005
|
selectedCheck = true; // first item marked selected
|
|
24996
25006
|
that.id = data.id;
|
|
25007
|
+
selectedIndex = i;
|
|
24997
25008
|
} else {
|
|
24998
25009
|
data.selected = "false"; // turn off selected
|
|
25010
|
+
selectedIndex = null;
|
|
24999
25011
|
}
|
|
25000
25012
|
}
|
|
25001
25013
|
}
|
|
@@ -26597,11 +26609,12 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
26597
26609
|
}
|
|
26598
26610
|
closeIcon.expand(40);
|
|
26599
26611
|
closeIcon.cur("pointer");
|
|
26600
|
-
closeIcon.on((!zns?WW.ACTIONEVENT=="mousedown":zim.ACTIONEVENT=="mousedown")?"mousedown":"click", function () {
|
|
26612
|
+
closeIcon.on((!zns?WW.ACTIONEVENT=="mousedown":zim.ACTIONEVENT=="mousedown")?"mousedown":"click", function (e) {
|
|
26601
26613
|
var s = that.stage;
|
|
26602
26614
|
that.removeFrom();
|
|
26603
26615
|
that.dispatchEvent("close");
|
|
26604
26616
|
s.update();
|
|
26617
|
+
e.stopImmediatePropagation();
|
|
26605
26618
|
});
|
|
26606
26619
|
}
|
|
26607
26620
|
this.add = function(obj, index, center, replace) {
|
|
@@ -58149,7 +58162,7 @@ transition - (default "none") the type of transition "none", "reveal", "slide",
|
|
|
58149
58162
|
"bubbleDark", "bubbleLight", "bubbleZIM",
|
|
58150
58163
|
"lineDark", "lineLight", "lineZIM"
|
|
58151
58164
|
"explodeDark" "explodeLight" "explodeZIM"
|
|
58152
|
-
NOTE: if using pages that are smaller than the
|
|
58165
|
+
NOTE: if using pages that are smaller than the stage, use a Rectangle() as the holder
|
|
58153
58166
|
and the transition effects will be automatically masked by the rectangle.
|
|
58154
58167
|
speed - (default .2) speed in seconds of the transition if set (see also ZIM TIME constant)
|
|
58155
58168
|
transitionTable - (default none) an array to override general transitions with following format:
|
|
@@ -65964,7 +65977,7 @@ zim.TextureActivesManager = function(stage, toggleKey, damp) {
|
|
|
65964
65977
|
width:200,
|
|
65965
65978
|
height:80,
|
|
65966
65979
|
titleBar:"TextureActives",
|
|
65967
|
-
draggable:true,
|
|
65980
|
+
// draggable:true,
|
|
65968
65981
|
close:true
|
|
65969
65982
|
}).pos(50,50,RIGHT,BOTTOM);
|
|
65970
65983
|
var slider = this.slider = new zim.Slider({min:0, max:100, damp:true})
|
|
@@ -84915,11 +84928,11 @@ dispatches "start", "end" and "error" on the utterance object returned by talk()
|
|
|
84915
84928
|
|
|
84916
84929
|
if (M!="ios") {
|
|
84917
84930
|
|
|
84918
|
-
var SpeechRecognition = SpeechRecognition || webkitSpeechRecognition;
|
|
84919
|
-
var SpeechGrammarList = SpeechGrammarList ||
|
|
84931
|
+
var SpeechRecognition = WW.SpeechRecognition || WW.webkitSpeechRecognition;
|
|
84932
|
+
var SpeechGrammarList = WW.SpeechGrammarList || WW.webkitSpeechGrammarList;
|
|
84920
84933
|
// this is causing an error on firefox even though they use this in their examples
|
|
84921
|
-
// and we have all the
|
|
84922
|
-
|
|
84934
|
+
// and we have all the speech about:config setting set to true
|
|
84935
|
+
var SpeechRecognitionEvent = WW.SpeechRecognitionEvent || WW.webkitSpeechRecognitionEvent;
|
|
84923
84936
|
var recognition = this.recognition = new SpeechRecognition();
|
|
84924
84937
|
recognition.continuous = false;
|
|
84925
84938
|
recognition.lang = this.language = "en-US";
|
|
@@ -85268,19 +85281,30 @@ EXAMPLE
|
|
|
85268
85281
|
// pops up a PermissionAsk Pane on iOS then if yes, goes to permissions on iOS
|
|
85269
85282
|
new PermissionAsk(init, "cam");
|
|
85270
85283
|
function init(val) {
|
|
85271
|
-
|
|
85272
|
-
|
|
85284
|
+
new Label(val).center(); // media stream if yes to permissions otherwise false
|
|
85285
|
+
S.update();
|
|
85286
|
+
}
|
|
85287
|
+
END EXAMPLE
|
|
85288
|
+
|
|
85289
|
+
EXAMPLE
|
|
85290
|
+
// on iOS, the app must be interacted with before using mic or cam
|
|
85291
|
+
// this goes right to permissions on computer and android
|
|
85292
|
+
// but pops up a PermissionAsk Pane on iOS then if yes, goes to permissions on iOS
|
|
85293
|
+
new PermissionAsk(init, "mic"); // or "cam" or "miccam"
|
|
85294
|
+
function init(val) {
|
|
85295
|
+
zog(val); // media stream if yes to permissions otherwise false
|
|
85296
|
+
S.update();
|
|
85273
85297
|
}
|
|
85274
85298
|
END EXAMPLE
|
|
85275
85299
|
|
|
85276
85300
|
PARAMETERS - accepts ZIM DUO regular parameters in order or a configuration object with parameters as properties
|
|
85277
85301
|
callback - the function to callback when permission is accepted
|
|
85278
|
-
|
|
85279
|
-
|
|
85280
|
-
|
|
85281
|
-
|
|
85282
|
-
|
|
85283
|
-
|
|
85302
|
+
if the permissionType is deviceorientation or devicemotion this will receive true for accept or false for no permission
|
|
85303
|
+
if the permissionType is audio, video or audiovideo this will receive a stream if accepted or false if not
|
|
85304
|
+
for not iOS, the system permissions will appear
|
|
85305
|
+
for iOS the PermissionAsk Pane will be shown and the system permissions
|
|
85306
|
+
in all cases, the callback will be called on result
|
|
85307
|
+
the parameter given to the callback will be true (sensors) or a media stream (mic / cam) or false if not accepted
|
|
85284
85308
|
permissionType - (default "deviceorientation") the string deviceorientation, devicemotion, mic, cam, or miccam
|
|
85285
85309
|
color - (default zim.dark) the font and border color of the widget
|
|
85286
85310
|
backgroundColor - (default zim.lighter) the backgroundColor of the widget
|
|
@@ -90894,7 +90918,7 @@ a ZIM Container
|
|
|
90894
90918
|
//-149
|
|
90895
90919
|
|
|
90896
90920
|
/*--
|
|
90897
|
-
makePath = function()
|
|
90921
|
+
makePath = function() ** there is no makePath() - please read details
|
|
90898
90922
|
|
|
90899
90923
|
makePath
|
|
90900
90924
|
zim libraries - PIZZAZZ 4
|