zimjs 16.0.4 → 16.1.0
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/README.md +5 -5
- package/package.json +1 -1
- package/src/zim.js +87 -71
- package/ts-src/typings/zim/index.d.ts +0 -1
package/README.md
CHANGED
|
@@ -145,7 +145,7 @@ function ready() {
|
|
|
145
145
|
|
|
146
146
|
} // end ready
|
|
147
147
|
```
|
|
148
|
-
- In the index.html file, replace the Vite icon with:
|
|
148
|
+
- In the index.html file, optionally replace the Vite icon with:
|
|
149
149
|
```html
|
|
150
150
|
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="https://zimjs.com/icons/apple-touch-icon-57x57.png" />
|
|
151
151
|
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="https://zimjs.com/icons/apple-touch-icon-114x114.png" />
|
|
@@ -168,7 +168,7 @@ C. DEVELOPMENT
|
|
|
168
168
|
- This opens up a browser to see the file with the purple circle
|
|
169
169
|
- Make edits to your ZIM app
|
|
170
170
|
- See https://zimjs.com/learn for how to use ZIM
|
|
171
|
-
- See https://zimjs.
|
|
171
|
+
- See https://zimjs.com/docs for reference to commands
|
|
172
172
|
- When done developing use CTRL C to exit the dev terminal
|
|
173
173
|
|
|
174
174
|
D. DEPLOYMENT
|
|
@@ -249,7 +249,7 @@ Follow the SETUP instructions above and then adjust the code as follows:<br>
|
|
|
249
249
|
color:light,
|
|
250
250
|
ready: () => {
|
|
251
251
|
// put code here
|
|
252
|
-
new
|
|
252
|
+
new Circle(50, red).center().drag();
|
|
253
253
|
}
|
|
254
254
|
});
|
|
255
255
|
});
|
|
@@ -319,7 +319,7 @@ Follow the SETUP instructions above and then adjust the code as follows:<br>
|
|
|
319
319
|
color:light,
|
|
320
320
|
ready: () => {
|
|
321
321
|
// put code here
|
|
322
|
-
new
|
|
322
|
+
new Circle(50, red).center().drag();
|
|
323
323
|
}
|
|
324
324
|
});
|
|
325
325
|
});
|
|
@@ -473,7 +473,7 @@ https://zimjs.com/updates.html
|
|
|
473
473
|
## Dependencies
|
|
474
474
|
ZIM is powered by the robust CreateJS Library and adds many conveniences, components and controls.<br>
|
|
475
475
|
Cheers to Grant, Lanny and the CreateJS Team!<br>
|
|
476
|
-
https://createjs.com
|
|
476
|
+
https://createjs.com - here is the <a href=https://github.com/danzen/createjs>ZIM version of CreateJS</a>
|
|
477
477
|
|
|
478
478
|
## Authors
|
|
479
479
|
* **Dr Abstract (Inventor Dan Zen)**<br>
|
package/package.json
CHANGED
package/src/zim.js
CHANGED
|
@@ -37,7 +37,7 @@ Node module - also see ES6 modules at https://zimjs.com/cdn
|
|
|
37
37
|
|
|
38
38
|
// This is used for the build but in a browser would be
|
|
39
39
|
// import createjs from "https://zimjs.org/cdn/1.4.0/createjs";
|
|
40
|
-
import "@
|
|
40
|
+
import "@zimjs/createjs";
|
|
41
41
|
|
|
42
42
|
var WW = window||{}; // minify does not shorten window so this saves 1.5k
|
|
43
43
|
var createjs = WW.createjs; // the expected CreateJS namespace - import CreateJS first
|
|
@@ -82771,6 +82771,8 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
|
|
|
82771
82771
|
}
|
|
82772
82772
|
if (canvas) canvas.removeAllEventListeners();
|
|
82773
82773
|
if (that.frameTime) clearInterval(that.frameTime);
|
|
82774
|
+
|
|
82775
|
+
if (WW.zimDefaultPhysics && WW.zimDefaultPhysics.dispose) WW.zimDefaultPhysics.dispose();
|
|
82774
82776
|
|
|
82775
82777
|
// remove frame events
|
|
82776
82778
|
// var realWindow = window.parent || window;
|
|
@@ -84510,10 +84512,9 @@ END EXAMPLE
|
|
|
84510
84512
|
|
|
84511
84513
|
EXAMPLE
|
|
84512
84514
|
// with loadAssets, the previous example would be:
|
|
84513
|
-
loadAssets("gf_Dancing+Script");
|
|
84514
|
-
F.complete(
|
|
84515
|
+
F.loadAssets("gf_Dancing+Script");
|
|
84516
|
+
F.on("complete", ()=>{
|
|
84515
84517
|
new Label("Custom Google Font", 50, "Dancing Script").center();
|
|
84516
|
-
S.update();
|
|
84517
84518
|
});
|
|
84518
84519
|
END EXAMPLE
|
|
84519
84520
|
--*///+83.85
|
|
@@ -87717,7 +87718,7 @@ grid - reference to the zim.Container used for the grid
|
|
|
87717
87718
|
var score = row.getChildAt(4);
|
|
87718
87719
|
});
|
|
87719
87720
|
titleText - reference to the zim.Label used for the title if the title parameter is provided
|
|
87720
|
-
dataSource - get the
|
|
87721
|
+
dataSource - get the data used as a string: database (using an ID), localStorage or manual (custom)
|
|
87721
87722
|
NOTE: if there is a problem with your data ID then this will revert from database to localStorage
|
|
87722
87723
|
You can tell when you save a score / name the save button says LOCAL if localStorage and SENT if database or manual
|
|
87723
87724
|
key - the ID (from https://zimjs.com/leaderboard/) if provided
|
|
@@ -87780,7 +87781,7 @@ Plus all the methods and properties of a Label
|
|
|
87780
87781
|
//-105
|
|
87781
87782
|
|
|
87782
87783
|
/*--
|
|
87783
|
-
zim.Board = function(size, cols, rows, backgroundColor, rollBackgroundColor, borderColor, borderWidth, isometric, indicatorColor, indicatorBorderColor, indicatorBorderWidth, indicatorSize, indicatorType, arrows, arrowColor, arrowRollColor, info, labels, color, scaleMin, scaleMax,
|
|
87784
|
+
zim.Board = function(size, cols, rows, backgroundColor, rollBackgroundColor, borderColor, borderWidth, isometric, indicatorColor, indicatorBorderColor, indicatorBorderWidth, indicatorSize, indicatorType, arrows, arrowColor, arrowRollColor, swipe, info, labels, color, scaleMin, scaleMax, buffer)
|
|
87784
87785
|
|
|
87785
87786
|
Board
|
|
87786
87787
|
zim class - extends a zim.Container which extends a createjs.Container
|
|
@@ -87849,6 +87850,7 @@ arrows - (default true) show (auto) arrows if info is larger than board view
|
|
|
87849
87850
|
so pressing right will move the board to the left, etc.
|
|
87850
87851
|
arrowColor - (default "rgba(0,0,0,.4)") the arrow color
|
|
87851
87852
|
arrowRollColor - (default white) the arrow roll color
|
|
87853
|
+
swipe - (default true) set to false to not swipe on the board to move the board (like arrows)
|
|
87852
87854
|
info - (default null) set to an array of rows and cols in the following format:
|
|
87853
87855
|
Rows are the outer array and cols are the inner arrays with {} being the info
|
|
87854
87856
|
[[{data:"x", color:blue, items:[new Person()]},{},{},,,,,], [,,],,,,,,,,,,,,,,,]
|
|
@@ -87865,7 +87867,6 @@ labels - (default false) set to true to display the data from info in tiles - fo
|
|
|
87865
87867
|
color - (default granite) color of the labels
|
|
87866
87868
|
scaleMin - (default 1.2) the minimum items will be scaled when farther (top) from user
|
|
87867
87869
|
scaleMax - (default 1.8) the maximum items will be scaled when closer (bottom) to user
|
|
87868
|
-
swipe - (default true) set to false to not swipe on the board to move the board (like arrows)
|
|
87869
87870
|
buffer - (default 3) nudge camera when moving item is this many tiles from the edge
|
|
87870
87871
|
applies when info is larger than board and keys or path is used to move item
|
|
87871
87872
|
set to 0 to not nudge camera
|
|
@@ -88541,7 +88542,8 @@ const dial = new Dial({min:0, max:360, step:0, continuous:true}).pos(70,0,LEFT,C
|
|
|
88541
88542
|
});
|
|
88542
88543
|
END EXAMPLE
|
|
88543
88544
|
|
|
88544
|
-
PARAMETERS
|
|
88545
|
+
PARAMETERS
|
|
88546
|
+
** supports DUO - parameters or single object with properties below
|
|
88545
88547
|
width - (default ZIM Frame width) the width to make the three.js canvas
|
|
88546
88548
|
height - (default ZIM Frame height) the height to make the three.js canvas
|
|
88547
88549
|
color - (default null - transparent) a CSS color (no transparency on color - just leave off to set transparent)
|
|
@@ -89163,6 +89165,7 @@ socket.on("data", d => {
|
|
|
89163
89165
|
END EXAMPLE
|
|
89164
89166
|
|
|
89165
89167
|
PARAMETERS
|
|
89168
|
+
** supports DUO - parameters or single object with properties below
|
|
89166
89169
|
server - (default https://localhost:3000) the server that is running node and the zimsocket.js : portNumber
|
|
89167
89170
|
appName - (required) a string id (one word or joined words) and unique for your app
|
|
89168
89171
|
roomName - (default "default") optional room name otherwise just uses a default room (can represent many rooms if maxPeople is set)
|
|
@@ -90121,8 +90124,11 @@ makeShape("drip", blue, 250).center();
|
|
|
90121
90124
|
END EXAMPLE
|
|
90122
90125
|
|
|
90123
90126
|
PARAMETERS
|
|
90124
|
-
|
|
90125
|
-
|
|
90127
|
+
** supports DUO - parameters or single object with properties below
|
|
90128
|
+
** supports VEE - parameters marked with ZIM VEE mean a zim Pick() object or Pick Literal can be passed
|
|
90129
|
+
** Pick Literal formats: [1,3,2] - random; {min:10, max:20} - range; series(1,2,3) - order, function(){return result;} - function
|
|
90130
|
+
type - |ZIM VEE| (default "cloud") the shape name - see list below
|
|
90131
|
+
color - |ZIM VEE| (default black) a color for the shape - ZIM color, HTML string or HEX
|
|
90126
90132
|
width (default as drawn) the width of the shape
|
|
90127
90133
|
height (default as drawn) the height of the shape
|
|
90128
90134
|
|
|
@@ -90201,9 +90207,12 @@ info.on("click", function(){zgo("https://zimjs.com/bits/view/icons.html")});
|
|
|
90201
90207
|
END EXAMPLE
|
|
90202
90208
|
|
|
90203
90209
|
PARAMETERS
|
|
90204
|
-
|
|
90205
|
-
|
|
90206
|
-
|
|
90210
|
+
** supports DUO - parameters or single object with properties below
|
|
90211
|
+
** supports VEE - parameters marked with ZIM VEE mean a zim Pick() object or Pick Literal can be passed
|
|
90212
|
+
** Pick Literal formats: [1,3,2] - random; {min:10, max:20} - range; series(1,2,3) - order, function(){return result;} - function
|
|
90213
|
+
type - |ZIM VEE| (default "play") 0 the shape name - see list below
|
|
90214
|
+
color - |ZIM VEE| (default black) a color for the icon - ZIM color, HTML string or HEX
|
|
90215
|
+
scale - |ZIM VEE| (default 1) the scale of the icon
|
|
90207
90216
|
multi (default 1) how many icons to show
|
|
90208
90217
|
multiAlpha (default .5) alpha for other icons
|
|
90209
90218
|
multiScale (default .3) scale for each subsequent icons
|
|
@@ -90275,11 +90284,11 @@ PARAMETERS
|
|
|
90275
90284
|
** supports DUO - parameters or single object with properties below
|
|
90276
90285
|
** supports VEE - parameters marked with ZIM VEE mean a zim Pick() object or Pick Literal can be passed
|
|
90277
90286
|
** Pick Literal formats: [1,3,2] - random; {min:10, max:20} - range; series(1,2,3) - order, function(){return result;} - function
|
|
90278
|
-
type (default "pixels") the pattern name - see list below:
|
|
90287
|
+
type - |ZIM VEE| (default "pixels") the pattern name - see list below:
|
|
90279
90288
|
// pixels, noise, dots, stripes, slants, hatch, plaid, bling, check
|
|
90280
90289
|
colors - |ZIM VEE| (default black) CSS colors for the pattern
|
|
90281
90290
|
// this uses ZIM VEE to apply multiple, random, or a series of colors, etc.
|
|
90282
|
-
size (default 10) the size of the shape used for the pattern
|
|
90291
|
+
size - |ZIM VEE| (default 10) the size of the shape used for the pattern
|
|
90283
90292
|
cols - (default 30) the columns to tile
|
|
90284
90293
|
rows - (default 10) the rows to tile
|
|
90285
90294
|
spacingH - (default 0) a spacing between columns
|
|
@@ -90418,61 +90427,62 @@ for (z_i = 0; z_i < globalFunctions.length; z_i++) {
|
|
|
90418
90427
|
WW[pair[0]] = zim[pair[0]] = pair[1];
|
|
90419
90428
|
}
|
|
90420
90429
|
|
|
90421
|
-
|
|
90422
|
-
|
|
90423
|
-
|
|
90424
|
-
|
|
90425
|
-
|
|
90426
|
-
|
|
90427
|
-
|
|
90428
|
-
|
|
90429
|
-
|
|
90430
|
-
|
|
90431
|
-
|
|
90432
|
-
|
|
90433
|
-
|
|
90434
|
-
|
|
90435
|
-
|
|
90436
|
-
|
|
90437
|
-
|
|
90438
|
-
|
|
90439
|
-
|
|
90440
|
-
|
|
90441
|
-
|
|
90442
|
-
|
|
90443
|
-
|
|
90444
|
-
|
|
90445
|
-
|
|
90446
|
-
|
|
90447
|
-
|
|
90448
|
-
|
|
90449
|
-
|
|
90450
|
-
|
|
90451
|
-
|
|
90452
|
-
|
|
90453
|
-
|
|
90454
|
-
|
|
90455
|
-
|
|
90456
|
-
|
|
90457
|
-
|
|
90458
|
-
|
|
90459
|
-
|
|
90460
|
-
|
|
90461
|
-
|
|
90462
|
-
|
|
90463
|
-
|
|
90464
|
-
|
|
90465
|
-
|
|
90466
|
-
|
|
90467
|
-
|
|
90468
|
-
|
|
90469
|
-
|
|
90470
|
-
|
|
90471
|
-
|
|
90472
|
-
|
|
90473
|
-
|
|
90474
|
-
|
|
90475
|
-
|
|
90430
|
+
if (zns) {
|
|
90431
|
+
// these are global regardless
|
|
90432
|
+
var globalsConstants = [
|
|
90433
|
+
["FIT", zim.FIT],
|
|
90434
|
+
["FILL", zim.FILL],
|
|
90435
|
+
["FULL", zim.FULL],
|
|
90436
|
+
["LEFT", zim.LEFT],
|
|
90437
|
+
["RIGHT", zim.RIGHT],
|
|
90438
|
+
["CENTER", zim.CENTER],
|
|
90439
|
+
["MIDDLE", zim.MIDDLE],
|
|
90440
|
+
["START", zim.START],
|
|
90441
|
+
["END", zim.END],
|
|
90442
|
+
["TOP", zim.TOP],
|
|
90443
|
+
["BOTTOM", zim.BOTTOM],
|
|
90444
|
+
["OVER", zim.OVER],
|
|
90445
|
+
["UNDER", zim.UNDER],
|
|
90446
|
+
["HORIZONTAL", zim.HORIZONTAL],
|
|
90447
|
+
["VERTICAL", zim.VERTICAL],
|
|
90448
|
+
["BOTH", zim.BOTH],
|
|
90449
|
+
["RADIAL", zim.RADIAL],
|
|
90450
|
+
["UP", zim.UP],
|
|
90451
|
+
["DOWN", zim.DOWN],
|
|
90452
|
+
["NEXT", zim.NEXT],
|
|
90453
|
+
["PREV", zim.PREV],
|
|
90454
|
+
["AUTO", zim.AUTO],
|
|
90455
|
+
["AVE", zim.AVE],
|
|
90456
|
+
["DEFAULT", zim.DEFAULT],
|
|
90457
|
+
["ALL", zim.ALL],
|
|
90458
|
+
["NONE", zim.NONE],
|
|
90459
|
+
["GET", zim.GET],
|
|
90460
|
+
["POST", zim.POST],
|
|
90461
|
+
["LOCALSTORAGE", zim.LOCALSTORAGE],
|
|
90462
|
+
["SOCKET", zim.SOCKET],
|
|
90463
|
+
["TO", zim.TO],
|
|
90464
|
+
["FROM", zim.FROM],
|
|
90465
|
+
["SINE", zim.SINE],
|
|
90466
|
+
["SQUARE", zim.SQUARE],
|
|
90467
|
+
["TRIANGLE", zim.TRIANGLE],
|
|
90468
|
+
["SAW", zim.SAW],
|
|
90469
|
+
["SAWTOOTH", zim.SAWTOOTH],
|
|
90470
|
+
["ZAP", zim.ZAP],
|
|
90471
|
+
["TAU", zim.TAU],
|
|
90472
|
+
["DEG", zim.DEG],
|
|
90473
|
+
["RAD", zim.RAD],
|
|
90474
|
+
["PHI", zim.PHI],
|
|
90475
|
+
];
|
|
90476
|
+
|
|
90477
|
+
for (z_i = 0; z_i < globalsConstants.length; z_i++) {
|
|
90478
|
+
var pair = globalsConstants[z_i];
|
|
90479
|
+
WW[pair[0]] = pair[1];
|
|
90480
|
+
}
|
|
90481
|
+
|
|
90482
|
+
for (z_i = 0; z_i < zim.colors.length; z_i++) {
|
|
90483
|
+
WW[zim.colors[z_i]] = zim.colorsHex[z_i];
|
|
90484
|
+
}
|
|
90485
|
+
} else zimplify();
|
|
90476
90486
|
|
|
90477
90487
|
WW.zim = zim;
|
|
90478
90488
|
export default zim;
|
|
@@ -90786,4 +90796,10 @@ export let getLatestVersions = zim.getLatestVersions;
|
|
|
90786
90796
|
export let PWA = zim.PWA;
|
|
90787
90797
|
export let QR = zim.QR;
|
|
90788
90798
|
export let GIF = zim.GIF;
|
|
90789
|
-
export let THEME = zim.THEME;
|
|
90799
|
+
export let THEME = zim.THEME;
|
|
90800
|
+
export let Theme = zim.Theme;
|
|
90801
|
+
export let Ticker = zim.Ticker;
|
|
90802
|
+
export let Style = zim.Style;
|
|
90803
|
+
export let assets = zim.assets;
|
|
90804
|
+
export let assetIDs = zim.assetIDs;
|
|
90805
|
+
export let ZIMON = zim.ZIMON;
|
|
@@ -1804,7 +1804,6 @@ declare namespace zim {
|
|
|
1804
1804
|
radialGradient(colors: [any], ratios: [any], x0: number, y0: number, radius0: number, x1: number, y1: number, radius1: number): this
|
|
1805
1805
|
readonly veeObj: zimVee
|
|
1806
1806
|
// END ZIM Shape Interface
|
|
1807
|
-
clone(exact?: boolean): this
|
|
1808
1807
|
corner: number
|
|
1809
1808
|
}
|
|
1810
1809
|
|