zimjs 16.3.6 → 16.3.8
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 +51 -28
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)
|
|
@@ -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
|
}
|
|
@@ -58149,7 +58161,7 @@ transition - (default "none") the type of transition "none", "reveal", "slide",
|
|
|
58149
58161
|
"bubbleDark", "bubbleLight", "bubbleZIM",
|
|
58150
58162
|
"lineDark", "lineLight", "lineZIM"
|
|
58151
58163
|
"explodeDark" "explodeLight" "explodeZIM"
|
|
58152
|
-
NOTE: if using pages that are smaller than the
|
|
58164
|
+
NOTE: if using pages that are smaller than the stage, use a Rectangle() as the holder
|
|
58153
58165
|
and the transition effects will be automatically masked by the rectangle.
|
|
58154
58166
|
speed - (default .2) speed in seconds of the transition if set (see also ZIM TIME constant)
|
|
58155
58167
|
transitionTable - (default none) an array to override general transitions with following format:
|
|
@@ -58780,7 +58792,7 @@ you can define multiple pages objects add and remove pages objects as needed
|
|
|
58780
58792
|
var current = that.pages[that.index];
|
|
58781
58793
|
if (!current || !current.swipe) return;
|
|
58782
58794
|
var swipe = current.swipe;
|
|
58783
|
-
var directions = [zim.LEFT, zim.RIGHT, zim.
|
|
58795
|
+
var directions = [zim.LEFT, zim.RIGHT, zim.UP, zim.DOWN];
|
|
58784
58796
|
zim.loop(directions, function (d, i) {
|
|
58785
58797
|
if (!swipe[i]) {
|
|
58786
58798
|
zim.loop(that.arrows[d], function(b) {
|
|
@@ -84915,11 +84927,11 @@ dispatches "start", "end" and "error" on the utterance object returned by talk()
|
|
|
84915
84927
|
|
|
84916
84928
|
if (M!="ios") {
|
|
84917
84929
|
|
|
84918
|
-
var SpeechRecognition = SpeechRecognition || webkitSpeechRecognition;
|
|
84919
|
-
var SpeechGrammarList = SpeechGrammarList ||
|
|
84930
|
+
var SpeechRecognition = WW.SpeechRecognition || WW.webkitSpeechRecognition;
|
|
84931
|
+
var SpeechGrammarList = WW.SpeechGrammarList || WW.webkitSpeechGrammarList;
|
|
84920
84932
|
// this is causing an error on firefox even though they use this in their examples
|
|
84921
|
-
// and we have all the
|
|
84922
|
-
|
|
84933
|
+
// and we have all the speech about:config setting set to true
|
|
84934
|
+
var SpeechRecognitionEvent = WW.SpeechRecognitionEvent || WW.webkitSpeechRecognitionEvent;
|
|
84923
84935
|
var recognition = this.recognition = new SpeechRecognition();
|
|
84924
84936
|
recognition.continuous = false;
|
|
84925
84937
|
recognition.lang = this.language = "en-US";
|
|
@@ -85268,19 +85280,30 @@ EXAMPLE
|
|
|
85268
85280
|
// pops up a PermissionAsk Pane on iOS then if yes, goes to permissions on iOS
|
|
85269
85281
|
new PermissionAsk(init, "cam");
|
|
85270
85282
|
function init(val) {
|
|
85271
|
-
|
|
85272
|
-
|
|
85283
|
+
new Label(val).center(); // media stream if yes to permissions otherwise false
|
|
85284
|
+
S.update();
|
|
85285
|
+
}
|
|
85286
|
+
END EXAMPLE
|
|
85287
|
+
|
|
85288
|
+
EXAMPLE
|
|
85289
|
+
// on iOS, the app must be interacted with before using mic or cam
|
|
85290
|
+
// this goes right to permissions on computer and android
|
|
85291
|
+
// but pops up a PermissionAsk Pane on iOS then if yes, goes to permissions on iOS
|
|
85292
|
+
new PermissionAsk(init, "mic"); // or "cam" or "miccam"
|
|
85293
|
+
function init(val) {
|
|
85294
|
+
zog(val); // media stream if yes to permissions otherwise false
|
|
85295
|
+
S.update();
|
|
85273
85296
|
}
|
|
85274
85297
|
END EXAMPLE
|
|
85275
85298
|
|
|
85276
85299
|
PARAMETERS - accepts ZIM DUO regular parameters in order or a configuration object with parameters as properties
|
|
85277
85300
|
callback - the function to callback when permission is accepted
|
|
85278
|
-
|
|
85279
|
-
|
|
85280
|
-
|
|
85281
|
-
|
|
85282
|
-
|
|
85283
|
-
|
|
85301
|
+
if the permissionType is deviceorientation or devicemotion this will receive true for accept or false for no permission
|
|
85302
|
+
if the permissionType is audio, video or audiovideo this will receive a stream if accepted or false if not
|
|
85303
|
+
for not iOS, the system permissions will appear
|
|
85304
|
+
for iOS the PermissionAsk Pane will be shown and the system permissions
|
|
85305
|
+
in all cases, the callback will be called on result
|
|
85306
|
+
the parameter given to the callback will be true (sensors) or a media stream (mic / cam) or false if not accepted
|
|
85284
85307
|
permissionType - (default "deviceorientation") the string deviceorientation, devicemotion, mic, cam, or miccam
|
|
85285
85308
|
color - (default zim.dark) the font and border color of the widget
|
|
85286
85309
|
backgroundColor - (default zim.lighter) the backgroundColor of the widget
|
|
@@ -90894,7 +90917,7 @@ a ZIM Container
|
|
|
90894
90917
|
//-149
|
|
90895
90918
|
|
|
90896
90919
|
/*--
|
|
90897
|
-
makePath = function()
|
|
90920
|
+
makePath = function() ** there is no makePath() - please read details
|
|
90898
90921
|
|
|
90899
90922
|
makePath
|
|
90900
90923
|
zim libraries - PIZZAZZ 4
|